A backend server that synchronize metaos chain data into a database
docker-compose up
Mongo-express(a web-based MongoDB admin interface): http://localhost:8081
- Set
node_urls(blockchain node RPC address) in config/config.toml export CONFIG_FILE_PATH=config/config.toml
- Build:
make all - Run:
make run - Cross compilation:
make build-linux
- node_uri:
requiredstringmongodb connection uri(example:mongodb://127.0.0.1:27017/?connect=direct&authSource=metaos) - database:
requiredstringdatabase name(example:DB_DATABASE)
- ip_port:
requiredstringAPI server IP address and port (example127.0.0.1:8787). - node_urls:
requiredstringfull node uri(example:tcp://127.0.0.1:26657, tcp://127.0.0.2:26657, ...) - worker_num_create_task:
requiredintthe maximum time (in seconds) that create task are allowed (default:1example:1) - worker_num_execute_task:
requiredintthe maximum time (in seconds) that synchronization TX threads are allowed to be out of work(example:30) - worker_max_sleep_time:
requiredintnum of worker to create tasks(unit: seconds)(example:90) - block_num_per_worker_handle:
requiredintnumber of blocks per sync TX task(example:50) - max_connection_num:
requiredintclient pool config total max connection - init_connection_num:
requiredintclient pool config idle connection - bech32_acc_prefix:
optionstringblock chain address prefix(default(cosmoshub): `` example(metaos):metaos) - chain_block_interval:
optionintblock interval; default5(example:5) - behind_block_num:
optionintwait block num to handle when retry failed; default0(example:0) - promethous_port:
optionintpromethous metrics server port - support_modules:
optionstringsetting only support module tx sync,default support [all module] (default: `` example:bank,nft) - deny_modules:
optionstringdisable support module tx sync - support_types:
optionstringsetting only support msgType tx sync,default support all types(default: `` example:transfer,recv_packet) - ignore_ibc_header:
optionbooleansetting update_client header info for tx collection ,default not ignore ibc header info(default:falseexample:false) - chain_id:
optionstringsetting collection name by chain_id
Note:
synchronizes cosmos data from specify block height(such as:17908 current time:1576208532) At first,stop the block_explorer and create the task. Run:
db.sync_task.insert({
'start_height':NumberLong(17908),
'end_height':NumberLong(0),
'current_height':NumberLong(0),
'status':'unhandled',
'worker_id' : '',
'worker_logs' : [],
'last_update_time' : NumberLong(0)
})