Skip to content

Commit

Permalink
Configurable base image (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
phearnot committed Sep 18, 2024
1 parent 3bc5a53 commit a898b18
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 22 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
description: 'Docker tag'
required: true
type: string
baseImage:
description: 'Base image'
required: true
default: 'wavesplatform/wavesnode:1.5.7'
type: string

env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
Expand Down Expand Up @@ -50,6 +55,7 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
pull: true
build-args: baseImage=${{ inputs.baseImage }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
FROM wavesplatform/wavesnode:1.5.7
ARG baseImage=wavesplatform/wavesnode:1.5.7
FROM $baseImage
COPY target /tmp/
RUN tar zxvf /tmp/consensus-client.tgz -C $WAVES_INSTALL_PATH --strip-components=1
9 changes: 0 additions & 9 deletions docker/docker-compose-geth.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
services:
geth-init:
extends:
file: ./services/geth.yml
service: geth-init

geth:
extends:
file: ./services/geth.yml
service: geth
depends_on:
geth-init:
condition: service_completed_successfully

waves-node:
extends:
file: ./services/waves-node.yml
Expand Down
4 changes: 2 additions & 2 deletions docker/genesis-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
"difficulty": "0x0",
"excessBlobGas": null,
"extraData": "0x",
"gasLimit": "0x1000000",
"gasLimit": "0xe4e1c0",
"gasUsed": "0x0",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0",
"number": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp": "0x66E7E580"
"timestamp": "0x66eac0c0"
}
1 change: 1 addition & 0 deletions docker/services/besu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ services:
- --genesis-file=/etc/besu/genesis.json
- --data-storage-format=BONSAI
- --network-id=${NETWORK_ID}
- --target-gas-limit=15000000
volumes:
- ../genesis-${NETWORK}.json:/etc/besu/genesis.json
- ../data/secrets:/etc/secrets:ro
Expand Down
11 changes: 2 additions & 9 deletions docker/services/geth.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
services:
geth-init:
container_name: geth-init
image: ethereum/client-go:stable
entrypoint: /tmp/init-geth.sh
volumes:
- ../genesis-${NETWORK}.json:/tmp/genesis.json
- ../data/geth:/root/.ethereum
- ../init-geth.sh:/tmp/init-geth.sh
geth:
container_name: geth
image: ethereum/client-go:stable
Expand All @@ -27,9 +19,10 @@ services:
- --authrpc.addr=0.0.0.0
- --authrpc.vhosts=*
- --discovery.dns=enrtree://AIRIZFFZSCSIVHXTKA44WYZQJMR75FLTGWJ5TUNEW5IP7QKZDLBRK@${NETWORK}-nodes.unit0.dev
- --networkid=88817
- --networkid=${NETWORK_ID}
- --authrpc.jwtsecret=/etc/secrets/jwtsecret
- --nodekey=/etc/secrets/p2p-key
- --miner.gaslimit=15000000
logging:
driver: local
options:
Expand Down
3 changes: 2 additions & 1 deletion local-network/configs/ec-common/jwt-token-generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jwt_header=$(base64_url_encode '{"alg":"HS256","typ":"JWT"}')
iat=$(date +%s) # Seconds since 1970-01-01
payload=$(base64_url_encode "{\"iat\":${iat}}")

hmac_signature=$(echo -n "${jwt_header}.${payload}" | openssl dgst -sha256 -mac HMAC -macopt hexkey:"${hexsecret}" -binary | base64_url_encode)
hmac_signature_bin=$(echo -n "${jwt_header}.${payload}" | openssl dgst -sha256 -mac HMAC -macopt hexkey:"${hexsecret}" -binary)
hmac_signature=$(base64_url_encode "$hmac_signature_bin")

echo -n "${jwt_header}.${payload}.${hmac_signature}"

0 comments on commit a898b18

Please sign in to comment.