node

module
v0.0.0-...-e04c47b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2022 License: AGPL-3.0

README

chainbing-node

Go implementation of the Chainbing node.

Go version

The node has been tested with go version 1.14

Build
  • Build the binary in the local environment for you current OS and check the current version:
$ make
$ ./dist/cbnode version
  • Build the binary in a docker container for all supported OS and check the current version (only docker needed):
$ make docker-build
$ ./dist/cbnode_<LOCAL_OS>_amd64/cbnode version

ez

  • Build the binary in the local environment for all supported OS using Goreleaser and check the current version:
$ make goreleaser
$ ./dist/cbnode_<LOCAL_OS>_amd64/cbnode version
Run

First you must edit the default/template config file into cmd/cbnode/cfg.buidler.toml, there are more information about the config file into cmd/cbnode/README.md

After setting the config, you can build and run the Chainbing Node as a synchronizer:

$ make run-node

Or build and run as a coordinator, and also passing the config file from other location:

$ MODE=sync CONFIG=cmd/cbnode/cfg.builder.toml make run-node

To check the useful make commands:

$ make help
Run as a service
$ sudo make install

After, update the config file manually at /etc/chainbing/config.toml

$ sudo service cbnode start

To check status

$ sudo service cbnode status

To stop

$ sudo service cbnode stop

If you just kill the process systemd will restart without asking.

Directories

Path Synopsis
api
Package api implements the public interface of the node using a HTTP REST API.
Package api implements the public interface of the node using a HTTP REST API.
cmd
apitypes
Package apitypes is used to map the common types used across the node with the format expected by the API.
Package apitypes is used to map the common types used across the node with the format expected by the API.
Package coordinator handles all the logic related to forging batches as a coordinator in the chainbing network.
Package coordinator handles all the logic related to forging batches as a coordinator in the chainbing network.
db
Package db have some common utilities shared by db/l2db and db/historydb, the most relevant ones are: - SQL connection utilities - Managing the SQL schema: this is done using migration files placed under db/migrations.
Package db have some common utilities shared by db/l2db and db/historydb, the most relevant ones are: - SQL connection utilities - Managing the SQL schema: this is done using migration files placed under db/migrations.
historydb
Package historydb is responsible for storing and retrieving the historic data of the Chainbing network.
Package historydb is responsible for storing and retrieving the historic data of the Chainbing network.
kvdb
Package kvdb provides a key-value database with Checkpoints & Resets system
Package kvdb provides a key-value database with Checkpoints & Resets system
l2db
Package l2db is responsible for storing and retrieving the data received by the coordinator through the api.
Package l2db is responsible for storing and retrieving the data received by the coordinator through the api.
eth
health
Package txselector is responsible to choose the transactions from the pool that will be forged in the next batch.
Package txselector is responsible to choose the transactions from the pool that will be forged in the next batch.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL