Skip to content

celer-network/sgn-contract

Repository files navigation

SGN contracts

CircleCI

Mainchain smart contracts for Celer State Guardian Network (SGN)

Test locally

  1. Install NodeJS v10.

  2. Install the node dependencies:

npm install
  1. Install truffle and ganache-cli (sudo permission might be needed):
npm install -g truffle ganache-cli
  1. Run ganache-cli:
ganache-cli --gasLimit 8000000 --accounts 20
  1. Use truffle to run tests:
truffle test

Prepare artifact JSON files for sgn-explorer

  1. Compile the contracts:
npx truffle migrate
  1. Edit the "networks" field in the artifact JSON files. Eg. build/contracts/DPos.json.

  2. Copy the artifacts to the sgn-explorer directory:

cp build/contracts/CELRToken.json build/contracts/DPoS.json build/contracts/SGN.json <path-to-sgn-explorer-repo>/src/contracts