Skip to content

Module 3 Deploy Smart Contract on Ulord Sidechain

yeousunn edited this page Aug 24, 2018 · 2 revisions

To deploy smart contract on Ulord-Sidechain, make sure Ulord-Sidechain node is running and is fully synced.

Open the previous project and edit the truffle.js file in the project root directory.

module.exports = {
  networks: {
    usc: {
      gas : 2500000,
      gasPrice : 20000000000,
      from : "<USC address>",
      host: "localhost", // Ulord-Sidechain Node Address
      port: 58858, // Ulord-Sidechain RPC port
      network_id: "*" // Match any network id
    }
  }
};

Before running migrate, the account needs to be unlocked. To do that connect to truffle console and run the following commands with private key and address:-

web3.personal.importRawKey("privateKey", "password")
web3.personal.unlockAccount("address", "password")

Migrate the contract to Ulord-Sidechain blockchain

truffle migrate --network usc --reset

Note:- The above code should be executed on the root directory of project.

Connect to Ulord-Sidechain blockchain using truffle

truffle console --network usc

On truffle console run the following code to call helloWorld function

HelloWorld.deployed().then(function(d){return d.helloWorld.call();});

previous module | next module