Last active
September 16, 2021 16:56
-
-
Save kevinelliott/82d9d4217aef90de772cf60d3da2d5a5 to your computer and use it in GitHub Desktop.
Tezos Node Setup (Ubuntu 20.04, Docker, Docker Compose, Docker Swarm, Portainer)
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
#!/bin/sh | |
TEZOS_HOST_PATH="/tezos" | |
TEZOS_SNAPSHOT_URL="https://mainnet.xtz-shots.io/full" | |
mkdir -p ${TEZOS_HOST_PATH}/snapshots | |
wget -O ${TEZOS_HOST_PATH}/snapshots/full ${TEZOS_SNAPSHOT_URL} |
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
#!/bin/sh | |
TEZOS_HOST_PATH="/tezos" | |
TEZOS_VERSION="10.2" | |
docker run --rm \ | |
-v ${TEZOS_HOST_PATH}/node:/var/run/tezos/node \ | |
-v ${TEZOS_HOST_PATH}/snapshots/full:/snapshot \ | |
tezos/tezos:v${TEZOS_VERSION} tezos-snapshot-import |
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
#!/bin/bash | |
apt remove docker docker-engine docker.io containerd runc | |
apt update | |
apt install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg \ | |
lsb-release \ | |
httpie \ | |
jq | |
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | |
echo \ | |
"deb [signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
apt update | |
apt install -y docker-ce docker-ce-cli containerd.io rsync |
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
#!/bin/sh | |
PASSWORD="changeme" | |
docker volume create portainer_data | |
docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce | |
http POST :9000/api/users/admin/init Username="admin" Password="${PASSWORD}" | |
PORTAINER_TOKEN=$(http POST :9000/api/auth Username="admin" Password="${PASSWORD}" | jq --raw-output .jwt) | |
http --form POST :9000/api/endpoints "Authorization: Bearer ${PORTAINER_TOKEN}" Name="localhost" EndpointCreationType=1 |
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
#!/bin/bash | |
PASSWORD="changeme" | |
TEZOS_HOST_PATH="/tezos" | |
TEZOS_VERSION="10.2" | |
PORTAINER_TOKEN=$(http POST :9000/api/auth Username="admin" Password="${PASSWORD}" | jq --raw-output .jwt) | |
SWARM_ID=$(http GET :9000/api/endpoints/1/docker/swarm "Authorization: Bearer ${PORTAINER_TOKEN}" | jq --raw-output .ID) | |
http POST ':9000/api/stacks?method=repository&type=1&endpointId=1' \ | |
"Authorization: Bearer ${PORTAINER_TOKEN}" \ | |
SwarmID="${SWARM_ID}" \ | |
Name="tezos" \ | |
RepositoryURL="https://github.com/kevinelliott/templates" \ | |
ComposeFilePathInRepository="stacks/crypto/tezos/tezos/docker-stack.yml" |
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
#!/bin/sh | |
TEZOS_HOST_PATH="/tezos" | |
mkdir -p ${TEZOS_HOST_PATH}/node | |
chmod 777 ${TEZOS_HOST_PATH}/node |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment