Configure bor params in the unit itself (#270)

This PR removes the necessity of having a startup script, less moving parts, and less files to watch.

* Distribute the cannonical genesys file with packages

As we are going to embed genesys data into the binary, this is the most close method to do it before the new CLI.

This way, each release gets tied to it's corresponding genesys file.

This establish bor repository as the source of truth for the genesys file.

* Simplify flags using defaults
This commit is contained in:
Victor Castell 2022-01-07 17:20:57 +01:00 committed by GitHub
parent 53d8947bfe
commit 8dd6f59bbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 199 additions and 8 deletions

View file

@ -84,6 +84,12 @@ nfpms:
- src: builder/files/bor.service
dst: /lib/systemd/system/bor.service
type: config
- src: builder/files/genesis-mainnet-v1.json
dst: /etc/bor/genesis-mainnet-v1.json
type: config
- src: builder/files/genesis-testnet-v4.json
dst: /etc/bor/genesis-testnet-v4.json
type: config
overrides:
rpm:
@ -103,7 +109,9 @@ dockers:
- linux-amd64
build_flag_templates:
- --platform=linux/amd64
skip_push: true
extra_files:
- builder/files/genesis-mainnet-v1.json
- builder/files/genesis-testnet-v4.json
- image_templates:
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-arm64
@ -113,8 +121,10 @@ dockers:
ids:
- linux-arm64
build_flag_templates:
- --platform=linux/arm64
skip_push: true
- --platform=linux/arm64/v8
extra_files:
- builder/files/genesis-mainnet-v1.json
- builder/files/genesis-testnet-v4.json
docker_manifests:
- name_template: 0xpolygon/{{ .ProjectName }}:{{ .Version }}

View file

@ -1,7 +1,10 @@
FROM alpine:3.14
RUN apk add --no-cache ca-certificates
RUN apk add --no-cache ca-certificates && \
mkdir -p /etc/bor
COPY bor /usr/local/bin/
COPY builder/files/genesis-mainnet-v1.json /etc/bor/
COPY builder/files/genesis-testnet-v4.json /etc/bor/
EXPOSE 8545 8546 8547 30303 30303/udp
ENTRYPOINT ["bor"]

View file

@ -6,11 +6,21 @@
[Service]
Restart=on-failure
RestartSec=5s
WorkingDirectory=$NODE_DIR
EnvironmentFile=/etc/matic/metadata
ExecStart=/usr/local/bin/bor $VALIDATOR_ADDRESS
ExecStart=/usr/local/bin/bor \
--bor-mumbai \
# --bor-mainnet \
--datadir /var/lib/bor/data \
--bootnodes "enode://0cb82b395094ee4a2915e9714894627de9ed8498fb881cec6db7c65e8b9a5bd7f2f25cc84e71e89d0947e51c76e85d0847de848c7782b13c0255247a6758178c@44.232.55.71:30303,enode://88116f4295f5a31538ae409e4d44ad40d22e44ee9342869e7d68bdec55b0f83c1530355ce8b41fbec0928a7d75a5745d528450d30aec92066ab6ba1ee351d710@159.203.9.164:30303"
# Validator params
# Uncomment and configure the following lines in case you run a validator
# --keystore /var/lib/bor/keystore \
# --unlock [VALIDATOR ADDRESS] \
# --password /var/lib/bor/password.txt \
# --allow-insecure-unlock \
# --nodiscover --maxpeers 1 \
# --mine
Type=simple
User=$USER
User=root
KillSignal=SIGINT
TimeoutStopSec=120

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long