Skip to content

Commit

Permalink
Merge pull request #2160 from eqlabs/krisztian/rpc-pathfinder-extensi…
Browse files Browse the repository at this point in the history
…ons-should-use-version-convention

pathfinder RPC extension endpoint should follow convention
  • Loading branch information
kkovaacs committed Aug 8, 2024
2 parents 9e0ceec + 53c866f commit 83d6ade
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
3 changes: 3 additions & 0 deletions crates/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 83d6ade

Please sign in to comment.