From 78e0eaad339e3bbac20a2e92d6d3aaa710613bf3 Mon Sep 17 00:00:00 2001 From: Hubert Bugaj Date: Fri, 19 Jun 2026 17:19:26 +0200 Subject: [PATCH] docs(rpc): add DESCRIPTION to net RPC methods --- src/rpc/methods/net.rs | 10 ++++++++++ src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap | 7 +++++++ src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap | 7 +++++++ src/rpc/snapshots/forest__rpc__tests__rpc__v2.snap | 4 ++++ 4 files changed, 28 insertions(+) diff --git a/src/rpc/methods/net.rs b/src/rpc/methods/net.rs index 8c027be21c8c..e3586d98c651 100644 --- a/src/rpc/methods/net.rs +++ b/src/rpc/methods/net.rs @@ -86,6 +86,8 @@ impl RpcMethod<1> for NetFindPeer { const PARAM_NAMES: [&'static str; 1] = ["peerId"]; const API_PATHS: BitFlags = 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; @@ -117,6 +119,8 @@ impl RpcMethod<0> for NetListening { const API_PATHS: BitFlags = 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; @@ -136,6 +140,8 @@ impl RpcMethod<0> for NetInfo { const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = 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; @@ -253,6 +259,8 @@ impl RpcMethod<0> for NetAutoNatStatus { const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = 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; @@ -279,6 +287,8 @@ impl RpcMethod<0> for NetVersion { const API_PATHS: BitFlags = 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; diff --git a/src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap b/src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap index 9e4e3904594a..c1e2b1afe696 100644 --- a/src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap +++ b/src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap @@ -2212,6 +2212,7 @@ methods: type: string paramStructure: by-position - name: Filecoin.NetAutoNatStatus + description: "Returns the node's AutoNAT reachability status and observed public addresses." params: [] result: name: Filecoin.NetAutoNatStatus.Result @@ -2246,6 +2247,7 @@ methods: type: "null" paramStructure: by-position - name: Filecoin.NetFindPeer + description: Returns the known addresses of the peer with the given peer ID. params: - name: peerId required: true @@ -2258,6 +2260,7 @@ methods: $ref: "#/components/schemas/AddrInfo" paramStructure: by-position - name: Forest.NetInfo + description: "Returns peer and connection statistics for the node's libp2p network." params: [] result: name: Forest.NetInfo.Result @@ -2266,6 +2269,7 @@ methods: $ref: "#/components/schemas/NetInfoResult" paramStructure: by-position - name: Filecoin.NetListening + description: "Returns whether the node is listening for network connections (always `true`)." params: [] result: name: Filecoin.NetListening.Result @@ -2274,6 +2278,7 @@ methods: type: boolean paramStructure: by-position - name: net_listening + description: "Returns whether the node is listening for network connections (always `true`)." params: [] result: name: net_listening.Result @@ -2342,6 +2347,7 @@ methods: type: "null" paramStructure: by-position - name: Filecoin.NetVersion + description: Returns the current network ID (the EIP-155 chain ID) as a decimal string. params: [] result: name: Filecoin.NetVersion.Result @@ -2350,6 +2356,7 @@ methods: type: string paramStructure: by-position - name: net_version + description: Returns the current network ID (the EIP-155 chain ID) as a decimal string. params: [] result: name: net_version.Result diff --git a/src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap b/src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap index 62c967cf6e96..4b13e8ad4ddf 100644 --- a/src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap +++ b/src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap @@ -2292,6 +2292,7 @@ methods: type: string paramStructure: by-position - name: Filecoin.NetAutoNatStatus + description: "Returns the node's AutoNAT reachability status and observed public addresses." params: [] result: name: Filecoin.NetAutoNatStatus.Result @@ -2326,6 +2327,7 @@ methods: type: "null" paramStructure: by-position - name: Filecoin.NetFindPeer + description: Returns the known addresses of the peer with the given peer ID. params: - name: peerId required: true @@ -2338,6 +2340,7 @@ methods: $ref: "#/components/schemas/AddrInfo" paramStructure: by-position - name: Forest.NetInfo + description: "Returns peer and connection statistics for the node's libp2p network." params: [] result: name: Forest.NetInfo.Result @@ -2346,6 +2349,7 @@ methods: $ref: "#/components/schemas/NetInfoResult" paramStructure: by-position - name: Filecoin.NetListening + description: "Returns whether the node is listening for network connections (always `true`)." params: [] result: name: Filecoin.NetListening.Result @@ -2354,6 +2358,7 @@ methods: type: boolean paramStructure: by-position - name: net_listening + description: "Returns whether the node is listening for network connections (always `true`)." params: [] result: name: net_listening.Result @@ -2422,6 +2427,7 @@ methods: type: "null" paramStructure: by-position - name: Filecoin.NetVersion + description: Returns the current network ID (the EIP-155 chain ID) as a decimal string. params: [] result: name: Filecoin.NetVersion.Result @@ -2430,6 +2436,7 @@ methods: type: string paramStructure: by-position - name: net_version + description: Returns the current network ID (the EIP-155 chain ID) as a decimal string. params: [] result: name: net_version.Result diff --git a/src/rpc/snapshots/forest__rpc__tests__rpc__v2.snap b/src/rpc/snapshots/forest__rpc__tests__rpc__v2.snap index f44b22800655..41075334472e 100644 --- a/src/rpc/snapshots/forest__rpc__tests__rpc__v2.snap +++ b/src/rpc/snapshots/forest__rpc__tests__rpc__v2.snap @@ -1458,6 +1458,7 @@ methods: $ref: "#/components/schemas/EthHash" paramStructure: by-position - name: Filecoin.NetListening + description: "Returns whether the node is listening for network connections (always `true`)." params: [] result: name: Filecoin.NetListening.Result @@ -1466,6 +1467,7 @@ methods: type: boolean paramStructure: by-position - name: net_listening + description: "Returns whether the node is listening for network connections (always `true`)." params: [] result: name: net_listening.Result @@ -1474,6 +1476,7 @@ methods: type: boolean paramStructure: by-position - name: Filecoin.NetVersion + description: Returns the current network ID (the EIP-155 chain ID) as a decimal string. params: [] result: name: Filecoin.NetVersion.Result @@ -1482,6 +1485,7 @@ methods: type: string paramStructure: by-position - name: net_version + description: Returns the current network ID (the EIP-155 chain ID) as a decimal string. params: [] result: name: net_version.Result