The main config files are:
deploys/<network-name>.json
- deployment configurations with addresses and names of contracts to be used. This includes contractswNat
,GovernanceVotePowers
and all instances of contractsPollingFoundation
.artifacts
folder - artifacts copied from theartifacts
folder whenflare-smart-contracts
repo is compiled. They should contain artifact files of relevant contracts mentioned above, which contain ABIs. Artifacts can be obtained from the repo by syncing (see below)..env
- environment variable configuration file.
- Web server:
WEB_SERVER_PORT
- the port on which the web server runs (for development we use9500
)
- Database
DB_TYPE
- database type (usuallymysql
)DB_HOST
- database host (usuallylocalhost
)DB_PORT
- database port (usually3306
)DB_DATABASE
- database name (for development we usegovbackdb
)DB_USERNAME
- database user name (for development we use (govbackuser
)DB_PASSWORD
- database user pasword (for development we uset$.passW.O:RD5
)
- Blockchain
NETWORK
- name of the network. It should match the file name for address configurationdeploys/<NETWORK>.json
RPC
- RPC api name for the networkMAX_BLOCKS_FOR_EVENT_READS
- how many blocks can be read with single web3 API call (likegetAllEvents
)INDEXING_START_BLOCK
- starting block for reading events if the database is clean.
In addition, there are optional configuration setting, that should not be used in production. They are used as a configuration for governor-cli
tool.
PROPOSER_PK_<index>
- where<index>
is a number. There can be several sequential such variables with different numbers but in sequence from 0 on. They contain0x
-prefixed private keys of whitelisted proposers of thePollingReject
contracts.VOTER_PK_<number>
- where<index>
is a number. There can be several sequential such variables with different numbers but in sequence from 0 on. They contain0x
-prefixed private keys of voters. Voters should have some funds.
Clone the flare-smart-contracts
repo into the same parent folder as this repo. Set the relevant branch on the flare-smart-contracts
repo and compile the contracts. Then run:
yarn artifacts
This will sync the artifacts
folder for the contract with names defined in the contractToSync
list in src/utils/sync-artifacts.ts
and run Typechain type file generation (generates the folder typechain-web3-v1
).