Skip to content

Commit 8b1142d

Browse files
authored
docs(jsonrpc): add admin_peers and admin_clearTxpool sections (#20185)
1 parent 2f55b1c commit 8b1142d

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

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

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,54 @@ These include general information about the node itself, as well as what protoco
114114
}
115115
```
116116

117+
## `admin_peers`
118+
119+
Returns information about peers currently known to the node.
120+
121+
| Client | Method invocation |
122+
| ------ | ------------------------------ |
123+
| RPC | `{"method": "admin_peers", "params": []}` |
124+
125+
### Example
126+
127+
```js
128+
// > {"jsonrpc":"2.0","id":1,"method":"admin_peers","params":[]}
129+
{"jsonrpc":"2.0","id":1,"result":[
130+
{
131+
"id":"44826a5d6a55f88a18298bca4773fca...",
132+
"name":"reth/v0.0.1/x86_64-unknown-linux-gnu",
133+
"enode":"enode://44826a5d6a55f88a18298bca4773fca5749cdc3a5c9f308aa7d810e9b31123f3e7c5fba0b1d70aac5308426f47df2a128a6747040a3815cc7dd7167d03be320d@192.168.1.1:30303",
134+
"enr":"enr:-IS4QHCYr...",
135+
"caps":["eth/67"],
136+
"network":{
137+
"remoteAddress":"192.168.1.1:30303",
138+
"localAddress":"127.0.0.1:30303",
139+
"inbound":false,
140+
"trusted":false,
141+
"staticNode":false
142+
},
143+
"protocols":{
144+
"eth":{"version":67}
145+
}
146+
}
147+
]}
148+
```
149+
150+
## `admin_clearTxpool`
151+
152+
Clears all transactions from the transaction pool. Returns the number of removed transactions.
153+
154+
| Client | Method invocation |
155+
| ------ | ----------------------------------------- |
156+
| RPC | `{"method": "admin_clearTxpool", "params": []}` |
157+
158+
### Example
159+
160+
```js
161+
// > {"jsonrpc":"2.0","id":1,"method":"admin_clearTxpool","params":[]}
162+
{"jsonrpc":"2.0","id":1,"result":42}
163+
```
164+
117165
## `admin_peerEvents`, `admin_peerEvents_unsubscribe`
118166

119167
Subscribe to events received by peers over the network. This creates a subscription that emits notifications about peer connections and disconnections.

0 commit comments

Comments
 (0)