diff --git a/GethNode/Dockerfile b/GethNode/Dockerfile index 46d4b9c..c38aa70 100644 --- a/GethNode/Dockerfile +++ b/GethNode/Dockerfile @@ -20,12 +20,8 @@ RUN apt-get update -y && \ apt-get install -y software-properties-common && \ add-apt-repository -y ppa:ethereum/ethereum -# Version configurations -ARG ETH_VER=1.13.4+build29068+jammy -ARG PRYSM_VER=v4.1.1 -ARG LIGHTHOUSE_VER=v4.5.0 - # Geth +ARG ETH_VER=1.13.4+build29068+jammy RUN apt-get update -y && \ apt-get install -y \ ethereum=${ETH_VER} \ @@ -35,17 +31,29 @@ RUN apt-get update -y && \ curl # Prysm +ARG PRYSM_VER=v4.1.1 RUN mkdir /opt/prysm RUN curl -L https://github.com/prysmaticlabs/prysm/raw/${PRYSM_VER}/prysm.sh \ --output /opt/prysm/prysm.sh RUN chmod 755 /opt/prysm/prysm.sh # Lighthouse +ARG LIGHTHOUSE_VER=v4.5.0 RUN mkdir /opt/lighthouse RUN curl -L https://github.com/sigp/lighthouse/releases/download/${LIGHTHOUSE_VER}/lighthouse-${LIGHTHOUSE_VER}-$(uname -m)-unknown-linux-gnu.tar.gz \ --output /opt/lighthouse/lighthouse-linux-gnu.tar.gz RUN tar -xvf /opt/lighthouse/lighthouse-linux-gnu.tar.gz -C /opt/lighthouse RUN chmod 755 /opt/lighthouse/lighthouse + +# staking-deposit-cli +ARG STAKE_CLI_VER=v2.7.0 +ARG STAKE_CLI_HASH=fdab65d +RUN mkdir /opt/staking-deposit-cli +RUN export ARCH=`uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/` && \ + curl -L https://github.com/ethereum/staking-deposit-cli/releases/download/${STAKE_CLI_VER}/staking_deposit-cli-${STAKE_CLI_HASH}-linux-${ARCH}.tar.gz \ + --output /opt/staking-deposit-cli/staking-deposit-cli.tar.gz && \ + export ARCH="" +RUN tar -xvf /opt/staking-deposit-cli/staking-deposit-cli.tar.gz --strip-components=2 -C /opt/staking-deposit-cli ################################################################################ ENV DEBIAN_FRONTEND= diff --git a/GethNode/init-geth b/GethNode/init-geth index 0e903e2..1ca4724 100755 --- a/GethNode/init-geth +++ b/GethNode/init-geth @@ -100,6 +100,31 @@ def RunConsCltLighthouse() -> subprocess.Popen: return lighthouseProc +def RunValiCltLighthouse() -> subprocess.Popen: + lighthouseAddArgs = [] + envVal = os.getenv('V_LIGHTHOUSE_OPTS', None) + if envVal is not None: + lighthouseAddArgs = shlex.split(envVal) + + lighthouseCmd = [ + '/opt/lighthouse/lighthouse', + 'validator_client', + '--beacon-nodes', 'http://localhost:5052', + ] + lighthouseAddArgs + + lighthouseEnv = { + 'PATH': os.environ.get('PATH', ''), + } + + lighthouseProc = subprocess.Popen( + lighthouseCmd, + env=lighthouseEnv, + stdout=sys.stdout, + stderr=sys.stderr + ) + return lighthouseProc + + def TerminateProc(proc: subprocess.Popen) -> None: while proc.poll() is None: proc.terminate() @@ -137,6 +162,16 @@ def main(): 'Unknown consensus client selection: {}'.format(consCltSelect) ) + valiCltSelect = os.getenv('ETH_VALI_CLT', None) + if valiCltSelect == 'lighthouse': + valiCltProc = RunValiCltLighthouse() + elif valiCltSelect is not None: + raise RuntimeError( + 'Unknown validator client selection: {}'.format(valiCltSelect) + ) + else: + print('Validator client disabled.') + # register signal handler signal.signal(signal.SIGTERM, OnTerminate) signal.signal(signal.SIGINT, OnTerminate) @@ -147,6 +182,8 @@ def main(): # terminate processes TerminateProc(consCltProc) TerminateProc(execCltProc) + if valiCltProc is not None: + TerminateProc(valiCltProc) if __name__ == '__main__':