Skip to content

Commit

Permalink
Merge pull request #740 from moonbeam-foundation/eshaben/client-v0.33…
Browse files Browse the repository at this point in the history
….0-ws-params

update docs for ws/rpc changes
  • Loading branch information
eshaben authored Sep 7, 2023
2 parents 415c106 + 5be7875 commit 49af231
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 40 deletions.
4 changes: 4 additions & 0 deletions .snippets/text/node-operators/client-changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
!!! note
For client versions prior to v0.30.0, `--rpc-port` was used to specify the port for HTTP connections, and `--ws-port` was used to specify the port for WS connections. As of client v0.30.0, these flags have been combined, and the default port for the `--ws-port` flag, which is `9944`, is used for both HTTP and WS connections. The maximum number of connections to that port has been hardcoded to 100 and could be modified with the `--ws-max-connections` flag.

As of client v0.33.0, the `--ws-port` and `--ws-max-connections` flags have been deprecated and removed in favor of the `--rpc-port` and `--rpc-max-connections` flags. The default port is still `9944`, and the default maximum number of connections is still set to 100.
17 changes: 8 additions & 9 deletions builders/get-started/networks/moonbeam-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@ Using Docker enables you to spin up a node in a matter of seconds. Once you have
```bash
docker run --rm --name {{ networks.development.container_name }} --network host \
purestake/moonbeam:{{ networks.development.build_tag }} \
--dev
--dev --rpc-external
```

=== "MacOS"

```bash
docker run --rm --name {{ networks.development.container_name }} -p 9944:9944 \
purestake/moonbeam:{{ networks.development.build_tag }} \
--dev --ws-external --rpc-external
--dev --rpc-external
```

=== "Windows"

```bash
docker run --rm --name {{ networks.development.container_name }} -p 9944:9944 ^
purestake/moonbeam:{{ networks.development.build_tag }} ^
--dev --ws-external --rpc-external
--dev --rpc-external
```

If successful, you should see an output showing an idle state waiting for blocks to be authored:
Expand Down Expand Up @@ -155,8 +155,7 @@ Flags do not take an argument. To use a flag, add it to the end of a command. Fo

- **`--dev`** - specifies the development chain
- **`--tmp`** - runs a temporary node in which all of the configuration will be deleted at the end of the process
- **`--rpc-external`** - listen to all RPC interfaces
- **`--ws-external`** - listen to all Websocket interfaces
- **`--rpc-external`** - listen to all RPC and WebSocket interfaces

### Common Options to Configure your Node {: #node-options }

Expand All @@ -168,10 +167,10 @@ Options accept an argument to the right of the option. For example:

- **`-l <log pattern>` or `--log <log pattern>`** - sets a custom logging filter. The syntax for the log pattern is `<target>=<level>`. For example, to print all of the JSON RPC logs, the command would look like this: `-l json=trace`
- **`--sealing <interval>`** - when blocks should be sealed in the dev service. Accepted arguments for interval: `instant`, `manual`, or a number representing the timer interval in milliseconds (for example, `6000` will have the node produce blocks every 6 seconds). Default is `instant`. Please refer to the [Configure Block Production](#configure-block-production) section below for more information
- **`--rpc-port <port>`** - *deprecated as of [client v0.30.0](https://github.com/moonbeam-foundation/moonbeam/releases/tag/v0.30.0){target=_blank}, use `--ws-port` for HTTP and WS connections instead* - sets the HTTP RPC server TCP port. Accepts a port as the argument
- **`--ws-port <port>`**: sets the WebSockets RPC server TCP port. As of [client v0.30.0](https://github.com/moonbeam-foundation/moonbeam/releases/tag/v0.30.0){target=_blank}, the WS port is a unified port for both HTTP and WS connections. Accepts a port as the argument. Default is {{ networks.parachain.ws }}
- **`--rpc-max-connections <connections>`** - *deprecated as of [client v0.30.0](https://github.com/moonbeam-foundation/moonbeam/releases/tag/v0.30.0){target=_blank}, this value has been hardcoded to 100. Use `--ws-max-connections` to adjust the combined HTTP and WS connection limit instead* - specifies the maximum number of HTTP RPC server connections
- **`--ws-max-connections <connections>`** - specifies the maximum number of WS RPC server connections. As of [client v0.30.0](https://github.com/moonbeam-foundation/moonbeam/releases/tag/v0.30.0){target=_blank}, this flag adjusts the combined HTTP and WS connection limit. Default is 100 connections
- **`--rpc-port <port>`** - sets the unified port for HTTP and WS connections. Accepts a port as the argument. Default is {{ networks.parachain.rpc }}
- **`--ws-port <port>`** - *deprecated as of [client v0.33.0](https://github.com/moonbeam-foundation/moonbeam/releases/tag/v0.33.0){target=_blank}, use `--rpc-port` for HTTP and WS connections instead* sets the WebSockets RPC server TCP port. As of [client v0.30.0](https://github.com/moonbeam-foundation/moonbeam/releases/tag/v0.30.0){target=_blank}, sets the unified port for both HTTP and WS connections. Accepts a port as the argument
- **`--rpc-max-connections <connections>`** - specifies the combined HTTP and WS connection limit. Default is 100 connections
- **`--ws-max-connections <connections>`** - *deprecated as of [client v0.33.0](https://github.com/moonbeam-foundation/moonbeam/releases/tag/v0.33.0){target=_blank}, use `--rpc-max-connections` to limit the HTTP and WS connections instead* - this flag adjusts the combined HTTP and WS connection limit. Default is 100 connections
- **`--rpc-cors <origins>`** - specifies the browser origins allowed to access the HTTP and WS RPC servers. The origins can be a comma-separated list of the origins to allow access or you can also specify `null`. When running a development node, the default is to allow all origins

For a complete list of flags and options, spin up your Moonbeam development node with `--help` added to the end of the command.
Expand Down
7 changes: 2 additions & 5 deletions node-operators/networks/run-a-node/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ Now, execute the docker run command. If you are setting up a collator node, make
- Replace `INSERT_YOUR_NODE_NAME` in two different places
- Replace `<50% RAM in MB>` for 50% of the actual RAM your server has. For example, for 32 GB RAM, the value must be set to `16000`. The minimum value is `2000`, but it is below the recommended specs

!!! note
For client versions prior to v0.27.0, the `--state-pruning` flag was named `--pruning`.

For client versions prior to v0.30.0, `--rpc-port` was used to specify the port for HTTP connections and `--ws-port` was used to specify the port for WS connections. As of client v0.30.0, the `--rpc-port` has been deprecated and the `--ws-port` flag is for both HTTP and WS connections. Similarly, the `--rpc-max-connections` flag has been deprecated and is now hardcoded to 100. You can use `--ws-max-connections` to adjust the combined HTTP and WS connection limit.
--8<-- 'text/node-operators/client-changes.md'

### Full Node {: #full-node }

Expand Down Expand Up @@ -175,7 +172,7 @@ Now, execute the docker run command. If you are setting up a collator node, make
```

!!! note
If you want to run an RPC endpoint, to connect Polkadot.js Apps, or to run your own application, use the flags `--unsafe-rpc-external` and/or `--unsafe-ws-external` to run the full node with external access to the RPC ports. More details are available by running `moonbeam --help`. This is **not** recommended for Collators.
If you want to run an RPC endpoint, to connect Polkadot.js Apps, or to run your own application, use the `--unsafe-rpc-external` flag to run the full node with external access to the RPC ports. More details are available by running `moonbeam --help`. This is **not** recommended for Collators.

### Collator {: #collator }

Expand Down
8 changes: 4 additions & 4 deletions node-operators/networks/run-a-node/flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ This guide will cover some of the most common flags and show you how to access a

- **`--collator`** - enables collator mode for collator candidates and, if eligible, allows the node to actively participate in block production
- **`--port`** - specifies the peer-to-peer protocol TCP port. The default port for parachains is `{{ networks.parachain.p2p }}` and `{{ networks.relay_chain.p2p }}` for the embedded relay chain
- **`--rpc-port`** - *deprecated as of [client v0.30.0](https://github.com/moonbeam-foundation/moonbeam/releases/tag/v0.30.0){target=_blank}, use `--ws-port` for HTTP and WS connections instead* - specifies the HTTP RPC server TCP port. The default port for parachains is `{{ networks.parachain.rpc }}` and `{{ networks.relay_chain.rpc }}` for the embedded relay chain
- **`--ws-port`** - specifies the WebSockets RPC server TCP port. As of [client v0.30.0](https://github.com/moonbeam-foundation/moonbeam/releases/tag/v0.30.0){target=_blank}, the WS port is a unified port for both HTTP and WS connections. The default port for parachains is `{{ networks.parachain.ws }}` and `{{ networks.relay_chain.ws }}` for the embedded relay chain
- **`--rpc-max-connections`** - *deprecated as of [client v0.30.0](https://github.com/moonbeam-foundation/moonbeam/releases/tag/v0.30.0){target=_blank}, this value has been hardcoded to 100. Use `--ws-max-connections` to adjust the combined HTTP and WS connection limit instead* - specifies the maximum number of HTTP RPC server connections
- **`--ws-max-connections`** - specifies the maximum number of WS RPC server connections. As of [client v0.30.0](https://github.com/moonbeam-foundation/moonbeam/releases/tag/v0.30.0){target=_blank}, this flag adjusts the combined HTTP and WS connection limit. The default value is 100
- **`--rpc-port`** - sets the unified port for both HTTP and WS connections. The default port for parachains is `{{ networks.parachain.rpc }}` and `{{ networks.relay_chain.ws }}` for the embedded relay chain
- **`--ws-port`** - - *deprecated as of [client v0.33.0](https://github.com/moonbeam-foundation/moonbeam/releases/tag/v0.33.0){target=_blank}, use `--rpc-port` for HTTP and WS connections instead* - sets the unified port for both HTTP and WS connections. The default port for parachains is `{{ networks.parachain.ws }}` and `{{ networks.relay_chain.ws }}` for the embedded relay chain
- **`--rpc-max-connections`** - specifies the maximum number of HTTP and WS server connections. The default is 100
- **`--ws-max-connections`** - *deprecated as of [client v0.33.0](https://github.com/moonbeam-foundation/moonbeam/releases/tag/v0.33.0){target=_blank}, use `--rpc-max-connections` to adjust the combined HTTP and WS connection limit instead* - specifies the maximum number of HTTP and WS server connections. The default is 100
- **`--execution`** - specifies the execution strategy that should be used by all execution contexts. The Substrate runtime is compiled into a native executable which is included locally as part of the node and a WebAssembly (Wasm) binary that is stored on-chain. The available options are:
- **`native`** - only execute with the native build
- **`wasm`** - only execute with the Wasm build
Expand Down
3 changes: 1 addition & 2 deletions node-operators/networks/run-a-node/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ As stated before, the relay/parachain nodes will listen on multiple ports. The d

The only ports that need to be open for incoming traffic are those designated for P2P. **Collators must not have RPC or WS ports opened**.

!!! note
As of [client v0.30.0](https://github.com/moonbeam-foundation/moonbeam/releases/tag/v0.30.0){target=_blank}, the HTTP RPC endpoint at port {{ networks.parachain.rpc }} has been deprecated. The WS RPC endpoint at port {{ networks.parachain.ws }} should be used for both HTTP and WS connections.
--8<-- 'text/node-operators/client-changes.md'

### Default Ports for a Parachain Full-Node {: #default-ports-for-a-parachain-full-node }

Expand Down
7 changes: 2 additions & 5 deletions node-operators/networks/run-a-node/systemd.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,7 @@ The next step is to create the systemd configuration file. If you are setting up
- Double-check the base path if you've used a different directory
- Name the file `/etc/systemd/system/moonbeam.service`
!!! note
For client versions prior to v0.27.0, the `--state-pruning` flag was named `--pruning`.
For client versions prior to v0.30.0, `--rpc-port` was used to specify the port for HTTP connections and `--ws-port` was used to specify the port for WS connections. As of client v0.30.0, the `--rpc-port` has been deprecated and the `--ws-port` flag is for both HTTP and WS connections. Similarly, the `--rpc-max-connections` flag has been deprecated and is now hardcoded to 100. You can use `--ws-max-connections` to adjust the combined HTTP and WS connection limit.
--8<-- 'text/node-operators/client-changes.md'
### Full Node {: #full-node }
Expand Down Expand Up @@ -310,7 +307,7 @@ The next step is to create the systemd configuration file. If you are setting up
```
!!! note
If you want to run an RPC endpoint, to connect Polkadot.js Apps, or to run your own application, use the flags `--unsafe-rpc-external` and/or `--unsafe-ws-external` to run the full node with external access to the RPC ports. More details are available by running `moonbeam --help`. This is **not** recommended for Collators. For an overview of the available flags, please refer to the [Flags](/node-operators/networks/run-a-node/flags){target=_blank} page of our documentation.
If you want to run an RPC endpoint, to connect Polkadot.js Apps, or to run your own application, use the `--unsafe-rpc-external` flag to run the full node with external access to the RPC ports. More details are available by running `moonbeam --help`. This is **not** recommended for Collators. For an overview of the available flags, please refer to the [Flags](/node-operators/networks/run-a-node/flags){target=_blank} page of our documentation.
### Collator {: #collator }
Expand Down
14 changes: 4 additions & 10 deletions node-operators/networks/tracing-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Spinning up a `debug`, `txpool`, or `tracing` node is similar to [running a full
- **`-ethapi-trace-cache-duration <uint>`** — sets the duration (in seconds) after which the cache of `trace_filter,` for a given block, is discarded. The default amount of time blocks are stored in the cache is `300` seconds

!!! note
If you want to run an RPC endpoint, to connect to Polkadot.js Apps, or to run your own application, use the flags `--unsafe-rpc-external` and/or `--unsafe-ws-external` to run the full node with external access to the RPC ports. More details are available by running `moonbeam --help`.
If you want to run an RPC endpoint, to connect to Polkadot.js Apps, or to run your own application, use the `--unsafe-rpc-external` flag to run the full node with external access to the RPC ports. More details are available by running `moonbeam --help`.

## Run a Tracing Node with Docker {: #run-a-tracing-node-with-docker }

Expand Down Expand Up @@ -94,10 +94,7 @@ Now, execute the docker run command. Note that you have to:
- Replace `INSERT_YOUR_NODE_NAME` in two different places
- Replace `<50% RAM in MB>` for 50% of the actual RAM your server has. For example, for 32 GB RAM, the value must be set to `16000`. The minimum value is `2000`, but it is below the recommended specs

!!! note
For client versions prior to v0.27.0, the `--state-pruning` flag was named `--pruning`.

For client versions prior to v0.30.0, `--rpc-port` was used to specify the port for HTTP connections and `--ws-port` was used to specify the port for WS connections. As of client v0.30.0, the `--rpc-port` has been deprecated and the `--ws-port` flag is for both HTTP and WS connections. Similarly, the `--rpc-max-connections` flag has been deprecated and is now hardcoded to 100. You can use `--ws-max-connections` to adjust the combined HTTP and WS connection limit.
--8<-- 'text/node-operators/client-changes.md'

The complete command for running a tracing node is as follows:

Expand Down Expand Up @@ -269,10 +266,7 @@ The next step is to create the systemd configuration file, you'll need to:
- Double-check the base path if you've used a different directory
- Name the file `/etc/systemd/system/moonbeam.service`
!!! note
For client versions prior to v0.27.0, the `--state-pruning` flag was named `--pruning`.
For client versions prior to v0.30.0, `--rpc-port` was used to specify the port for HTTP connections and `--ws-port` was used to specify the port for WS connections. As of client v0.30.0, the `--rpc-port` has been deprecated and the `--ws-port` flag is for both HTTP and WS connections. Similarly, the `--rpc-max-connections` flag has been deprecated and is now hardcoded to 100. You can use `--ws-max-connections` to adjust the combined HTTP and WS connection limit.
--8<-- 'text/node-operators/client-changes.md'
=== "Moonbeam"
Expand Down Expand Up @@ -374,7 +368,7 @@ The next step is to create the systemd configuration file, you'll need to:
```
!!! note
If you want to run an RPC endpoint, to connect polkadot.js.org, or to run your own application, use the flags `--unsafe-rpc-external` and/or `--unsafe-ws-external` to run the full node with external access to the RPC ports. More details are available by running `moonbeam --help`.
If you want to run an RPC endpoint, to connect polkadot.js.org, or to run your own application, use the `--unsafe-rpc-external` flag to run the full node with external access to the RPC ports. More details are available by running `moonbeam --help`.
### Run the Service {: #run-the-service }
Expand Down
8 changes: 4 additions & 4 deletions tutorials/integrations/local-subsquid.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ We'll use the following commands when starting up our node:

- `--dev` - specifies to use a development chain
- `--sealing 4000` - seals a block every four seconds (4000 milliseconds)
- `--ws-external` - listen to all WebSocket interfaces
- `--rpc-external` - listen to all HTTP and WebSocket interfaces

To spin up a development node, which will pull the latest Docker image for Moonbeam, you can run the following command:

Expand All @@ -44,23 +44,23 @@ To spin up a development node, which will pull the latest Docker image for Moonb
```bash
docker run --rm --name {{ networks.development.container_name }} --network host \
purestake/moonbeam:{{ networks.development.build_tag }} \
--dev --sealing 4000 --ws-external --rpc-external
--dev --sealing 4000 --rpc-external
```

=== "MacOS"

```bash
docker run --rm --name {{ networks.development.container_name }} -p 9944:9944 \
purestake/moonbeam:{{ networks.development.build_tag }} \
--dev --sealing 4000 --ws-external --rpc-external
--dev --sealing 4000 --rpc-external
```

=== "Windows"

```bash
docker run --rm --name {{ networks.development.container_name }} -p 9944:9944 ^
purestake/moonbeam:{{ networks.development.build_tag }} ^
--dev --sealing 4000 --ws-external --rpc-external
--dev --sealing 4000 --rpc-external
```

This will start up our development node, which can be accessed on port 9944.
Expand Down
2 changes: 1 addition & 1 deletion variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ networks:
prometheus: 9616
parachain:
p2p: 30333
rpc: 9933
rpc: 9944
ws: 9944
prometheus: 9615
polkadot:
Expand Down

0 comments on commit 49af231

Please sign in to comment.