Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BrightID-Node Backup Script

This script is used by the official brightid nodes to upload daily backups to the google storage service. Other nodes that want to join the network restore the last backup to reach the state of the backup time. Nodes read the operations sent after the backup time from the blockchain and apply them to sync to the current state of the network.

Latest BrightID backup can always be downloaded from:

https://storage.googleapis.com/brightid-backups/brightid.tar.gz

Available backup files can be found:

https://storage.googleapis.com/brightid-backups/

There are backup files avilable for following times:

  • one file per hour for a day
  • one file per day for a week
  • one file per week for a month
  • one file per month forever

Prerequisites:

  • python3
  • pip3
  • arangodump
  • You can find out how to install arangodump from arango client tools on your os from here.

Install

pip3 install -r requirements.txt

Run

  • Place your google credentials json file beside the backup.py with the google.json as name.

  • Add a cron job to run the script every hour.

# m h  dom mon dow   command
0 * * * * cd /home/as/BrightID-Node-Backup-Script && python3 backup.py >> /var/log/brightid_backup.log 2>&1
  • Give permissions to the log file to the user running the cron.
sudo su -
touch /var/log/brightid_backup.log
chown as:as /var/log/brightid_backup.log
  • Create /etc/logrotate.d/brightid-backup to keep logs from getting too big.
/var/log/brightid_backup.log {
    daily
    rotate 7
    compress
    missingok
    notifempty
    copytruncate
}

About

Script for official BrightID nodes to upload daily backups

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages