Skip to content

Commit 30fe86d

Browse files
authored
docs: update admin namespace docs (#23916)
1 parent 44879c3 commit 30fe86d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

docs/vocs/docs/pages/jsonrpc/admin.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Returns true if the peer was successfully removed.
8080
Returns all information known about the running node.
8181

8282
These include general information about the node itself, as well as what protocols it participates in, its IP and ports.
83+
The `id` field is the keccak256 hash of the node's `enode` public key, encoded as 64 lowercase hex characters without a `0x` prefix.
8384

8485
| Client | Method invocation |
8586
| ------ | ------------------------------ |
@@ -94,7 +95,7 @@ These include general information about the node itself, as well as what protoco
9495
"id": 1,
9596
"result": {
9697
"enode": "enode://44826a5d6a55f88a18298bca4773fca5749cdc3a5c9f308aa7d810e9b31123f3e7c5fba0b1d70aac5308426f47df2a128a6747040a3815cc7dd7167d03be320d@[::]:30303",
97-
"id": "44826a5d6a55f88a18298bca4773fca5749cdc3a5c9f308aa7d810e9b31123f3e7c5fba0b1d70aac5308426f47df2a128a6747040a3815cc7dd7167d03be320d",
98+
"id": "8915d6ec2f53ede650d5b9bea77d7756f177092171648ee1d8cbc550d334fa7a",
9899
"ip": "::",
99100
"listenAddr": "[::]:30303",
100101
"name": "reth/v0.0.1/x86_64-unknown-linux-gnu",
@@ -117,6 +118,7 @@ These include general information about the node itself, as well as what protoco
117118
## `admin_peers`
118119

119120
Returns information about peers currently known to the node.
121+
For each peer, `id` is the keccak256 hash of the peer `enode` public key, encoded as 64 lowercase hex characters without a `0x` prefix.
120122

121123
| Client | Method invocation |
122124
| ------ | ------------------------------ |
@@ -128,7 +130,7 @@ Returns information about peers currently known to the node.
128130
// > {"jsonrpc":"2.0","id":1,"method":"admin_peers","params":[]}
129131
{"jsonrpc":"2.0","id":1,"result":[
130132
{
131-
"id":"44826a5d6a55f88a18298bca4773fca...",
133+
"id":"8915d6ec2f53ede650d5b9bea77d7756f177092171648ee1d8cbc550d334fa7a",
132134
"name":"reth/v0.0.1/x86_64-unknown-linux-gnu",
133135
"enode":"enode://44826a5d6a55f88a18298bca4773fca5749cdc3a5c9f308aa7d810e9b31123f3e7c5fba0b1d70aac5308426f47df2a128a6747040a3815cc7dd7167d03be320d@192.168.1.1:30303",
134136
"enr":"enr:-IS4QHCYr...",
@@ -190,7 +192,7 @@ The subscription emits events with the following structure:
190192
"result": {
191193
"type": "add", // or "drop", "error"
192194
"peer": {
193-
"id": "44826a5d6a55f88a18298bca4773fca5749cdc3a5c9f308aa7d810e9b31123f3e7c5fba0b1d70aac5308426f47df2a128a6747040a3815cc7dd7167d03be320d",
195+
"id": "8915d6ec2f53ede650d5b9bea77d7756f177092171648ee1d8cbc550d334fa7a",
194196
"enode": "enode://44826a5d6a55f88a18298bca4773fca5749cdc3a5c9f308aa7d810e9b31123f3e7c5fba0b1d70aac5308426f47df2a128a6747040a3815cc7dd7167d03be320d@192.168.1.1:30303",
195197
"addr": "192.168.1.1:30303"
196198
},
@@ -208,7 +210,7 @@ The subscription emits events with the following structure:
208210
{"jsonrpc": "2.0", "id": 1, "result": "0xcd0c3e8af590364c09d0fa6a1210faf5"}
209211

210212
// Example event when a peer connects
211-
{"jsonrpc":"2.0","method":"admin_subscription","params":{"subscription":"0xcd0c3e8af590364c09d0fa6a1210faf5","result":{"type":"add","peer":{"id":"44826a5d6a55f88a18298bca4773fca5749cdc3a5c9f308aa7d810e9b31123f3e7c5fba0b1d70aac5308426f47df2a128a6747040a3815cc7dd7167d03be320d","enode":"enode://44826a5d6a55f88a18298bca4773fca5749cdc3a5c9f308aa7d810e9b31123f3e7c5fba0b1d70aac5308426f47df2a128a6747040a3815cc7dd7167d03be320d@192.168.1.1:30303","addr":"192.168.1.1:30303"}}}}
213+
{"jsonrpc":"2.0","method":"admin_subscription","params":{"subscription":"0xcd0c3e8af590364c09d0fa6a1210faf5","result":{"type":"add","peer":{"id":"8915d6ec2f53ede650d5b9bea77d7756f177092171648ee1d8cbc550d334fa7a","enode":"enode://44826a5d6a55f88a18298bca4773fca5749cdc3a5c9f308aa7d810e9b31123f3e7c5fba0b1d70aac5308426f47df2a128a6747040a3815cc7dd7167d03be320d@192.168.1.1:30303","addr":"192.168.1.1:30303"}}}}
212214

213215
// Unsubscribe
214216
// > {"jsonrpc":"2.0","id":2,"method":"admin_peerEvents_unsubscribe","params":["0xcd0c3e8af590364c09d0fa6a1210faf5"]}

0 commit comments

Comments
 (0)