powered by NexuSecurus™
Supported HW | Target OS | Code Stats | Audience | Type | Dependencies | License |
---|---|---|---|---|---|---|
SNAPMaker simplifies the snapshot management process within the Cosmos Ecosystem. Operating locally, it requires pre-installed blockchain chains, even if they're not actively running. Once initiated, SNAPMaker systematically processes each chain, generating snapshots relying on external RPCs and P2P Endpoints, without the need for active node interaction. This unique approach allows a single machine to handle snapshot creation for multiple chains, without disrupting existing infrastructure. By automating tasks like resetting, syncing, compressing, and transferring blockchain data to remote servers, SNAPMaker ensures that users can effortlessly maintain current snapshots with minimal intervention. Moreover, its compatibility with tools like crontab enables scheduled execution, seamlessly integrating snapshot management into existing workflows.
Automated Snapshot Creation - Streamlines the process of creating blockchain snapshots by automating essential tasks such as resetting blockchain data, syncing to the latest block, compressing data, and copying snapshots, addressbook and genesis files to remote servers.
Chain Configuration File - Users can easily configure multiple blockchain networks within the chains.conf file, allowing SNAPMAKER to handle snapshots for various chains simultaneously.
Remote Server Support - Seamlessly integrates with remote servers, enabling users to store their blockchain snapshots securely off-site. It provides options to specify remote server details such as hostname, port, and SSH key for efficient snapshot transfer.
JSON Metrics Generator - Generates JSON metrics containing vital information about each snapshot, including chain name, snapshot size, checksum, sync status, and download URLs. These metrics facilitate easy tracking, auditing of snapshots and integrate their info with your website.
- Cosmos Ecosystem SNAPMaker
- Ubuntu based Linux OS (We recommend Ubuntu Server Minimized, to avoid unnecessary software cluttering)
- 2 vCPUs Minimum for Nodes (4 vCPUs recommended or more)
- 6GB RAM Minimum for Nodes (we recommend 8GB RAM or more)
- 60GB to 500GB Disk Space (Depending on Node Type, and Pruning Strategy)
- Internet Connection ;
- Installed NODE of the Chain you want to Snapshot in the local system.
- A reachable RPC endpoint for the Chain
- A reachable P2P endpoint for the Chain
All dependencies and required packages for the correct execution of this program, will be installed when the script is executed for the first time. - ncat - curl - rsync - openssh-server
Clone this repository to your machine using the following commands:
git clone https://github.com/nexusecurus/cosmossnapman.git
For the script to be executed, you must add execution permission to the file:
chmod +x snapmaker.sh
Open the [chains.conf](/vars/chains.conf) file under [vars](/vars/), and edit the VARIABLES that match your chain specifications, such as:
Example:
- CHAIN_NAME = The name of the Chain
- HOME_DIR = Path where Chain files are located
- STATE_SYNC_RPC = The URL of the RPC server you want to use.
- STATE_SYNC_PEER = The NodeID@URL:PORT of the P2P server you want to use.
- BIN_NAME = Binary name of the Chain.
- SERVICE_NAME = The name of the service your chain is configured to use.
- RPC_PORT = The RPC por of the localhost node, to verify when state reaches synced.
Open the [remote.conf](/vars/remote.conf) file under [vars](/vars/), and edit the VARIABLES that match your REMOTE HOST info, such as:
Example:
- NOTIFY="username" -> Will notify user, to internal mail. If postfix is installed along with proper ALIASES and SMTP_HEADERS, variable can be an email.
- DEST_DIR="/var/www/snapshots.nexusecurus.com/public_html" -> Folder location where snapshots will copied to.
- REMOTE_HOST="username@hostname" -> Can be username@hostname, username@ip or if you want to copy files to local filesystem use username@localhost.
- SSH_KEY="~/.ssh/ssh_private-key" -> SSH Private Key to access REMOTE_HOST, if not configured, delete variable content.
- REMOTE_SSH_PORT="22" -> SSH Port configured on the target system.
This section contains crucial information on what files need to be present for the program to work, in case you dont want to clone the full repo.
The main program file is snapmaker.sh, but it will not run if vars folder is not present in the same directory, along with chains.conf, remote.conf and requirements.txt files.
Directly on Terminal
After cloning the repository and making the program file executable as instructed above, the only thing remaining is program execution.
Run the following command inside cosmossnapman directory:
./snapmaker.sh
Using Crontab
If you want to execute the script in specified intervals, the most common way to do it, is using Crontab.
Run the following command to edit your crontab file:
crontab -e
Then add the following at the end of the file for run the SNAPMaker once per day at 10am:
0 10 * * * /bin/bash /path/to/script/snapmaker.sh > /dev/null 2>&1
Then press CTRL+X, answer yes, and press ENTER to save.
There are no known issues at the moment...
- Organization: NexuSecurus
- Author: prenats
- Contact: renato@nexusecurus.com
- Year: 2024
Asset | Address |
---|---|
CosmosHub | cosmos1ravucs2erl88yn07eyudkhzekswcyw8mhy5lpc |
Osmosis | osmo1ravucs2erl88yn07eyudkhzekswcyw8mll80h2 |
AKASH | akash1ravucs2erl88yn07eyudkhzekswcyw8m6leccz |
Source Protocol | source1ravucs2erl88yn07eyudkhzekswcyw8m3hdp3x |
Teritori | tori1ravucs2erl88yn07eyudkhzekswcyw8m4srk6g |