Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable base image #16

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -39,6 +44,7 @@ jobs:
images: ${{ env.IMAGE_NAME }}
flavor: latest=false
tags: type=raw,value=${{ inputs.dockerTag }}
build-args: baseImage=${{ inputs.baseImage }}
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.licenses=MIT
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}"