This repository outlines the necessary steps to setup a Tezos Node, a TzKT blockchain indexer aswell as the necessary monitoring framework with Grafana and Prometheus.
Table of Contents
The infrastructure is part of a bigger project of generative art called serialCore. The scripts in this repository are regrouping the knowledge that has been acquired through experimentation and learning. It allows to setup a whole Tezos blockchain stack comprised of a non-baking node (RPC), with a blockchain indexer called TzKT and a monitoring stack to keep watch over the Docker instances.
The goal of having one's own Tezos stack is to be able to interact more freely with the blockchain, without having the limitations of the publicly accessible services. When a high load is requested, it's not rare of having slow downs or freezes on the public instances.
All credits have been added where they were due.
First and foremost step is to get either a VPS, or a dedicated server to host the Tezos Node, the TzKT blockchain indexer and the monitoring stack. Current preferred provider is Servdiscount. Recommended specifications: 8(v)Cores / 16GB RAM / 500GB+ (SSD is recommended)
Note: these steps are valid on a CentOS 7 distribution but can be reproduced with some changes on any other distro (Ubuntu, Debian...).
A general knowledge of *nix system is a prerequisite.
This script will add a few necessary things to your CentOS installation (Development tools, Docker Community Edition and Docker Compose, NTP Syncing)
Downloading and running the script (run as root/sudo):
cd ~
curl -L https://raw.githubusercontent.com/somaticbits/tezos-infra/main/CentOS-post-install.sh -o post-install.sh
chmod +x post-install.sh
./post-install.shIf this error occurs: Failed to set locale, defaulting to C, refer to this post: unixstackexchange
Once everything installed, create a new account (here tezos), add a password and grant root permissions:
adduser tezos
passwd tezos
usermod -aG wheel tezos- Clone this repository
git clone https://github.com/somaticbits/tezos-infra - Switch to the
tezos-infrafolder - Add execution permission to scripts
chmod +x install-* - Install the RPC (node)
./install-node.sh - Install TzKT
./install-tzkt.sh - Install NGINX
./install-nginx.sh - (optional) Install monitoring stack
cp .env.example .env, set the passwords in.env, then
./install-monitoring.sh
-
Node: once installed, you need to exchange the RPC Url in your wallet of choice. In Temple, open the settings and under
Network, you can set your freshly installed node. Forget about overcrowded public nodes.
If the container crashes, fire it back up withTEZOS_VERSION=TEZOS_VERSION sudo docker-compose up -din the repo folder.TEZOS_VERSIONin this case is the one defined in theconfig.shfile (example v12.0-rc1). It relies on thedocker-compose.ymlto restart the container, and will at this point restart automatically if it crashes again. -
TzKT: this part of the infrastructure allows you to use the TzKT api under your own address of choice. For more documentation, please relate to the official documentation: TzKT API Docs
-
Monitoring stack: This part can be accessed via the
MONITOR_URLvariable you set in theconfig.shfile (an example would be: https://monitor.somaticbits.xyz).
Login:admin. The password isGF_SECURITY_ADMIN_PASSWORDin your.envfile (see.env.example), which is never committed.
The RPC node is monitored via theTezosdashboard, generic container metrics can be found underDocker Prometheus Monitoringdashboard. An additional datasource has been added and can be used to access directly the PostgreSQL Database from TzKT.
Built 2022 for serialCore on CentOS 7, which reached end of life in 2024. Kept as a reference project; not maintained.
Distributed under the MIT License. See LICENSE for details.
David Pettersson - @somaticbits - david@somaticbits.com
Project Link: https://github.com/somaticbits/tezos-infra
- br0kenlink for the post-install script
- BakingBad for their blockchain indexer