Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): add notes about indexer in rpc specs #4584

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
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
15 changes: 9 additions & 6 deletions crates/iota-json-rpc-api/src/extended.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Return a list of epoch info. Exclusively served by the indexer
/// Return a list of epoch info. Exclusively served by the indexer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And below as well please 🙏

#[rustfmt::skip]
#[method(name = "getEpochs")]
async fn get_epochs(
Expand All @@ -27,7 +27,7 @@ pub trait ExtendedApi {
descending_order: Option<bool>,
) -> RpcResult<EpochPage>;

/// 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,
Expand All @@ -39,31 +39,34 @@ pub trait ExtendedApi {
descending_order: Option<bool>,
) -> RpcResult<EpochMetricsPage>;

/// Return current epoch info
/// Return current epoch info. Exclusively served by the indexer
#[method(name = "getCurrentEpoch")]
async fn get_current_epoch(&self) -> RpcResult<EpochInfo>;

/// Return Network metrics
/// Return Network metrics. Exclusively served by the indexer
#[method(name = "getNetworkMetrics")]
async fn get_network_metrics(&self) -> RpcResult<NetworkMetrics>;

/// Return move call metrics
/// Return move call metrics. Exclusively served by the indexer
#[method(name = "getMoveCallMetrics")]
async fn get_move_call_metrics(&self) -> RpcResult<MoveCallMetrics>;

/// Address related metrics
/// Address related metrics. Exclusively served by the indexer
#[method(name = "getLatestAddressMetrics")]
async fn get_latest_address_metrics(&self) -> RpcResult<AddressMetrics>;

/// Address related metrics. Exclusively served by the indexer
#[method(name = "getCheckpointAddressMetrics")]
async fn get_checkpoint_address_metrics(&self, checkpoint: u64) -> RpcResult<AddressMetrics>;

/// Address related metrics. Exclusively served by the indexer
#[method(name = "getAllEpochAddressMetrics")]
async fn get_all_epoch_address_metrics(
&self,
descending_order: Option<bool>,
) -> RpcResult<Vec<AddressMetrics>>;

/// Return the total number of transactions. Exclusively served by the indexer
#[method(name = "getTotalTransactions")]
async fn get_total_transactions(&self) -> RpcResult<BigInt<u64>>;
}
4 changes: 2 additions & 2 deletions crates/iota-json-rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"[email protected]",
Expand Down
19 changes: 11 additions & 8 deletions crates/iota-open-rpc/spec/openrpc.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -3303,6 +3303,7 @@
"name": "Extended API"
}
],
"description": "Address related metrics. Exclusively served by the indexer",
"params": [
{
"name": "descending_order",
Expand Down Expand Up @@ -3385,6 +3386,7 @@
"name": "Extended API"
}
],
"description": "Address related metrics. Exclusively served by the indexer",
"params": [
{
"name": "checkpoint",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -3901,7 +3903,7 @@
"name": "Extended API"
}
],
"description": "Address related metrics",
"description": "Address related metrics. Exclusively served by the indexer",
"params": [],
"result": {
"name": "AddressMetrics",
Expand Down Expand Up @@ -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",
Expand All @@ -3962,7 +3964,7 @@
"name": "Extended API"
}
],
"description": "Return Network metrics",
"description": "Return Network metrics. Exclusively served by the indexer",
"params": [],
"result": {
"name": "NetworkMetrics",
Expand Down Expand Up @@ -4398,6 +4400,7 @@
"name": "Extended API"
}
],
"description": "Return the total number of transactions. Exclusively served by the indexer",
"params": [],
"result": {
"name": "BigInt<u64>",
Expand Down
Loading