From bac7bfbb32f6a3ecd6d1bad42982378d4359fa75 Mon Sep 17 00:00:00 2001 From: yukang Date: Fri, 2 Feb 2024 10:32:53 +0800 Subject: [PATCH] fix gen-rpc-doc --- Makefile | 3 +-- devtools/doc/rpc-gen/src/main.rs | 28 +++++++++++--------- devtools/doc/rpc-gen/src/utils.rs | 14 ++++++++++ docs/ckb_rpc_openrpc | 2 +- rpc/README.md | 44 +++++++++++++++---------------- rpc/src/module/chain.rs | 2 +- 6 files changed, 55 insertions(+), 38 deletions(-) diff --git a/Makefile b/Makefile index 5ffaa32743a..873e19a2501 100644 --- a/Makefile +++ b/Makefile @@ -104,9 +104,8 @@ doc-deps: ## Build the documentation for the local package and all dependencies. .PHONY: gen-rpc-doc gen-rpc-doc: submodule-init ## Generate rpc documentation cd devtools/doc/rpc-gen && cargo build - cd docs/ckb_rpc_openrpc/ && git reset --hard && git clean -fd - ./target/debug/ckb-rpc-gen rpc/README.md ./target/debug/ckb-rpc-gen --json + ./target/debug/ckb-rpc-gen rpc/README.md .PHONY: gen-hashes gen-hashes: ## Generate docs/hashes.toml diff --git a/devtools/doc/rpc-gen/src/main.rs b/devtools/doc/rpc-gen/src/main.rs index 2d1275c83a6..3c5d543a777 100644 --- a/devtools/doc/rpc-gen/src/main.rs +++ b/devtools/doc/rpc-gen/src/main.rs @@ -22,18 +22,22 @@ fn dump_openrpc_json() -> Result<(), Box> { "finished dump openrpc json for version: {:?} at dir: {:?}", version, json_dir ); - // run git commit all changes before generate rpc readme - run_command("git", &["add", "."], Some(OPENRPC_DIR)); - run_command( - "git", - &[ - "commit", - "-m", - &format!("update openrpc json for version: {:?}", version), - ], - Some(OPENRPC_DIR), - ); - run_command("git", &["push"], Some(OPENRPC_DIR)); + + if is_git_repo_dirty() { + // run git commit all changes before generate rpc readme + eprintln!("commit OpenRPC changes to repo: {}", get_git_remote_url()); + run_command("git", &["add", "."], Some(OPENRPC_DIR)); + run_command( + "git", + &[ + "commit", + "-m", + &format!("update openrpc json for version: {:?}", version), + ], + Some(OPENRPC_DIR), + ); + run_command("git", &["push"], Some(OPENRPC_DIR)); + } Ok(()) } diff --git a/devtools/doc/rpc-gen/src/utils.rs b/devtools/doc/rpc-gen/src/utils.rs index d121cf22c8b..7bc6b4f88c9 100644 --- a/devtools/doc/rpc-gen/src/utils.rs +++ b/devtools/doc/rpc-gen/src/utils.rs @@ -67,3 +67,17 @@ pub(crate) fn checkout_tag_branch(version: &str) { run_command("git", &["checkout", "-b", version], dir); } } + +pub(crate) fn is_git_repo_dirty() -> bool { + let res = run_command("git", &["status", "--porcelain"], Some(OPENRPC_DIR)); + res.map(|s| !s.is_empty()).unwrap_or(false) +} + +pub(crate) fn get_git_remote_url() -> String { + run_command( + "git", + &["config", "--get", "remote.origin.url"], + Some(OPENRPC_DIR), + ) + .map_or("".to_string(), |s| s.trim().to_string()) +} diff --git a/docs/ckb_rpc_openrpc b/docs/ckb_rpc_openrpc index 056e0e52aba..e7b5c1c42c0 160000 --- a/docs/ckb_rpc_openrpc +++ b/docs/ckb_rpc_openrpc @@ -1 +1 @@ -Subproject commit 056e0e52abaae25a6a7cfa12b6864e4077248984 +Subproject commit e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa diff --git a/rpc/README.md b/rpc/README.md index 4ce1d99e0ee..543ac7b838a 100644 --- a/rpc/README.md +++ b/rpc/README.md @@ -31,9 +31,9 @@ The crate `ckb-rpc`'s minimum supported rustc version is 1.71.1. * [RPC Methods](#rpc-methods) - * [Module Alert](#module-alert) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Alert&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/alert_rpc_doc.json) + * [Module Alert](#module-alert) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Alert&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/alert_rpc_doc.json) * [Method `send_alert`](#method-send_alert) - * [Module Chain](#module-chain) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Chain&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/chain_rpc_doc.json) + * [Module Chain](#module-chain) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Chain&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/chain_rpc_doc.json) * [Method `get_block`](#method-get_block) * [Method `get_block_by_number`](#method-get_block_by_number) * [Method `get_header`](#method-get_header) @@ -57,19 +57,19 @@ The crate `ckb-rpc`'s minimum supported rustc version is 1.71.1. * [Method `estimate_cycles`](#method-estimate_cycles) * [Method `get_fee_rate_statics`](#method-get_fee_rate_statics) * [Method `get_fee_rate_statistics`](#method-get_fee_rate_statistics) - * [Module Debug](#module-debug) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Debug&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/debug_rpc_doc.json) + * [Module Debug](#module-debug) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Debug&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/debug_rpc_doc.json) * [Method `jemalloc_profiling_dump`](#method-jemalloc_profiling_dump) * [Method `update_main_logger`](#method-update_main_logger) * [Method `set_extra_logger`](#method-set_extra_logger) - * [Module Experiment](#module-experiment) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Experiment&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/experiment_rpc_doc.json) + * [Module Experiment](#module-experiment) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Experiment&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/experiment_rpc_doc.json) * [Method `dry_run_transaction`](#method-dry_run_transaction) * [Method `calculate_dao_maximum_withdraw`](#method-calculate_dao_maximum_withdraw) - * [Module Indexer](#module-indexer) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Indexer&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/indexer_rpc_doc.json) + * [Module Indexer](#module-indexer) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Indexer&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/indexer_rpc_doc.json) * [Method `get_indexer_tip`](#method-get_indexer_tip) * [Method `get_cells`](#method-get_cells) * [Method `get_transactions`](#method-get_transactions) * [Method `get_cells_capacity`](#method-get_cells_capacity) - * [Module Integration_test](#module-integration_test) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Integration_test&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/integration_test_rpc_doc.json) + * [Module Integration_test](#module-integration_test) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Integration_test&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/integration_test_rpc_doc.json) * [Method `process_block_without_verify`](#method-process_block_without_verify) * [Method `truncate`](#method-truncate) * [Method `generate_block`](#method-generate_block) @@ -77,10 +77,10 @@ The crate `ckb-rpc`'s minimum supported rustc version is 1.71.1. * [Method `notify_transaction`](#method-notify_transaction) * [Method `generate_block_with_template`](#method-generate_block_with_template) * [Method `calculate_dao_field`](#method-calculate_dao_field) - * [Module Miner](#module-miner) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Miner&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/miner_rpc_doc.json) + * [Module Miner](#module-miner) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Miner&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/miner_rpc_doc.json) * [Method `get_block_template`](#method-get_block_template) * [Method `submit_block`](#method-submit_block) - * [Module Net](#module-net) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Net&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/net_rpc_doc.json) + * [Module Net](#module-net) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Net&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/net_rpc_doc.json) * [Method `local_node_info`](#method-local_node_info) * [Method `get_peers`](#method-get_peers) * [Method `get_banned_addresses`](#method-get_banned_addresses) @@ -91,7 +91,7 @@ The crate `ckb-rpc`'s minimum supported rustc version is 1.71.1. * [Method `add_node`](#method-add_node) * [Method `remove_node`](#method-remove_node) * [Method `ping_peers`](#method-ping_peers) - * [Module Pool](#module-pool) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Pool&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/pool_rpc_doc.json) + * [Module Pool](#module-pool) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Pool&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/pool_rpc_doc.json) * [Method `send_transaction`](#method-send_transaction) * [Method `remove_transaction`](#method-remove_transaction) * [Method `tx_pool_info`](#method-tx_pool_info) @@ -99,10 +99,10 @@ The crate `ckb-rpc`'s minimum supported rustc version is 1.71.1. * [Method `get_raw_tx_pool`](#method-get_raw_tx_pool) * [Method `get_pool_tx_detail_info`](#method-get_pool_tx_detail_info) * [Method `tx_pool_ready`](#method-tx_pool_ready) - * [Module Stats](#module-stats) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Stats&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/stats_rpc_doc.json) + * [Module Stats](#module-stats) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Stats&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/stats_rpc_doc.json) * [Method `get_blockchain_info`](#method-get_blockchain_info) * [Method `get_deployments_info`](#method-get_deployments_info) - * [Module Subscription](#module-subscription) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Subscription&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/subscription_rpc_doc.json) + * [Module Subscription](#module-subscription) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Subscription&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/subscription_rpc_doc.json) * [Method `subscribe`](#method-subscribe) * [Method `unsubscribe`](#method-unsubscribe) * [RPC Types](#rpc-types) @@ -207,7 +207,7 @@ The crate `ckb-rpc`'s minimum supported rustc version is 1.71.1. ## RPC Modules ### Module `Alert` -- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Alert&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/alert_rpc_doc.json) +- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Alert&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/alert_rpc_doc.json) RPC Module Alert for network alerts. @@ -272,7 +272,7 @@ Response ``` ### Module `Chain` -- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Chain&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/chain_rpc_doc.json) +- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Chain&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/chain_rpc_doc.json) RPC Module Chain for methods related to the canonical chain. @@ -286,7 +286,7 @@ the sum of difficulties of all the blocks in the chain. ##### Chain Reorganization Chain Reorganization happens when CKB found a chain that has accumulated more work than the -canonical chain. The reorganization reverts the blocks in the current canonical chain if needed, +canonical chain. The reorganization revert the blocks in the current canonical chain if needed, and switch the canonical chain to that better chain. ##### Live Cell @@ -1889,7 +1889,7 @@ Response ``` ### Module `Debug` -- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Debug&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/debug_rpc_doc.json) +- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Debug&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/debug_rpc_doc.json) RPC Module Debug for internal RPC methods. @@ -1932,7 +1932,7 @@ they only append logs to their log files. Removes the logger when this is null. ### Module `Experiment` -- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Experiment&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/experiment_rpc_doc.json) +- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Experiment&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/experiment_rpc_doc.json) RPC Module Experiment for experimenting methods. @@ -2084,7 +2084,7 @@ Response ``` ### Module `Indexer` -- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Indexer&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/indexer_rpc_doc.json) +- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Indexer&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/indexer_rpc_doc.json) RPC Module Indexer. @@ -2962,7 +2962,7 @@ Response ``` ### Module `Integration_test` -- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Integration_test&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/integration_test_rpc_doc.json) +- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Integration_test&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/integration_test_rpc_doc.json) RPC for Integration Test. @@ -3456,7 +3456,7 @@ Response ``` ### Module `Miner` -- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Miner&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/miner_rpc_doc.json) +- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Miner&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/miner_rpc_doc.json) RPC Module Miner for miners. @@ -3670,7 +3670,7 @@ Response ``` ### Module `Net` -- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Net&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/net_rpc_doc.json) +- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Net&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/net_rpc_doc.json) RPC Module Net for P2P network. @@ -4217,7 +4217,7 @@ Response ``` ### Module `Pool` -- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Pool&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/pool_rpc_doc.json) +- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Pool&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/pool_rpc_doc.json) RPC Module Pool for transaction memory pool. @@ -4553,7 +4553,7 @@ Response ``` ### Module `Stats` -- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Stats&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/056e0e52abaae25a6a7cfa12b6864e4077248984/json/stats_rpc_doc.json) +- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Stats&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/main/ckb-logo.jpg&schemaUrl=https://raw.githubusercontent.com/cryptape/ckb-rpc-resources/e7b5c1c42c07d4ac93acd1b02e9b29458658d3fa/json/stats_rpc_doc.json) RPC Module Stats for getting various statistic data. diff --git a/rpc/src/module/chain.rs b/rpc/src/module/chain.rs index 66e244e47bc..da56b00c66e 100644 --- a/rpc/src/module/chain.rs +++ b/rpc/src/module/chain.rs @@ -43,7 +43,7 @@ use std::sync::Arc; /// ## Chain Reorganization /// /// Chain Reorganization happens when CKB found a chain that has accumulated more work than the -/// canonical chain. The reorganization reverts the blocks in the current canonical chain if needed, +/// canonical chain. The reorganization revert the blocks in the current canonical chain if needed, /// and switch the canonical chain to that better chain. /// /// ## Live Cell