release fixes (#1966)

This commit is contained in:
Ștefan Talpalaru 2020-11-07 08:46:53 +01:00 committed by GitHub
parent d2476b643a
commit bf58915500
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 80 additions and 6 deletions

View File

@ -15,6 +15,8 @@ jobs:
- name: Build project
id: build_linux
run: |
#echo "::set-output name=tag::"$(echo ${{ github.ref }} | sed 's%refs/tags/%%')
#curl -sSOL https://github.com/status-im/nimbus-eth2/archive/$(echo ${{ github.ref }} | sed 's%refs/tags/%%').tar.gz
make dist
cd dist
echo "::set-output name=linux_amd64_archive::"$(echo nimbus-eth2_Linux_amd64_*.tar.gz)
@ -28,6 +30,15 @@ jobs:
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
#- name: Upload Release Tarball
#uses: actions/upload-release-asset@v1
#env:
#GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#with:
#upload_url: ${{ steps.create_release.outputs.upload_url }}
#asset_path: ${{ steps.build_linux.outputs.tag }}.tar.gz
#asset_name: nimbus-eth2-${{ steps.build_linux.outputs.tag }}.tar.gz
#asset_content_type: application/gzip
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:

View File

@ -16,7 +16,7 @@ const
gitRevision* = staticExec("git rev-parse --short HEAD")
nimBanner* = staticExec("nim --version")
nimBanner* = staticExec("nim --version | grep -v Compiled")
versionAsStr* =
$versionMajor & "." & $versionMinor & "." & $versionBuild

19
docker/dist/README.md vendored
View File

@ -2,7 +2,7 @@
This binary distribution was created from https://github.com/status-im/nimbus-eth2
Tarball naming scheme: "nimbus-eth2\_Linux\_amd64\_<VERSION>\_<GIT COMMIT>\_<YYYYMMDDHHMMSS>.tar.gz" (the date is in UTC).
Tarball naming scheme: "nimbus-eth2\_Linux\_amd64\_<VERSION>\_<GIT COMMIT>.tar.gz".
## Reproducing the build
@ -40,3 +40,20 @@ Add arbitrary `beacon_node` parameters (yes, you can combine this with env vars)
./run_medalla_node.sh --log-level=DEBUG --rpc-port=9290
```
Use your own Infura endpoint, because the default one is probably throttled:
```bash
GOERLI_WEB3_URL="wss://goerli.infura.io/ws/v3/<YOUR PROJECT ID>" ./run_medalla_node.sh
```
## Running a mainnet node
Same conventions as the Medalla script described above, plus the requirement of specifying a Web3 URL:
```bash
# using a local Geth instance
WEB3_URL="ws://localhost:8545" ./run_mainnet_node.sh
# using Infura
WEB3_URL="wss://mainnet.infura.io/ws/v3/<YOUR PROJECT ID>" ./run_mainnet_node.sh
```

View File

@ -3,6 +3,7 @@
set -e
cd /home/user/nimbus-eth2
git config --global core.abbrev 8
BINARIES="beacon_node beacon_node_spec_0_12_3"
@ -14,11 +15,14 @@ make -j$(nproc) LOG_LEVEL="TRACE" NIMFLAGS="-d:disableMarchNative" PARTIAL_STATI
PREFIX="nimbus-eth2_Linux_amd64_"
GIT_COMMIT="$(git rev-parse --short HEAD)"
VERSION="$(./env.sh nim --verbosity:0 --hints:off --warnings:off scripts/print_version.nims)"
TIMESTAMP="$(date --utc +'%Y%m%d%H%M%S')"
DIR="${PREFIX}${VERSION}_${GIT_COMMIT}_${TIMESTAMP}"
#TIMESTAMP="$(date --utc +'%Y%m%d%H%M%S')"
DIR="${PREFIX}${VERSION}_${GIT_COMMIT}"
DIST_PATH="dist/${DIR}"
# delete old artefacts
rm -rf "dist/${PREFIX}"*.tar.gz
if [[ -d "${DIST_PATH}" ]]; then
rm -rf "${DIST_PATH}"
fi
mkdir -p "${DIST_PATH}"
# copy and checksum binaries, copy scripts and docs
@ -30,8 +34,8 @@ for BINARY in ${BINARIES}; do
cd - >/dev/null
done
sed -e "s/GIT_COMMIT/${GIT_COMMIT}/" docker/dist/README.md > "${DIST_PATH}/README.md"
cp -a scripts/makedir.sh docker/dist/run_medalla_node.sh "${DIST_PATH}/"
cp -a docs/the_nimbus_book "${DIST_PATH}/"
cp -a scripts/makedir.sh docker/dist/run_*_node.sh "${DIST_PATH}/"
#cp -a docs/the_nimbus_book "${DIST_PATH}/"
# create the tarball
cd dist

42
docker/dist/run_mainnet_node.sh vendored Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
# Copyright (c) 2020 Status Research & Development GmbH. Licensed under
# either of:
# - Apache License, version 2.0
# - MIT license
# at your option. This file may not be copied, modified, or distributed except
# according to those terms.
set -e
REL_PATH="$(dirname $0)"
# Overridable from the environment.
: ${LOG_LEVEL:="INFO"}
: ${NODE_ID:=0}
: ${NETWORK:="mainnet"}
: ${DATA_DIR:="shared_${NETWORK}_${NODE_ID}"}
: ${BASE_PORT:=9000}
: ${BASE_RPC_PORT:=9190}
# Sanity checks.
if [[ -z "${WEB3_URL}" ]]; then
echo "WEB3_URL not set in the environment. Aborting."
exit 1
fi
# Create the data directory with the proper permissions.
"${REL_PATH}"/makedir.sh "${DATA_DIR}"
# Run the beacon node.
"${REL_PATH}"/beacon_node \
--log-level="${LOG_LEVEL}" \
--log-file="${DATA_DIR}"/nbc_bn_$(date +"%Y%m%d%H%M%S").log \
--data-dir="${DATA_DIR}" \
--web3-url=${WEB3_URL} \
--tcp-port=$(( ${BASE_PORT} + ${NODE_ID} )) \
--udp-port=$(( ${BASE_PORT} + ${NODE_ID} )) \
--rpc \
--rpc-port=$(( ${BASE_RPC_PORT} +${NODE_ID} )) \
"$@"