leopchain2019 / MetaCoin

deploying smart contracts with Truffle and Ropsten
0 stars 0 forks source link

Basic Truffle Ropsten Project

Try running some of the following tasks:

  1. Set up Truffle

    npm install -g truffle
    npm install --save truffle-hdwallet-provider
  2. Create your contract in ./contracts

  3. Deploy your contract

In ./migrations, create a deployment script specifically named 2_deploy_contracts.js

  1. Configure Ropsten network and the provider in truffle.js

Make sure to replace mnemonic and API_KEY with your own.

truffle deploy --network ropsten
  1. Access your deployed contract
    truffle console --network ropsten
HelloWorld.deployed().then(function(instance){return instance });
  1. Finally, invoke contract function and say hello!
    HelloWorld.deployed().then(function(instance){return instance.sayHello()});