NOTE (IMPORTANT!) If you modify contracts, run
forge build
before testing/deploying/etc, or Foundry may not recompile them!
Setup genesis whenever contracts get changed
npm install
git submodule init
git submodule update
cd matic-contracts
npm install
node scripts/process-templates.js --bor-chain-id <bor-chain-id>
npm run truffle:compile
cd ..
Following command will generate BorValidatorSet.sol
file from BorValidatorSet.template
file.
# Generate bor validator set using stake and balance
# Modify validators.json before as per your need
$ node generate-borvalidatorset.js --bor-chain-id <bor-chain-id> --heimdall-chain-id <heimdall-chain-id>
$ npm run truffle:compile
To add custom block time and associated block no.s in genesis, edit the blocks.js
file
Following command will generate genesis.json
file from genesis-template.json
file.
# Generate genesis file
node generate-genesis.js --bor-chain-id <bor-chain-id> --heimdall-chain-id <heimdall-chain-id>
$ npm run testrpc
$ npm test