6.3.1 ConsenSys Quorum Access Instruction
1. Use GoQuorum Client to interact with nodes
Example:
$ ./geth attach https://VuF0h0y7pLwtvDqjuW:y2sYuiIciR6JFtHbmC@bsnmu7d0gNn.bsngate.com:19602/node1
INFO [05-08|16:05:52.534] Running with private transaction manager disabled - quorum private transactions will not be supported
Welcome to the Geth JavaScript console!
instance: Geth/v1.9.7-stable-af752518(quorum-v20.10.0)/linux-amd64/go1.13.15
coinbase: 0xf957d0ae8a1c1b2cdcea0acb8fb0a2a750abadaa
at block: 109 (Sat May 08 2021 16:05:48 GMT+0800 (CST))
datadir: /root/quorum/data
modules: admin:1.0 debug:1.0 eth:1.0 istanbul:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0
> web3.eth.blockNumber
11
2. Use JSON-RPC API to interact with nodes
Geth JSON-RPC documentation: https://github.com/ethereum/wiki/wiki/JSON-RPC
Quorum API documentation: https://docs.goquorum.consensys.net/en/latest/Reference/APIs/PrivacyAPI/
The API can be called by using CURL and Postman.
Example:
$ curl -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":2}' https://VuF0h0y7pLwtvDqjuW:y2sYuiIciR6JFtHbmC@bsnmu7d0gNn.bsngate.com:19602/node1
{"jsonrpc":"2.0","id":2,"result":"0x10"}
3. Use web3.js to interact with nodes
- Web3.js class library: https://github.com/ChainSafe/web3.js
Example:
const Web3 = require("web3");
const web3 = new Web3(
new Web3.providers.HttpProvider("https://VuF0h0y7pLwtvDqjuW:y2sYuiIciR6JFtHbmC@bsnmu7d0gNn.bsngate.com:19602/node1")
);
web3.eth.getBlockNumber().then(console.log);