Git Product home page Git Product logo

cosmos-sync's Introduction

cosmos-sync

A server that synchronize cosmos chain data into a database

SetUp

Build And Run

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

Env Variables

  • CONFIG_FILE_PATH: option string config file path

Config Descriptiom

[database]
addrs= "localhost:27018"
user= "iris"
passwd= "irispassword"
database= "bifrost-sync"

[server]
node_urls="tcp://192.168.150.40:26657"
worker_num_create_task=1
worker_num_execute_task=30
worker_max_sleep_time=120
block_num_per_worker_handle=100
max_connection_num=100
init_connection_num=5
bech32_acc_prefix=""
chain_id=""
chain_block_interval=5
behind_block_num=0
promethous_port=9090
support_modules="" 
deny_modules=""

Db config

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

Server config

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

  • worker_num_create_task: required string the maximum time (in seconds) that create task are allowed (default: 1 example: 1

  • 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

  • max_connection_num: required string client pool config total max connection

  • init_connection_num: required string client pool config idle connection

  • bech32_acc_prefix: option string block chain address prefix(default: i example: i

  • chain_block_interval: option string block interval; default 5 (example: 5)

  • behind_block_num: option string wait block num to handle when retry failed; default 0 (example: 0)

  • promethous_port: option string promethous metrics server port

  • support_modules: option string setting only support module tx sync,default support all module (default: `` example: bank,nft)

  • deny_modules: option string disable support module tx sync

  • chain_id: option string setting collection name by chain_id

Note:

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

cosmos-sync's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.