Skip to content

A daemon that synchronizes IRITA blockchain data into a database

Notifications You must be signed in to change notification settings

wanghao-bianjie/irita-sync

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

irita-sync

A server that synchronize irita chain data into a database

SetUp

Build And Run

  • Build: make all
  • Run: make run
  • Cross compilation: make build-linux

Env Variables

Db config

  • DB_ADDR: required string db addr(example: 127.0.0.1:27017, 127.0.0.2:27017, ...
  • DB_USER: required string db user(example: user
  • DB_PASSWD: required string db password(example: DB_PASSWD
  • DB_DATABASE:required string database name(example:DB_DATABASE

Server config

  • SER_BC_FULL_NODES: required string full node uri(example: tcp://127.0.0.1:26657, tcp://127.0.0.2:26657, ...

  • WORKER_NUM_EXECUTE_TASK: required string the maximum time (in seconds) that synchronization TX threads are allowed to be out of work(example: 30

  • WORKER_MAX_SLEEP_TIME: required string num of worker to create tasks(unit: seconds)(example: 90

  • BLOCK_NUM_PER_WORKER_HANDLE: required string number of blocks per sync TX task(example: 50

  • BECH32_ACC_PREFIX: option string block chain address prefix(example: iaa

  • CHAIN_ID: option string block chain id for mongodb create collection name(example: cschain-bond

Note:

synchronizes irita data from specify block height(such as:17908 current time:1576208532) At first,stop the irita-sync 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)
})

About

A daemon that synchronizes IRITA blockchain data into a database

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 99.0%
  • Other 1.0%