Skip to content

Commit

Permalink
changed way command gets passed in and updated infrastructure files
Browse files Browse the repository at this point in the history
revved dockerfile go version to 1.20
  • Loading branch information
robertlincecum committed Jun 16, 2023
1 parent 927e152 commit 415ddbe
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 131 deletions.
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG VERSION=""
ARG BUILDNUM=""

# Build Quai in a stock Go builder container
FROM golang:1.19-alpine as builder
FROM golang:1.20-alpine as builder
RUN apk add --no-cache gcc musl-dev linux-headers git

ADD . /go-quai
Expand All @@ -14,7 +14,7 @@ WORKDIR /go-quai
RUN env GO111MODULE=on go run build/ci.go install ./cmd/go-quai

# Stage 2
FROM golang:1.19-alpine
FROM golang:1.20-alpine

EXPOSE 8546 8547 30303 30303/udp
EXPOSE 8578 8579 30304 30304/udp
Expand All @@ -32,7 +32,6 @@ EXPOSE 8678 8679 30315 30315/udp

COPY --from=builder /go-quai/build/bin ./build/bin
COPY --from=builder /go-quai/VERSION ./VERSION
COPY --from=builder /go-quai/genallocs ./genallocs

WORKDIR ./

CMD ./build/bin/go-quai --$NETWORK --syncmode full --http --http.vhosts="*" --ws --mine --miner.threads 1 --miner.etherbase $COINBASE_ADDR --http.addr 0.0.0.0 --http.api eth,net,web3,quai,txpool,debug --ws.addr 0.0.0.0 --ws.api eth,net,web3,quai,txpool,debug --port $TCP_PORT --http.port $HTTP_PORT --ws.port $WS_PORT --ws.origins="*" --http.corsdomain="*" --gcmode archive $BOOTNODE $REGION $ZONE $SUB $DOM
123 changes: 42 additions & 81 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,61 @@
networks:
go-quai_default:
external: true
services:
prime:
env_file:
- network.env
environment:
- TCP_PORT=30303
- HTTP_PORT=8547
- WS_PORT=8548
- NETWORK=garden
- SUB=--sub.urls ws://cyprus:8579,ws://paxos:8581,ws://hydra:8583
- COINBASE_ADDR=0x00114a47a5d39ea2022dd4d864cb62cfd16879fc
- HTTP_PORT=8546
- WS_PORT=8547
build: .
command: sh -c './build/bin/go-quai --$$NETWORK --slices "$$SLICES" --syncmode full --http --http.vhosts=* --ws --http.addr 0.0.0.0 --http.api eth,net,web3,quai,txpool,debug --ws.addr 0.0.0.0 --ws.api eth,net,web3,quai,txpool,debug --port $$TCP_PORT --http.port $$HTTP_PORT --ws.port $$WS_PORT --ws.origins=* --http.corsdomain=* --gcmode archive --nonce $$NONCE --sub.urls ws://cyprus:8579,ws://paxos:8581,ws://hydra:8583'
ports:
- "30303"
- "8547"
- "8548"
volumes:
- ~/.quai:/root/.quai

networks:
- go-quai_default
cyprus:
env_file:
- network.env
environment:
- TCP_PORT=30304
- HTTP_PORT=8578
- WS_PORT=8579
- NETWORK=garden
- REGION=--region 0
- DOM=--dom.url ws://prime:8548
- SUB=--sub.urls ws://cyprus1:8611,ws://cyprus2:8643,ws://cyprus3:8675
- COINBASE_ADDR=0x0d79b69c082e6f6a2e78a10a9a49baedb7db37a5
build: .
command: sh -c './build/bin/go-quai --$$NETWORK --slices "$$SLICES" --syncmode full --http --http.vhosts=* --ws --http.addr 0.0.0.0 --http.api eth,net,web3,quai,txpool,debug --ws.addr 0.0.0.0 --ws.api eth,net,web3,quai,txpool,debug --port $$TCP_PORT --http.port $$HTTP_PORT --ws.port $$WS_PORT --ws.origins=* --http.corsdomain=* --gcmode archive --nonce $$NONCE --region 0 --sub.urls ws://cyprus1:8611,ws://cyprus2:8643,ws://cyprus3:8675 --dom.url ws://prime:8547'
ports:
- "30304"
- "8578"
- "8579"
volumes:
- ~/.quai:/root/.quai

networks:
- go-quai_default
paxos:
env_file:
- network.env
environment:
- TCP_PORT=30305
- HTTP_PORT=8580
- WS_PORT=8581
- NETWORK=garden
- REGION=--region 1
- DOM=--dom.url ws://prime:8548
- SUB=--sub.urls ws://paxos1:8613,ws://paxos2:8645,ws://paxos3:8677
- COINBASE_ADDR=0x5a457339697cb56e5a9bfa5267ea80d2c6375d98
build: .
command: sh -c './build/bin/go-quai --$$NETWORK --slices "$$SLICES" --syncmode full --http --http.vhosts=* --ws --http.addr 0.0.0.0 --http.api eth,net,web3,quai,txpool,debug --ws.addr 0.0.0.0 --ws.api eth,net,web3,quai,txpool,debug --port $$TCP_PORT --http.port $$HTTP_PORT --ws.port $$WS_PORT --ws.origins=* --http.corsdomain=* --gcmode archive --nonce $$NONCE --region 1 --sub.urls ws://paxos1:8613,ws://paxos2:8645,ws://paxos3:8677 --dom.url ws://prime:8547'
ports:
- "30305"
- "8580"
- "8581"
volumes:
- ~/.quai:/root/.quai
networks:
- go-quai_default

hydra:
env_file:
- network.env
environment:
- TCP_PORT=30306
- HTTP_PORT=8582
- WS_PORT=8583
- NETWORK=garden
- REGION=--region 2
- DOM=--dom.url ws://prime:8548
- SUB=--sub.urls ws://hydra1:8615,ws://hydra2:8647,ws://hydra3:8679
- COINBASE_ADDR=0x3bccbe6c6001c46874263169df887cbf5c3580d6
build: .
command: sh -c './build/bin/go-quai --$$NETWORK --slices "$$SLICES" --syncmode full --http --http.vhosts=* --ws --http.addr 0.0.0.0 --http.api eth,net,web3,quai,txpool,debug --ws.addr 0.0.0.0 --ws.api eth,net,web3,quai,txpool,debug --port $$TCP_PORT --http.port $$HTTP_PORT --ws.port $$WS_PORT --ws.origins=* --http.corsdomain=* --gcmode archive --nonce $$NONCE --region 2 --sub.urls ws://hydra1:8615,ws://hydra2:8647,ws://hydra3:8679 --dom.url ws://prime:8547'
ports:
- "30306"
- "8582"
Expand All @@ -78,156 +64,134 @@ services:
- ~/.quai:/root/.quai

cyprus1:
env_file:
- network.env
environment:
- TCP_PORT=30307
- HTTP_PORT=8610
- WS_PORT=8611
- NETWORK=garden
- REGION=--region 0
- ZONE=--zone 0
- DOM=--dom.url ws://cyprus:8579
- COINBASE_ADDR=0x1b00Fbd0eB8116704a1796A008DAecc14eb5a92e
build: .
command: sh -c './build/bin/go-quai --$$NETWORK --slices "$$SLICES" --syncmode full --http --http.vhosts=* --ws --miner.etherbase $$COINBASE_ADDR --http.addr 0.0.0.0 --http.api eth,net,web3,quai,txpool,debug --ws.addr 0.0.0.0 --ws.api eth,net,web3,quai,txpool,debug --port $$TCP_PORT --http.port $$HTTP_PORT --ws.port $$WS_PORT --ws.origins=* --http.corsdomain=* --gcmode archive --nonce $$NONCE --region 0 --zone 0 --dom.url ws://cyprus:8579'
ports:
- "30307"
- "8610"
- "8611"
volumes:
- ~/.quai:/root/.quai

networks:
- go-quai_default
cyprus2:
env_file:
- network.env
environment:
- TCP_PORT=30308
- HTTP_PORT=8542
- WS_PORT=8643
- NETWORK=garden
- REGION=--region 0
- ZONE=--zone 1
- DOM=--dom.url ws://cyprus:8579
- COINBASE_ADDR=0x246ae82bb49e9dda583cb5fd304fd31cc1b69790
build: .
command: sh -c './build/bin/go-quai --$$NETWORK --slices "$$SLICES" --syncmode full --http --http.vhosts=* --ws --miner.etherbase $$COINBASE_ADDR --http.addr 0.0.0.0 --http.api eth,net,web3,quai,txpool,debug --ws.addr 0.0.0.0 --ws.api eth,net,web3,quai,txpool,debug --port $$TCP_PORT --http.port $$HTTP_PORT --ws.port $$WS_PORT --ws.origins=* --http.corsdomain=* --gcmode archive --nonce $$NONCE --region 0 --zone 1 --dom.url ws://cyprus:8579'
ports:
- "30308"
- "8542"
- "8642"
volumes:
- ~/.quai:/root/.quai

networks:
- go-quai_default
cyprus3:
env_file:
- network.env
environment:
- TCP_PORT=30309
- HTTP_PORT=8674
- WS_PORT=8675
- NETWORK=garden
- REGION=--region 0
- ZONE=--zone 2
- DOM=--dom.url ws://cyprus:8579
- COINBASE_ADDR=0x2e82bec9c7e47564b9e89b5ab989c0002373c497
build: .
command: sh -c './build/bin/go-quai --$$NETWORK --slices "$$SLICES" --syncmode full --http --http.vhosts=* --ws --miner.etherbase $$COINBASE_ADDR --http.addr 0.0.0.0 --http.api eth,net,web3,quai,txpool,debug --ws.addr 0.0.0.0 --ws.api eth,net,web3,quai,txpool,debug --port $$TCP_PORT --http.port $$HTTP_PORT --ws.port $$WS_PORT --ws.origins=* --http.corsdomain=* --gcmode archive --nonce $$NONCE --region 0 --zone 2 --dom.url ws://cyprus:8579'
ports:
- "30309"
- "8674"
- "8675"
volumes:
- ~/.quai:/root/.quai

networks:
- go-quai_default
paxos1:
env_file:
- network.env
environment:
- TCP_PORT=30310
- HTTP_PORT=8512
- WS_PORT=8613
- NETWORK=garden
- REGION=--region 1
- ZONE=--zone 0
- DOM=--dom.url ws://paxos:8581
- COINBASE_ADDR=0x421bc7323295c6b7f2f75fc4c854d4fb600e69e7
build: .
command: sh -c './build/bin/go-quai --$$NETWORK --slices "$$SLICES" --syncmode full --http --http.vhosts=* --ws --miner.etherbase $$COINBASE_ADDR --http.addr 0.0.0.0 --http.api eth,net,web3,quai,txpool,debug --ws.addr 0.0.0.0 --ws.api eth,net,web3,quai,txpool,debug --port $$TCP_PORT --http.port $$HTTP_PORT --ws.port $$WS_PORT --ws.origins=* --http.corsdomain=* --gcmode archive --nonce $$NONCE --region 1 --zone 0 --dom.url ws://paxos:8581'
ports:
- "30310"
- "8512"
- "8613"
volumes:
- ~/.quai:/root/.quai

networks:
- go-quai_default
paxos2:
env_file:
- network.env
environment:
- TCP_PORT=30311
- HTTP_PORT=8544
- WS_PORT=8645
- NETWORK=garden
- REGION=--region 1
- ZONE=--zone 1
- DOM=--dom.url ws://paxos:8581
- COINBASE_ADDR=0x4d6605da9271f8bcea42326a07f3c43f7f67a431
build: .
command: sh -c './build/bin/go-quai --$$NETWORK --slices "$$SLICES" --syncmode full --http --http.vhosts=* --ws --miner.etherbase $$COINBASE_ADDR --http.addr 0.0.0.0 --http.api eth,net,web3,quai,txpool,debug --ws.addr 0.0.0.0 --ws.api eth,net,web3,quai,txpool,debug --port $$TCP_PORT --http.port $$HTTP_PORT --ws.port $$WS_PORT --ws.origins=* --http.corsdomain=* --gcmode archive --nonce $$NONCE --region 1 --zone 1 --dom.url ws://paxos:8581'
ports:
- "30311"
- "8544"
- "8645"
volumes:
- ~/.quai:/root/.quai

networks:
- go-quai_default
paxos3:
env_file:
- network.env
environment:
- TCP_PORT=30312
- HTTP_PORT=8576
- WS_PORT=8677
- NETWORK=garden
- REGION=--region 1
- ZONE=--zone 2
- DOM=--dom.url ws://paxos:8581
- COINBASE_ADDR=0x59630c586ede320c8d7759f38373564f5f9faf20
build: .
command: sh -c './build/bin/go-quai --$$NETWORK --slices "$$SLICES" --syncmode full --http --http.vhosts=* --ws --miner.etherbase $$COINBASE_ADDR --http.addr 0.0.0.0 --http.api eth,net,web3,quai,txpool,debug --ws.addr 0.0.0.0 --ws.api eth,net,web3,quai,txpool,debug --port $$TCP_PORT --http.port $$HTTP_PORT --ws.port $$WS_PORT --ws.origins=* --http.corsdomain=* --gcmode archive --nonce $$NONCE --region 1 --zone 2 --dom.url ws://paxos:8581'
ports:
- "30312"
- "8576"
- "8677"
volumes:
- ~/.quai:/root/.quai

networks:
- go-quai_default
hydra1:
env_file:
- network.env
environment:
- TCP_PORT=30313
- HTTP_PORT=8614
- WS_PORT=8615
- NETWORK=garden
- REGION=--region 2
- ZONE=--zone 0
- DOM=--dom.url ws://hydra:8583
- COINBASE_ADDR=0x6b70b802661a87823a9cb16a8a39763bc8e11de4
build: .
command: sh -c './build/bin/go-quai --$$NETWORK --slices "$$SLICES" --syncmode full --http --http.vhosts=* --ws --miner.etherbase $$COINBASE_ADDR --http.addr 0.0.0.0 --http.api eth,net,web3,quai,txpool,debug --ws.addr 0.0.0.0 --ws.api eth,net,web3,quai,txpool,debug --port $$TCP_PORT --http.port $$HTTP_PORT --ws.port $$WS_PORT --ws.origins=* --http.corsdomain=* --gcmode archive --nonce $$NONCE --region 2 --zone 0 --dom.url ws://hydra:8583'
ports:
- "30313"
- "8614"
- "8615"
volumes:
- ~/.quai:/root/.quai

networks:
- go-quai_default
hydra2:
env_file:
- network.env
environment:
- TCP_PORT=30314
- HTTP_PORT=8646
- WS_PORT=8647
- NETWORK=garden
- REGION=--region 2
- ZONE=--zone 1
- DOM=--dom.url ws://hydra:8583
- COINBASE_ADDR=0x70820eb5e384b65caf931e85224601f3203ecd20
build: .
command: sh -c './build/bin/go-quai --$$NETWORK --slices "$$SLICES" --syncmode full --http --http.vhosts=* --ws --miner.etherbase $$COINBASE_ADDR --http.addr 0.0.0.0 --http.api eth,net,web3,quai,txpool,debug --ws.addr 0.0.0.0 --ws.api eth,net,web3,quai,txpool,debug --port $$TCP_PORT --http.port $$HTTP_PORT --ws.port $$WS_PORT --ws.origins=* --http.corsdomain=* --gcmode archive --nonce $$NONCE --region 2 --zone 1 --dom.url ws://hydra:8583'
ports:
- "30314"
- "8646"
Expand All @@ -236,22 +200,19 @@ services:
- ~/.quai:/root/.quai

hydra3:
env_file:
- network.env
environment:
- TCP_PORT=30315
- HTTP_PORT=8678
- WS_PORT=8679
- NETWORK=garden
- REGION=--region 2
- ZONE=--zone 2
- DOM=--dom.url ws://hydra:8583
- COINBASE_ADDR=0x7f8a6306426b57d13f1e3975d377574e18d7a7a3
build: .
command: sh -c './build/bin/go-quai --$$NETWORK --slices "$$SLICES" --syncmode full --http --http.vhosts=* --ws --miner.etherbase $$COINBASE_ADDR --http.addr 0.0.0.0 --http.api eth,net,web3,quai,txpool,debug --ws.addr 0.0.0.0 --ws.api eth,net,web3,quai,txpool,debug --port $$TCP_PORT --http.port $$HTTP_PORT --ws.port $$WS_PORT --ws.origins=* --http.corsdomain=* --gcmode archive --nonce $$NONCE --region 2 --zone 2 --dom.url ws://hydra:8583'
ports:
- "30315"
- "8678"
- "8679"
volumes:
- ~/.quai:/root/.quai

networks:
- go-quai_default
1 change: 1 addition & 0 deletions helm/env/quai-dev.values.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
goQuai:
env: "quai-dev"
slices: "\"[0 0],[0 1],[0 2],[1 0],[1 1],[1 2],[2 0],[2 1],[2 2]\""
1 change: 1 addition & 0 deletions helm/env/quai-prod.values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
goQuai:
env: "quai-prod"
network: "colosseum"
slices: "\"[0 0],[0 1],[0 2],[1 0],[1 1],[1 2],[2 0],[2 1],[2 2]\""
2 changes: 2 additions & 0 deletions helm/env/quai-sandbox.values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
goQuai:
env: "quai-sandbox"
network: "colosseum"
slices: "\"[0 0],[0 1],[0 2],[1 0],[1 1],[1 2],[2 0],[2 1],[2 2]\""


16 changes: 8 additions & 8 deletions helm/templates/_statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@
- image: {{ .Values.goQuai.image.name -}}:{{- .Values.goQuai.image.version }}
imagePullPolicy: Always
name: prime-go-quai
command: ["./build/bin/go-quai", --$(NETWORK), "--slices", $(SLICES)", "--syncmode", "full", "--http", "--http.vhosts=*", "--ws", <MINER_ETHERBASE>, "--http.addr", "0.0.0.0", "--http.api", "eth,net,web3,quai,txpool,debug", "--ws.addr", "0.0.0.0", "--ws.api", "eth,net,web3,quai,txpool,debug", "--port", $(TCP_PORT), "--http.port", $(HTTP_PORT), "--ws.port", $(WS_PORT), "--ws.origins=*", "--http.corsdomain=*", "--gcmode", "archive", "--nonce", $(NONCE), <REGION>, <ZONE>, <SUB>, <DOM>]
env:
- name: COINBASE_ADDR
valueFrom:
secretKeyRef:
name: {{ include "go-quai.name" $ }}
key: PRIME_COINBASE_ADDR
- name: NONCE
valueFrom:
secretKeyRef:
name: {{ include "go-quai.name" $ }}
key: NONCE
- name: TCP_PORT
value: "<DISC>"
- name: HTTP_PORT
Expand All @@ -30,14 +36,8 @@
value: "<WS>"
- name: NETWORK
value: {{ .Values.goQuai.network }}
- name: REGION
value: "<REGION>"
- name: ZONE
value: "<ZONE>"
- name: DOM
value: "<DOM>"
- name: SUB
value: "<SUB>"
- name: SLICES
value: {{ .Values.goQuai.slices }}
ports:
- containerPort: <HTTP>
name: prime-http
Expand Down
9 changes: 8 additions & 1 deletion helm/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,15 @@ spec:
app: {{ $name }}
spec:
containers:
{{- $root := . -}}
{{- range $chain := .Values.goQuai.chains }}
{{ include "go-quai.statefulset" $ | replace "<REGION>" $chain.region | replace "<ZONE>" $chain.zone | replace "<DOM>" $chain.dom | replace "<SUB>" $chain.sub | replace "<HTTP>" $chain.ports.http | replace "<WS>" $chain.ports.ws | replace "<DISC>" $chain.ports.disc | replace "prime" $chain.name | replace "PRIME" ($chain.name | upper) | indent 6 }}
{{- $minerEtherbase := ternary (printf "\"--miner.etherbase\", %s, " "$(COINBASE_ADDR)") "" (regexMatch "[0-9]$" $chain.name) }}
{{/*{{- $minerEtherbase := ternary "\"--miner.etherbase\", '${COINBASE_ADDR}', " "" (regexMatch "[0-9]$" $chain.name) }}*/}}
{{- $region := ternary (printf ", \"--region\", %s" ($chain.region | quote)) "" (ne (len (toString $chain.region)) 0)}}
{{- $zone := ternary (printf ", \"--zone\", %s" ($chain.zone | quote)) "" (ne (len (toString $chain.zone)) 0) }}
{{- $sub := ternary (printf ", \"--sub.urls\", %s" ($chain.sub | quote)) "" (ne (len (toString $chain.sub)) 0) }}
{{- $dom := ternary (printf ", \"--dom.url\", %s" ($chain.dom | quote)) "" (ne (len (toString $chain.dom)) 0) }}
{{ include "go-quai.statefulset" $ | replace "<HTTP>" $chain.ports.http | replace "<WS>" $chain.ports.ws | replace "<DISC>" $chain.ports.disc | replace "prime" $chain.name | replace "PRIME" ($chain.name | upper) | replace "<MINER_ETHERBASE>, " $minerEtherbase | replace ", <REGION>" $region | replace ", <ZONE>" $zone | replace ", <SUB>" $sub | replace ", <DOM>" $dom | indent 6 }}
{{- end }}
volumeClaimTemplates:
- apiVersion: v1
Expand Down
Loading

0 comments on commit 415ddbe

Please sign in to comment.