Last active
May 21, 2019 13:32
-
-
Save maxaleks/0f7feb136e967093c1a66beb2b76b781 to your computer and use it in GitHub Desktop.
Script for deploying an IPFS node on a server
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/sh | |
ssh root@$IP_ADDRESS << HERE | |
wget "https://dist.ipfs.io/go-ipfs/v0.4.20/go-ipfs_v0.4.20_linux-amd64.tar.gz" | |
tar xvfz go-ipfs_v0.4.20_linux-amd64.tar.gz | |
cd go-ipfs/ | |
./install.sh | |
ipfs init -p server | |
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]' | |
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]' | |
ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001 | |
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080 | |
sudo bash -c 'cat >/lib/systemd/system/ipfs.service << EOL | |
[Unit] | |
Description=IPFS Daemon | |
[Service] | |
ExecStart=/usr/local/bin/ipfs daemon | |
Restart=always | |
User=root | |
[Install] | |
WantedBy=multi-user.target | |
EOL' | |
sudo systemctl daemon-reload | |
sudo systemctl enable ipfs.service | |
sudo systemctl start ipfs | |
sudo systemctl status ipfs | |
HERE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment