Last active
November 29, 2022 04:30
-
-
Save sanderpick/4d9a8ddb310c6c2908498ae9ee72a6a2 to your computer and use it in GitHub Desktop.
Install ipfs on Amazon Linux.
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
#!/usr/bin/env bash | |
set -e | |
echo 'export IPFS_PATH=/data/ipfs' >>~/.bash_profile | |
source ~/.bash_profile | |
# ipfs daemon | |
wget https://dist.ipfs.io/go-ipfs/v0.4.15/go-ipfs_v0.4.15_linux-amd64.tar.gz | |
tar xvfz go-ipfs_v0.4.15_linux-amd64.tar.gz | |
rm go-ipfs_v0.4.15_linux-amd64.tar.gz | |
sudo mv go-ipfs/ipfs /usr/local/bin | |
rm -rf go-ipfs | |
# init ipfs | |
sudo mkdir -p $IPFS_PATH | |
sudo chown ec2-user:ec2-user $IPFS_PATH | |
ipfs init | |
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080 | |
# ipfs systemctl service | |
sudo bash -c 'cat >/lib/systemd/system/ipfs.service <<EOL | |
[Unit] | |
Description=ipfs daemon | |
[Service] | |
ExecStart=/usr/local/bin/ipfs daemon --enable-gc --enable-pubsub-experiment | |
Restart=always | |
User=ec2-user | |
Group=ec2-user | |
Environment="IPFS_PATH=/data/ipfs" | |
[Install] | |
WantedBy=multi-user.target | |
EOL' | |
# enable the new services | |
sudo systemctl daemon-reload | |
sudo systemctl enable ipfs.service | |
sudo systemctl start ipfs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run the installer
Sanity check
Tail Logs