Last active
October 29, 2022 00:51
-
-
Save KEINOS/bc0e44d42debd817f823eeff20e1e1a8 to your computer and use it in GitHub Desktop.
[IPFS] Simple "systemd" example to run IPFS and IPFS-Cluster as a service.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=IPFS-Cluster daemon | |
After=network.target ipfs | |
[Service] | |
User=myuser | |
WorkingDirectory=/home/myuser/ | |
ExecStart=/usr/local/bin/ipfs-cluster-service daemon --bootstrap /ip4/<IP of your bootstrap>/tcp/9096/p2p/<NodeID> | |
Restart=on-failure | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=IPFS daemon | |
After=network.target | |
[Service] | |
User=myuser | |
WorkingDirectory=/home/myuser/ | |
ExecStart=/usr/local/bin/ipfs daemon --enable-gc --migrate | |
Restart=on-failure | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copy the service files | |
cp ./ipfs.service /etc/systemd/system/ipfs.service | |
cp ./ipfs-cluster.service /etc/systemd/system/ipfs-cluster.service | |
# Regist service | |
sudo systemctl --system daemon-reload | |
sudo systemctl enable ipfs ipfs-cluster | |
sudo systemctl start ipfs ipfs-cluster |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment