From dedd6ff8fc482589a1af6f1b99027e14056a65d0 Mon Sep 17 00:00:00 2001 From: Ruben Buniatyan Date: Thu, 6 Jul 2023 19:38:14 +0200 Subject: [PATCH 1/6] Rename Nethermind executable --- Dockerfile | 2 +- Dockerfile.dev | 2 +- README.md | 2 +- scripts/deployment/build-runner.sh | 4 ++++ scripts/execution.sh | 4 ++-- scripts/infra.sh | 2 +- scripts/nethermind.service | 2 +- .../Nethermind.Overseer.Test/Framework/ProcessBuilder.cs | 2 +- src/Nethermind/Nethermind.Runner/Dockerfile | 2 +- src/Nethermind/Nethermind.Runner/Nethermind.Runner.csproj | 1 + 10 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index c24abab54c3..e29abaf5013 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,4 +40,4 @@ VOLUME /nethermind/nethermind_db VOLUME /nethermind/logs VOLUME /nethermind/keystore -ENTRYPOINT ["./Nethermind.Runner"] +ENTRYPOINT ["./nethermind"] diff --git a/Dockerfile.dev b/Dockerfile.dev index f5ca72a4a36..20312201f64 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -54,4 +54,4 @@ VOLUME /nethermind/nethermind_db VOLUME /nethermind/logs VOLUME /nethermind/keystore -ENTRYPOINT ["./Nethermind.Runner"] +ENTRYPOINT ["./nethermind"] diff --git a/README.md b/README.md index 545caf5ee26..f2d122b8b47 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ winget install Microsoft.VCRedist.2015+.x64 #### Install using Windows Package Manager 1. `winget install nethermind` -2. To run directly: `nethermind.runner.exe -c mainnet` \ +2. To run directly: `nethermind.exe -c mainnet` \ or with the assistant: `nethermind.launcher.exe` ### On macOS diff --git a/scripts/deployment/build-runner.sh b/scripts/deployment/build-runner.sh index 7e9016b8459..687a3878465 100755 --- a/scripts/deployment/build-runner.sh +++ b/scripts/deployment/build-runner.sh @@ -24,6 +24,10 @@ do cp -r configs $output_path/$rid mkdir $output_path/$rid/keystore + + # A temporary symlink for Linux to support existing scripts + # To be removed after a few months + [[ $rid == linux* ]] && ln -s $output_path/$rid/nethermind $output_path/$rid/Nethermind.Runner done cd .. diff --git a/scripts/execution.sh b/scripts/execution.sh index 20e333b64f1..0f10d98bb87 100644 --- a/scripts/execution.sh +++ b/scripts/execution.sh @@ -6,8 +6,8 @@ sudo chown -R $(whoami) /usr/share/nethermind opts=$@ if [ ${#opts} -gt 0 ] then - echo 'Executing Nethermind Runner' - sudo /usr/share/nethermind/Nethermind.Runner $@ + echo 'Executing Nethermind' + sudo /usr/share/nethermind/nethermind $@ else echo 'Executing Nethermind Launcher' cd /usr/share/nethermind diff --git a/scripts/infra.sh b/scripts/infra.sh index 29267d00f31..aad2014ac36 100644 --- a/scripts/infra.sh +++ b/scripts/infra.sh @@ -18,4 +18,4 @@ cp ~/$CONFIG.key ~/nethermind_$CONFIG/keystore/node.key.plain DB_PATH="/root/db/$CONFIG" echo "DB PATH: " $DB_PATH cat ~/$CONFIG.cfg | jq '.Init.BaseDbPath = "'$DB_PATH'"' | sponge ~/$CONFIG.cfg -dotnet Nethermind.Runner.dll --config ../$CONFIG.cfg +dotnet nethermind.dll -c ../$CONFIG.cfg diff --git a/scripts/nethermind.service b/scripts/nethermind.service index d073cb81ff5..64299ff780b 100644 --- a/scripts/nethermind.service +++ b/scripts/nethermind.service @@ -11,7 +11,7 @@ User=nethermind Group=nethermind EnvironmentFile=/home/nethermind/.env WorkingDirectory=/home/nethermind -ExecStart=/home/nethermind/build/Nethermind.Runner --datadir /home/nethermind/data +ExecStart=/home/nethermind/build/nethermind --datadir /home/nethermind/data Restart=on-failure LimitNOFILE=1000000 diff --git a/src/Nethermind/Nethermind.Overseer.Test/Framework/ProcessBuilder.cs b/src/Nethermind/Nethermind.Overseer.Test/Framework/ProcessBuilder.cs index 7dcfd2c6d53..c6f54e3685e 100644 --- a/src/Nethermind/Nethermind.Overseer.Test/Framework/ProcessBuilder.cs +++ b/src/Nethermind/Nethermind.Overseer.Test/Framework/ProcessBuilder.cs @@ -21,7 +21,7 @@ public NethermindProcessWrapper Create(string name, string workingDirectory, str process.Exited += ProcessOnExited; process.StartInfo.WorkingDirectory = workingDirectory; process.StartInfo.FileName = "dotnet"; - var arguments = $"Nethermind.Runner.dll --config {config} --JsonRpc.Port {httpPort} --Network.P2PPort {p2pPort} --Network.DiscoveryPort {p2pPort} --KeyStore.TestNodeKey {nodeKey}"; + var arguments = $"nethermind.dll --config {config} --JsonRpc.Port {httpPort} --Network.P2PPort {p2pPort} --Network.DiscoveryPort {p2pPort} --KeyStore.TestNodeKey {nodeKey}"; if (!string.IsNullOrEmpty(dbPath)) { arguments = $"{arguments} --baseDbPath {dbPath}"; diff --git a/src/Nethermind/Nethermind.Runner/Dockerfile b/src/Nethermind/Nethermind.Runner/Dockerfile index 6c27772f767..d70400b080f 100644 --- a/src/Nethermind/Nethermind.Runner/Dockerfile +++ b/src/Nethermind/Nethermind.Runner/Dockerfile @@ -54,4 +54,4 @@ RUN dotnet publish Nethermind.Runner.csproj -c release -o /app/publish -p:UseApp FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "Nethermind.Runner.dll"] +ENTRYPOINT ["dotnet", "nethermind.dll"] diff --git a/src/Nethermind/Nethermind.Runner/Nethermind.Runner.csproj b/src/Nethermind/Nethermind.Runner/Nethermind.Runner.csproj index ab715d37da9..4382a6e0ce4 100644 --- a/src/Nethermind/Nethermind.Runner/Nethermind.Runner.csproj +++ b/src/Nethermind/Nethermind.Runner/Nethermind.Runner.csproj @@ -4,6 +4,7 @@ net7.0 latest annotations + nethermind true false false From 0654afa664dc2c2fdfa764c772ff60b7a0150878 Mon Sep 17 00:00:00 2001 From: Ruben Buniatyan Date: Sat, 8 Jul 2023 11:35:49 +0200 Subject: [PATCH 2/6] Rename Nethermind CLI executable --- src/Nethermind/Nethermind.Cli/Nethermind.Cli.csproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Nethermind/Nethermind.Cli/Nethermind.Cli.csproj b/src/Nethermind/Nethermind.Cli/Nethermind.Cli.csproj index fca16b9b62c..f0a2b11c5bc 100644 --- a/src/Nethermind/Nethermind.Cli/Nethermind.Cli.csproj +++ b/src/Nethermind/Nethermind.Cli/Nethermind.Cli.csproj @@ -4,6 +4,7 @@ net7.0 true Exe + nethermind-cli Nethermind CLI Nethermind 1.0.0 @@ -14,7 +15,7 @@ - + From c957d4a77dc76adce200e7a9b110d98340a6e8b8 Mon Sep 17 00:00:00 2001 From: Ruben Buniatyan Date: Sat, 8 Jul 2023 12:09:06 +0200 Subject: [PATCH 3/6] Rename Nethermind Launcher executable --- .github/workflows/build-nethermind-packages.yml | 8 ++++---- .github/workflows/release.yml | 8 ++++---- Dockerfile.launcher | 4 ++-- scripts/deployment/build-launcher.sh | 2 +- scripts/execution.sh | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-nethermind-packages.yml b/.github/workflows/build-nethermind-packages.yml index bd1db5b0c83..e1d9da93b43 100644 --- a/.github/workflows/build-nethermind-packages.yml +++ b/.github/workflows/build-nethermind-packages.yml @@ -46,14 +46,14 @@ jobs: scripts/deployment/build-runner.sh $GITHUB_SHA $build_timestamp - name: Build Nethermind.Cli run: nethermind/scripts/deployment/build-cli.sh $GITHUB_SHA ${{ steps.build-runner.outputs.build-timestamp }} - - name: Build Nethermind.Launcher + - name: Build Nethermind launcher run: nethermind/scripts/deployment/build-launcher.sh - - name: Build Nethermind.Launcher for Linux arm64 + - name: Build Nethermind launcher for Linux arm64 run: | cd nethermind docker buildx build --platform=linux/arm64 -t tmp-launcher -f Dockerfile.launcher . --load - docker run --platform=linux/arm64 -v $PWD:/opt/mount --rm tmp-launcher bash -c "cp /nethermind/Nethermind.Launcher /opt/mount/" - mv Nethermind.Launcher $GITHUB_WORKSPACE/$PUB_DIR/linux-arm64/Nethermind.Launcher + docker run --platform=linux/arm64 -v $PWD:/opt/mount --rm tmp-launcher bash -c "cp /nethermind/nethermind-launcher /opt/mount/" + mv nethermind-launcher $GITHUB_WORKSPACE/$PUB_DIR/linux-arm64/nethermind-launcher - name: Archive packages env: PACKAGE_PREFIX: nethermind-preview-${{ steps.build-runner.outputs.commit-hash }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9e5a99546e9..2e627679013 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,14 +61,14 @@ jobs: $SCRIPTS_PATH/build-runner.sh $GITHUB_SHA $build_timestamp - name: Build Nethermind.Cli run: $SCRIPTS_PATH/build-cli.sh $GITHUB_SHA ${{ steps.build-runner.outputs.build-timestamp }} - - name: Build Nethermind.Launcher + - name: Build Nethermind launcher run: $SCRIPTS_PATH/build-launcher.sh - - name: Build Nethermind.Launcher for Linux arm64 + - name: Build Nethermind launcher for Linux arm64 working-directory: nethermind run: | docker buildx build --platform=linux/arm64 -t tmp-launcher -f Dockerfile.launcher . --load - docker run --platform=linux/arm64 -v $PWD:/opt/mount --rm tmp-launcher bash -c "cp /nethermind/Nethermind.Launcher /opt/mount/" - mv Nethermind.Launcher $GITHUB_WORKSPACE/$PUB_DIR/linux-arm64/Nethermind.Launcher + docker run --platform=linux/arm64 -v $PWD:/opt/mount --rm tmp-launcher bash -c "cp /nethermind/nethermind-launcher /opt/mount/" + mv nethermind-launcher $GITHUB_WORKSPACE/$PUB_DIR/linux-arm64/nethermind-launcher - name: Archive packages id: archive env: diff --git a/Dockerfile.launcher b/Dockerfile.launcher index 61f27af5986..28e45133000 100644 --- a/Dockerfile.launcher +++ b/Dockerfile.launcher @@ -9,9 +9,9 @@ RUN npm i pkg @vercel/ncc -g && \ git clone https://github.com/NethermindEth/nethermind.launcher.git && \ cd nethermind.launcher && \ npm install && \ - pkg index.js -t latest-linux-arm64 -o Nethermind.Launcher + pkg index.js -t latest-linux-arm64 -o nethermind-launcher FROM arm64v8/node AS launcher WORKDIR /nethermind -COPY --from=build /source/nethermind.launcher/Nethermind.Launcher . +COPY --from=build /source/nethermind.launcher/nethermind-launcher . diff --git a/scripts/deployment/build-launcher.sh b/scripts/deployment/build-launcher.sh index 54ce9ffa885..72b4342fa3b 100755 --- a/scripts/deployment/build-launcher.sh +++ b/scripts/deployment/build-launcher.sh @@ -4,7 +4,7 @@ set -e -app_name=Nethermind.Launcher +app_name=nethermind-launcher output_path=$GITHUB_WORKSPACE/$PUB_DIR echo "Building Nethermind Launcher" diff --git a/scripts/execution.sh b/scripts/execution.sh index 0f10d98bb87..06ddaa44c36 100644 --- a/scripts/execution.sh +++ b/scripts/execution.sh @@ -11,5 +11,5 @@ then else echo 'Executing Nethermind Launcher' cd /usr/share/nethermind - sudo /usr/share/nethermind/Nethermind.Launcher + sudo /usr/share/nethermind/nethermind-launcher fi From 6d256c8f4c0c064d92bd46ad558f99ace0ed2c7f Mon Sep 17 00:00:00 2001 From: Ruben Buniatyan Date: Sat, 8 Jul 2023 19:25:18 +0200 Subject: [PATCH 4/6] Shorten CLI option --- scripts/nethermind.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/nethermind.service b/scripts/nethermind.service index 64299ff780b..c51eda62f2d 100644 --- a/scripts/nethermind.service +++ b/scripts/nethermind.service @@ -11,7 +11,7 @@ User=nethermind Group=nethermind EnvironmentFile=/home/nethermind/.env WorkingDirectory=/home/nethermind -ExecStart=/home/nethermind/build/nethermind --datadir /home/nethermind/data +ExecStart=/home/nethermind/build/nethermind -dd /home/nethermind/data Restart=on-failure LimitNOFILE=1000000 From 8cc73eeebca421b79706244f8905d6ce25f30dce Mon Sep 17 00:00:00 2001 From: Ruben Buniatyan Date: Sun, 23 Jul 2023 16:15:19 +0200 Subject: [PATCH 5/6] Revert README --- README.md | 2 +- .../Nethermind.Overseer.Test/Framework/ProcessBuilder.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b5d93209124..80bf4b60c8e 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ winget install Microsoft.VCRedist.2015+.x64 #### Install using Windows Package Manager 1. `winget install nethermind` -2. To run directly: `nethermind.exe -c mainnet` \ +2. To run directly: `nethermind.runner.exe -c mainnet` \ or with the assistant: `nethermind.launcher.exe` ### On macOS diff --git a/src/Nethermind/Nethermind.Overseer.Test/Framework/ProcessBuilder.cs b/src/Nethermind/Nethermind.Overseer.Test/Framework/ProcessBuilder.cs index c6f54e3685e..7e514d9b89d 100644 --- a/src/Nethermind/Nethermind.Overseer.Test/Framework/ProcessBuilder.cs +++ b/src/Nethermind/Nethermind.Overseer.Test/Framework/ProcessBuilder.cs @@ -21,10 +21,10 @@ public NethermindProcessWrapper Create(string name, string workingDirectory, str process.Exited += ProcessOnExited; process.StartInfo.WorkingDirectory = workingDirectory; process.StartInfo.FileName = "dotnet"; - var arguments = $"nethermind.dll --config {config} --JsonRpc.Port {httpPort} --Network.P2PPort {p2pPort} --Network.DiscoveryPort {p2pPort} --KeyStore.TestNodeKey {nodeKey}"; + var arguments = $"nethermind.dll -c {config} --JsonRpc.Port {httpPort} --Network.P2PPort {p2pPort} --Network.DiscoveryPort {p2pPort} --KeyStore.TestNodeKey {nodeKey}"; if (!string.IsNullOrEmpty(dbPath)) { - arguments = $"{arguments} --baseDbPath {dbPath}"; + arguments = $"{arguments} -d {dbPath}"; } if (!string.IsNullOrEmpty(bootnode)) From b6d214cc9f162582ac8a58a6abfba4befce82600 Mon Sep 17 00:00:00 2001 From: Ruben Buniatyan Date: Sun, 23 Jul 2023 21:47:45 +0200 Subject: [PATCH 6/6] Fix symlink --- scripts/deployment/archive-packages.sh | 4 ++-- scripts/deployment/build-runner.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/deployment/archive-packages.sh b/scripts/deployment/archive-packages.sh index 2321847e8b7..f4bc2814c1a 100755 --- a/scripts/deployment/archive-packages.sh +++ b/scripts/deployment/archive-packages.sh @@ -10,8 +10,8 @@ cd $GITHUB_WORKSPACE mkdir $PACKAGE_DIR cd $PUB_DIR -cd linux-x64 && zip -r $GITHUB_WORKSPACE/$PACKAGE_DIR/$PACKAGE_PREFIX-linux-x64.zip . && cd .. -cd linux-arm64 && zip -r $GITHUB_WORKSPACE/$PACKAGE_DIR/$PACKAGE_PREFIX-linux-arm64.zip . && cd .. +cd linux-x64 && zip -r -y $GITHUB_WORKSPACE/$PACKAGE_DIR/$PACKAGE_PREFIX-linux-x64.zip . && cd .. +cd linux-arm64 && zip -r -y $GITHUB_WORKSPACE/$PACKAGE_DIR/$PACKAGE_PREFIX-linux-arm64.zip . && cd .. cd win-x64 && zip -r $GITHUB_WORKSPACE/$PACKAGE_DIR/$PACKAGE_PREFIX-windows-x64.zip . && cd .. cd osx-x64 && zip -r $GITHUB_WORKSPACE/$PACKAGE_DIR/$PACKAGE_PREFIX-macos-x64.zip . && cd .. cd osx-arm64 && zip -r $GITHUB_WORKSPACE/$PACKAGE_DIR/$PACKAGE_PREFIX-macos-arm64.zip . && cd .. diff --git a/scripts/deployment/build-runner.sh b/scripts/deployment/build-runner.sh index 687a3878465..9a12be89506 100755 --- a/scripts/deployment/build-runner.sh +++ b/scripts/deployment/build-runner.sh @@ -25,9 +25,9 @@ do cp -r configs $output_path/$rid mkdir $output_path/$rid/keystore - # A temporary symlink for Linux to support existing scripts + # A temporary symlink for Linux to support existing scripts if any # To be removed after a few months - [[ $rid == linux* ]] && ln -s $output_path/$rid/nethermind $output_path/$rid/Nethermind.Runner + [[ $rid == linux* ]] && ln -s -r $output_path/$rid/nethermind $output_path/$rid/Nethermind.Runner done cd ..