Installation Guide for BUMO Synchronization Nodes in Main Network
Overview
This document will walk you through the process of installing and configuring the BUMO node in both Linux system.
Details:BUMO Installation and Maintenance Guide
System Requirements
Before installing a BUMO node, you must make sure that your system meets the following requirements.
Hardware Requirements
The hardware requirements must meet the following configurations:
- Recommended:CPU 8 cores, memory 32G, bandwidth 20M, SSD disk 500G
- Minimum:CPU 4 cores, memory 16G, bandwidth 10M, SSD disk 500G
Software Requirements
You can choose Ubuntu, Centos or MacOS systems. The following systems are supported.
- Ubuntu 14.04
- Centos 7
Installing with a Package
Installing with a package refers to installing the BUMO node with an installation package. Installing the BUMO node with the installation package consists of five parts: Obtaining the Installation Package and Extracting It, Registering the Services, Modifying the Service Startup Directory, Setting the Boot Start, and Selecting the Configuration File for the Main Network.
Example for bumo 1.3.1 version.
Obtaining the Installation Package and Extracting It
You must complete the following steps to obtain the installation package of BUMO and extract it.
Input the following command to download the installation package of BUMO.
wget https://github.com/bumoproject/bumo/releases/download/1.3.1/buchain-1.3.1-linux-x64.tar.gz
Note:
- If you have not installed
wget
, you can use theapt-get install wget
command to installwget
.- You can find the version you need from the https://github.com/bumoproject/bumo/releases link and then right-click the version to copy the download link.
- In this example the file is downloaded to the root directory.
Copy the installation package to the /usr/local/ directory by inputting the following command.
cp buchain-1.3.1-linux-x64.tar.gz /usr/local/
Note: The above copy operation is done in the directory where the file is downloaded. You must copy the file according to the specific download directory.
Input the following command to go to the /usr/local/ directory.
cd /usr/local/
Input the following command to extract the file.
tar -zxvf buchain-1.3.1-linux-x64.tar.gz
Note: After extracting the file, the buchain/ directory is generated.
Registering the Services
After extracting the file, you must register the services of bumo and bumod. You must complete the following steps to register services:
Input the following command to register the service of bumo.
ln -s /usr/local/buchain/scripts/bumo /etc/init.d/bumo
Input the following command to register the service of bumod.
ln -s /usr/local/buchain/scripts/bumod /etc/init.d/bumod
Modifying the Service Startup Directory
You must complete the following steps to modify the boot directory of bumo and bumod:
Open the bumo file by inputting the following command in the local/ directory.
vim buchain/scripts/bumo
Locate
install_dir
and change the installation directory of bumo.install_dir=/usr/local/buchain
Note: By default, the directory of
install_dir
is in the /usr/local/buchain directory; you can modify it according to the specific installation directory of bumo.
Press
Esc
to exit editing.Input
:wq
to save the file.Open the bumod file by inputting the following command in the local/ directory.
vim /buchain/scripts/bumod
Locate
install_dir
and change the installation directory for bumod.install_dir=/usr/local/buchain
**Note: **By default, the directory of
install_dir
is in the /usr/local/buchain directory; you can modify it according to the specific installation directory of bumod.
Press
Esc
to exit editing.Input
:wq
to save the file.
Setting the Boot Start
Setting up booting includes setting the startup level, adding startup commands, and modifying file permissions. You must complete the following steps to set up the boot:
Input the following command to set level 1.
ln -s -f /etc/init.d/bumod /etc/rc1.d/S99bumod
Input the following command to set level 2.
ln -s -f /etc/init.d/bumod /etc/rc2.d/S99bumod
Input the following command to set level 3.
ln -s -f /etc/init.d/bumod /etc/rc3.d/S99bumod
Input the following command to set level 4.
ln -s -f /etc/init.d/bumod /etc/rc4.d/S99bumod
Input the following command to set level 5.
ln -s -f /etc/init.d/bumod /etc/rc5.d/S99bumod
Input the following command to open the rc.local file.
vim /etc/rc.local
Append the following command to the end of the rc.local file.
/etc/init.d/bumod start
Press
Esc
to exit editing.Input
:wq
to save the file.Execute the following command to set the permission of the rc.local file.
chmod +x /etc/rc.local
**Note: **Now the BUMO node is installed. Before starting the bumo service, you must select the configuration file for the running environment.
Selecting the Configuration File for the Main Network
After installing the BUMO node, you must select the configuration file of the main network to start the bumo service. Steps as follow:
Input the following command to go to the configuration file directory.
cd /usr/local/buchain/config/
Input the following command to rename the configuration file for the runtime environment.
mv bumo-mainnet.json bumo.json
**Note: **
- In this example, the main network environment is selected as the running environment. You can also select other files as your running environment according to your needs.
- After renaming the file, the bumo service can be started by the
service bumo start
command.- After installing the BUMO node, you can view the directory structure of the installation file in the buchain/ directory.
Configuration
Configuration by modifying the bumo.json file in buchain's config directory. Here we configure validation_address and validation_private_key in ledger. These two items are the account address of the validation node and the encrypted private key. If the synchronization node is used, these two items will not work, but if the synchronization node applies to be the validation node, they can be used to participate in the consensus.
Structure
"ledger":{
"validation_address":"buQmtDED9nFcCfRkwAF4TVhg6SL1FupDNhZY",//The address of validation node; the sync node or wallet does not need to be configured
"validation_private_key": "e174929ecec818c0861aeb168ebb800f6317dae1d439ec85ac0ce4ccdb88487487c3b74a316ee777a3a7a77e5b12efd724cd789b3b57b063b5db0215fc8f3e89", //The private key of validation node; the sync node or wallet does not need to be configured
"max_trans_per_ledger":1000, //Maximum number of transactions per block
"tx_pool": //Transaction pool configuration
{
"queue_limit":10240, // Limited transactions in the transaction pool
"queue_per_account_txs_limit":64 //Maximum transaction buffer for a single account
}
}
**Note: **
Validation_address
andvalidation_private_key
can be obtained through the bumo program command line tool. Please save the account information properly and you will not be able to retrieve it if it is lost.
Generate Command
1. Generate a new public-private key pair with the following executable command (Where address and private_key_aes correspond to validation_address and validation_private_key, respectively.):
[[email protected] ~]# cd /usr/local/buchain/bin
[[email protected] bin]#./bumo --create-account
{
"address" : "buQmtDED9nFcCfRkwAF4TVhg6SL1FupDNhZY", //Address
"private_key" : "privbsZozNs3q9aixZWEUzL9ft8AYph5DixN1sQccYvLs2zPsPhPK1Pt", //Private key
"private_key_aes" : "e174929ecec818c0861aeb168ebb800f6317dae1d439ec85ac0ce4ccdb88487487c3b74a316ee777a3a7a77e5b12efd724cd789b3b57b063b5db0215fc8f3e89", //AES encrypted private key
"public_key" : "b00108d329d5ff69a70177a60bf1b68972576b35a22d99d0b9a61541ab568521db5ee817fea6", //Public key
"public_key_raw" : "08d329d5ff69a70177a60bf1b68972576b35a22d99d0b9a61541ab568521db5e", //Original public key
"sign_type" : "ed25519" //Eed25519 encrypted
}
- If there is already a public-private key pair, the private key can be encrypted by the following command (If the address is buQmtDED9nFcCfRkwAF4TVhg6SL1FupDNhZY, and the private key is privbsZozNs3q9aixZWEUzL9ft8AYph5DixN1sQccYvLs2zPsPhPK1Pt):
[[email protected] ~]# cd /usr/local/buchain/bin
[[email protected] bin]#./bumo --aes-crypto privbsZozNs3q9aixZWEUzL9ft8AYph5DixN1sQccYvLs2zPsPhPK1Pt
e174929ecec818c0861aeb168ebb800f6317dae1d439ec85ac0ce4ccdb88487487c3b74a316ee777a3a7a77e5b12efd724cd789b3b57b063b5db0215fc8f3e89
Accounting Node Address
Enter the address of the accounting node when applying to become an accounting node (validation_address). Chart as follow:
Synchronizing System Time
To ensure that the node can run normally, it is necessary to ensure that the time of the node is consistent with that of other nodes on the public network. Therefore, it is necessary to periodically Synchronize the system time.
Synchronize the Time Periodically
Enter the following command to Synchronize the system time every 10 seconds.
echo "*/10 * * * * /usr/sbin/ntpdate ntpdate time.windows.com" >> /var/spool/cron/root
Ensure that the change takes effect
To ensure that the changes take effect, enter the following command to restart the crond service.
systemctl restart crond
Service Commands
The main commands introduced here, includes:Starting the BUMO Service、Stopping the BUMO Service、Querying the BUMO Service Status、Clearing Database。
Starting the BUMO Service
Input the following command to start the bumo service.
service bumo start
Stopping the BUMO Service
Input the following command to stop the bumo service.
service bumo stop
Querying the BUMO Service Status
Input the following command to query the bumo service.
service bumo status
Clearing Database
You must stop the BUMO service before clearing the database. You must complete the following steps to clear the database:
Stopping the BUMO Service
service bumo stop
Input the following command to enter the bumo service directory.
cd /usr/local/buchain/bin
- Input the following command to clear the database.
./bumo --dropdb
- Cleared successfully, the following message is displayed.
[[email protected] bin]# ./bumo --dropdb
[2019-05-23 15:13:51.507 - INF] <7FFFA81B4380> main.cpp(137):Initialized daemon successfully
[2019-05-23 15:13:51.508 - INF] <7FFFA81B4380> main.cpp(138):Loaded configure successfully
[2019-05-23 15:13:51.508 - INF] <7FFFA81B4380> main.cpp(139):Initialized logger successfully
[2019-05-23 15:13:51.508 - INF] <7FFFA81B4380> main.cpp(146):The path of the database is as follows: keyvalue(/Users/fengruiming/single/buchain/data/keyvalue.db),account(/Users/fengruiming/single/buchain/data/account.db),ledger(/Users/fengruiming/single/buchain/data/ledger.db)
[2019-05-23 15:13:51.524 - INF] <7FFFA81B4380> storage.cpp(296):Drop db successful
[2019-05-23 15:13:51.524 - INF] <7FFFA81B4380> main.cpp(153):Initialized database successfully
[2019-05-23 15:13:51.524 - INF] <7FFFA81B4380> main.cpp(156):Droped database successfully
Troubleshooting
Whether the node is running normally after the deployment is complete
After the deployment is complete, check whether the block height increases normally. If the block height is greater than 1, it means that the node is running normally.
Command
Calling the following command(For example, the IP is 127.0.0.1 and the port is 36002.):
[[email protected] ~]# curl 127.0.0.1:16002/getLedger
Result
The results are as follows:
{ "error_code" : 0, "result" : { "header" : { "account_tree_hash" : "bf337b72bb5ab150f25a4e665259049cd94fa70966a1c0f56f79a44969980ccb", "close_time" : 1558595960522453, "consensus_value_hash" : "04c172793d72b14ce2da8c5a9f9b7366edf75bc3c81aaf9f3069e6af3af1c857", "fees_hash" : "916daa78d264b3e2d9cff8aac84c943a834f49a62b7354d4fa228dab65515313", "hash" : "7349292089a68b134c03aefceed8a3ce0bf69960a21a6ca41467a672d3e2c3ce", "previous_hash" : "5d86cc2bb4a97831c4f8bbb1bbb8a09289337c42c33fa64bc7c1aa352b17b2ba", "seq" : 3, "validators_hash" : "9ff25c4231deb81c44eec379fd2467156d2389c5d69edf308d38f7b5ac53705b", "version" : 1002 } } }
**Note: **Here seq is the block height, it is 3, indicating that the node is running normally.
The node is running normally, but the transaction commit always fails
Check to see if the node is synchronized. For nodes that are not synchronized, the sent transaction cannot be executed normally.
Command
View the current node status, the command is as follows:
[[email protected] ~]# curl 127.0.0.1:16002/getModulesStatus
Result
The partial results are shown below:
... "ledger_manager" : { "account_count" : 117, "chain_max_ledger_seq" : 3185646, "hash_type" : "sha256", "ledger_context" : { "completed_size" : 0, "running_size" : 0 }, "ledger_sequence" : 65017, }, ...
**Note: The chain_max_ledger_seq indicates the latest block height of the current blockchain. The ledger_sequence indicates the block height of the current node. Since the ledger_sequence is smaller than the chain_max_ledger_seq, it indicates that the current block has not been synchronized yet, and the transaction sent through the node cannot be executed normally.