Skip to content
Open
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
4 changes: 4 additions & 0 deletions src/rpc/methods/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ impl AuthNew {

impl RpcMethod<2> for AuthNew {
const NAME: &'static str = "Filecoin.AuthNew";
const DESCRIPTION: Option<&'static str> =
Some("Creates a new JWT token with the specified permissions.");
const N_REQUIRED_PARAMS: usize = 1;
// Note: Lotus does not support the optional `expiration_secs` parameter
const PARAM_NAMES: [&'static str; 2] = ["permissions", "expiration_secs"];
Expand Down Expand Up @@ -57,6 +59,8 @@ impl RpcMethod<2> for AuthNew {
pub enum AuthVerify {}
impl RpcMethod<1> for AuthVerify {
const NAME: &'static str = "Filecoin.AuthVerify";
const DESCRIPTION: Option<&'static str> =
Some("Verifies a JWT token and returns its permissions.");
const PARAM_NAMES: [&'static str; 1] = ["header_raw"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
Expand Down
3 changes: 3 additions & 0 deletions src/rpc/methods/beacon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ use enumflags2::{BitFlags, make_bitflags};
pub enum BeaconGetEntry {}
impl RpcMethod<1> for BeaconGetEntry {
const NAME: &'static str = "Filecoin.BeaconGetEntry";
const DESCRIPTION: Option<&'static str> = Some(
"Returns the beacon entry for the given Filecoin epoch, blocking until the entry is available.",
);
const PARAM_NAMES: [&'static str; 1] = ["first"];
const API_PATHS: BitFlags<ApiPaths> = make_bitflags!(ApiPaths::V0); // Not supported in V1
const PERMISSION: Permission = Permission::Read;
Expand Down
25 changes: 25 additions & 0 deletions src/rpc/methods/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ impl RpcMethod<1> for ChainGetParentReceipts {
pub enum ChainGetMessagesInTipset {}
impl RpcMethod<1> for ChainGetMessagesInTipset {
const NAME: &'static str = "Filecoin.ChainGetMessagesInTipset";
const DESCRIPTION: Option<&'static str> =
Some("Returns all messages included in the specified tipset.");
const PARAM_NAMES: [&'static str; 1] = ["tipsetKey"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
Expand All @@ -324,6 +326,8 @@ impl RpcMethod<1> for ChainGetMessagesInTipset {
pub enum ChainPruneSnapshot {}
impl RpcMethod<1> for ChainPruneSnapshot {
const NAME: &'static str = "Forest.SnapshotGC";
const DESCRIPTION: Option<&'static str> =
Some("Triggers garbage collection of old snapshot data.");
const PARAM_NAMES: [&'static str; 1] = ["blocking"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Admin;
Expand All @@ -349,6 +353,8 @@ impl RpcMethod<1> for ChainPruneSnapshot {
pub enum ForestChainExport {}
impl RpcMethod<1> for ForestChainExport {
const NAME: &'static str = "Forest.ChainExport";
const DESCRIPTION: Option<&'static str> =
Some("Exports the chain state to a file using Forest-specific parameters.");
const PARAM_NAMES: [&'static str; 1] = ["params"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all_with_v2();
const PERMISSION: Permission = Permission::Read;
Expand Down Expand Up @@ -488,6 +494,8 @@ impl RpcMethod<1> for ForestChainExport {
pub enum ForestChainExportStatus {}
impl RpcMethod<0> for ForestChainExportStatus {
const NAME: &'static str = "Forest.ChainExportStatus";
const DESCRIPTION: Option<&'static str> =
Some("Returns the status of the current chain export operation.");
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all_with_v2();
const PERMISSION: Permission = Permission::Read;
Expand Down Expand Up @@ -529,6 +537,8 @@ impl RpcMethod<0> for ForestChainExportStatus {
pub enum ForestChainExportCancel {}
impl RpcMethod<0> for ForestChainExportCancel {
const NAME: &'static str = "Forest.ChainExportCancel";
const DESCRIPTION: Option<&'static str> =
Some("Cancels an in-progress chain export.");
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all_with_v2();
const PERMISSION: Permission = Permission::Read;
Expand All @@ -553,6 +563,8 @@ impl RpcMethod<0> for ForestChainExportCancel {
pub enum ForestChainExportDiff {}
impl RpcMethod<1> for ForestChainExportDiff {
const NAME: &'static str = "Forest.ChainExportDiff";
const DESCRIPTION: Option<&'static str> =
Some("Exports a diff between two chain states to a file.");
const PARAM_NAMES: [&'static str; 1] = ["params"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all_with_v2();
const PERMISSION: Permission = Permission::Read;
Expand Down Expand Up @@ -612,6 +624,8 @@ impl RpcMethod<1> for ForestChainExportDiff {
pub enum ChainExport {}
impl RpcMethod<1> for ChainExport {
const NAME: &'static str = "Filecoin.ChainExport";
const DESCRIPTION: Option<&'static str> =
Some("Exports the chain state to a CAR file.");
const PARAM_NAMES: [&'static str; 1] = ["params"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
Expand Down Expand Up @@ -703,6 +717,9 @@ impl RpcMethod<1> for ChainHasObj {
pub enum ChainStatObj {}
impl RpcMethod<2> for ChainStatObj {
const NAME: &'static str = "Filecoin.ChainStatObj";
const DESCRIPTION: Option<&'static str> = Some(
"Returns statistics about the DAG rooted at the given CID, optionally diffed against a base CID.",
);
const PARAM_NAMES: [&'static str; 2] = ["obj_cid", "base_cid"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
Expand Down Expand Up @@ -932,6 +949,8 @@ impl RpcMethod<2> for ChainGetTipSetAfterHeight {
pub enum ChainGetGenesis {}
impl RpcMethod<0> for ChainGetGenesis {
const NAME: &'static str = "Filecoin.ChainGetGenesis";
const DESCRIPTION: Option<&'static str> =
Some("Returns the genesis tipset of the chain.");
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
Expand Down Expand Up @@ -1264,6 +1283,8 @@ impl RpcMethod<0> for ChainGetTipSetFinalityStatus {
pub enum ChainSetHead {}
impl RpcMethod<1> for ChainSetHead {
const NAME: &'static str = "Filecoin.ChainSetHead";
const DESCRIPTION: Option<&'static str> =
Some("Forcefully sets the current chain head to the specified tipset.");
const PARAM_NAMES: [&'static str; 1] = ["tsk"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Admin;
Expand Down Expand Up @@ -1297,6 +1318,8 @@ impl RpcMethod<1> for ChainSetHead {
pub enum ChainGetMinBaseFee {}
impl RpcMethod<1> for ChainGetMinBaseFee {
const NAME: &'static str = "Forest.ChainGetMinBaseFee";
const DESCRIPTION: Option<&'static str> =
Some("Returns the minimum base fee over the given number of recent epochs.");
const PARAM_NAMES: [&'static str; 1] = ["lookback"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
Expand Down Expand Up @@ -1351,6 +1374,8 @@ impl RpcMethod<1> for ChainTipSetWeight {
pub enum ChainGetTipsetByParentState {}
impl RpcMethod<1> for ChainGetTipsetByParentState {
const NAME: &'static str = "Forest.ChainGetTipsetByParentState";
const DESCRIPTION: Option<&'static str> =
Some("Returns the tipset whose parent state root matches the given CID.");
const PARAM_NAMES: [&'static str; 1] = ["parentState"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
Expand Down
8 changes: 8 additions & 0 deletions src/rpc/methods/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ static SESSION_UUID: LazyLock<Uuid> = LazyLock::new(crate::utils::rand::new_uuid
pub enum Session {}
impl RpcMethod<0> for Session {
const NAME: &'static str = "Filecoin.Session";
const DESCRIPTION: Option<&'static str> =
Some("Returns a UUID that uniquely identifies the API node session.");
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
Expand All @@ -31,6 +33,8 @@ impl RpcMethod<0> for Session {
pub enum Version {}
impl RpcMethod<0> for Version {
const NAME: &'static str = "Filecoin.Version";
const DESCRIPTION: Option<&'static str> =
Some("Returns the version of the node and its API.");
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
Expand All @@ -57,6 +61,8 @@ impl RpcMethod<0> for Version {
pub enum Shutdown {}
impl RpcMethod<0> for Shutdown {
const NAME: &'static str = "Filecoin.Shutdown";
const DESCRIPTION: Option<&'static str> =
Some("Triggers a graceful shutdown of the node.");
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Admin;
Expand All @@ -77,6 +83,8 @@ impl RpcMethod<0> for Shutdown {
pub enum StartTime {}
impl RpcMethod<0> for StartTime {
const NAME: &'static str = "Filecoin.StartTime";
const DESCRIPTION: Option<&'static str> =
Some("Returns the time at which the node was started.");
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
Expand Down
Loading
Loading