Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 1.92 KB

File metadata and controls

58 lines (41 loc) · 1.92 KB

Portal Network JSON-RPC Specification

View the spec

The Portal Network JSON-RPC is a collection of methods that all clients implement. This interface allows downstream tooling and infrastructure to treat different Portal Network clients as modules that can be swapped at will.

Setup

When this doc was written, the build and test steps required node.js version v16+. Verify if this version is current by inspecting the node-version defined in the project's test config file.

Building

The specification is split into multiple files to improve readability. It can be compiled the into a single document by running:

$ npm install
$ npm run build
Build successful.

This will output the file openrpc.json in the root of the project. This file will have all schema #refs resolved.

Preview the built result by copying the openrpc.json file into the open-rpc playground.

Contributing

The specification is written in OpenRPC. Refer to the OpenRPC specification and the JSON schema specification to get started.

Testing

There are currently two tools for testing contributions. The first tool is an OpenRPC validator.

$ npm install
$ npm run lint
OpenRPC spec validated successfully.

The second tool can validate a live JSON-RPC provider hosted at http://localhost:8545 against the specification:

$ ./scripts/debug.sh discv5_sendPing \"enr:-....\"
data.json valid