1.download
wget https://dist.ipfs.io/go-ipfs/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz
2.unzip the file:
# tar -xvzf go-ipfs_v0.12.2_linux-amd64.tar.gz go-ipfs/LICENSE go-ipfs/LICENSE-APACHE go-ipfs/LICENSE-MIT go-ipfs/README.md go-ipfs/install.sh go-ipfs/ipfs #
3.Move into the go-ipfs folder and run the install script:
# cd go-ipfs # ls install.sh ipfs LICENSE LICENSE-APACHE LICENSE-MIT README.md # sh install.sh Moved ./ipfs to /usr/local/bin #
4.Test that IPFS has installed correctly:
# ipfs --version ipfs version 0.12.2 #
5.port open
# firewall-cmd --add-port=5001/tcp --zone=public --permanent # firewall-cmd --add-port=8080/tcp --zone=public --permanent # firewall-cmd --reload
6.~/.ipfs/configの編集
・192.168.1.127のserverにインストール
"API": { "HTTPHeaders": { "Access-Control-Allow-Methods": [], "Access-Control-Allow-Origin": [ "http://localhost:3000", "http://192.168.1.127:5001", "http://127.0.0.1:5001", ] } }, "Addresses": { "Announce": [], "AppendAnnounce": [], "NoAnnounce": [], "API": ["/ip4/127.0.0.1/tcp/5001","/ip4/192.168.1.130/tcp/5001"], "Gateway": "/ip4/192.168.1.130/tcp/8081" "Swarm": [ "/ip4/0.0.0.0/tcp/4001", "/ip6/::/tcp/4001", "/ip4/0.0.0.0/udp/4001/quic", "/ip6/::/udp/4001/quic" ] },
7.パブリックで起動
# ipfs daemon
8.パブリックでの稼働の確認
# ipfs swarm peers /ip4/1.36.56.24/tcp/46825/p2p/QmR8g2U6UDsuTeoStqfYGXU8V8qFLBBeMHVJJF8VFBHMPW /ip4/1.65.134.116/tcp/46465/p2p/QmPvnXgsNYgUcxHgA9eJr3pZNiJx5KWHD4pD8XF67t5VYt /ip4/100.34.48.75/tcp/4001/p2p/12D3KooWMsJmAoehzYiQxsTkoiKrb8VJgBfmwtn5tF7PGnmLngN8 ・・・
9.パブリックで稼働しているのをブラウザから確認
http://192.168.1.127:5001/webui
・Connected to IPFSのページでNETWORK TRAFFICを確認
10.プライベートで起動
# ipfs daemon --offline
11.プライベートでの稼働の確認
# ipfs swarm peers Error: this action must be run in online mode, try running 'ipfs daemon' first
12.プライベートで稼働しているのをブラウザから確認
http://192.168.1.127:5001/webui
・Connected to IPFSのページにアクセスできない
又は、
・Could not connect to the IPFS API
13.documentの書き込み
# ipfs add README.md added QmVh1g359Sb2YNmegSxSRp5paktWGVLQMwtgYBx1haqwjA README.md 467 B / 467 B [=======================================================] 100.00%[root@localhost go-ipfs]# ipfs cat QmVh1g359Sb2YNmegSxSRp5paktWGVLQMwtgYBx1haqwjA
14.書き込んだdocumentをブラウザから確認
http://192.168.1.127:8080/ipfs/QmVh1g359Sb2YNmegSxSRp5paktWGVLQMwtgYBx1haqwjA
15.プライベートで運用するserviceの登録
# vi /lib/systemd/system/ipfs.service [Unit] Description=IPFS After=network.target [Service] ExecStart=/usr/local/bin/ipfs daemon --offline Restart=always User=root Group=root Restart=on-failure KillSignal=SIGINT [Install] WantedBy=multi-user.target
16.serviceの有効化と起動
# systemctl enable ipfs # systemctl start ipfs
以上