From 5d90024db4a8a2ee573b30fc6f7afa411e1bf021 Mon Sep 17 00:00:00 2001 From: Hugo Trentesaux <hugo@trentesaux.fr> Date: Tue, 14 May 2024 12:18:21 +0200 Subject: [PATCH] update doc for rpc port --- .cargo/config.toml | 2 +- .../local-docker-test-network/duniter.Dockerfile | 2 +- README.md | 6 ++---- docker-compose.yml | 2 -- docker/Dockerfile | 4 ++-- docker/README.md | 12 ++++++------ docs/user/nginx_reverse_proxy.md | 16 +++++++++------- 7 files changed, 21 insertions(+), 23 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 4cce48d3d..2efc17777 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -9,4 +9,4 @@ ta = "test -Zgit=shallow-deps --workspace --exclude duniter-live-tests --feature tb = "test -Zgit=shallow-deps --features runtime-benchmarks -p" rbp = "run -Zgit=shallow-deps --release --features runtime-benchmarks -- benchmark pallet --chain=dev --steps=50 --repeat=20 --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=. --pallet" xtask = "run -Zgit=shallow-deps --package xtask --" -cucumber-node = "run -Zgit=shallow-deps -- --chain=gdev_dev --execution=Native --sealing=manual --force-authoring --rpc-cors=all --tmp --ws-port 9944 --alice --features constant-fees" +cucumber-node = "run -Zgit=shallow-deps -- --chain=gdev_dev --execution=Native --sealing=manual --force-authoring --rpc-cors=all --tmp --rpc-port 9944 --alice --features constant-fees" diff --git a/.maintain/local-docker-test-network/duniter.Dockerfile b/.maintain/local-docker-test-network/duniter.Dockerfile index 948917a3f..b481147d0 100644 --- a/.maintain/local-docker-test-network/duniter.Dockerfile +++ b/.maintain/local-docker-test-network/duniter.Dockerfile @@ -29,7 +29,7 @@ USER duniter # check if executable works in this container RUN /usr/local/bin/duniter --version -EXPOSE 30333 9933 9944 +EXPOSE 30333 9944 VOLUME ["/duniter"] ENTRYPOINT ["/usr/local/bin/duniter"] diff --git a/README.md b/README.md index 8d6b38def..6d67f3a60 100644 --- a/README.md +++ b/README.md @@ -172,8 +172,7 @@ If you want to see the multi-node consensus algorithm in action, refer to --chain local \ --alice \ --port 30333 \ - --ws-port 9945 \ - --rpc-port 9933 \ + --rpc-port 9944 \ --node-key 0000000000000000000000000000000000000000000000000000000000000001 \ --validator ``` @@ -186,8 +185,7 @@ If you want to see the multi-node consensus algorithm in action, refer to --chain local \ --bob \ --port 30334 \ - --ws-port 9946 \ - --rpc-port 9934 \ + --rpc-port 9945 \ --validator \ --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp ``` diff --git a/docker-compose.yml b/docker-compose.yml index d50ab885b..c77c3a2d7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,8 +12,6 @@ services: # telemetry - 9615:9615 # rpc - - 9933:9933 - # rpc-ws - 9944:9944 # p2p - 30333:30333 diff --git a/docker/Dockerfile b/docker/Dockerfile index c3363d229..ec6e346f9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -83,8 +83,8 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/* RUN adduser --home /var/lib/duniter duniter # Configuration -# rpc, rpc-ws, p2p, telemetry -EXPOSE 9933 9944 30333 9615 +# rpc, p2p, telemetry +EXPOSE 9944 30333 9615 VOLUME /var/lib/duniter ENTRYPOINT ["docker-entrypoint"] USER duniter diff --git a/docker/README.md b/docker/README.md index 3f7791239..0110be191 100644 --- a/docker/README.md +++ b/docker/README.md @@ -16,9 +16,7 @@ services: ports: # Prometheus endpoint - 9615:9615 - # rpc via http - - 9933:9933 - # rpc via websocket + # rpc - 9944:9944 # p2p - 30333:30333 @@ -60,20 +58,21 @@ volumes: ## Environment variables | Name | Description | Default | -|------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------| +| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | | `DUNITER_NODE_NAME` | The node name. This name will appear on the Substrate telemetry server when telemetry is enabled. | Random name | | `DUNITER_CHAIN_NAME` | The currency to process. "gdev" uses the embeded chainspec. A path allows to use a local json raw chainspec. | `dev` (development mode) | | `DUNITER_PUBLIC_ADDR` | The libp2p public address base. See [libp2p documentation](https://docs.libp2p.io/concepts/fundamentals/addressing/). This variable is useful when the node is behind a reverse proxy with its ports not directly exposed.<br>Note: the `p2p/<peer_id>` part of the address shouldn't be set in this variable. It is automatically added by Duniter. | duniter-v2s guesses one from the node's IPv4 address. | -| `DUNITER_LISTEN_ADDR` | The libp2p listen address. See [libp2p documentation](https://docs.libp2p.io/concepts/fundamentals/addressing/). This variable is useful when running a validator node behind a reverse proxy, to force the P2P end point in websocket mode with:<br> `DUNITER_LISTEN_ADDR=/ip4/0.0.0.0/tcp/30333/ws` | Non validator node: `/ip4/0.0.0.0/tcp/30333/ws`<br>Validator node: `/ip4/0.0.0.0/tcp/30333` | +| `DUNITER_LISTEN_ADDR` | The libp2p listen address. See [libp2p documentation](https://docs.libp2p.io/concepts/fundamentals/addressing/). This variable is useful when running a validator node behind a reverse proxy, to force the P2P end point in websocket mode with:<br> `DUNITER_LISTEN_ADDR=/ip4/0.0.0.0/tcp/30333/ws` | Non validator node: `/ip4/0.0.0.0/tcp/30333/ws`<br>Validator node: `/ip4/0.0.0.0/tcp/30333` | | `DUNITER_RPC_CORS` | Value of the polkadot `--rpc-cors` option. | `all` | | `DUNITER_VALIDATOR` | Boolean (`true` / `false`) to run the node in validator mode. Configure the polkadot options `--validator --rpc-methods Unsafe`. | `false` | | `DUNITER_DISABLE_PROMETHEUS` | Boolean to disable the Prometheus endpoint on port 9615. | `false` | | `DUNITER_DISABLE_TELEMETRY` | Boolean to disable connecting to the Substrate telemetry server. | `false` | -| `DUNITER_PRUNING_PROFILE` | * `default`<br> * `archive`: keep all blocks and state blocks<br> * `light`: keep only last 256 state blocks and last 14400 blocks (one day duration) | `default` | +| `DUNITER_PRUNING_PROFILE` | _ `default`<br> _ `archive`: keep all blocks and state blocks<br> \* `light`: keep only last 256 state blocks and last 14400 blocks (one day duration) | `default` | ## Other Duniter options You can pass any other option to Duniter using the `command` docker-compose element: + ``` command: # workaround for substrate issue #12073 @@ -92,6 +91,7 @@ docker compose up -d ## Running duniter subcommands or custom set of options To run duniter from the command line without the default configuration detailed in the "Environment variables" section use `--` as the first argument. For example: + ``` $ docker run --rm duniter/duniter-v2s-gdev:latest -- key generate $ docker run --rm duniter/duniter-v2s-gdev:latest -- --chain gdev ... diff --git a/docs/user/nginx_reverse_proxy.md b/docs/user/nginx_reverse_proxy.md index b315cea8e..cd17455eb 100644 --- a/docs/user/nginx_reverse_proxy.md +++ b/docs/user/nginx_reverse_proxy.md @@ -1,9 +1,14 @@ - # Nginx reverse proxy example In `/etc/nginx/sites-enabled/gdev.YOUR_DOMAIN` put (you can probably do simpler): ```nginx +# see http://nginx.org/en/docs/http/websocket.html +map $http_upgrade $connection_upgrade { + default upgrade; + '' close; +} + server { server_name gdev.YOUR_DOMAIN.fr; @@ -25,15 +30,12 @@ server { proxy_set_header X-Forwarded-Port $server_port; proxy_read_timeout 90; - location /http { - proxy_pass http://localhost:9933; - proxy_http_version 1.1; - } - location /ws { + + location / { proxy_pass http://localhost:9944; proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; + proxy_set_header Connection $connection_upgrade; proxy_http_version 1.1; proxy_read_timeout 1200s; -- GitLab