When Voting.sol
contract is deployed on the blockchain it initialized the list of super heroes as well as the total number of tokens available for "sale".
# JSON-RPC node can be running and configured in `truffle.js` with your local network IP ( `127.0.0.1` )
npm i -g ganache-cli
# run local eth
ganache-cli
Build and deploy contracts
npm i -g truffle
# generates json files abstraction
# Writing artifacts to ./build/contracts
truffle compile
# deploy the contracts
truffle migrate --network development
Optional: copy local contracts to the mobile dapp
yarn copy-local
For more information about truffle see ganache-cli
-
An account and an API is necessary to getting started
-
Edit
truffle.js
configuration -
Run
truffle compile
truffle migrate --network ropsten
See intructions: http://truffleframework.com/tutorials/using-infura-custom-provider
https://medium.com/@guccimanepunk/how-to-deploy-a-truffle-contract-to-ropsten-e2fb817870c1
https://ropsten.etherscan.io/address/0x367f283aa2c1979eb400f98bc00b5ba21439e6a0
Running migration: 1_initial_migration.js
================================
BLOCK CHANGED: #26ae87 0x4a81567c88de674833a4ce3d49efcb5b2e3cdb0e48cc68fb60c2fcf3db34384e
================================
Deploying Migrations...
... 0xf239321bdaf8a4f21b2b952340bd3164e7ddb3aebf34ae8d1ca19af57d4e9592
================================
BLOCK CHANGED: #26ae88 0xc45593b4177158c5108b29f46503e536c9e46cbbda30236e31ab2189a81b416d
================================
================================
BLOCK CHANGED: #26ae89 0xecae905cfd236ee4cb0e6f54496e91304a416af1386699760bd24bd65ebba232
================================
Migrations: 0x367f283aa2c1979eb400f98bc00b5ba21439e6a0
Saving successful migration to network...
... 0x08c2fa2d86514532332b4afd8146496931a8dfa072098eb150eb20a41016bc3e
Saving artifacts...
Running migration: 2_deploy_contracts.js
Deploying Voting...
================================
BLOCK CHANGED: #26ae8b 0x1da766d9f59df85eecd54a8d49e7eab4efad275dea34bd15e97be3fdb4fda792
================================
... 0x62b07c9ac3a261a99be23656d5ac7d3b5d7d775d7a82d7f8e34346c7680e2da4
================================
BLOCK CHANGED: #26ae8c 0xb93c9a44f81fab1e22bc7302c5f5af934185da59d9abf139f089f9c9a596bae0
================================
================================
BLOCK CHANGED: #26ae8d 0xfcec71debd017dd0d153897fa8ce15e60ac99359f93277a1a7aac6d51155d867
================================
Voting: 0x0477fc2032a23845516789b5781543040acda2e9
Saving successful migration to network...
... 0x927ac98d1fe494fe5eace47e9db07c8d841a67b21bfef574e256d38edb12ff0f
================================
BLOCK CHANGED: #26ae8e 0x0794a25aca78e389d5c0a34adeb1550e3d34b67903220c2c9be73f0ebbad19f8
================================
================================
BLOCK CHANGED: #26ae8f 0xfa5bfd44e14701175fa939fe05b579f1446db79ef110a158c96ed3a452418113
================================
Saving artifacts...
MIT @ zetta
Some great resources:
https://github.com/gjeanmart/stackexchange/tree/master/23279-what-is-steps-to-deploy-the-contract-on-ropsten-network