Skip to content

Configure Truffle to connect with RSK

Meri Herrera edited this page May 4, 2018 · 5 revisions

For this module, it is supposed that you have an RSK node running. If not, you can read this section to install one.

Open the truffle.js file and change the default port to 4444 (this is the default port for RSK):

module.exports = {
  networks: {
    rsk: {
      host: "localhost",
      port: 4444,
      network_id: "*" // Match any network id
    }
  }
};

Note: replace 'localhost' with your IP if necessary.

Go to the command terminal and open Truffle console by typing:

truffle console --network rsk

Try to interact with the node:

truffle(RSK)> web3.eth.blockNumber

It should return a number (the last block in your node).

You are now connected to your RSK node.

  • For further information about DApps and deploying smart contracts in RSK go here.
  • Truffle documentation here.
Clone this wiki locally