From e7fcff80d629d4a9f113e698a9d677f76d170337 Mon Sep 17 00:00:00 2001 From: Dr-Electron Date: Fri, 20 Dec 2024 13:19:48 +0100 Subject: [PATCH] fix(docs): add notes about indexer in rpc specs --- crates/iota-json-rpc-api/src/extended.rs | 15 +++++++++------ crates/iota-json-rpc/src/lib.rs | 4 ++-- crates/iota-open-rpc/spec/openrpc.json | 19 +++++++++++-------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/crates/iota-json-rpc-api/src/extended.rs b/crates/iota-json-rpc-api/src/extended.rs index b048fc7c425..bf19069dccb 100644 --- a/crates/iota-json-rpc-api/src/extended.rs +++ b/crates/iota-json-rpc-api/src/extended.rs @@ -14,7 +14,7 @@ use jsonrpsee::{core::RpcResult, proc_macros::rpc}; #[open_rpc(namespace = "iotax", tag = "Extended API")] #[rpc(server, client, namespace = "iotax")] pub trait ExtendedApi { - /// Return a list of epoch info + /// Return a list of epoch info. Exclusively served by the indexer #[rustfmt::skip] #[method(name = "getEpochs")] async fn get_epochs( @@ -27,7 +27,7 @@ pub trait ExtendedApi { descending_order: Option, ) -> RpcResult; - /// Return a list of epoch metrics, which is a subset of epoch info + /// Return a list of epoch metrics, which is a subset of epoch info. Exclusively served by the indexer #[method(name = "getEpochMetrics")] async fn get_epoch_metrics( &self, @@ -39,31 +39,34 @@ pub trait ExtendedApi { descending_order: Option, ) -> RpcResult; - /// Return current epoch info + /// Return current epoch info. Exclusively served by the indexer #[method(name = "getCurrentEpoch")] async fn get_current_epoch(&self) -> RpcResult; - /// Return Network metrics + /// Return Network metrics. Exclusively served by the indexer #[method(name = "getNetworkMetrics")] async fn get_network_metrics(&self) -> RpcResult; - /// Return move call metrics + /// Return move call metrics. Exclusively served by the indexer #[method(name = "getMoveCallMetrics")] async fn get_move_call_metrics(&self) -> RpcResult; - /// Address related metrics + /// Address related metrics. Exclusively served by the indexer #[method(name = "getLatestAddressMetrics")] async fn get_latest_address_metrics(&self) -> RpcResult; + /// Address related metrics. Exclusively served by the indexer #[method(name = "getCheckpointAddressMetrics")] async fn get_checkpoint_address_metrics(&self, checkpoint: u64) -> RpcResult; + /// Address related metrics. Exclusively served by the indexer #[method(name = "getAllEpochAddressMetrics")] async fn get_all_epoch_address_metrics( &self, descending_order: Option, ) -> RpcResult>; + /// Return the total number of transactions. Exclusively served by the indexer #[method(name = "getTotalTransactions")] async fn get_total_transactions(&self) -> RpcResult>; } diff --git a/crates/iota-json-rpc/src/lib.rs b/crates/iota-json-rpc/src/lib.rs index 4332692fac1..d3e894a3123 100644 --- a/crates/iota-json-rpc/src/lib.rs +++ b/crates/iota-json-rpc/src/lib.rs @@ -70,8 +70,8 @@ pub struct JsonRpcServerBuilder { pub fn iota_rpc_doc(version: &str) -> Project { Project::new( version, - "Iota JSON-RPC", - "Iota JSON-RPC API for interaction with Iota Full node. Make RPC calls using https://fullnode.NETWORK.iota.io:443, where NETWORK is the network you want to use (testnet, devnet, mainnet). By default, local networks use port 9000.", + "IOTA JSON-RPC", + "IOTA JSON-RPC API for interaction with IOTA full node or indexer. Make RPC calls using https://api.NETWORK.iota.cafe:443 (or https://indexer.NETWORK.iota.cafe:443 for the indexer), where NETWORK is the network you want to use (testnet, devnet, mainnet). By default, local networks use port 9000 (or 9124 for the indexer).", "IOTA Foundation", "https://iota.org", "info@iota.org", diff --git a/crates/iota-open-rpc/spec/openrpc.json b/crates/iota-open-rpc/spec/openrpc.json index 95f08307724..00515789345 100644 --- a/crates/iota-open-rpc/spec/openrpc.json +++ b/crates/iota-open-rpc/spec/openrpc.json @@ -1,8 +1,8 @@ { "openrpc": "1.2.6", "info": { - "title": "Iota JSON-RPC", - "description": "Iota JSON-RPC API for interaction with Iota Full node. Make RPC calls using https://fullnode.NETWORK.iota.io:443, where NETWORK is the network you want to use (testnet, devnet, mainnet). By default, local networks use port 9000.", + "title": "IOTA JSON-RPC", + "description": "IOTA JSON-RPC API for interaction with IOTA full node or indexer. Make RPC calls using https://api.NETWORK.iota.cafe:443 (or https://indexer.NETWORK.iota.cafe:443 for the indexer), where NETWORK is the network you want to use (testnet, devnet, mainnet). By default, local networks use port 9000 (or 9124 for the indexer).", "contact": { "name": "IOTA Foundation", "url": "https://iota.org", @@ -3303,6 +3303,7 @@ "name": "Extended API" } ], + "description": "Address related metrics. Exclusively served by the indexer", "params": [ { "name": "descending_order", @@ -3385,6 +3386,7 @@ "name": "Extended API" } ], + "description": "Address related metrics. Exclusively served by the indexer", "params": [ { "name": "checkpoint", @@ -3623,7 +3625,7 @@ "name": "Extended API" } ], - "description": "Return current epoch info", + "description": "Return current epoch info. Exclusively served by the indexer", "params": [], "result": { "name": "EpochInfo", @@ -3819,7 +3821,7 @@ "name": "Extended API" } ], - "description": "Return a list of epoch metrics, which is a subset of epoch info", + "description": "Return a list of epoch metrics, which is a subset of epoch info. Exclusively served by the indexer", "params": [ { "name": "cursor", @@ -3860,7 +3862,7 @@ "name": "Extended API" } ], - "description": "Return a list of epoch info", + "description": "Return a list of epoch info. Exclusively served by the indexer", "params": [ { "name": "cursor", @@ -3901,7 +3903,7 @@ "name": "Extended API" } ], - "description": "Address related metrics", + "description": "Address related metrics. Exclusively served by the indexer", "params": [], "result": { "name": "AddressMetrics", @@ -3945,7 +3947,7 @@ "name": "Extended API" } ], - "description": "Return move call metrics", + "description": "Return move call metrics. Exclusively served by the indexer", "params": [], "result": { "name": "MoveCallMetrics", @@ -3962,7 +3964,7 @@ "name": "Extended API" } ], - "description": "Return Network metrics", + "description": "Return Network metrics. Exclusively served by the indexer", "params": [], "result": { "name": "NetworkMetrics", @@ -4398,6 +4400,7 @@ "name": "Extended API" } ], + "description": "Return the total number of transactions. Exclusively served by the indexer", "params": [], "result": { "name": "BigInt",