Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/rpc/methods/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ impl RpcMethod<1> for NetFindPeer {
const PARAM_NAMES: [&'static str; 1] = ["peerId"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
const DESCRIPTION: Option<&'static str> =
Some("Returns the known addresses of the peer with the given peer ID.");

type Params = (String,);
type Ok = AddrInfo;
Expand Down Expand Up @@ -117,6 +119,8 @@ impl RpcMethod<0> for NetListening {
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all_with_v2();
const PERMISSION: Permission = Permission::Read;
const NAME_ALIAS: Option<&'static str> = Some("net_listening");
const DESCRIPTION: Option<&'static str> =
Some("Returns whether the node is listening for network connections (always `true`).");

type Params = ();
type Ok = bool;
Expand All @@ -136,6 +140,8 @@ impl RpcMethod<0> for NetInfo {
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
const DESCRIPTION: Option<&'static str> =
Some("Returns peer and connection statistics for the node's libp2p network.");

type Params = ();
type Ok = NetInfoResult;
Expand Down Expand Up @@ -253,6 +259,8 @@ impl RpcMethod<0> for NetAutoNatStatus {
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
const DESCRIPTION: Option<&'static str> =
Some("Returns the node's AutoNAT reachability status and observed public addresses.");

type Params = ();
type Ok = NatStatusResult;
Expand All @@ -279,6 +287,8 @@ impl RpcMethod<0> for NetVersion {
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all_with_v2();
const PERMISSION: Permission = Permission::Read;
const NAME_ALIAS: Option<&'static str> = Some("net_version");
const DESCRIPTION: Option<&'static str> =
Some("Returns the current network ID (the EIP-155 chain ID) as a decimal string.");

type Params = ();
type Ok = Arc<str>;
Expand Down
7 changes: 7 additions & 0 deletions src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/rpc/snapshots/forest__rpc__tests__rpc__v2.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading