diff --git a/src/rpc/methods/auth.rs b/src/rpc/methods/auth.rs index be2a2e66953..642edb0fe49 100644 --- a/src/rpc/methods/auth.rs +++ b/src/rpc/methods/auth.rs @@ -35,6 +35,8 @@ impl RpcMethod<2> for AuthNew { const PARAM_NAMES: [&'static str; 2] = ["permissions", "expirationSecs"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Admin; + const DESCRIPTION: Option<&'static str> = + Some("Creates a new JWT authentication token with the given permissions."); type Params = (Vec, Option); type Ok = Vec; async fn handle( @@ -60,6 +62,8 @@ impl RpcMethod<1> for AuthVerify { const PARAM_NAMES: [&'static str; 1] = ["headerRaw"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; + const DESCRIPTION: Option<&'static str> = + Some("Verifies a JWT authentication token and returns its permissions."); type Params = (String,); type Ok = Vec; async fn handle( diff --git a/src/rpc/methods/beacon.rs b/src/rpc/methods/beacon.rs index 9b47056f309..73667837c37 100644 --- a/src/rpc/methods/beacon.rs +++ b/src/rpc/methods/beacon.rs @@ -16,6 +16,9 @@ impl RpcMethod<1> for BeaconGetEntry { const PARAM_NAMES: [&'static str; 1] = ["first"]; const API_PATHS: BitFlags = make_bitflags!(ApiPaths::V0); // Not supported in V1 const PERMISSION: Permission = Permission::Read; + const DESCRIPTION: Option<&'static str> = Some( + "Returns the drand beacon entry for the given epoch, blocking until it becomes available.", + ); type Params = (ChainEpoch,); type Ok = BeaconEntry; diff --git a/src/rpc/methods/common.rs b/src/rpc/methods/common.rs index 5c1aee3e41a..5a1a32b5790 100644 --- a/src/rpc/methods/common.rs +++ b/src/rpc/methods/common.rs @@ -19,6 +19,8 @@ impl RpcMethod<0> for Session { const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; + const DESCRIPTION: Option<&'static str> = + Some("Returns a UUID that uniquely identifies this node for the current session."); type Params = (); type Ok = Uuid; @@ -34,6 +36,8 @@ impl RpcMethod<0> for Version { 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 version, API version, and block delay."); type Params = (); type Ok = PublicVersion; @@ -60,6 +64,7 @@ impl RpcMethod<0> for Shutdown { const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Admin; + const DESCRIPTION: Option<&'static str> = Some("Shuts the node down."); type Params = (); type Ok = (); @@ -80,6 +85,8 @@ impl RpcMethod<0> for StartTime { 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 time at which the node was started."); type Params = (); type Ok = chrono::DateTime; diff --git a/src/rpc/methods/market.rs b/src/rpc/methods/market.rs index 4bb936d4cf2..2b5ef6641de 100644 --- a/src/rpc/methods/market.rs +++ b/src/rpc/methods/market.rs @@ -18,6 +18,9 @@ impl RpcMethod<3> for MarketAddBalance { const PARAM_NAMES: [&'static str; 3] = ["wallet", "address", "amount"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Sign; + const DESCRIPTION: Option<&'static str> = Some( + "Adds funds to the market actor escrow balance for the given address and returns the message CID.", + ); type Params = (Address, Address, BigInt); type Ok = Cid; diff --git a/src/rpc/methods/msig.rs b/src/rpc/methods/msig.rs index e1c46b01cf5..4841a6dcd20 100644 --- a/src/rpc/methods/msig.rs +++ b/src/rpc/methods/msig.rs @@ -18,6 +18,9 @@ impl RpcMethod<2> for MsigGetAvailableBalance { const PARAM_NAMES: [&'static str; 2] = ["address", "tipsetKey"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; + const DESCRIPTION: Option<&'static str> = Some( + "Returns the spendable balance of the given multisig (total balance minus the locked amount) at the given tipset.", + ); type Params = (Address, ApiTipsetKey); type Ok = TokenAmount; @@ -47,6 +50,9 @@ impl RpcMethod<2> for MsigGetPending { const PARAM_NAMES: [&'static str; 2] = ["address", "tipsetKey"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; + const DESCRIPTION: Option<&'static str> = Some( + "Returns the transactions awaiting approval in the given multisig at the given tipset.", + ); type Params = (Address, ApiTipsetKey); type Ok = Vec; @@ -82,6 +88,9 @@ impl RpcMethod<3> for MsigGetVested { const PARAM_NAMES: [&'static str; 3] = ["address", "startTipsetKey", "endTipsetKey"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; + const DESCRIPTION: Option<&'static str> = Some( + "Returns the amount that vested in the given multisig between the start and end tipsets.", + ); type Params = (Address, ApiTipsetKey, ApiTipsetKey); type Ok = BigInt; @@ -122,6 +131,8 @@ impl RpcMethod<2> for MsigGetVestingSchedule { const PARAM_NAMES: [&'static str; 2] = ["address", "tsk"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; + const DESCRIPTION: Option<&'static str> = + Some("Returns the vesting schedule of the given multisig at the given tipset."); type Params = (Address, ApiTipsetKey); type Ok = MsigVesting; diff --git a/src/rpc/methods/node.rs b/src/rpc/methods/node.rs index f406cf666ee..2aa9121e058 100644 --- a/src/rpc/methods/node.rs +++ b/src/rpc/methods/node.rs @@ -17,6 +17,8 @@ impl RpcMethod<0> for NodeStatus { 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 status, including sync and chain health information."); type Params = (); type Ok = NodeStatusResult; diff --git a/src/rpc/methods/sync.rs b/src/rpc/methods/sync.rs index 4d6075d69ca..c7e53142985 100644 --- a/src/rpc/methods/sync.rs +++ b/src/rpc/methods/sync.rs @@ -20,6 +20,8 @@ impl RpcMethod<1> for SyncCheckBad { const PARAM_NAMES: [&'static str; 1] = ["cid"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; + const DESCRIPTION: Option<&'static str> = + Some("Returns the reason the given block is marked bad, or an empty string if it is not."); type Params = (Cid,); type Ok = String; @@ -45,6 +47,8 @@ impl RpcMethod<1> for SyncMarkBad { const PARAM_NAMES: [&'static str; 1] = ["cid"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Admin; + const DESCRIPTION: Option<&'static str> = + Some("Marks the block with the given CID as bad in the bad-block cache."); type Params = (Cid,); type Ok = (); diff --git a/src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap b/src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap index 9e4e3904594..8d77ac55c76 100644 --- a/src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap +++ b/src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap @@ -8,6 +8,7 @@ info: version: 0.33.6 methods: - name: Filecoin.AuthNew + description: Creates a new JWT authentication token with the given permissions. params: - name: permissions required: true @@ -31,6 +32,7 @@ methods: $ref: "#/components/schemas/Base64String" paramStructure: by-position - name: Filecoin.AuthVerify + description: Verifies a JWT authentication token and returns its permissions. params: - name: headerRaw required: true @@ -47,6 +49,7 @@ methods: type: string paramStructure: by-position - name: Filecoin.BeaconGetEntry + description: "Returns the drand beacon entry for the given epoch, blocking until it becomes available." params: - name: first required: true @@ -436,6 +439,7 @@ methods: - type: "null" paramStructure: by-position - name: Filecoin.Session + description: Returns a UUID that uniquely identifies this node for the current session. params: [] result: name: Filecoin.Session.Result @@ -445,6 +449,7 @@ methods: format: uuid paramStructure: by-position - name: Filecoin.Shutdown + description: Shuts the node down. params: [] result: name: Filecoin.Shutdown.Result @@ -453,6 +458,7 @@ methods: type: "null" paramStructure: by-position - name: Filecoin.StartTime + description: Returns the time at which the node was started. params: [] result: name: Filecoin.StartTime.Result @@ -462,6 +468,7 @@ methods: format: date-time paramStructure: by-position - name: Filecoin.Version + description: "Returns the node version, API version, and block delay." params: [] result: name: Filecoin.Version.Result @@ -1881,6 +1888,7 @@ methods: $ref: "#/components/schemas/Message" paramStructure: by-position - name: Filecoin.MarketAddBalance + description: Adds funds to the market actor escrow balance for the given address and returns the message CID. params: - name: wallet required: true @@ -2098,6 +2106,7 @@ methods: $ref: "#/components/schemas/SignedMessage" paramStructure: by-position - name: Filecoin.MsigGetAvailableBalance + description: Returns the spendable balance of the given multisig (total balance minus the locked amount) at the given tipset. params: - name: address required: true @@ -2118,6 +2127,7 @@ methods: $ref: "#/components/schemas/TokenAmount" paramStructure: by-position - name: Filecoin.MsigGetPending + description: Returns the transactions awaiting approval in the given multisig at the given tipset. params: - name: address required: true @@ -2142,6 +2152,7 @@ methods: $ref: "#/components/schemas/Transaction" paramStructure: by-position - name: Filecoin.MsigGetVested + description: Returns the amount that vested in the given multisig between the start and end tipsets. params: - name: address required: true @@ -2170,6 +2181,7 @@ methods: $ref: "#/components/schemas/BigInt" paramStructure: by-position - name: Filecoin.MsigGetVestingSchedule + description: Returns the vesting schedule of the given multisig at the given tipset. params: - name: address required: true @@ -2387,6 +2399,7 @@ methods: type: string paramStructure: by-position - name: Filecoin.NodeStatus + description: "Returns the node's status, including sync and chain health information." params: [] result: name: Filecoin.NodeStatus.Result @@ -3881,6 +3894,7 @@ methods: $ref: "#/components/schemas/TokenAmount" paramStructure: by-position - name: Filecoin.SyncCheckBad + description: "Returns the reason the given block is marked bad, or an empty string if it is not." params: - name: cid required: true @@ -3893,6 +3907,7 @@ methods: type: string paramStructure: by-position - name: Filecoin.SyncMarkBad + description: Marks the block with the given CID as bad in the bad-block cache. params: - name: cid required: true diff --git a/src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap b/src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap index 62c967cf6e9..a9012b2d5d3 100644 --- a/src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap +++ b/src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap @@ -8,6 +8,7 @@ info: version: 0.33.6 methods: - name: Filecoin.AuthNew + description: Creates a new JWT authentication token with the given permissions. params: - name: permissions required: true @@ -31,6 +32,7 @@ methods: $ref: "#/components/schemas/Base64String" paramStructure: by-position - name: Filecoin.AuthVerify + description: Verifies a JWT authentication token and returns its permissions. params: - name: headerRaw required: true @@ -432,6 +434,7 @@ methods: - type: "null" paramStructure: by-position - name: Filecoin.Session + description: Returns a UUID that uniquely identifies this node for the current session. params: [] result: name: Filecoin.Session.Result @@ -441,6 +444,7 @@ methods: format: uuid paramStructure: by-position - name: Filecoin.Shutdown + description: Shuts the node down. params: [] result: name: Filecoin.Shutdown.Result @@ -449,6 +453,7 @@ methods: type: "null" paramStructure: by-position - name: Filecoin.StartTime + description: Returns the time at which the node was started. params: [] result: name: Filecoin.StartTime.Result @@ -458,6 +463,7 @@ methods: format: date-time paramStructure: by-position - name: Filecoin.Version + description: "Returns the node version, API version, and block delay." params: [] result: name: Filecoin.Version.Result @@ -1961,6 +1967,7 @@ methods: $ref: "#/components/schemas/Message" paramStructure: by-position - name: Filecoin.MarketAddBalance + description: Adds funds to the market actor escrow balance for the given address and returns the message CID. params: - name: wallet required: true @@ -2178,6 +2185,7 @@ methods: $ref: "#/components/schemas/SignedMessage" paramStructure: by-position - name: Filecoin.MsigGetAvailableBalance + description: Returns the spendable balance of the given multisig (total balance minus the locked amount) at the given tipset. params: - name: address required: true @@ -2198,6 +2206,7 @@ methods: $ref: "#/components/schemas/TokenAmount" paramStructure: by-position - name: Filecoin.MsigGetPending + description: Returns the transactions awaiting approval in the given multisig at the given tipset. params: - name: address required: true @@ -2222,6 +2231,7 @@ methods: $ref: "#/components/schemas/Transaction" paramStructure: by-position - name: Filecoin.MsigGetVested + description: Returns the amount that vested in the given multisig between the start and end tipsets. params: - name: address required: true @@ -2250,6 +2260,7 @@ methods: $ref: "#/components/schemas/BigInt" paramStructure: by-position - name: Filecoin.MsigGetVestingSchedule + description: Returns the vesting schedule of the given multisig at the given tipset. params: - name: address required: true @@ -2467,6 +2478,7 @@ methods: type: string paramStructure: by-position - name: Filecoin.NodeStatus + description: "Returns the node's status, including sync and chain health information." params: [] result: name: Filecoin.NodeStatus.Result @@ -3934,6 +3946,7 @@ methods: $ref: "#/components/schemas/TokenAmount" paramStructure: by-position - name: Filecoin.SyncCheckBad + description: "Returns the reason the given block is marked bad, or an empty string if it is not." params: - name: cid required: true @@ -3946,6 +3959,7 @@ methods: type: string paramStructure: by-position - name: Filecoin.SyncMarkBad + description: Marks the block with the given CID as bad in the bad-block cache. params: - name: cid required: true