# Compile and run a full node
# Build executable
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
First, node initialization:
$ cd ./cmd/bytomd $ ./bytomd init --chain_id testnet
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.
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!
Switch to the test directory.
cd $GOPATH/src/github.com/bytom/test go test -v -bench=. -benchtime=3s -run=none
-bench option to specify the test directory, and use
-benchtime to specify the test time.
For more, please refer to go test flags (opens new window)