BubiChain Maintenance
Starting the BubiChain Service
Input the following command to start the bubi service.
service bubi start
Note: To start the bubi service in MacOS, you must enter the /usr/local/bubichain/bin directory and start the bubi service with the
./bubi
command.
Stopping the BubiChain Service
Input the following command to stop the bubi service.
service bubi stop
Note: In the MacOS system, you can stop the bubi service by pressing
control+c
.
Querying the BubiChain Service Status
Input the following command to query the bubi service.
service bubi status
Note: No service is available in MacOS.
Querying the Detailed System Status
Input the following command to query the detailed system status.
curl 127.0.0.1:19333/getModulesStatus
The result is shown below:
{
"glue_manager":{
"cache_topic_size":0,
"ledger_upgrade":{
"current_states":null,
"local_state":null
},
"system":{
"current_time":"2017-07-20 10:32:22", //Current system time
"process_uptime":"2017-07-20 09:35:06", //When bubi is started
"uptime":"2017-05-14 23:51:04"
},
"time":"0 ms",
"transaction_size":0
},
"keyvalue_db":Object{...},
"ledger_db":Object{...},
"ledger_manager":{
"account_count":2316, //Total accounts
"hash_type":"sha256",
"ledger_sequence":12187,
"time":"0 ms",
"tx_count":1185 //Total transactions
},
"peer_manager":Object{...},
"web server":Object{...}
}
Note: No service is available in MacOS.
Clearing Database
You must stop the BubiChain service before clearing the database. You must complete the following steps to clear the database:
Input the following command to enter the bubi service directory.
cd /usr/local/bubichain/bin
Input the following command to clear the database.
./bubi --dropdb
Note: After the database is successfully cleared, you can see the information shown below.
Creating a Hard Fork
You must complete the following steps to create a hard fork.
Create the hard fork by inputting the following command in the /usr/local directory.
bubichain/bin/bubi --create-hardfork
Enter
y
when prompted and then pressEnter
. The message shown below indicates the hard fork is created successfully.
Note:
- After executing the above command, the new blockchain network has only one verification node.
- After executing the hard fork command, the following hash value is displayed:
4b9ad78065c65aaf1280edf6129ab2da93c99c42f2bcd380b5966750ccd5d80d
Input the following command to clear the consensus status data. When clearing the consensus status data, you must ensure that the bubi service is not running, otherwise it cannot be cleared.
bubichain/bin/bubi --clear-consensus-status
Add the hash value to the bubi.json file in the /usr/local/bubichain/config directory of the node or synchronization node.
"ledger": { "genesis_account": "adxSe9NGrGXmNBhwDerRyRyaXouFT4WbPT7LA", "max_trans_per_ledger": 1000, "hardfork_points":[ "4b9ad78065c65aaf1280edf6129ab2da93c99c42f2bcd380b5966750ccd5d80d" ] },
Start the node service for the configuration to take effect.
Updating the configure file
Before updating the configure file, you must make sure that the BubiChain service is down. If you want to update the configure file of the BubiChain node, you can modify it by following the steps below.
Input the following command to enter the directory where the configuration file is located.
cd /usr/local/bubichain/config/
Change the configuration file name (bubi.json) for the current running environment, for example:
cp bubi.json bubi-previous.json
Update the configure file bubi.json, for example:
vi bubi.json
Note:
- If you want to update the configure file, you can refer to Configuration.
- After changing the running environment, you must clear the database to restart the bubi service.