Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Build Node

martinbtm edited this page Sep 6, 2021 · 1 revision

Set up Full Node

Build executable

Compile

Switch to the root directory of the original warehouse.

$ cd $GOPATH/src/github.com/bytom
$ make bytomd    # build bytomd

When you successfully build the project,bytom binary file will be in the cmd/bytomd directory.

Run bytomd

Intialization

First, node initialization:

$ cd ./cmd/bytomd
$ ./bytomd init --chain_id mainnet

Three options --chain_id:

  • testnet: Connect to testnet
  • mainnet: Connect to Mainnet
  • solonet: Connect to a stand-alone network

After running this command, you will find that .bytomd is produced in the current folder, and then you can start the node.

Start node

$ ./bytomd node

Here are some available parameters:

      --help        Help about any command
      --init        Initialize blockchain
      --node        Run the bytomd
      --version     Show version info

After the bytomd node is running, you can perform the following operations:

  • Create private key, and then you can create accounts and assets.
  • To send a transaction, you need to create, sign and submit the transaction.
  • Query all information, such as available private keys, accounts, balances and transactions, etc.

Test

test library:

go test -v ./account 

It is recommended to use the option -v (no errors will also be logged) .

Only test some methods:

go test -v ./account -run TestCreateAccount

Note: here all tests with prefix TestMethod will be run, so if you got TestMethod, TestMethod1, then both!

Test benchmark:

Switch to the test directory.

cd $GOPATH/src/github.com/bytom/test
go test -v -bench=. -benchtime=3s -run=none

Use the-bench option to specify the test directory, and use -benchtime to specify the test time. For more, please refer to go test flags

home

Installation Instructions

Development-Environment

Build-Node

Usage

Create-Account-and-Wallet

Node-CLI-Guide

Node-GUI-Guide

Smart contract

Coming soon

API

API-Reference

Explorer

Explorer-API

Clone this wiki locally