Difference between revisions of "Relay Node"
Mochimowiki (talk | contribs) (→Deployment Steps) |
Mochimowiki (talk | contribs) (→Deployment Steps) |
||
Line 21: | Line 21: | ||
1. Create ramdisk directory. | 1. Create ramdisk directory. | ||
− | mkdir /mnt/ramdisk | + | <pre>mkdir /mnt/ramdisk</pre> |
2. Setup crontab to reboot daily. Below script selects nano with "1" and sets | 2. Setup crontab to reboot daily. Below script selects nano with "1" and sets | ||
the system to reboot weekly at 6 am. | the system to reboot weekly at 6 am. | ||
− | apt-get install nano | + | <pre>apt-get install nano |
cd /etc | cd /etc | ||
crontab -e | crontab -e | ||
1 | 1 | ||
− | + | </pre> | |
File Contents: | File Contents: | ||
− | 0 6 * * 1 /sbin/shutdown -r | + | <pre>0 6 * * 1 /sbin/shutdown -r</pre> |
3. Install build tools, and build Mochimo | 3. Install build tools, and build Mochimo | ||
− | apt-get install git | + | <pre>apt-get install git |
apt-get install build-essential | apt-get install build-essential | ||
cd /root | cd /root | ||
Line 44: | Line 44: | ||
cd mochimo/src | cd mochimo/src | ||
./makeunx bin -DCPU | ./makeunx bin -DCPU | ||
− | ./makeunx install | + | ./makeunx install</pre> |
4. Tar the binary directory, and copy to /root | 4. Tar the binary directory, and copy to /root | ||
− | cd .. | + | <pre>cd .. |
tar -czvf bin.tgz bin | tar -czvf bin.tgz bin | ||
cp bin.tgz /root/bin.tgz | cp bin.tgz /root/bin.tgz | ||
cd .. | cd .. | ||
− | rm -rf mochimo | + | rm -rf mochimo</pre> |
5. Set the fstab to load the ramdisk on reboot | 5. Set the fstab to load the ramdisk on reboot | ||
− | nano /etc/fstab | + | <pre>nano /etc/fstab</pre> |
File Contents (append to bottom of file): | File Contents (append to bottom of file): | ||
− | tmpfs /mnt/ramdisk tmpfs nodev,nosuid,nodiratime,size=1024M | + | <pre>tmpfs /mnt/ramdisk tmpfs nodev,nosuid,nodiratime,size=1024M</pre> |
6. Create the systemd system service to start Mochimo on boot. | 6. Create the systemd system service to start Mochimo on boot. | ||
− | cd /etc/systemd/system | + | <pre>cd /etc/systemd/system |
− | nano mochimo.service | + | nano mochimo.service</pre> |
File Contents: | File Contents: | ||
− | [Unit] | + | <pre>[Unit] |
Description=Mochimo Server | Description=Mochimo Server | ||
Line 76: | Line 76: | ||
[Install] | [Install] | ||
− | WantedBy=default.target | + | WantedBy=default.target</pre> |
7. Make the service privs 644: | 7. Make the service privs 644: | ||
− | chmod 644 mochimo.service | + | <pre>chmod 644 mochimo.service</pre> |
8. Create the startup script off of /root | 8. Create the startup script off of /root | ||
− | nano /root/start-mochimo.sh | + | <pre>nano /root/start-mochimo.sh |
#! /bin/bash | #! /bin/bash | ||
Line 92: | Line 92: | ||
cd bin | cd bin | ||
cp maddr.mat maddr.dat | cp maddr.mat maddr.dat | ||
− | ./gomochi d -n -D | + | ./gomochi d -n -D</pre> |
9. Make the startup script executable: | 9. Make the startup script executable: | ||
− | chmod +x /root/start-mochimo.sh | + | <pre>chmod +x /root/start-mochimo.sh</pre> |
10. Start the service, and reboot to confirm: | 10. Start the service, and reboot to confirm: | ||
− | sudo systemctl enable mochimo.service | + | <pre>sudo systemctl enable mochimo.service |
sudo systemctl start mochimo.service | sudo systemctl start mochimo.service | ||
− | sudo reboot | + | sudo reboot</pre> |
Revision as of 12:54, 8 February 2021
Contents
How to Deploy a Mochimo VPS Relay Node
Summary
The below steps will allow you to set up a VPS node that self-reboots weekly, installs the Mochimo server in a ramdisk (for high performance) creates a local mochimo service, and automatically restarts the Mochimo server as a non solving node upon reboot.
Audience
People who want to support the network by operating a node to relay transactions / blocks.
Minimum System Requirements
Ubuntu 16.04 LTS 1 vCPU 2 GB RAM 10 GB Hard Disk
Deployment Steps
1. Create ramdisk directory.
mkdir /mnt/ramdisk
2. Setup crontab to reboot daily. Below script selects nano with "1" and sets the system to reboot weekly at 6 am.
apt-get install nano cd /etc crontab -e 1
File Contents:
0 6 * * 1 /sbin/shutdown -r
3. Install build tools, and build Mochimo
apt-get install git apt-get install build-essential cd /root git clone https://github.com/mochimodev/mochimo cd mochimo/src ./makeunx bin -DCPU ./makeunx install
4. Tar the binary directory, and copy to /root
cd .. tar -czvf bin.tgz bin cp bin.tgz /root/bin.tgz cd .. rm -rf mochimo
5. Set the fstab to load the ramdisk on reboot
nano /etc/fstab
File Contents (append to bottom of file):
tmpfs /mnt/ramdisk tmpfs nodev,nosuid,nodiratime,size=1024M
6. Create the systemd system service to start Mochimo on boot.
cd /etc/systemd/system nano mochimo.service
File Contents:
[Unit] Description=Mochimo Server [Service] ExecStart=/root/start-mochimo.sh [Install] WantedBy=default.target
7. Make the service privs 644:
chmod 644 mochimo.service
8. Create the startup script off of /root
nano /root/start-mochimo.sh #! /bin/bash cp /root/bin.tgz /mnt/ramdisk cd /mnt/ramdisk tar -xzvf bin.tgz cd bin cp maddr.mat maddr.dat ./gomochi d -n -D
9. Make the startup script executable:
chmod +x /root/start-mochimo.sh
10. Start the service, and reboot to confirm:
sudo systemctl enable mochimo.service sudo systemctl start mochimo.service sudo reboot