A server that synchronize IRIS blockChain data into a database
conf: config of projectmodule: project modulemongodb: mongodb script to create databaseservice: main logic of sync-server, sync data from blockChain and write to databasestore: database modelutil: common constants and helper functionsmain.go: bootstrap project
run script mongodb.js in mongodb folder to create database before run project
- Build:
make all - Run:
make run - Cross compilation:
make build-linux
- DB_ADDR:
requiredstring数据库连接地址(example:127.0.0.1:27017, 127.0.0.2:27017, ...) - DB_USER:
requiredstring数据库连接用户(example:user) - DB_PASSWD:
requiredstring数据库密码(example:DB_PASSWD) - DB_DATABASE:
requiredstring数据库名称(example:DB_DATABASE)
-
SER_BC_FULL_NODE:
requiredstring全节点地址(example:tcp://127.0.0.1:26657, tcp://127.0.0.2:26657, ...) -
SER_BC_CHAIN_ID:
requiredstringchain id(example:rainbow-dev) -
WORKER_NUM_CREATE_TASK:
requiredstring执行任务创建的线程数(example:2) -
WORKER_NUM_EXECUTE_TASK:
requiredstring执行任务执行的线程数(example:30) -
NETWORK:
optionstring网络类型(example:testnet,mainnet) -
CRON_SAVE_VALIDATOR_HISTORY:
optionstring保存验证人历史的定时任务(default:@daily)