Mainchain smart contracts for Celer State Guardian Network (SGN)
-
Install NodeJS v10.
-
Install the node dependencies:
npm install
- Install truffle and ganache-cli (
sudo
permission might be needed):
npm install -g truffle ganache-cli
- Run ganache-cli:
ganache-cli --gasLimit 8000000 --accounts 20
- Use truffle to run tests:
truffle test
- Compile the contracts:
npx truffle migrate
-
Edit the "networks" field in the artifact JSON files. Eg.
build/contracts/DPos.json
. -
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