6

There doesn't seem to be much documentation on how to transition your truffle DApp from working locally to being migrated to the mainnet. Below are some steps I generally would think are necessary:

  1. Develop Smart Contract
  2. Compile and migrate contract into testrpc
  3. Test Smart Contract w/ testrpc, test scripts, etc.
  4. Build front end of DApp
  5. Test Dapp locally with testrpc on
  6. Compile and Migrate contract on mainnet

Step 7 is where my questions start:

  • Which IP address do we use in the truffle.js file of the Dapp?
  • What steps do we take to migrate the contract to mainnet AND make sure that the Dapp still works with live instance of the contract? I assume that we'll need to record the contract's live address and change some code around in the Dapp.

Lastly, some more theoretical questions related to migrating contract code onto various networks:

  • How do test networks know which address is the contract owner, given that you don't need to deploy from a static account on test networks like you would on mainnet?

Thanks in advance!

1
  • @benjaminion maybe this is in your domain of expertise? Aug 21, 2017 at 7:31

2 Answers 2

2

You can use infura.io, they give you link to connect to their rpc node. I tried it with truffle using this tutorial: http://truffleframework.com/tutorials/using-infura-custom-provider

I used my Metamask generated wallet for this but after I run: truffle migrate --network ropsten it only deployed Migrations.sol and didn't get confirmation that it is successfully deployed.

Couldn't resolve this so I opted for manual deployment. I set up geth node on AWS EC2 Ubuntu instance and synced blockchain, cloned project from git and deployed from there (as I was doing before for testnet).

2
  • I am going to setup deployment process which is fully automated when I solve problem of geth continuously running in background uninterrupted and unlocking several different accounts for testing from .sh script at once. Aug 24, 2017 at 12:02
  • could you provide us with the steps you took to implement your final solution? This would be incredibly helpful to the broader blockchain dev community! Aug 24, 2017 at 14:39
0

So instead of running test-rpc you open a console and run geth --testnet --rpc and wait for that to sync.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.