Skip to content

Commit d00c015

Browse files
committed
Revise UI and JSON-RPC sections
1 parent 7421dbc commit d00c015

File tree

4 files changed

+50
-38
lines changed

4 files changed

+50
-38
lines changed

docs/interacting/json-rpc-server.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_position: 0
66
import Tabs from "@theme/Tabs";
77
import TabItem from "@theme/TabItem";
88

9-
Interacting with Nethermind requires using the JSON-RPC 2.0 protocol. Nethermind provides JSON-RPC over [HTTP](#http), [WebSocket](#websocket), and [IPC socket](#ipc-socket) transports. Each transport must be enabled with the respective configuration option, as shown below. For more details, see the [JSON-RPC configuration options](../fundamentals/configuration.md#jsonrpc).
9+
Interacting with Nethermind requires using the JSON-RPC 2.0 protocol. Nethermind provides JSON-RPC over [HTTP](#http), [WebSocket](#websocket), and [IPC socket](#ipc-socket) transports. Each transport must be enabled with the respective configuration option, as shown below. For more details, see the [JSON-RPC configuration options](../fundamentals/configuration.md#jsonrpc).
1010

1111
The JSON-RPC API methods are grouped into several categories (namespaces) depending on their purpose. All API method names are composed of the namespace and the actual method name in that namespace. For instance, the `eth_call` method belongs to the `eth` namespace. See the sidebar for all supported namespaces and methods.
1212

@@ -22,11 +22,11 @@ The right choice of transport depends on the specific use case.
2222
- HTTP is a familiar and idempotent transport that closes connections between requests and can, therefore, have lower overall overhead for a relatively low number of requests.
2323
- WebSocket provides a continuous open channel that enables event subscriptions and streaming and handles large volumes of requests with more negligible per-message overhead.
2424
- IPC is generally the most secure as it is limited to local interactions and cannot be exposed to external traffic. It can also be used for event subscriptions.
25-
:::
25+
:::
2626

2727
### HTTP
2828

29-
HTTP is the most widely used transport for Nethermind. To enable the HTTP server, set the [`JsonRpc.Enabled`](../fundamentals/configuration.md#jsonrpc-enabled) configuration option to `true`. By default, Nethermind uses local loopback (`127.0.0.1` or `localhost`) and `8545` port. To use a different host or port, set the [`JsonRpc.Host`](../fundamentals/configuration.md#jsonrpc-host) and [`JsonRpc.Port`](../fundamentals/configuration.md#jsonrpc-port) configuration options, respectively.
29+
HTTP is the most widely used transport for Nethermind. To enable the HTTP server, set the [`JsonRpc.Enabled`](../fundamentals/configuration.md#jsonrpc-enabled) configuration option to `true`. By default, Nethermind uses local loopback (127.0.0.1 or `localhost`) and 8545 port. To use a different host or port, set the [`JsonRpc.Host`](../fundamentals/configuration.md#jsonrpc-host) and [`JsonRpc.Port`](../fundamentals/configuration.md#jsonrpc-port) configuration options, respectively.
3030

3131
### WebSocket
3232

@@ -46,7 +46,7 @@ If the `path/to/ipc` doesn't exist, Nethermind creates one.
4646

4747
The Engine API is a set of RPC methods that enable communication between an execution and consensus client. The clients call these methods automatically when they need to exchange information. Engine API is enabled automatically by default and is not designed to be exposed to the user.
4848

49-
By default, the Engine API uses local loopback (`127.0.0.1` or `localhost`) and `8551` port. To use a different host or port, set the [`JsonRpc.EngineHost`](../fundamentals/configuration.md#jsonrpc-enginehost) and [`JsonRpc.EnginePort`](../fundamentals/configuration.md#jsonrpc-engineport) configuration options, respectively. For example, this can be useful when execution and consensus clients are on different machines.
49+
By default, the Engine API uses local loopback (127.0.0.1 or `localhost`) and 8551 port. To use a different host or port, set the [`JsonRpc.EngineHost`](../fundamentals/configuration.md#jsonrpc-enginehost) and [`JsonRpc.EnginePort`](../fundamentals/configuration.md#jsonrpc-engineport) configuration options, respectively. For example, this can be useful when execution and consensus clients are on different machines.
5050

5151
:::warning Important
5252
When the `JsonRpc.EngineHost` option is specified, the `JsonRpc.EnginePort` option must be specified as well.
@@ -106,12 +106,18 @@ import { JsonRpcProvider, formatEther } from 'ethers';
106106
const provider = new JsonRpcProvider('http://localhost:8545');
107107

108108
// Use the low-level API to send the request
109-
let balance = await provider.send('eth_getBalance', ['0x00000000219ab540356cbb839cbe05303d7705fa', 'latest']);
109+
let balance = await provider.send('eth_getBalance', [
110+
'0x00000000219ab540356cbb839cbe05303d7705fa',
111+
'latest'
112+
]);
110113
console.log('Balance:', formatEther(balance));
111114

112115
// Use the high-level API to send the request.
113116
// Note that the return type may differ from the one of the low-level API.
114-
balance = await provider.getBalance('0x00000000219ab540356cbb839cbe05303d7705fa', 'latest');
117+
balance = await provider.getBalance(
118+
'0x00000000219ab540356cbb839cbe05303d7705fa',
119+
'latest'
120+
);
115121
console.log('Balance:', formatEther(balance));
116122
```
117123

@@ -151,23 +157,23 @@ import { localhost } from 'viem/chains';
151157

152158
// Assuming Nethermind is running locally using the default port of 8545
153159
const client = createPublicClient({
154-
chain: localhost,
155-
transport: http('http://localhost:8545'),
160+
chain: localhost,
161+
transport: http('http://localhost:8545')
156162
});
157163

158164
// Use the low-level API to send the request
159165
let balance = await client.request({
160-
method: 'eth_getBalance',
161-
params: ['0x00000000219ab540356cbb839cbe05303d7705fa', 'latest'],
166+
method: 'eth_getBalance',
167+
params: ['0x00000000219ab540356cbb839cbe05303d7705fa', 'latest']
162168
});
163169
console.log('Balance:', formatEther(hexToNumber(balance)));
164170

165171
// Use the high-level API to send the request.
166172
// Note that the return type may differ from the one of the low-level API.
167173
// Not all JSON-RPC methods have their respective high-level API.
168174
balance = await client.getBalance({
169-
address: '0x00000000219ab540356cbb839cbe05303d7705fa',
170-
blockTag: 'latest'
175+
address: '0x00000000219ab540356cbb839cbe05303d7705fa',
176+
blockTag: 'latest'
171177
});
172178
console.log('Balance:', formatEther(balance));
173179
```
@@ -180,21 +186,21 @@ import { localhost } from 'viem/chains';
180186

181187
// Assuming Nethermind is running locally using the default port of 8545
182188
const client = createPublicClient({
183-
chain: localhost,
184-
transport: http('http://localhost:8545'),
189+
chain: localhost,
190+
transport: http('http://localhost:8545')
185191
});
186192

187193
// Use the low-level API to send the request
188194
let block = await client.request({
189-
method: 'eth_getBlockByNumber',
190-
params: ['latest', true],
195+
method: 'eth_getBlockByNumber',
196+
params: ['latest', true]
191197
});
192198
console.log('Block:', block);
193199

194200
// Use the high-level API to send the request
195201
block = await client.getBlock({
196-
blockTag: 'latest',
197-
includeTransactions: true
202+
blockTag: 'latest',
203+
includeTransactions: true
198204
});
199205
console.log('Block:', block);
200206
```

docs/monitoring/ui.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ To provide a richer and more user-friendly experience, Nethermind is bundled wit
77

88
![Nethermind UI](/images/ui.png)
99

10-
Disabled by default, the UI can be enabled together with the [health check](./health-check.md) using the [`HealthChecks.Enabled`](../fundamentals/configuration.md#healthchecks-enabled) configuration option as follows:
10+
By default, the UI is available on the same host and port as the JSON-RPC interface—namely, the local loopback interface (127.0.0.1 or `localhost`) on port 8545. The UI is disabled by default and can be enabled together with the [health check](./health-check.md) using the [`HealthChecks.Enabled`](../fundamentals/configuration.md#healthchecks-enabled) configuration option as follows:
1111

1212
```bash
1313
nethermind \

versioned_docs/version-1.35.0/interacting/json-rpc-server.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_position: 0
66
import Tabs from "@theme/Tabs";
77
import TabItem from "@theme/TabItem";
88

9-
Interacting with Nethermind requires using the JSON-RPC 2.0 protocol. Nethermind provides JSON-RPC over [HTTP](#http), [WebSocket](#websocket), and [IPC socket](#ipc-socket) transports. Each transport must be enabled with the respective configuration option, as shown below. For more details, see the [JSON-RPC configuration options](../fundamentals/configuration.md#jsonrpc).
9+
Interacting with Nethermind requires using the JSON-RPC 2.0 protocol. Nethermind provides JSON-RPC over [HTTP](#http), [WebSocket](#websocket), and [IPC socket](#ipc-socket) transports. Each transport must be enabled with the respective configuration option, as shown below. For more details, see the [JSON-RPC configuration options](../fundamentals/configuration.md#jsonrpc).
1010

1111
The JSON-RPC API methods are grouped into several categories (namespaces) depending on their purpose. All API method names are composed of the namespace and the actual method name in that namespace. For instance, the `eth_call` method belongs to the `eth` namespace. See the sidebar for all supported namespaces and methods.
1212

@@ -22,11 +22,11 @@ The right choice of transport depends on the specific use case.
2222
- HTTP is a familiar and idempotent transport that closes connections between requests and can, therefore, have lower overall overhead for a relatively low number of requests.
2323
- WebSocket provides a continuous open channel that enables event subscriptions and streaming and handles large volumes of requests with more negligible per-message overhead.
2424
- IPC is generally the most secure as it is limited to local interactions and cannot be exposed to external traffic. It can also be used for event subscriptions.
25-
:::
25+
:::
2626

2727
### HTTP
2828

29-
HTTP is the most widely used transport for Nethermind. To enable the HTTP server, set the [`JsonRpc.Enabled`](../fundamentals/configuration.md#jsonrpc-enabled) configuration option to `true`. By default, Nethermind uses local loopback (`127.0.0.1` or `localhost`) and `8545` port. To use a different host or port, set the [`JsonRpc.Host`](../fundamentals/configuration.md#jsonrpc-host) and [`JsonRpc.Port`](../fundamentals/configuration.md#jsonrpc-port) configuration options, respectively.
29+
HTTP is the most widely used transport for Nethermind. To enable the HTTP server, set the [`JsonRpc.Enabled`](../fundamentals/configuration.md#jsonrpc-enabled) configuration option to `true`. By default, Nethermind uses local loopback (127.0.0.1 or `localhost`) and 8545 port. To use a different host or port, set the [`JsonRpc.Host`](../fundamentals/configuration.md#jsonrpc-host) and [`JsonRpc.Port`](../fundamentals/configuration.md#jsonrpc-port) configuration options, respectively.
3030

3131
### WebSocket
3232

@@ -46,7 +46,7 @@ If the `path/to/ipc` doesn't exist, Nethermind creates one.
4646

4747
The Engine API is a set of RPC methods that enable communication between an execution and consensus client. The clients call these methods automatically when they need to exchange information. Engine API is enabled automatically by default and is not designed to be exposed to the user.
4848

49-
By default, the Engine API uses local loopback (`127.0.0.1` or `localhost`) and `8551` port. To use a different host or port, set the [`JsonRpc.EngineHost`](../fundamentals/configuration.md#jsonrpc-enginehost) and [`JsonRpc.EnginePort`](../fundamentals/configuration.md#jsonrpc-engineport) configuration options, respectively. For example, this can be useful when execution and consensus clients are on different machines.
49+
By default, the Engine API uses local loopback (127.0.0.1 or `localhost`) and 8551 port. To use a different host or port, set the [`JsonRpc.EngineHost`](../fundamentals/configuration.md#jsonrpc-enginehost) and [`JsonRpc.EnginePort`](../fundamentals/configuration.md#jsonrpc-engineport) configuration options, respectively. For example, this can be useful when execution and consensus clients are on different machines.
5050

5151
:::warning Important
5252
When the `JsonRpc.EngineHost` option is specified, the `JsonRpc.EnginePort` option must be specified as well.
@@ -106,12 +106,18 @@ import { JsonRpcProvider, formatEther } from 'ethers';
106106
const provider = new JsonRpcProvider('http://localhost:8545');
107107

108108
// Use the low-level API to send the request
109-
let balance = await provider.send('eth_getBalance', ['0x00000000219ab540356cbb839cbe05303d7705fa', 'latest']);
109+
let balance = await provider.send('eth_getBalance', [
110+
'0x00000000219ab540356cbb839cbe05303d7705fa',
111+
'latest'
112+
]);
110113
console.log('Balance:', formatEther(balance));
111114

112115
// Use the high-level API to send the request.
113116
// Note that the return type may differ from the one of the low-level API.
114-
balance = await provider.getBalance('0x00000000219ab540356cbb839cbe05303d7705fa', 'latest');
117+
balance = await provider.getBalance(
118+
'0x00000000219ab540356cbb839cbe05303d7705fa',
119+
'latest'
120+
);
115121
console.log('Balance:', formatEther(balance));
116122
```
117123

@@ -151,23 +157,23 @@ import { localhost } from 'viem/chains';
151157

152158
// Assuming Nethermind is running locally using the default port of 8545
153159
const client = createPublicClient({
154-
chain: localhost,
155-
transport: http('http://localhost:8545'),
160+
chain: localhost,
161+
transport: http('http://localhost:8545')
156162
});
157163

158164
// Use the low-level API to send the request
159165
let balance = await client.request({
160-
method: 'eth_getBalance',
161-
params: ['0x00000000219ab540356cbb839cbe05303d7705fa', 'latest'],
166+
method: 'eth_getBalance',
167+
params: ['0x00000000219ab540356cbb839cbe05303d7705fa', 'latest']
162168
});
163169
console.log('Balance:', formatEther(hexToNumber(balance)));
164170

165171
// Use the high-level API to send the request.
166172
// Note that the return type may differ from the one of the low-level API.
167173
// Not all JSON-RPC methods have their respective high-level API.
168174
balance = await client.getBalance({
169-
address: '0x00000000219ab540356cbb839cbe05303d7705fa',
170-
blockTag: 'latest'
175+
address: '0x00000000219ab540356cbb839cbe05303d7705fa',
176+
blockTag: 'latest'
171177
});
172178
console.log('Balance:', formatEther(balance));
173179
```
@@ -180,21 +186,21 @@ import { localhost } from 'viem/chains';
180186

181187
// Assuming Nethermind is running locally using the default port of 8545
182188
const client = createPublicClient({
183-
chain: localhost,
184-
transport: http('http://localhost:8545'),
189+
chain: localhost,
190+
transport: http('http://localhost:8545')
185191
});
186192

187193
// Use the low-level API to send the request
188194
let block = await client.request({
189-
method: 'eth_getBlockByNumber',
190-
params: ['latest', true],
195+
method: 'eth_getBlockByNumber',
196+
params: ['latest', true]
191197
});
192198
console.log('Block:', block);
193199

194200
// Use the high-level API to send the request
195201
block = await client.getBlock({
196-
blockTag: 'latest',
197-
includeTransactions: true
202+
blockTag: 'latest',
203+
includeTransactions: true
198204
});
199205
console.log('Block:', block);
200206
```

versioned_docs/version-1.35.0/monitoring/ui.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ To provide a richer and more user-friendly experience, Nethermind is bundled wit
77

88
![Nethermind UI](/images/ui.png)
99

10-
Disabled by default, the UI can be enabled together with the [health check](./health-check.md) using the [`HealthChecks.Enabled`](../fundamentals/configuration.md#healthchecks-enabled) configuration option as follows:
10+
By default, the UI is available on the same host and port as the JSON-RPC interface—namely, the local loopback interface (127.0.0.1 or `localhost`) on port 8545. The UI is disabled by default and can be enabled together with the [health check](./health-check.md) using the [`HealthChecks.Enabled`](../fundamentals/configuration.md#healthchecks-enabled) configuration option as follows:
1111

1212
```bash
1313
nethermind \

0 commit comments

Comments
 (0)