Knowledge Base Home

How do I use Truffle with Kaleido?

Using the Truffle Framework with Kaleido works exactly the same as everywhere else, except you will have to:

  1. Explicitly declare the provider using web3js or another supported provider that support basic authentication.
  2. Specify a network gasPrice of 0. Transactions within Kaleido networks do not cost Ether, but gas is still expelled so that stalled computations will forcefully terminate.

The truffle.js configuration file below displays an example configuration that should sit at the root of your Truffle project’s directory:

const Web3 = require('web3');
module.exports = {
  networks: {
    geth: {
      provider: function () {
        return new Web3.providers.HttpProvider('https://USERNAME:PASSWORD@HTTP_RPC_ENDPOINT')
      },
      network_id: '*',
      gasPrice: 0
    },
    quorum: {
      provider: function() {
        return new Web3.providers.HttpProvider('https://USERNAME:PASSWORD@HTTP_RPC_ENDPOINT')
      },
      network_id: '*',
      gasPrice: 0
    }
  }
};

Details

  • truffle@4.x.x only supports web3@0.20.6 or possibly lower.
  • web3@1.0.0-betaX mostly works with truffle@next, the truffle nightly build.
Prev Why the Ether Pool? Next How do I connect with MetaMask?