-
Notifications
You must be signed in to change notification settings - Fork 361
Build Node
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.
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.
$ ./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 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
by bytom
Coming soon