Console¶
Tags: “go-sdk” “Go SDK Console”
Go SDK A simple console is implemented through ‘console.go’, supporting blockchain and node information query。
使用¶
Pull code and compile
# Pull Code
git clone https://github.com/FISCO-BCOS/go-sdk.git
# If the above command cannot be executed for a long time due to network problems, try the following command:
git clone https://gitee.com/FISCO-BCOS/go-sdk.git
# Switch Directory
cd go-sdk
# Compile cmd / console.go
go build cmd/console.go
Copy the corresponding ca.crt, sdk.crt and sdk.key certificates to the console executable working directory
getBlockByHash¶
Obtain block information based on the block hash:
./console getBlockByHash [blockHash] [true/false]
Parameters include:
-blockHash: block hash value; -true / false: true will return the details of all transactions in the block, false will only return the hash value of all transactions in the block, the default is true。
> ./console getBlockByHash 0xce28a18b54ee72450c403968f705253a59c87a22801a88cc642ae800bb8b4848 true
Block:
{
"extraData": [],
"gasLimit": "0x0",
"gasUsed": "0x0",
"hash": "0xce28a18b54ee72450c403968f705253a59c87a22801a88cc642ae800bb8b4848",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"number": "0x3",
"parentHash": "0x57016509418eb81c0353b1252a364383fcfc5c71035c8a01d24e785ac6e2ce4a",
"receiptsRoot": "0x4e430ca6474d7013a819a7c602497b7bfdfa14a1197a1edc35444b756cf7e6fc",
"sealer": "0x1",
"sealerList": [
"42ae2ae3950a2933b6f576dc946b90b242b7f9a2a8d45aae53c1a1664cd582bd759fa69e4b52f7a453dce702878b9ef11fd34fce1bd15c9bdcabcbbee43e1302",
"8b5e90815966004e807803aba5f003bc271d0b0aa82805c85764b21187bd504f79ec46eaf1e60752956af174a927d7b16c072c0bca1601968b29342521639c14",
"95381c1d22d10ad73171f0d34ec1f2e5809f47ee76264aeed4bb0daaf594bfb5da89f6a65ff4a056952f66a6a99fc927320d002191cecc7a48905edd61ad84b7",
"955ab783c6adc7a5f817773a5fbe32ecd9310f9392406eb1f9fa3d2b21539577a70c933158c1bd3a0bf183d5498bf57202b88401e1cb20e8972aab43ba3354f0"
],
"stateRoot": "0x2d23b1248fe53a1769db06af5c0e99261678643f405f058cfa89193592d13fa7",
"timestamp": "0x172fe19b855",
"transactions": [
{
"blockHash": "0xce28a18b54ee72450c403968f705253a59c87a22801a88cc642ae800bb8b4848",
"blockNumber": "0x3",
"from": "0x4ca29e9e8cb79c863c04f83827ab540315f25e67",
"gas": "0x11e1a300",
"gasPrice": "0x11e1a300",
"hash": "0x5518df7c2063efeb6481c35c4c58f378fac5f476c023c2019b9b01d221478434",
"input": "0x2800efc0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000803432616532616533393530613239333362366635373664633934366239306232343262376639613261386434356161653533633161313636346364353832626437353966613639653462353266376134353364636537303238373862396566313166643334666365316264313563396264636162636262656534336531333032",
"nonce": "0x359fbc4677e4f4ca87a96a31372b1194f03ba200db94a18ad0b30f2e858ac32",
"to": "0x0000000000000000000000000000000000001003",
"transactionIndex": "0x0",
"value": "0x0"
}
],
"transactionsRoot": "0xcf057dc481d7a97700e93a1ea65f331c3cfee2fee80e3bb80c30748e4988fe9d"
}
> ./console getBlockByHash 0xce28a18b54ee72450c403968f705253a59c87a22801a88cc642ae800bb8b4848 false
Block:
{
"extraData": [],
"gasLimit": "0x0",
"gasUsed": "0x0",
"hash": "0xce28a18b54ee72450c403968f705253a59c87a22801a88cc642ae800bb8b4848",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"number": "0x3",
"parentHash": "0x57016509418eb81c0353b1252a364383fcfc5c71035c8a01d24e785ac6e2ce4a",
"receiptsRoot": "0x4e430ca6474d7013a819a7c602497b7bfdfa14a1197a1edc35444b756cf7e6fc",
"sealer": "0x1",
"sealerList": [
"42ae2ae3950a2933b6f576dc946b90b242b7f9a2a8d45aae53c1a1664cd582bd759fa69e4b52f7a453dce702878b9ef11fd34fce1bd15c9bdcabcbbee43e1302",
"8b5e90815966004e807803aba5f003bc271d0b0aa82805c85764b21187bd504f79ec46eaf1e60752956af174a927d7b16c072c0bca1601968b29342521639c14",
"95381c1d22d10ad73171f0d34ec1f2e5809f47ee76264aeed4bb0daaf594bfb5da89f6a65ff4a056952f66a6a99fc927320d002191cecc7a48905edd61ad84b7",
"955ab783c6adc7a5f817773a5fbe32ecd9310f9392406eb1f9fa3d2b21539577a70c933158c1bd3a0bf183d5498bf57202b88401e1cb20e8972aab43ba3354f0"
],
"stateRoot": "0x2d23b1248fe53a1769db06af5c0e99261678643f405f058cfa89193592d13fa7",
"timestamp": "0x172fe19b855",
"transactions": [
"0x5518df7c2063efeb6481c35c4c58f378fac5f476c023c2019b9b01d221478434"
],
"transactionsRoot": "0xcf057dc481d7a97700e93a1ea65f331c3cfee2fee80e3bb80c30748e4988fe9d"
}
getBlockByNumber¶
Obtain block information based on block height:
./console getBlockByNumber [blockNumber] [true/false]
Parameters include:
-blockNumber: block height; -true / false: true will return the details of all transactions in the block, false will only return the hash value of all transactions in the block, the default is true。
> ./console getBlockByNumber 3 true
Block:
{
"dbHash": "0x2d23b1248fe53a1769db06af5c0e99261678643f405f058cfa89193592d13fa7",
"extraData": [],
"gasLimit": "0x0",
"gasUsed": "0x0",
"hash": "0xce28a18b54ee72450c403968f705253a59c87a22801a88cc642ae800bb8b4848",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"number": "0x3",
"parentHash": "0x57016509418eb81c0353b1252a364383fcfc5c71035c8a01d24e785ac6e2ce4a",
"receiptsRoot": "0x4e430ca6474d7013a819a7c602497b7bfdfa14a1197a1edc35444b756cf7e6fc",
"sealer": "0x1",
"sealerList": [
"42ae2ae3950a2933b6f576dc946b90b242b7f9a2a8d45aae53c1a1664cd582bd759fa69e4b52f7a453dce702878b9ef11fd34fce1bd15c9bdcabcbbee43e1302",
"8b5e90815966004e807803aba5f003bc271d0b0aa82805c85764b21187bd504f79ec46eaf1e60752956af174a927d7b16c072c0bca1601968b29342521639c14",
"95381c1d22d10ad73171f0d34ec1f2e5809f47ee76264aeed4bb0daaf594bfb5da89f6a65ff4a056952f66a6a99fc927320d002191cecc7a48905edd61ad84b7",
"955ab783c6adc7a5f817773a5fbe32ecd9310f9392406eb1f9fa3d2b21539577a70c933158c1bd3a0bf183d5498bf57202b88401e1cb20e8972aab43ba3354f0"
],
"stateRoot": "0x2d23b1248fe53a1769db06af5c0e99261678643f405f058cfa89193592d13fa7",
"timestamp": "0x172fe19b855",
"transactions": [
{
"blockHash": "0xce28a18b54ee72450c403968f705253a59c87a22801a88cc642ae800bb8b4848",
"blockNumber": "0x3",
"from": "0x4ca29e9e8cb79c863c04f83827ab540315f25e67",
"gas": "0x11e1a300",
"gasPrice": "0x11e1a300",
"hash": "0x5518df7c2063efeb6481c35c4c58f378fac5f476c023c2019b9b01d221478434",
"input": "0x2800efc0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000803432616532616533393530613239333362366635373664633934366239306232343262376639613261386434356161653533633161313636346364353832626437353966613639653462353266376134353364636537303238373862396566313166643334666365316264313563396264636162636262656534336531333032",
"nonce": "0x359fbc4677e4f4ca87a96a31372b1194f03ba200db94a18ad0b30f2e858ac32",
"to": "0x0000000000000000000000000000000000001003",
"transactionIndex": "0x0",
"value": "0x0"
}
],
"transactionsRoot": "0xcf057dc481d7a97700e93a1ea65f331c3cfee2fee80e3bb80c30748e4988fe9d"
}
> ./console getBlockByNumber 3 false
Block:
{
"dbHash": "0x2d23b1248fe53a1769db06af5c0e99261678643f405f058cfa89193592d13fa7",
"extraData": [],
"gasLimit": "0x0",
"gasUsed": "0x0",
"hash": "0xce28a18b54ee72450c403968f705253a59c87a22801a88cc642ae800bb8b4848",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"number": "0x3",
"parentHash": "0x57016509418eb81c0353b1252a364383fcfc5c71035c8a01d24e785ac6e2ce4a",
"receiptsRoot": "0x4e430ca6474d7013a819a7c602497b7bfdfa14a1197a1edc35444b756cf7e6fc",
"sealer": "0x1",
"sealerList": [
"42ae2ae3950a2933b6f576dc946b90b242b7f9a2a8d45aae53c1a1664cd582bd759fa69e4b52f7a453dce702878b9ef11fd34fce1bd15c9bdcabcbbee43e1302",
"8b5e90815966004e807803aba5f003bc271d0b0aa82805c85764b21187bd504f79ec46eaf1e60752956af174a927d7b16c072c0bca1601968b29342521639c14",
"95381c1d22d10ad73171f0d34ec1f2e5809f47ee76264aeed4bb0daaf594bfb5da89f6a65ff4a056952f66a6a99fc927320d002191cecc7a48905edd61ad84b7",
"955ab783c6adc7a5f817773a5fbe32ecd9310f9392406eb1f9fa3d2b21539577a70c933158c1bd3a0bf183d5498bf57202b88401e1cb20e8972aab43ba3354f0"
],
"stateRoot": "0x2d23b1248fe53a1769db06af5c0e99261678643f405f058cfa89193592d13fa7",
"timestamp": "0x172fe19b855",
"transactions": [
"0x5518df7c2063efeb6481c35c4c58f378fac5f476c023c2019b9b01d221478434"
],
"transactionsRoot": "0xcf057dc481d7a97700e93a1ea65f331c3cfee2fee80e3bb80c30748e4988fe9d"
}
getBlockHashByNumber¶
Obtain the block hash based on the block height:
./console getBlockHashByNumber [blockNumber]
Parameters include:
-blockNumber: block height。
> ./console getBlockHashByNumber 3
Block Hash:
"0xce28a18b54ee72450c403968f705253a59c87a22801a88cc642ae800bb8b4848"
getBlockNumber¶
Get the latest block high:
> ./console getBlockNumber
blocknumber:
hex: "0x3"
decimal: 3
getCode¶
Query contract data based on contract address:
./console getCode [contract address]
Parameters include:
-contract address: contract address。
> ./console getCode 0x65474dbd4f08170bc2dc30f9ae32f8e2206b15a6
Contract Code:
"0x60806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634ed3885e146100515780636d4ce63c146100ba575b600080fd5b34801561005d57600080fd5b506100b8600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061014a565b005b3480156100c657600080fd5b506100cf610164565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561010f5780820151818401526020810190506100f4565b50505050905090810190601f16801561013c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b8060009080519060200190610160929190610206565b5050565b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156101fc5780601f106101d1576101008083540402835291602001916101fc565b820191906000526020600020905b8154815290600101906020018083116101df57829003601f168201915b5050505050905090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061024757805160ff1916838001178555610275565b82800160010185558215610275579182015b82811115610274578251825591602001919060010190610259565b5b5090506102829190610286565b5090565b6102a891905b808211156102a457600081600090555060010161028c565b5090565b905600a165627a7a72305820d0c58adfbd1215902f16e710a4e52b14e5c9ad7f0f3363c86d2b3156894bd0610029"
getConsensusStatus¶
Get blockchain node consensus status
> ./console getConsensusStatus
Consensus Status:
[
{
"accountType": 1,
"allowFutureBlocks": true,
"cfgErr": false,
"connectedNodes": 3,
"consensusedBlockNumber": 4,
"currentView": 80,
"groupId": 1,
"highestblockHash": "0xce28a18b54ee72450c403968f705253a59c87a22801a88cc642ae800bb8b4848",
"highestblockNumber": 3,
"leaderFailed": false,
"max_faulty_leader": 0,
"nodeId": "955ab783c6adc7a5f817773a5fbe32ecd9310f9392406eb1f9fa3d2b21539577a70c933158c1bd3a0bf183d5498bf57202b88401e1cb20e8972aab43ba3354f0",
"nodeNum": 3,
"node_index": 2,
"omitEmptyBlock": true,
"protocolId": 65544,
"sealer.0": "8b5e90815966004e807803aba5f003bc271d0b0aa82805c85764b21187bd504f79ec46eaf1e60752956af174a927d7b16c072c0bca1601968b29342521639c14",
"sealer.1": "95381c1d22d10ad73171f0d34ec1f2e5809f47ee76264aeed4bb0daaf594bfb5da89f6a65ff4a056952f66a6a99fc927320d002191cecc7a48905edd61ad84b7",
"sealer.2": "955ab783c6adc7a5f817773a5fbe32ecd9310f9392406eb1f9fa3d2b21539577a70c933158c1bd3a0bf183d5498bf57202b88401e1cb20e8972aab43ba3354f0",
"toView": 80
},
[
{
"nodeId": "8b5e90815966004e807803aba5f003bc271d0b0aa82805c85764b21187bd504f79ec46eaf1e60752956af174a927d7b16c072c0bca1601968b29342521639c14",
"view": 78
},
{
"nodeId": "95381c1d22d10ad73171f0d34ec1f2e5809f47ee76264aeed4bb0daaf594bfb5da89f6a65ff4a056952f66a6a99fc927320d002191cecc7a48905edd61ad84b7",
"view": 79
},
{
"nodeId": "955ab783c6adc7a5f817773a5fbe32ecd9310f9392406eb1f9fa3d2b21539577a70c933158c1bd3a0bf183d5498bf57202b88401e1cb20e8972aab43ba3354f0",
"view": 80
}
]
]
getGroupID¶
Get the connection node group ID specified in the configuration file:
> ./console getGroupID
Group ID:
1
getGroupList¶
Get the list of group IDs of the group to which the node belongs:
> ./console getGroupList
Group ID List:
[
1
]
getGroupPeers¶
Get the list of consensus nodes and observation nodes for the specified group:
> ./console getGroupPeers
Peers:
[
"42ae2ae3950a2933b6f576dc946b90b242b7f9a2a8d45aae53c1a1664cd582bd759fa69e4b52f7a453dce702878b9ef11fd34fce1bd15c9bdcabcbbee43e1302",
"8b5e90815966004e807803aba5f003bc271d0b0aa82805c85764b21187bd504f79ec46eaf1e60752956af174a927d7b16c072c0bca1601968b29342521639c14",
"95381c1d22d10ad73171f0d34ec1f2e5809f47ee76264aeed4bb0daaf594bfb5da89f6a65ff4a056952f66a6a99fc927320d002191cecc7a48905edd61ad84b7",
"955ab783c6adc7a5f817773a5fbe32ecd9310f9392406eb1f9fa3d2b21539577a70c933158c1bd3a0bf183d5498bf57202b88401e1cb20e8972aab43ba3354f0"
]
getNodeIDList¶
Get a list of nodes and their connected nodes:
> ./console getNodeIDList
Node ID list:
[
"955ab783c6adc7a5f817773a5fbe32ecd9310f9392406eb1f9fa3d2b21539577a70c933158c1bd3a0bf183d5498bf57202b88401e1cb20e8972aab43ba3354f0",
"8b5e90815966004e807803aba5f003bc271d0b0aa82805c85764b21187bd504f79ec46eaf1e60752956af174a927d7b16c072c0bca1601968b29342521639c14",
"42ae2ae3950a2933b6f576dc946b90b242b7f9a2a8d45aae53c1a1664cd582bd759fa69e4b52f7a453dce702878b9ef11fd34fce1bd15c9bdcabcbbee43e1302",
"95381c1d22d10ad73171f0d34ec1f2e5809f47ee76264aeed4bb0daaf594bfb5da89f6a65ff4a056952f66a6a99fc927320d002191cecc7a48905edd61ad84b7"
]
getObserverList¶
Get the list of observer nodes:
> ./console getObserverList
Observer List:
[
"42ae2ae3950a2933b6f576dc946b90b242b7f9a2a8d45aae53c1a1664cd582bd759fa69e4b52f7a453dce702878b9ef11fd34fce1bd15c9bdcabcbbee43e1302"
]
getPeers¶
Obtain the connection information of a blockchain node:
> ./console getPeers
Peers:
[
{
"Agency": "agency",
"IPAndPort": "127.0.0.1:51808",
"Node": "node3",
"NodeID": "8b5e90815966004e807803aba5f003bc271d0b0aa82805c85764b21187bd504f79ec46eaf1e60752956af174a927d7b16c072c0bca1601968b29342521639c14",
"Topic": []
},
{
"Agency": "agency",
"IPAndPort": "127.0.0.1:30302",
"Node": "node2",
"NodeID": "42ae2ae3950a2933b6f576dc946b90b242b7f9a2a8d45aae53c1a1664cd582bd759fa69e4b52f7a453dce702878b9ef11fd34fce1bd15c9bdcabcbbee43e1302",
"Topic": []
},
{
"Agency": "agency",
"IPAndPort": "127.0.0.1:30301",
"Node": "node1",
"NodeID": "95381c1d22d10ad73171f0d34ec1f2e5809f47ee76264aeed4bb0daaf594bfb5da89f6a65ff4a056952f66a6a99fc927320d002191cecc7a48905edd61ad84b7",
"Topic": []
}
]
getPendingTxSize¶
Get the number of unchained transactions in the transaction pool:
> ./console getPendingTxSize
Pending Transactions Count:
hex: "0x0"
decimal: 0
getSealerList¶
Get the list of consensus nodes:
> ./console getSealerList
Sealer List:
[
"8b5e90815966004e807803aba5f003bc271d0b0aa82805c85764b21187bd504f79ec46eaf1e60752956af174a927d7b16c072c0bca1601968b29342521639c14",
"95381c1d22d10ad73171f0d34ec1f2e5809f47ee76264aeed4bb0daaf594bfb5da89f6a65ff4a056952f66a6a99fc927320d002191cecc7a48905edd61ad84b7",
"955ab783c6adc7a5f817773a5fbe32ecd9310f9392406eb1f9fa3d2b21539577a70c933158c1bd3a0bf183d5498bf57202b88401e1cb20e8972aab43ba3354f0"
]
getSyncStatus¶
Obtain the synchronization status of a blockchain node:
> ./console getSyncStatus
Synchronization Status:
{
"blockNumber": 3,
"genesisHash": "65e9c13da61b1f47564ccc6498260d739ce3dfd3366accc539a64412c1ef8e88",
"isSyncing": false,
"knownHighestNumber": 3,
"knownLatestHash": "ce28a18b54ee72450c403968f705253a59c87a22801a88cc642ae800bb8b4848",
"latestHash": "ce28a18b54ee72450c403968f705253a59c87a22801a88cc642ae800bb8b4848",
"nodeId": "955ab783c6adc7a5f817773a5fbe32ecd9310f9392406eb1f9fa3d2b21539577a70c933158c1bd3a0bf183d5498bf57202b88401e1cb20e8972aab43ba3354f0",
"peers": [
{
"blockNumber": 3,
"genesisHash": "65e9c13da61b1f47564ccc6498260d739ce3dfd3366accc539a64412c1ef8e88",
"latestHash": "ce28a18b54ee72450c403968f705253a59c87a22801a88cc642ae800bb8b4848",
"nodeId": "42ae2ae3950a2933b6f576dc946b90b242b7f9a2a8d45aae53c1a1664cd582bd759fa69e4b52f7a453dce702878b9ef11fd34fce1bd15c9bdcabcbbee43e1302"
},
{
"blockNumber": 3,
"genesisHash": "65e9c13da61b1f47564ccc6498260d739ce3dfd3366accc539a64412c1ef8e88",
"latestHash": "ce28a18b54ee72450c403968f705253a59c87a22801a88cc642ae800bb8b4848",
"nodeId": "8b5e90815966004e807803aba5f003bc271d0b0aa82805c85764b21187bd504f79ec46eaf1e60752956af174a927d7b16c072c0bca1601968b29342521639c14"
},
{
"blockNumber": 3,
"genesisHash": "65e9c13da61b1f47564ccc6498260d739ce3dfd3366accc539a64412c1ef8e88",
"latestHash": "ce28a18b54ee72450c403968f705253a59c87a22801a88cc642ae800bb8b4848",
"nodeId": "95381c1d22d10ad73171f0d34ec1f2e5809f47ee76264aeed4bb0daaf594bfb5da89f6a65ff4a056952f66a6a99fc927320d002191cecc7a48905edd61ad84b7"
}
],
"protocolId": 65545,
"txPoolSize": "0"
}
getSystemConfigByKey¶
Obtain the blockchain system configuration based on the keyword:
./console getSystemConfigByKey [tx_count_limit/tx_gas_limit]
Parameters include:
tx _ count _ limit / tx _ gas _ limit: limit on the number of transactions in a single block / limit on the amount of gas that can be consumed in a single transaction
> ./console getSystemConfigByKey tx_count_limit
Result:
"1000"
> ./console getSystemConfigByKey tx_gas_limit
Result:
"300000000"
getTotalTransactionCount¶
Get the number of on-chain transactions for the specified group:
> ./console getTotalTransactionCount
Latest Statistics on Transaction and Block Height:
{
"blockNumber": "0x5",
"failedTxSum": "0x0",
"txSum": "0x5"
}
getTransactionByHash¶
Get transaction information based on transaction hash:
./console getTransactionByHash [transactionHash]
Parameters include:
-transactionHash: transaction hash value。
> ./console getTransactionByHash 0x5518df7c2063efeb6481c35c4c58f378fac5f476c023c2019b9b01d221478434
Transaction:
{
"blockHash": "0xce28a18b54ee72450c403968f705253a59c87a22801a88cc642ae800bb8b4848",
"blockNumber": "0x3",
"from": "0x4ca29e9e8cb79c863c04f83827ab540315f25e67",
"gas": "0x11e1a300",
"gasPrice": "0x11e1a300",
"hash": "0x5518df7c2063efeb6481c35c4c58f378fac5f476c023c2019b9b01d221478434",
"input": "0x2800efc0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000803432616532616533393530613239333362366635373664633934366239306232343262376639613261386434356161653533633161313636346364353832626437353966613639653462353266376134353364636537303238373862396566313166643334666365316264313563396264636162636262656534336531333032",
"nonce": "0x359fbc4677e4f4ca87a96a31372b1194f03ba200db94a18ad0b30f2e858ac32",
"to": "0x0000000000000000000000000000000000001003",
"transactionIndex": "0x0",
"value": "0x0"
}
getTransactionReceipt¶
Get transaction receipt based on transaction hash:
./console getTransactionReceipt [transactionHash]
Parameters include:
-transactionHash: transaction hash value。
> ./console getTransactionReceipt 0x5518df7c2063efeb6481c35c4c58f378fac5f476c023c2019b9b01d221478434
Transaction Receipt:
{
"transactionHash": "0x5518df7c2063efeb6481c35c4c58f378fac5f476c023c2019b9b01d221478434",
"transactionIndex": "0x0",
"blockHash": "0xce28a18b54ee72450c403968f705253a59c87a22801a88cc642ae800bb8b4848",
"blockNumber": "0x3",
"gasUsed": "0x765b",
"contractAddress": "0x0000000000000000000000000000000000000000",
"root": "0x2d23b1248fe53a1769db06af5c0e99261678643f405f058cfa89193592d13fa7",
"status": "0x0",
"from": "0x4ca29e9e8cb79c863c04f83827ab540315f25e67",
"to": "0x0000000000000000000000000000000000001003",
"input": "0x2800efc0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000803432616532616533393530613239333362366635373664633934366239306232343262376639613261386434356161653533633161313636346364353832626437353966613639653462353266376134353364636537303238373862396566313166643334666365316264313563396264636162636262656534336531333032",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
setSystemConfigByKey¶
Set the blockchain system configuration based on the keyword:
./console setSystemConfigByKey [tx_count_limit/tx_gas_limit/rpbft_epoch_sealer_num/rpbft_epoch_block_num]
Parameters include:
tx _ count _ limit / tx _ gas _ limit / rpbft _ epoch _ sealer _ num / rpbft _ epoch _ block _ num: limit on the number of transactions in a single block / limit on the amount of gas that can be consumed in a single transaction
> ./console setSystemConfigByKey tx_count_limit 999
success
> ./console setSystemConfigByKey tx_gas_limit 30000000
success
> ./console setSystemConfigByKey rpbft_epoch_sealer_num 20
success
> ./console setSystemConfigByKey rpbft_epoch_block_num 30
success
addObserver¶
Set the corresponding node as the observer node according to the node NodeID
./console addObserver [Node ID]
Parameters include:
Node ID: Node ID。
> ./console addObserver 58108297d9b545dc6e9a7ee4fea539c7886ced0c4cfeb33acd16ad23158247901d7d45dfbacc2fe97e38afaf163a4608f2fc2338d3ca37245d44e983adbde202
success
addSealer¶
Set the corresponding node as the consensus node according to the node NodeID
./console addSealer [Node ID]
Parameters include:
Node ID: Node ID。
> ./console addSealer 58108297d9b545dc6e9a7ee4fea539c7886ced0c4cfeb33acd16ad23158247901d7d45dfbacc2fe97e38afaf163a4608f2fc2338d3ca37245d44e983adbde202
success
removeNode¶
Set the corresponding node as a free node according to the node NodeID
./console removeNode [Node ID]
Parameters include:
Node ID: Node ID。
> ./console removeNode 58108297d9b545dc6e9a7ee4fea539c7886ced0c4cfeb33acd16ad23158247901d7d45dfbacc2fe97e38afaf163a4608f2fc2338d3ca37245d44e983adbde202
success