Giter Site home page Giter Site logo

crypto-chemistry / threshold-statesync Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iprouteth0/threshold-statesync

0.0 0.0 0.0 18 KB

A threshold based statesync script that will automate cosmos validator storage management.

Shell 100.00%

threshold-statesync's Introduction

threshold-statesync

A threshold based statesync script that will automate cosmos validator storage management.

Installation

To prepare to install Threshold Statesync, run the following commands:

sudo su
git clone https://github.com/iprouteth0/threshold-statesync
cd threshold-statesync
chmod +x deploy.sh

Then, run the deploy.sh. The systemd argument can be passed to install using systemd service and timer files. Otherwise, crontab will be used to routinely run the scripts:

# To install with systemd files
./deploy systemd 

# To install with crontab
./deploy

For chains that require snapshots due to oracle files or wasm files not being obtained via statesync;

chmod +x deploy-snapshot.sh

# To install with systemd files
./deploy-snapshot.sh systemd

# To isntall with crontab
./deploy-snapshot.sh

Usage

Depending on the installation method, either the crontab file or the threshold-*.service files control the script behavior. Multiple arguments can be passed to configure the script to your system settings within these files.

Available Parameters

Parameter Type Required Description Default
-c, --chain String Yes The chain name (jackal, kujira, etc) None
-d, --daemon_dir String Yes The daemon directory (eg: /home/user/.canine) None
-n, --daemon_name String Yes The daemon name or full path (eg: canined or /usr/local/go/bin/canined) None
-r, --rpc String No The RPC to use as the state sync endpoint (only available if using the threshold-statesync.sh script) https://${CHAIN}-rpc.polkachu.com:443
-s, --service_file String Yes The service file that controls the daemon (eg: cosmovisor.service, canined.service, etc.) cosmovisor.service
-t, --threshold String No The % threshold full to run the statesync/snapshot at (eg: 75) 75
-u, --user String Yes The user that runs the daemon service (eg: cosmovisor) None
-v, --volume String Yes The device with the chain data (eg: /dev/sda3) None

Example systemd configuration

/etc/systemd/system/threshold-statesync.service

[Unit]
Description=Threshold Statesync Service

[Service]
Type=simple
User=root
ExecStart=/root/threshold-statesync.sh \
            -c jackal \
            -d /home/cosmovisor/.canine/ \
            -n canined \
            -r "https://jackal-rpc.polkachu.com:443" \
            -s cosmovisor.service \
            -t 75 \
            -u cosmovisor \
            -v /dev/sda3

[Install]
WantedBy=default.target

Example crontab configuration

0 * * * * /bin/bash -c "./threshold-statesync-jackal.sh -c jackal -d /home/cosmovisor/.canine/ -n canined -r 'https://jackal-rpc.polkachu.com:443' -s cosmovisor.service -t 75 -u cosmovisor -v /dev/sda3" >> ./threshold.log 2>&1

threshold-statesync's People

Contributors

iprouteth0 avatar relyte 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.