Giter Site home page Giter Site logo

x1-validator's Introduction

Project URL: https://github.com/bok11/x1-validator

How to run

pre-requisites

windows

If you are on windows, you need to install WSL and Docker Desktop to run this project.

linux

If you are on linux, you need to install Docker and Docker Compose to run this project.

To set this up on your machine, you need to run the following commands:

DISCLAIMER: The following commands have been tested on debian 11, running on a hetzner dedicated server. If you are running a different distro, you might need to adapt the commands to your needs.

for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done
sudo apt update
sudo apt-get install ca-certificates curl gnupg

sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

sudo usermod -aG docker $(whoami)

running the project in linux

one liner

Fast and easy to run, optionally in a screen or tmux session.

mkdir x1
docker run -v x1:/home/opera bok11/x1-validator

systemd service

Running the validator as a systemd service will make sure it is always running in the background uless stopped, even after a reboot.

DATADIR=/x1
USER=$(whoami)
sudo tee /etc/systemd/system//x1-validator.service << EOF
[Unit]
Description=x1-validator

[Service]
TimeoutStartSec=0
User=$USER
Restart=always
ExecStartPre=-/usr/bin/docker exec %n stop
ExecStartPre=-/usr/bin/docker rm %n
ExecStartPre=/usr/bin/docker pull bok11/x1-validator:latest
ExecStart=/usr/bin/docker run --rm --name %n \
    -v $DATADIR:/home/opera \
    bok11/x1-validator:latest

[Install]
WantedBy=default.target
EOF

sudo systemctl enable x1-validator.service
sudo systemctl start x1-validator.service

You can check the status of the service with sudo systemctl status x1-validator.service and stop it with sudo systemctl stop x1-validator.service. To see the logs, run sudo journalctl -u x1-validator.service -f.

x1-validator's People

Contributors

bok11 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.