6.3.3 Hyperledger Besu Access Instruction

1. Interact with node by Geth console

Example:

 [root@localhost ~]# geth attach https://admin:123456@bsn91000001.bsngate.com:19602/node1

 INFO [07-15|13:41:24.391] Running with private transaction manager disabled - quorum private transactions will not be supported

 WARNING: call to admin.getNodeInfo() failed, unable to determine consensus mechanism

 Welcome to the Geth JavaScript console!

 instance: besu/v21.1.2/linux-x86_64/oracle_openjdk-java-11

 coinbase: 0xfd0fdb96a3326c61756711d314bea0149088c3d9

 at block: 195 (Thu Jul 15 2021 13:41:24 GMT+0800 (CST))

 modules: eea:1.0 eth:1.0 ibft:1.0 net:1.0 perm:1.0 priv:1.0 web3:1.0

 > web3.eth.blockNumber
 202
 >

2. Interact with nodes by JSON-RPC

Example:

  [root@localhost ~]# curl -H "Content-Type: application/json" -d \
  >   '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":2}' \
  >  https://admin:123456@bsn91000001.bsngate.com:19602/node1

  {
    "jsonrpc" : "2.0",
    "id" : 2,
    "result" : "0x365"
  }

3. Interact with node by 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);
© 2019-2024 Red Date (Hong Kong) Technology Limited. all right reserved,powered by GitbookFile Modify: 2023-02-16 12:22:03

results matching ""

    No results matching ""

    results matching ""

      No results matching ""