|
|
|
@ -27,19 +27,29 @@ Use the button to import our collection of examples to [Postman](https://www.get |
|
|
|
|
|
|
|
|
|
[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/cffe1bc034b3ab139fa7) |
|
|
|
|
|
|
|
|
|
### Endpoint Address and Port |
|
|
|
|
### Endpoint Host and Port |
|
|
|
|
|
|
|
|
|
In this reference, the placeholder |
|
|
|
|
`<JSON-RPC-http-endpoint:port>` and `<JSON-RPC-ws-endpoint:port>` means an endpoint (IP address and port) |
|
|
|
|
of the JSON-RPC service of a Pantheon node respectively for http endpoint and for WebSocket endpoint. |
|
|
|
|
The placeholder |
|
|
|
|
`<JSON-RPC-http-endpoint:port>` and `<JSON-RPC-ws-endpoint:port>` represents an endpoint (IP address and port) |
|
|
|
|
of the JSON-RPC service of a Pantheon node for HTTP and WebSocket requests. |
|
|
|
|
|
|
|
|
|
To activate JSON-RPC using http or WebSocket, see [`--rpc-http-enabled`](../Reference/Pantheon-CLI-Syntax.md#rpc-http-enabled) |
|
|
|
|
and [`--rpc-ws-listen`](../Reference/Pantheon-CLI-Syntax.md#rpc-ws-listen) options in the CLI documentation. |
|
|
|
|
To enable JSON-RPC over HTTP or WebSockets, use the [`--rpc-http-enabled`](../Reference/Pantheon-CLI-Syntax.md#rpc-http-enabled) |
|
|
|
|
and [`--rpc-ws-enabled`](../Reference/Pantheon-CLI-Syntax.md#rpc-ws-enabled) options. |
|
|
|
|
|
|
|
|
|
The transport attributes are: |
|
|
|
|
Use the [--rpc-http-host](../Reference/Pantheon-CLI-Syntax.md#rpc-http-host) and [--rpc-ws-host](../Reference/Pantheon-CLI-Syntax.md#rpc-ws-host) |
|
|
|
|
options to specify the host on which the JSON-RPC listens. The default host is 127.0.0.1 for HTTP and WebSockets. |
|
|
|
|
|
|
|
|
|
* HTTP: Listens by default on port 8545 |
|
|
|
|
* WebSockets: Listens by default on port 8546 |
|
|
|
|
Set the host to `0.0.0.0` to allow remote connections. |
|
|
|
|
|
|
|
|
|
!!! caution |
|
|
|
|
Setting the host to 0.0.0.0 exposes the RPC connection on your node to any remote connection. In a |
|
|
|
|
production environment, ensure you are using a firewall to avoid exposing your node to the internet. |
|
|
|
|
|
|
|
|
|
Use the [--rpc-http-port](../Reference/Pantheon-CLI-Syntax.md#rpc-http-port) and [--rpc-ws-port](../Reference/Pantheon-CLI-Syntax.md#rpc-ws-port) |
|
|
|
|
options to specify the port on which the JSON-RPC listens. The default ports are: |
|
|
|
|
|
|
|
|
|
* 8545 for HTTP |
|
|
|
|
* 8546 for WebSockets |
|
|
|
|
|
|
|
|
|
### HTTP and WebSocket Requests |
|
|
|
|
|
|
|
|
|