diff --git a/README.md b/README.md index 2fb9d1598f4..d99b65f8681 100644 --- a/README.md +++ b/README.md @@ -108,21 +108,22 @@ else curl -o - https://downloads.csnapshots.io/mainnet/$(curl -s https://downloads.csnapshots.io/mainnet/mainnet-db-snapshot.json| jq -r .[].file_name ) | lz4 -c -d - | tar -x -C $NODE_DB mv $NODE_DB/db/* $NODE_DB/ rm -rf $NODE_DB/db + docker compose -f docker-compose-mainnet.yml up -d elif [ $NETWORK == "preprod" ] then curl -o - https://downloads.csnapshots.io/testnet/$(curl -s https://downloads.csnapshots.io/testnet/testnet-db-snapshot.json| jq -r .[].file_name ) | lz4 -c -d - | tar -x -C $NODE_DB mv $NODE_DB/db/* $NODE_DB/ rm -rf $NODE_DB/db + docker compose -f docker-compose-preprod.yml up -d elif [ $NETWORK == "sanchonet" ] - then echo "no cache for sancho"; + then + echo "no cache for sancho"; + docker compose -f docker-compose-sanchonet.yml up -d else echo "NETWORK must be mainnet or preprod or sanchonet" exit 1 fi fi - -# start the services -docker-compose up ``` diff --git a/docker-compose.yml b/docker-compose-common.yml similarity index 56% rename from docker-compose.yml rename to docker-compose-common.yml index dd275233e48..e71d928456b 100644 --- a/docker-compose.yml +++ b/docker-compose-common.yml @@ -3,10 +3,6 @@ services: cardano-node: container_name: cardano-node-on-${WALLET_PORT:-8090} - image: cardanofoundation/cardano-wallet:${WALLET_TAG} - environment: - CARDANO_NODE_SOCKET_PATH: /ipc/${NODE_SOCKET_NAME:-node.socket} - NETWORK: ${NETWORK:-preprod} volumes: - ${NODE_DB}:/data - ${NODE_SOCKET_DIR}:/ipc @@ -20,12 +16,6 @@ services: max-file: "10" max-size: "50m" entrypoint: [] - command: > - cardano-node run --topology /configs/${NETWORK}/topology.json - --database-path /data - --socket-path ${CARDANO_NODE_SOCKET_PATH} - --config /configs/${NETWORK}/config.json - +RTS -N3 cardano-wallet: container_name: cardano-wallet-on-${WALLET_PORT} @@ -37,19 +27,6 @@ services: ports: - ${WALLET_PORT}:8090 entrypoint: [] - command: | - NETWORK_OPTION=$([[ $$NETWORK == \"mainnet\" ]] && echo --mainnet \ - || echo --testnet /configs/${NETWORK}/byron-genesis.json) - cardano-wallet serve \ - --node-socket ${CARDANO_NODE_SOCKET_PATH} \ - --database /wallet-db \ - --listen-address 0.0.0.0 \ - $$NETWORK_OPTION \ - +RTS -N3 - environment: - WALLET_PORT: ${WALLET_PORT:-8090} - CARDANO_NODE_SOCKET_PATH: /ipc/${NODE_SOCKET_NAME:-node.socket} - NETWORK: ${NETWORK:-preprod} user: ${USER_ID} restart: on-failure logging: @@ -58,6 +35,9 @@ services: compress: "true" max-file: "10" max-size: "50m" + environment: + WALLET_PORT: ${WALLET_PORT:-8090} + icarus: image: piotrstachyra/icarus:v2023-04-14 container_name: icarus-on-${WALLET_PORT} diff --git a/docker-compose-mainnet.yml b/docker-compose-mainnet.yml new file mode 100644 index 00000000000..efe706aa707 --- /dev/null +++ b/docker-compose-mainnet.yml @@ -0,0 +1,34 @@ + + + +services: + cardano-node: + extends: + file: docker-compose-common.yml + service: cardano-node + image: ghcr.io/intersectmbo/cardano-node:8.9.3 + command: > + cardano-node run --topology /configs/mainnet/topology.json + --database-path /data + --socket-path /ipc/${NODE_SOCKET_NAME:-node.socket} + --config /configs/mainnet/config.json + +RTS -N3 + + cardano-wallet: + + extends: + file: docker-compose-common.yml + service: cardano-wallet + + command: > + cardano-wallet serve + --node-socket /ipc/${NODE_SOCKET_NAME:-node.socket} + --database /wallet-db + --listen-address 0.0.0.0 + --mainnet + +RTS -N3 + + icarus: + extends: + file: docker-compose-common.yml + service: icarus diff --git a/docker-compose-preprod.yml b/docker-compose-preprod.yml new file mode 100644 index 00000000000..9792cf34d2b --- /dev/null +++ b/docker-compose-preprod.yml @@ -0,0 +1,34 @@ + + + +services: + cardano-node: + extends: + file: docker-compose-common.yml + service: cardano-node + image: cardanofoundation/cardano-wallet:${WALLET_TAG} + command: > + cardano-node run --topology /configs/preprod/topology.json + --database-path /data + --socket-path /ipc/${NODE_SOCKET_NAME:-node.socket} + --config /configs/preprod/config.json + +RTS -N3 + + cardano-wallet: + + extends: + file: docker-compose-common.yml + service: cardano-wallet + + command: > + cardano-wallet serve + --node-socket /ipc/${NODE_SOCKET_NAME:-node.socket} + --database /wallet-db + --listen-address 0.0.0.0 + --testnet /configs/preprod/byron-genesis.json + +RTS -N3 + + icarus: + extends: + file: docker-compose-common.yml + service: icarus diff --git a/docker-compose-sanchonet.yml b/docker-compose-sanchonet.yml new file mode 100644 index 00000000000..91cc9800439 --- /dev/null +++ b/docker-compose-sanchonet.yml @@ -0,0 +1,35 @@ + + + +services: + cardano-node: + + extends: + file: docker-compose-common.yml + service: cardano-node + image: ghcr.io/intersectmbo/cardano-node:8.11.0-pre + command: > + cardano-node run --topology /configs/sanchonet/topology.json + --database-path /data + --socket-path /ipc/${NODE_SOCKET_NAME:-node.socket} + --config /configs/sanchonet/config.json + +RTS -N3 + + cardano-wallet: + + extends: + file: docker-compose-common.yml + service: cardano-wallet + + command: > + cardano-wallet serve + --node-socket /ipc/${NODE_SOCKET_NAME:-node.socket} + --database /wallet-db + --listen-address 0.0.0.0 + --testnet /configs/sanchonet/byron-genesis.json + +RTS -N3 + + icarus: + extends: + file: docker-compose-common.yml + service: icarus diff --git a/scripts/buildkite/release/docker-e2e.sh b/scripts/buildkite/release/docker-e2e.sh index 852f17b8bbf..fca0af9c24f 100755 --- a/scripts/buildkite/release/docker-e2e.sh +++ b/scripts/buildkite/release/docker-e2e.sh @@ -52,9 +52,10 @@ export NODE_SOCKET_NAME COMPOSE_PROJECT_NAME="e2e-tests-$WALLET_PORT" export COMPOSE_PROJECT_NAME -docker-compose down || true +dc="docker compose -f docker-compose-preprod.yml" -docker-compose up -d +${dc} down || true +${dc} up -d mkdir -p "$(pwd)/logs" @@ -88,6 +89,6 @@ nix develop -c rake wait_until_node_synced nix develop -c rake secrets_decode nix develop -c rake spec -docker-compose down +${dc} down rm -rf "$NODE_SOCKET_DIR" diff --git a/scripts/buildkite/release/docker-smoke-test.sh b/scripts/buildkite/release/docker-smoke-test.sh index ab05b78d109..a193c80b3e6 100755 --- a/scripts/buildkite/release/docker-smoke-test.sh +++ b/scripts/buildkite/release/docker-smoke-test.sh @@ -45,9 +45,10 @@ export NODE_SOCKET_NAME COMPOSE_PROJECT_NAME="docker-smoke-test-$WALLET_PORT" export COMPOSE_PROJECT_NAME -docker compose down || true +dc="docker compose -f docker-compose-preprod.yml" -docker-compose up -d +${dc} down || true +${dc} up -d n=0 while : @@ -62,15 +63,16 @@ do sleep 4 n=$((n+1)) fi - if [ "$n" -ge 30 ] + if [ "$n" -ge 10 ] then break fi done mkdir -p logs -docker-compose logs > logs/docker-compose.log -docker-compose down + +${dc} logs > logs/docker-compose.log +${dc} down rm -rf "$tmpfile"