TurtleCoin® needs to sync when you first launch it to grab a copy of the whole blockchain. We use checkpoints to make that sync faster. Serving checkpoints can be tough for just one server to host, so we have made an easy guide for people who want to help distribute the checkpoints! With IPFS we can create a swarm of decentralized nodes that host checkpoints for the rest of the community.
Follow the directions below to get started.
You will need the following:
Once you have Node.js installed, perform the following steps:
- Clone the TurtleCoin® Checkpoints IPFS Helper package from GitHub
git clone https://github.com/turtlecoin/checkpoints-ipfs-helper
- Enter the newly cloned directory.
cd checkpoints-ipfs-helper
- Install the package dependencies
npm install
- Start the script
npm start
After a few moments you will see output such as shown below:
> turtlecoin-checkpoints-ipfs-helper@0.0.2 /home/travis/build/turtlecoin/checkpoints-ipfs-helper
> node index.js
Tue, 15 Oct 2019 01:08:02 GMT: [INFO] Starting IPFS node in: /home/travis/TurtleCoinIPFS
Tue, 15 Oct 2019 01:08:03 GMT: [INFO] IPFS node started
Tue, 15 Oct 2019 01:08:03 GMT: [INFO] Waiting for IPFS node to connect to swarm...
Tue, 15 Oct 2019 01:08:08 GMT: [INFO] IPFS node connected to swarm...
Tue, 15 Oct 2019 01:08:08 GMT: [INFO] Detected new checkpoints IPFS hash: QmWNWv8NjbAZuLSCw3ZNuJJ7y1wLCRsDq2kpcrMaoowwNc
Tue, 15 Oct 2019 01:08:08 GMT: [INFO] Attempting to pin locally: QmWNWv8NjbAZuLSCw3ZNuJJ7y1wLCRsDq2kpcrMaoowwNc
Tue, 15 Oct 2019 01:13:31 GMT: [INFO] Pinned successfully: QmWNWv8NjbAZuLSCw3ZNuJJ7y1wLCRsDq2kpcrMaoowwNc
Note: The actual time to pin the hash varies based upon your Internet connection, firewall(s), network configuration, and the current IPFS network load. Don't worry if it takes a while to pin the hash.
Leave the script running to continue to help distribute the checkpoints via IPFS. The script will automatically check for an updated checkpoints hash to pin once per hour.
If you would rather use a tool like PM2 or forever to keep the script running, see below.