// TODO: add Dockerfile, kubernetes-deployment files. // TODO: secure privateKey in /data directory // TODO: fire error log to chat app for monitoring. // TODO: optimize get nonce to speedup send transactions. (DONE optimization ver 1) // TODO: check nonce conflict. (DONE use transaction creator to get nonce)
POLYGON_URL POLYGON_CHAIN_ID POLYGON_NETWORK_ID
- Polygon RPC and chain info.
POLYGON_SCAN_FROM_BACK_LATEST_BLOCK
- Start scan from (latest_block - back_block)
POLYGON_SCAN_START_BLOCK
- Set scan from block manually. If this env variable is not empty, it'll overide POLYGON_SCAN_FROM_BACK_LATEST_BLOCK flow.
POLYGON_DELAY_CONFIRMED_BLOCKS
- Scan to (latest_block - delay_block)
POLYGON_SLEEP_TIME
- When not finding newest block, sleep for miliseconds.
BSC_xxx env variables are similar to polygon counterparts.
Look at src/contracts directory.
yarn install
# Run in another terminal
docker-compose up
# Prepare account signer private key and address
# ./accounts/signer/privateKey - Storing account private key plain text.
# ./accounts/signer/address -Storing account address plain text.
# Set appropriate environments variables in .env.development file.
# Run polygon watcher
yarn start:polygon_logs_watcher:dev
# Open another terminal, run bsc watcher
yarn start:bsc_logs_watcher:dev
# Open another terminal, run transaction creator
yarn start:transaction_creator:dev
yarn install
# Prepare account signer private key and address
# ./accounts/signer/privateKey - Storing account private key plain text.
# ./accounts/signer/address -Storing account address plain text.
# Build
yarn build
# Set appropriate environments variables in .env.production file.
# Run polygon watcher
yarn start:polygon_logs_watcher:prod
# Open another terminal, run bsc watcher
yarn start:bsc_logs_watcher:prod
# Open another terminal, run transaction creator
yarn start:transaction_creator:prod