1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
//! network RPC method wrappers
//!
//! This module contains transport wrappers for network methods.
use ;
use crate;
/// Attempts to add or remove a node from the addnode list.
/// Or try a connection to a node once.
/// Nodes added using addnode (or -connect) are protected from DoS disconnection and are not required to be
/// full nodes/support SegWit as other outbound peers are (though such peers will not be synced from).
/// Addnode connections are limited to 8 at a time and are counted separately from the -maxconnections limit.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.addnode(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::addnode(&transport, ...).await`
///
/// Calls the `addnode` RPC method.
pub async
/// Clear all banned IPs.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.clearbanned(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::clearbanned(&transport, ...).await`
///
/// Calls the `clearbanned` RPC method.
pub async
/// Immediately disconnects from the specified peer node.
/// Strictly one out of 'address' and 'nodeid' can be provided to identify the node.
/// To disconnect by nodeid, either set 'address' to the empty string, or call using the named 'nodeid' argument only.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.disconnectnode(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::disconnectnode(&transport, ...).await`
///
/// Calls the `disconnectnode` RPC method.
pub async
/// Returns information about the given added node, or all added nodes
/// (note that onetry addnodes are not listed here)
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.getaddednodeinfo(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::getaddednodeinfo(&transport, ...).await`
///
/// Calls the `getaddednodeinfo` RPC method.
pub async
/// Provides information about the node's address manager by returning the number of addresses in the `new` and `tried` tables and their sum for all networks.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.getaddrmaninfo(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::getaddrmaninfo(&transport, ...).await`
///
/// Calls the `getaddrmaninfo` RPC method.
pub async
/// Returns the number of connections to other nodes.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.getconnectioncount(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::getconnectioncount(&transport, ...).await`
///
/// Calls the `getconnectioncount` RPC method.
pub async
/// Returns information about network traffic, including bytes in, bytes out,
/// and current system time.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.getnettotals(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::getnettotals(&transport, ...).await`
///
/// Calls the `getnettotals` RPC method.
pub async
/// Returns an object containing various state info regarding P2P networking.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.getnetworkinfo(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::getnetworkinfo(&transport, ...).await`
///
/// Calls the `getnetworkinfo` RPC method.
pub async
/// Return known addresses, after filtering for quality and recency.
/// These can potentially be used to find new peers in the network.
/// The total number of addresses known to the node may be higher.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.getnodeaddresses(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::getnodeaddresses(&transport, ...).await`
///
/// Calls the `getnodeaddresses` RPC method.
pub async
/// Returns data about each connected network peer as a json array of objects.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.getpeerinfo(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::getpeerinfo(&transport, ...).await`
///
/// Calls the `getpeerinfo` RPC method.
pub async
/// List all manually banned IPs/Subnets.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.listbanned(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::listbanned(&transport, ...).await`
///
/// Calls the `listbanned` RPC method.
pub async
/// Requests that a ping be sent to all other nodes, to measure ping time.
/// Results are provided in getpeerinfo.
/// Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.ping(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::ping(&transport, ...).await`
///
/// Calls the `ping` RPC method.
pub async
/// Attempts to add or remove an IP/Subnet from the banned list.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.setban(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::setban(&transport, ...).await`
///
/// Calls the `setban` RPC method.
pub async
/// Disable/enable all p2p network activity.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.setnetworkactive(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::setnetworkactive(&transport, ...).await`
///
/// Calls the `setnetworkactive` RPC method.
pub async