This repository was archived by the owner on Aug 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.sh
More file actions
39 lines (31 loc) · 1.4 KB
/
Copy pathscript.sh
File metadata and controls
39 lines (31 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Check if Docker is already installed
if command -v docker &> /dev/null; then
echo "Docker is already installed. Skipping installation."
else
# Download and run the Docker installation script
wget https://raw.githubusercontent.com/docker/docker-install/master/docker-install.sh -O - | sudo sh
fi
# Load environment variables from .env file
if [ -f .env ]; then
export $(grep -v '^#' .env | xargs)
fi
# Establish a host mapping path
mkdir -p /var/lib/node_bevm_test_storage
path="/var/lib/node_bevm_test_storage"
# Fetch the Docker image if not already present
if sudo docker images | grep -q "btclayer2/bevm:v0.1.1"; then
echo "Docker image btclayer2/bevm:v0.1.1 is already present. Skipping image download."
else
sudo docker pull btclayer2/bevm:v0.1.1
fi
# Run the Docker container
read -p "Enter your desired node name (or press Enter to use the default from .env): " user_node_name
node_name=${user_node_name:-$NODE_NAME}
telemetry_url=${TELEMETRY_URL:-"wss://telemetry.bevm.io/submit 0"}
echo "Running Docker container with the following parameters:"
echo "Host mapping path: $path"
echo "Node name: $node_name"
echo "Telemetry URL: $telemetry_url"
sudo docker run -d -v $path:/root/.local/share/bevm btclayer2/bevm:v0.1.1 bevm "--chain=testnet" "--name=$node_name" "--pruning=archive" --telemetry-url "$telemetry_url"
echo "Docker setup completed. Your node name is: $node_name"