From cd6fff89a2ce41ef20be618ee1a3519ad1a5aded Mon Sep 17 00:00:00 2001 From: Krisztian Kovacs Date: Thu, 8 Aug 2024 11:05:12 +0200 Subject: [PATCH 1/2] feat(rpc): add an endpoint for Pathfinder extensions using the `vx_y` convention Closes: #1866 --- crates/rpc/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/rpc/src/lib.rs b/crates/rpc/src/lib.rs index 8c749436a8..51dd801433 100644 --- a/crates/rpc/src/lib.rs +++ b/crates/rpc/src/lib.rs @@ -198,6 +198,7 @@ impl RpcServer { .route("/rpc/v0_7", post(rpc_handler)) .with_state(v07_routes.clone()) .route("/rpc/pathfinder/v0.1", post(rpc_handler)) + .route("/rpc/pathfinder/v0_1", post(rpc_handler)) .with_state(pathfinder_routes.clone()); let router = if self.context.websocket.is_some() { @@ -894,6 +895,8 @@ mod tests { #[case::v0_4_pathfinder("/rpc/v0_4", "pathfinder_rpc_api.json", &["pathfinder_version"])] #[case::pathfinder("/rpc/pathfinder/v0.1", "pathfinder_rpc_api.json", &[])] + #[case::pathfinder("/rpc/pathfinder/v0_1", "pathfinder_rpc_api.json", &[])] + #[tokio::test] async fn rpc_routing( From 53c866f9428b0d7160c1125d51f9872ea8dded91 Mon Sep 17 00:00:00 2001 From: Krisztian Kovacs Date: Thu, 8 Aug 2024 11:08:41 +0200 Subject: [PATCH 2/2] chore: update CHANGELOG and README --- CHANGELOG.md | 6 ++++++ README.md | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec1f44da2a..6a3314fdc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ More expansive patch notes and explanations may be found in the specific [pathfi The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Added + +- Pathfinder JSON-RPC extension methods are now also exposed on the `/rpc/pathfinder/v0_1` endpoint. + ## [0.14.1] - 2024-07-29 ### Fixed diff --git a/README.md b/README.md index 464814c35c..fbdfa2b343 100644 --- a/README.md +++ b/README.md @@ -284,7 +284,7 @@ The `path` of the URL used to access the JSON-RPC server determines which versio - the `v0.5.1` API is exposed on the `/`, `/rpc/v0.5` and `/rpc/v0_5` path - the `v0.6.0` API is exposed on the `/rpc/v0_6` path via HTTP and on `/ws/rpc/v0_6` via Websocket - the `v0.7.0` API is exposed on the `/rpc/v0_7` path via HTTP and on `/ws/rpc/v0_7` via Websocket -- the pathfinder extension API is exposed on `/rpc/pathfinder/v0.1` via HTTP and `/ws/rpc/pathfinder/v0_1` via Websocket. +- the pathfinder extension API is exposed on `/rpc/pathfinder/v0.1` and `/rpc/pathfinder/v0_1` via HTTP and `/ws/rpc/pathfinder/v0_1` via Websocket. Version of the API, which is served on the root (`/`) path via HTTP and on `/ws` via Websocket, can be configured via the pathfinder parameter `--rpc.root-version` (or the `RPC_ROOT_VERSION` environment variable).