1、首先安装完成之后运行 ipfs help 出现相关提示说明运行成功 2、接着运行如下命令 ipfs init 3、运行成功后出现如下命令运行 ipfs cat /ipfs/QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/readme 4、运行如下 sysctl -w net.core.rmem_max=2500000 5、运行 ipfs daemon 启动节点 6、运行 ipfs swarm peers | wc -l 查看连接节点数 ipfs swarm peers ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST", "OPTIONS"]' ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]' ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]' ipfs config --json API.HTTPHeaders.Access-Control-Allow-Headers '["Authorization"]' ipfs config --json API.HTTPHeaders.Access-Control-Expose-Headers '["Location"]' ipfs config --json Addresses.API '"/ip4/0.0.0.0/tcp/5001"' ipfs config --json Addresses.Gateway '"/ip4/0.0.0.0/tcp/8080"' sysctl -w net.core.rmem_max=2500000 git clone https://hub.fastgit.org/Kubuxu/go-ipfs-swarm-key-gen.git ipfs bootstrap add /ip4/192.168.1.162/tcp/4001/ipfs/12D3KooWCRuDWrEzRJR1CcGhYzHgPMPF1KrdttWsCARfpb2Y8yLj ipfs bootstrap add /ip4/192.168.1.161/tcp/4001/ipfs/12D3KooWJTCaKhMkaqWrpMUaWY6PTNAeEyjvCEEiCLvQtWkUZeKe wget http://192.168.1.161:8080/ipfs/QmTMMVMX45d2UwcePRphFEqAW5NhcB7a66LRveNDJyifmz git clone https://hub.fastgit.org/Kubuxu/go-ipfs-swarm-key-gen.git ipfs daemon > ipfs.log & ipfs bootstrap rm --all #后台运行,关闭不停止 nohup ipfs daemon #查看节点数 ipfs stats bitswap echo "lll" >> hello1.txt ipfs add hello1.txt ipfs cat QmZyxoXZNAgPeDDVC3jnkhuqkB8aYZeVWkpMXCQGJL1XAV https://cloud.tencent.com/developer/article/1362604?from=15425 学习好网址 ipfs swarm peers | wc -l 查看连接节点数 git clone https://github.com/ipfs/go-ipfs.git cd go-ipfs make install 下载 # 下载 $ cd /home $ wget https://download.fastgit.org/ipfs/go-ipfs/releases/download/v0.9.1/go-ipfs_v0.9.1_linux-amd64.tar.gz # 解压缩 $ tar xvfz go-ipfs_v0.9.1_linux-amd64.tar.gz # 安装 $ cd go-ipfs/ $ ./install.sh 图片传输到ipfs节点然后将生成的ipfs访问链接存到区块链 https://learnblockchain.cn/article/3712 ipfs bootstrap add /ip4/192.168.22.136/4001/ipfs/上一步查询到的136节点ID /ip4/192.168.1.161/tcp/4001/p2p/12D3KooWQqT2sDKk4r2yeYrz9azUP4rQRsVWm22dZAYbDv9zXF2h
IPFS跨域配置
最新推荐文章于 2023-07-26 11:40:42 发布