diff --git a/hive_integration/nimbus/enode.sh b/hive_integration/nimbus/enode.sh index f5395afa99..0c4ad0c5ad 100644 --- a/hive_integration/nimbus/enode.sh +++ b/hive_integration/nimbus/enode.sh @@ -9,7 +9,7 @@ # Immediately abort the script on any error encountered set -e -TARGET_RESPONSE=$(curl -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"net_nodeInfo","params":[],"id":1}' "localhost:8545" ) +TARGET_RESPONSE=$(curl -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"admin_nodeInfo","params":[],"id":1}' "localhost:8545" ) TARGET_ENODE=$(echo ${TARGET_RESPONSE}| jq -r '.result.enode') echo "$TARGET_ENODE" diff --git a/nimbus/rpc/common.nim b/nimbus/rpc/common.nim index 6ef969b12a..8bb7c42b2a 100644 --- a/nimbus/rpc/common.nim +++ b/nimbus/rpc/common.nim @@ -46,21 +46,24 @@ proc setupCommonRpc*(node: EthereumNode, conf: NimbusConf, server: RpcServer) = let peerCount = uint node.numPeers result = encodeQuantity(peerCount) - server.rpc("net_nodeInfo") do() -> NodeInfo: - let enode = toENode(node) - let nodeId = toNodeId(node.keys.pubkey) - result = NodeInfo( - id: nodeId.toHex, - name: conf.agentString, - enode: $enode, - ip: $enode.address.ip, - ports: NodePorts( - discovery: $enode.address.udpPort, - listener: $enode.address.tcpPort + server.rpc("admin_nodeInfo") do() -> NodeInfo: + let + enode = toENode(node) + nodeId = toNodeId(node.keys.pubkey) + nodeInfo = NodeInfo( + id: nodeId.toHex, + name: conf.agentString, + enode: $enode, + ip: $enode.address.ip, + ports: NodePorts( + discovery: $enode.address.udpPort, + listener: $enode.address.tcpPort + ) ) - ) - server.rpc("nimbus_addPeer") do(enode: string) -> bool: + return nodeInfo + + server.rpc("admin_addPeer") do(enode: string) -> bool: var res = ENode.fromString(enode) if res.isOk: asyncSpawn node.connectToNode(res.get())