modulepackage
0.1.1-rc0
Repository: https://github.com/bianjieai/irita-sync.git
Documentation: pkg.go.dev
# README
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
) - NETWORK:
option
string
network type(example:testnet,mainnet
)
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(15000),
'end_height':NumberLong(0),
'current_height':NumberLong(0),
'status':'unhandled',
'last_update_time': NumberLong(0)
})