Table of contents
Simple operation of calling HelloWorld contract
Commands related to expanding the capacity of new nodes
Permission management related commands
The following commands are introduced in my other articles
Install ubuntu dependencies:
sudo apt install -y openssl curl
Build a single group 4-node alliance chain
bash build_chain.sh -l 127.0.0.1:4 -p 30300,20200,8545
Install java on ubuntu system
sudo apt install -y default -jdk
Configure console certificate
cp -r nodes/127.0.0.1/sdk/* console/conf/
Console related commands
Get client version
getNodeVersion
Get node information
getPeers
View current block height
getBlockNumber
addSealer: Set the corresponding node as the consensus node according to the node NodelD
addObserver: Set the corresponding node as an observation node according to the node NodelD
removeNode: Set the corresponding node as a free node according to the node NodelD getSealerList: View the list of consensus nodes in the group
getObserverList: View the list of observation nodes in the group
getNodelDList: View the NodelD of all other nodes to which the node is connected
Simple operation of calling HelloWorld contract
1. Deploy the contract (the contract has been placed in fisco/console/contracts/solidity/HelloWorld.sol)
deploy HelloWorld
Executing this command will return two values
2. Call the contract
call HelloWorld "transaction" get
call HelloWorld "contract address" set "Hi,word"
3. Quit the console quit
Commands related to expanding the capacity of new nodes
Generate node private key certificate
bash gen_node_cert.sh -c ../cert/agency -o node4
Confirm that node4 establishes a connection with other nodes
tail -f node4/log/log* | grep "connected count"
Node joins group
1. Get the nodeid of the node
cat node4/conf/node.nodeid
2. Use the console to add node4 as an observation node to group 1
addObserver "nodeid"
Then execute getObserverList and you will find that the id appears
3. Use the console to join node4 as a consensus node in group 1
addSealer "nodeid"
Then execute getOSealerList and you will find that the id appears
Additional instructions about nodes
Convert the specified node to a free node
removeNode + "the nodeid"
Query node list
getNodeidList
Permission management related commands
Related knowledge click here
1. Generate account
bash console/get_account.sh
Add account as member
grantCommitteeMember +"Account Address"
Log in to account 1 as a member
./start.sh 1 -pem +"Private Key"
View committee list
listCommitteeMembers
Cancel account
revokeCommitteeMember +"Address"
Changing and querying the voting validity threshold
updateThreshold 75
queryThreshold
Add account as operation and maintenance role
grantOperator +Address
Commands related to node operations
addSealer |
Set the node as a consensus node |
|
addObserver |
Set the node as an observation node |
|
removeNode |
Set the node as a free node |
|
getSealerList |
Query consensus node list |
|
getObserverList |
Query the list of observation nodes |
View node connections
$ curl -X POST --data '{"jsonrpc":"2.0","method":"getPeers","params":[1],"id":1}'
http://127.0.0.1:8545 |jq
In this command, 8545 is the rpc port number of the node.
One-click deployment
PyMySql deployment
sudo apt-get install -y python3-pip
sudo pip3 install PyMySQL
Modify the common.properties configuration file during one-click deployment
Deploy and start all services
python3 deploy.py installAll
Inspection orders
Check if the process is started
ps -rf |grep -v grep | grep fisco-bcos
Check the number of nodes connected to node node0
tail -f nodes/127.0.0.1/node0/log/log* | grep connected
Check if consensus is reached
tail -f nodes/127.0.0.1/node0/log/log* | grep +++
Check node process
ps -ef | grep node
Check the node front webase-front process
ps -ef | grep webase.front
Check node channel port (20200)
netstat -anlp | grep 20200
Check whether the webase-front port (default is 5002) is listening
netstat -anlp | grep 5002
Check the running success log
grep -B 3 "main run success" log/WeBASE-Front.log
End~Follow the collection for continued updates