Skip to content

Instantly share code, notes, and snippets.

@joewright
Created January 8, 2018 01:39
Show Gist options
  • Save joewright/10723f15ddc88565849007e7430406da to your computer and use it in GitHub Desktop.
Save joewright/10723f15ddc88565849007e7430406da to your computer and use it in GitHub Desktop.
Quick solidity test environment via truffle/ganache

Getting Started with Truffle/Ganache

Install Ganache

Then install truffle

npm install --global truffle

Create metacoin example project

mkdir metacoin
cd metacoin
truffle unbox metacoin

Update truffle.js with the following:

module.exports = {
  // See <http://truffleframework.com/docs/advanced/configuration>
  // to customize your Truffle configuration!
  networks: {
    ganache: {
      host: "127.0.0.1",
      port: 7545,
      network_id: "5777" // ganache network id
    }
  }
};

Run migrations

truffle migrate --network ganache

Run tests

truffle test --network ganache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment