Deployment of a contract into Kovan can be done in 5 steps:
-
creation of a project on Infura (FIXME: This step is currently not used but might be used for whitelisting),
-
creation of an Ethereum address which will own the deployed contract,
-
getting free test ETH for use by the contract on Kovan,
-
compilation of the contract into bytecode and the ABI,
-
deployment of the bytecode (FIXME: using credentials from the Infura project?).
This project automates steps 2, 4 and 5. The other two are explained as well.
-
node
-
npm
Run npm i
to install the Node.js dependencies.
Create an account at Infura. While in the dashboard, click on "Create new project", give the project a name and view it. The credentials are:
-
project ID,
-
project secret
-
Kovan endpoint.
Create a new Ethereum account to own the deployment by running npm run create-account
. The account number will be stored in accounts/owner
and the
associated secret key will be stored in accounts/owner.secret
.
Submit the account number from accounts/owner
to the Kovan testnet Gitter
faucet. Do not send the secret! You
should get a confirmation that the account has been sent test ETH.
Compile and deploy the contract by running node run deploy
. The deployment
script compiles the Solidity contract into the ABI and bytecode internally. If
the contract deployment is successful, the contract address is saved to
accounts/contract
.
Test scripts are found in the test
directory. Run them by node run test
.