-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #176 from chainbound/feat/sidecar/deploy-dev
feat(sidecar): quick deployment script with systemctl
- Loading branch information
Showing
10 changed files
with
127 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
# node + PBS URLs | ||
BOLT_SIDECAR_EXECUTION_API_URL=http://localhost:4485 | ||
BOLT_SIDECAR_BEACON_API_URL=http://localhost:4400 | ||
BOLT_SIDECAR_ENGINE_API_URL=http://localhost:4451 | ||
BOLT_SIDECAR_MEVBOOST_URL=http://localhost:19550 | ||
|
||
# server ports | ||
BOLT_SIDECAR_PORT=8000 | ||
BOLT_SIDECAR_MEVBOOST_PROXY_PORT=18551 | ||
|
||
# commitment limits | ||
BOLT_SIDECAR_MAX_COMMITMENTS=128 | ||
BOLT_SIDECAR_MAX_COMMITTED_GAS=10000000 | ||
|
||
# chain configs | ||
BOLT_SIDECAR_CHAIN=helder | ||
BOLT_SIDECAR_COMMITMENT_DEADLINE=8000 | ||
BOLT_SIDECAR_SLOT_TIME=12 | ||
|
||
# sidecar security configs | ||
BOLT_SIDECAR_VALIDATOR_INDEXES= | ||
BOLT_SIDECAR_JWT_HEX= | ||
BOLT_SIDECAR_FEE_RECIPIENT= | ||
BOLT_SIDECAR_BUILDER_PRIVATE_KEY= | ||
BOLT_SIDECAR_PRIVATE_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
target/ | ||
.env | ||
.env | ||
.env.dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=Bolt Sidecar Development Service | ||
After=network.target | ||
|
||
[Service] | ||
User=shared | ||
ExecStart=/usr/local/bin/bolt-sidecar | ||
Restart=on-failure | ||
EnvironmentFile=/home/shared/bolt_sidecar/.env.dev | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# This script is used to deploy the bolt_sidecar binary as a service on | ||
# our remote dev server. Requirements: | ||
# - Access to Chainbound's Tailnet dev server "remotebeast" | ||
# - A .env.dev file in the bolt_sidecar directory, filled with the necessary vars | ||
|
||
set -e | ||
|
||
# check if ".env.dev" exists. if not, exit with error | ||
test -f ./bolt-sidecar/.env.dev || (echo "No .env.dev file found. Exiting." && exit 1) | ||
|
||
# copy the files to the remote dev server | ||
rsync -av --exclude target --exclude .git ./bolt-sidecar/ shared@remotebeast:/home/shared/bolt_sidecar | ||
rsync -av ./scripts/bolt_sidecar.service shared@remotebeast:/home/shared/bolt_sidecar/bolt_sidecar.service | ||
|
||
# build the project on the remote dev server | ||
ssh shared@remotebeast "cd ~/bolt_sidecar && CC=clang ~/.cargo/bin/cargo build --release" | ||
ssh shared@remotebeast "mv ~/bolt_sidecar/target/release/bolt-sidecar /usr/local/bin/bolt-sidecar || true" | ||
ssh shared@remotebeast "cp -f ~/bolt_sidecar/bolt_sidecar.service /etc/systemd/system/bolt_sidecar.service" | ||
ssh shared@remotebeast "sudo systemctl daemon-reload && sudo systemctl enable bolt_sidecar" | ||
ssh shared@remotebeast "sudo systemctl restart bolt_sidecar" | ||
|
||
echo "Deployed bolt_sidecar successfully" |