{"id":2294,"date":"2022-05-08T18:58:18","date_gmt":"2022-05-08T09:58:18","guid":{"rendered":"https:\/\/blog.wsd.sh\/?p=2294"},"modified":"2022-06-22T14:09:46","modified_gmt":"2022-06-22T05:09:46","slug":"centos-stram9-ipfs-install","status":"publish","type":"post","link":"https:\/\/blog.wsd.sh\/?p=2294","title":{"rendered":"<small>CentOS Stream 9 : ipfs \u306e install \u3068 ipfs\u3092\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u3067\u904b\u7528 <\/small>"},"content":{"rendered":"<p>\uff11\uff0edownload<\/p>\n<pre>\r\nwget https:\/\/dist.ipfs.io\/go-ipfs\/v0.12.2\/go-ipfs_v0.12.2_linux-amd64.tar.gz\r\n<\/pre>\n<p>\uff12\uff0eunzip the file:<\/p>\n<pre>\r\n# tar -xvzf go-ipfs_v0.12.2_linux-amd64.tar.gz\r\ngo-ipfs\/LICENSE\r\ngo-ipfs\/LICENSE-APACHE\r\ngo-ipfs\/LICENSE-MIT\r\ngo-ipfs\/README.md\r\ngo-ipfs\/install.sh\r\ngo-ipfs\/ipfs\r\n#\r\n<\/pre>\n<p>\uff13\uff0eMove into the go-ipfs folder and run the install script:<\/p>\n<pre>\r\n# cd go-ipfs\r\n# ls\r\ninstall.sh  ipfs  LICENSE  LICENSE-APACHE  LICENSE-MIT  README.md\r\n# sh install.sh\r\nMoved .\/ipfs to \/usr\/local\/bin\r\n#\r\n<\/pre>\n<p>\uff14\uff0eTest that IPFS has installed correctly:<\/p>\n<pre>\r\n# ipfs --version\r\nipfs version 0.12.2\r\n#\r\n<\/pre>\n<p>\uff15\uff0eport open<\/p>\n<pre>\r\n# firewall-cmd --add-port=5001\/tcp --zone=public --permanent\r\n# firewall-cmd --add-port=8080\/tcp --zone=public --permanent\r\n# firewall-cmd --reload\r\n<\/pre>\n<p>\uff16\uff0e~\/.ipfs\/config\u306e\u7de8\u96c6<br \/>\n\u30fb192.168.1.127\u306eserver\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<pre>\r\n  \"API\": {\r\n    \"HTTPHeaders\": {\r\n      \"Access-Control-Allow-Methods\": [],\r\n      \"Access-Control-Allow-Origin\": [\r\n        \"http:\/\/localhost:3000\",\r\n        \"http:\/\/192.168.1.127:5001\",\r\n        \"http:\/\/127.0.0.1:5001\",\r\n      ]\r\n    }\r\n  },\r\n  \"Addresses\": {\r\n    \"Announce\": [],\r\n    \"AppendAnnounce\": [],\r\n    \"NoAnnounce\": [],\r\n    \"API\": [\"\/ip4\/127.0.0.1\/tcp\/5001\",\"\/ip4\/192.168.1.130\/tcp\/5001\"],\r\n    \"Gateway\": \"\/ip4\/192.168.1.130\/tcp\/8081\"\r\n    \"Swarm\": [\r\n      \"\/ip4\/0.0.0.0\/tcp\/4001\",\r\n      \"\/ip6\/::\/tcp\/4001\",\r\n      \"\/ip4\/0.0.0.0\/udp\/4001\/quic\",\r\n      \"\/ip6\/::\/udp\/4001\/quic\"\r\n    ]\r\n  },\r\n<\/pre>\n<p>\uff17\uff0e\u30d1\u30d6\u30ea\u30c3\u30af\u3067\u8d77\u52d5<\/p>\n<pre>\r\n# ipfs daemon\r\n<\/pre>\n<p>\uff18\uff0e\u30d1\u30d6\u30ea\u30c3\u30af\u3067\u306e\u7a3c\u50cd\u306e\u78ba\u8a8d<\/p>\n<pre>\r\n# ipfs swarm peers\r\n\/ip4\/1.36.56.24\/tcp\/46825\/p2p\/QmR8g2U6UDsuTeoStqfYGXU8V8qFLBBeMHVJJF8VFBHMPW\r\n\/ip4\/1.65.134.116\/tcp\/46465\/p2p\/QmPvnXgsNYgUcxHgA9eJr3pZNiJx5KWHD4pD8XF67t5VYt\r\n\/ip4\/100.34.48.75\/tcp\/4001\/p2p\/12D3KooWMsJmAoehzYiQxsTkoiKrb8VJgBfmwtn5tF7PGnmLngN8\r\n\u30fb\u30fb\u30fb\r\n<\/pre>\n<p>\uff19\uff0e\u30d1\u30d6\u30ea\u30c3\u30af\u3067\u7a3c\u50cd\u3057\u3066\u3044\u308b\u306e\u3092\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u78ba\u8a8d<\/p>\n<pre>\r\nhttp:\/\/192.168.1.127:5001\/webui\r\n<\/pre>\n<p>\u30fbConnected to IPFS\u306e\u30da\u30fc\u30b8\u3067NETWORK TRAFFIC\u3092\u78ba\u8a8d<\/p>\n<p>\uff11\uff10\uff0e\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u3067\u8d77\u52d5<\/p>\n<pre>\r\n# ipfs daemon --offline\r\n<\/pre>\n<p>\uff11\uff11\uff0e\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u3067\u306e\u7a3c\u50cd\u306e\u78ba\u8a8d<\/p>\n<pre>\r\n# ipfs swarm peers\r\nError: this action must be run in online mode, try running 'ipfs daemon' first\r\n<\/pre>\n<p>\uff11\uff12\uff0e\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u3067\u7a3c\u50cd\u3057\u3066\u3044\u308b\u306e\u3092\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u78ba\u8a8d<\/p>\n<pre>\r\nhttp:\/\/192.168.1.127:5001\/webui\r\n<\/pre>\n<p>\u30fbConnected to IPFS\u306e\u30da\u30fc\u30b8\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u3044<br \/>\n\u53c8\u306f\u3001<br \/>\n\u30fbCould not connect to the IPFS API<\/p>\n<p>\uff11\uff13\uff0edocument\u306e\u66f8\u304d\u8fbc\u307f<\/p>\n<pre>\r\n# ipfs add README.md\r\nadded QmVh1g359Sb2YNmegSxSRp5paktWGVLQMwtgYBx1haqwjA README.md\r\n 467 B \/ 467 B [=======================================================] 100.00%[root@localhost go-ipfs]# ipfs cat QmVh1g359Sb2YNmegSxSRp5paktWGVLQMwtgYBx1haqwjA\r\n<\/pre>\n<p>\uff11\uff14\uff0e\u66f8\u304d\u8fbc\u3093\u3060document\u3092\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u78ba\u8a8d<\/p>\n<pre>\r\nhttp:\/\/192.168.1.127:8080\/ipfs\/QmVh1g359Sb2YNmegSxSRp5paktWGVLQMwtgYBx1haqwjA\r\n<\/pre>\n<p>\uff11\uff15\uff0e\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u3067\u904b\u7528\u3059\u308bservice\u306e\u767b\u9332<\/p>\n<pre>\r\n# vi \/lib\/systemd\/system\/ipfs.service\r\n\r\n[Unit]\r\nDescription=IPFS\r\nAfter=network.target\r\n[Service]\r\nExecStart=\/usr\/local\/bin\/ipfs daemon --offline\r\nRestart=always\r\nUser=root\r\nGroup=root\r\nRestart=on-failure\r\nKillSignal=SIGINT\r\n[Install]\r\nWantedBy=multi-user.target\r\n<\/pre>\n<p>\uff11\uff16\uff0eservice\u306e\u6709\u52b9\u5316\u3068\u8d77\u52d5<\/p>\n<pre>\r\n# systemctl enable ipfs\r\n# systemctl start ipfs\r\n<\/pre>\n<p>\u4ee5\u4e0a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uff11\uff0edownload wget https:\/\/dist.ipfs.io\/go-ipfs\/v0.12.2\/go-ipfs_v0.12.2_linux-amd64.tar.gz \uff12\uff0eunzip the file: # ta&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts\/2294"}],"collection":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2294"}],"version-history":[{"count":36,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts\/2294\/revisions"}],"predecessor-version":[{"id":2635,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts\/2294\/revisions\/2635"}],"wp:attachment":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}