Skip to content

Commit

Permalink
Bump Node tag and remove everything related to gRPC API v1 (#67)
Browse files Browse the repository at this point in the history
Bumping Node to version 6.2.3-0 (active tag on both Mainnet and Testnet).

The original gRPC API (v1) is no longer supported by the Node. The corresponding configuration therefore no longer has any effect and has been removed. The Node Dashboard service has not been upgraded to API v2 and therefore no longer works. The build and deploy configuration for the service has therefore been removed as well.

Furthermore, the Network Dashboard has been decommissioned in favor of the [Nodes page on CCDScan](https://ccdscan.io/nodes). This page uses the endpoints of Network Dashboard related to Collector Backend (i.e. `/nodes/post` and `/nodesSummary`), so they're still available for use.
  • Loading branch information
bisgardo authored Dec 6, 2023
1 parent 842d36e commit 58a85a7
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 229 deletions.
2 changes: 1 addition & 1 deletion .M-O
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
MO_python_venv
#MO_override_var COMPOSE_PROFILES prometheus,node-dashboard
#MO_override_var COMPOSE_PROFILES prometheus
4 changes: 0 additions & 4 deletions .github/workflows/build-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ on: # yamllint disable-line rule:truthy
env:
user: bisgardo
node_image_repo: 'bisgardo/concordium-node'
node_dashboard_image_repo: 'bisgardo/concordium-node-dashboard'
node_tag: '${{ github.event.inputs.node_tag }}'
node_image_tag: '${{ github.event.inputs.node_image_tag }}'
node_dashboard_image_tag: 'node-${{ github.event.inputs.node_image_tag }}'

jobs:
build-push:
Expand All @@ -30,6 +28,4 @@ jobs:
run: |
export NODE_TAG="${{ env.node_tag }}"
export NODE_IMAGE="${{ env.node_image_repo }}:${{ env.node_image_tag }}"
export NODE_DASHBOARD_IMAGE=${{ env.node_dashboard_image_repo }}:${{ env.node_dashboard_image_tag }}
export COMPOSE_PROFILES=node-dashboard
NODE_NAME= docker-compose build && docker-compose push
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ RUN apt-get update && \
EXPOSE 8888
# Prometheus port ('concordium-node').
EXPOSE 9090
# GRPC port ('concordium-node').
EXPOSE 10000
# GRPC APIv2 port.
# GRPC API (v2) port.
EXPOSE 11000

COPY --from=build /target/bin/concordium-node /concordium-node
Expand Down
52 changes: 13 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,17 @@ To enable a given feature, append `+` followed by the name of the feature to the

The following features are available:

- [Node Dashboard](#node-dashboard): `+node-dashboard`
- [Prometheus](#metrics) (metrics): `+prometheus`
- [Transaction Logger](#transaction-logging): `+txlog`
- [Rosetta](#rosetta): `+rosetta`
- [CCDScan](#ccdscan): `+ccdscan`

*Example*

Run a node with name `<node-name>` and connected instances of Prometheus and Rosetta on network `<network>`:
Run a node with name `<node-name>` and connected instances of Prometheus and Transaction Logger on network `<network>`:

```shell
NODE_NAME=<node-name> ./run.sh <network> +prometheus +rosetta
NODE_NAME=<node-name> ./run.sh <network> +prometheus +txlog
```

## Build
Expand All @@ -56,7 +55,7 @@ due to the project's dependency on the [Haskell toolchain](https://hub.docker.co
### `concordium-node`

Dual-purpose Docker image containing the applications `concordium-node` and `node-collector`
(for reporting state to the public [dashboard](https://dashboard.mainnet.concordium.software/)).
(for reporting state to the public [dashboard](https://dashboard.mainnet.concordium.software)).
The two applications are intended to run in separate containers instantiated from this image.

The image may be build with Docker using the following command or using Docker Compose as described below:
Expand All @@ -73,7 +72,7 @@ If a branch name is used for `<tag>` (not recommended),
then the `--no-cache` flag should be set to prevent the Docker daemon from using a
previously cached clone of the source code at an older version of the branch.

The currently active tag (as of 2023-10-23) is `6.1.7-0` for both mainnet and testnet.
The currently active tag (as of 2023-12-06) is `6.2.3-0` for both Mainnet and Testnet.

*Optional*

Expand All @@ -95,60 +94,40 @@ allowing it to be passed as a simple bind mount.

To this end, the following genesis files are located in directory [`genesis`](./genesis):

- `mainnet-0.dat`: Initial genesis data for the mainnet (started on 2021-06-09; [source](https://distribution.mainnet.concordium.software/data/genesis.dat)).
- `testnet-1.dat`: Genesis data for the current testnet (started on 2022-06-13; [source](https://distribution.testnet.concordium.com/data/genesis.dat)).
- `mainnet-0.dat`: Initial genesis data for Mainnet (started on 2021-06-09; [source](https://distribution.mainnet.concordium.software/data/genesis.dat)).
- `testnet-1.dat`: Genesis data for Testnet (started on 2022-06-13; [source](https://distribution.testnet.concordium.com/data/genesis.dat)).

The directory also holds the now-unused dockerfile for the genesis image. See commit `17dde7d` for the old instructions.

### `node-dashboard`

Image containing the [`node-dashboard`](https://github.com/Concordium/concordium-node-dashboard.git) web app
for inspecting the state of a locally running node.

To enable the dashboard to communicate with the node over gRPC,
an [Envoy](https://www.envoyproxy.io/) instance must be running to proxy the data.
A working Envoy configuration is stored in [`envoy.yaml`](./node-dashboard/envoy.yaml).

Build:

```shell
docker build -t concordium-node-dashboard:<tag> --build-arg=tag=main ./node-dashboard
```

Run:

See [`docker-compose.yaml`](./docker-compose.yaml) for a working run configuration (set profile `node-dashboard` to enable).

## Build and/or run using Docker Compose

The project includes a full Docker Compose deployment for running a node and collector,
optionally along with a set of related services (each of which is enabled individually).

The main setup is configured in [`docker-compose.yaml`](./docker-compose.yaml)
and is thoroughly parameterized to work with any Concordium blockchain network.
and is thoroughly parameterized to work with any Concordium blockchain network (including unofficial ones).

It relies on features that are available only in relatively recent versions of Compose.
The `requirements.txt` file pins a compatible version (the latest v1 release at the time of this writing)
which may be installed (preferably in a [virtualenv](https://docs.python.org/3/library/venv.html))
using `pip install -r requirements.txt`.
The setup has not yet been tested with [Compose v2](https://docs.docker.com/compose/cli-command/).

To build and run a node/collector, and Node Dashboard on the mainnet network, adjust and run the following command:
To build and run a node/collector instance on Mainnet with Prometheus enabled, adjust and run the following command:

```shell
NODE_NAME=my_node \
NODE_TAG=<tag> \
DOMAIN=mainnet.concordium.software \
GENESIS_DATA_FILE=./genesis/mainnet-0.dat \
NODE_IMAGE=concordium-node:<tag> \
NODE_DASHBOARD_IMAGE=concordium-node-dashboard:node-<tag> \
COMPOSE_PROFILES=node-dashboard \
COMPOSE_PROFILES=prometheus \
docker-compose --project-name=mainnet up
```

where `<tag>` is as described above.

The variable `NODE_NAME` sets the name to be displayed on the public dashboard.
The variable `NODE_NAME` sets the name to be displayed on [CCDScan](https://ccdscan.io/nodes).

The variable `DOMAIN` determines which concrete network to join.
The publicly available official options are:
Expand All @@ -168,10 +147,6 @@ Adding `--project-name=<name>` to `docker-compose up` prepends `<name>` to the n
making it possible to switch between networks without having to delete data and existing containers.
Note that because ports are fixed, running multiple nodes at the same time is not supported with the current setup.

Enabling profile `node-dashboard` (i.e. adding `--profile=node-dashboard` or setting `COMPOSE_PROFILES=node-dashboard`)
activates a Node Dashboard instance on port `8099` (and an accompanying Envoy gRPC proxy instance)
to be started up as part of the deployment.

The command will automatically build the images from scratch if they don't already exist.
Set the flag `--no-build` to prevent that.
To only build the images without starting containers, use the command `... docker-compose build`,
Expand Down Expand Up @@ -328,16 +303,15 @@ A GitHub Actions CI job for building and pushing the images to
[a public registry](https://hub.docker.com/r/bisgardo/concordium-node) is defined in
[`./.github/workflows/build-push.yaml`](.github/workflows/build-push.yaml).

A mainnet node setup may for example be run using the Docker Compose script like so:
For example, a Mainnet node setup that includes a Prometheus instance may be run using the Docker Compose script like so:

```shell
export NODE_NAME=my_node
export DOMAIN=mainnet.concordium.software
export GENESIS_DATA_FILE=./genesis/mainnet-0.dat
export NODE_IMAGE=bisgardo/concordium-node:<tag>
export NODE_DASHBOARD_IMAGE=bisgardo/concordium-node-dashboard:<tag>
docker-compose pull # prevent 'up' from building instead of pulling
docker-compose --project-name=mainnet up --profile=node-dashboard --no-build
docker-compose --project-name=mainnet up --profile=prometheus --no-build
```

The convenience script `run.sh` loads the parameters from a `<network>.env` file:
Expand All @@ -362,7 +336,7 @@ of applying `docker-compose.override.yaml` automatically (it could still be enab
Using `run.sh`, the example above simplifies to

```shell
NODE_NAME=my_node ./run.sh mainnet +node-dashboard
NODE_NAME=my_node ./run.sh mainnet +prometheus
```

To instead enable [transaction logging](#transaction-logging), append `+txlog` and pass the DB password:
Expand Down
32 changes: 1 addition & 31 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ services:
- CONCORDIUM_NODE_CONSENSUS_DOWNLOAD_BLOCKS_FROM=https://catchup.${DOMAIN}/blocks.idx
- CONCORDIUM_NODE_CONSENSUS_GENESIS_DATA_FILE=/mnt/genesis.dat
- CONCORDIUM_NODE_CONNECTION_BOOTSTRAP_NODES=bootstrap.${DOMAIN}:8888
- CONCORDIUM_NODE_RPC_SERVER_ADDR=0.0.0.0
- CONCORDIUM_NODE_RPC_SERVER_PORT=10000
- CONCORDIUM_NODE_GRPC2_LISTEN_ADDRESS=0.0.0.0
- CONCORDIUM_NODE_GRPC2_LISTEN_PORT=11000
- CONCORDIUM_NODE_PROMETHEUS_SERVER=1
Expand All @@ -35,9 +33,8 @@ services:
- concordium
ports:
- "8888:8888" # P2P
- "10000:10000" # gRPC APIv1
- "11000:11000" # gRPC APIv2
- "9090:9090" # Prometheus (metrics)
- "11000:11000" # gRPC API (v2)
volumes:
- ${GENESIS_DATA_FILE}:/mnt/genesis.dat
- data:/mnt/data
Expand Down Expand Up @@ -71,33 +68,6 @@ services:
volumes:
- ./metrics/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- metrics:/prometheus
node-dashboard-grpc-proxy:
profiles: [node-dashboard]
image: envoyproxy/envoy:v1.23-latest
pull_policy: always
entrypoint: /usr/local/bin/envoy --config-path /etc/envoy/envoy.yaml
depends_on:
- node
networks:
- concordium
ports:
- "9901:9901" # admin
- "9999:9999" # proxy
volumes:
- ./node-dashboard/envoy.yaml:/etc/envoy/envoy.yaml:ro
node-dashboard:
profiles: [node-dashboard]
image: ${NODE_DASHBOARD_IMAGE}
depends_on:
- node-dashboard-grpc-proxy
networks:
- concordium
ports:
- "8099:80" # web
build:
context: ./node-dashboard
args:
tag: main
transaction-logger:
profiles: [txlog]
image: ${TRANSACTION_LOGGER_IMAGE}
Expand Down
5 changes: 1 addition & 4 deletions mainnet.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ COMPOSE_PROJECT_NAME=${NETWORK}
DOMAIN=${NETWORK}.concordium.software

# Node (always enabled).
NODE_VERSION=6.1.7-0_0
NODE_VERSION=6.2.3-0_2
NODE_IMAGE=bisgardo/concordium-node:${NODE_VERSION}
GENESIS_DATA_FILE=./genesis/mainnet-0.dat

# Node Dashboard (not enabled by default).
NODE_DASHBOARD_IMAGE=bisgardo/concordium-node-dashboard:node-${NODE_VERSION}

# Prometheus configuration (not enabled by default).
PROMETHEUS_IMAGE=prom/prometheus:v2.36.2

Expand Down
62 changes: 0 additions & 62 deletions node-dashboard/Dockerfile

This file was deleted.

79 changes: 0 additions & 79 deletions node-dashboard/envoy.yaml

This file was deleted.

Loading

0 comments on commit 58a85a7

Please sign in to comment.