• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ahester57/ipfs-private-swarm: Tutorials using IPFS in a private setting. (from 2 ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

ahester57/ipfs-private-swarm

开源软件地址:

https://github.com/ahester57/ipfs-private-swarm

开源编程语言:


开源软件介绍:

IPFS Private Swarm


0. Requirements

Docker is useful for deploying test networks.


1. Setup

  1. Download latest release go-ipfs binary and untar it.

  2. Now copy go-ipfs/ipfs to /usr/local/bin/ipfs or somewhere $PATH points to.

  3. Test ipfs is working with ipfs help

  4. Run ipfs init, this will set up a node with the default IPFS_PATH=/home/$USER/.ipfs and create a new identity.

initializing IPFS node at /home/$USER/.ipfs
generating 2048-bit RSA keypair...done
peer identity: QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv

  1. Since this is a private swarm, delete the default bootstrap nodes with ipfs bootstrap rm --all

2. Generate swarm.key

Skip these steps if you have a pre-shared swarm.key.

  1. git clone https://github.com/Kubuxu/go-ipfs-swarm-key-gen
  2. cd go-ipfs-swarm-key-gen/
  3. ⚠️ Next command will Overwrite existing swarm.key
  4. go run ipfs-swarm-key-gen/main.go > $IPFS_PATH/swarm.key

2.1 Generate swarm.key without Above Repository

As mentioned in #1, you can also generate a swarm.key using the following command:

⚠️ Next command will Overwrite existing swarm.key

(echo -e '/key/swarm/psk/1.0.0/\n/base16/' ; head -c 32 /dev/urandom | od -t x1 -A none - | tr -d '\n '; echo '') > $IPFS_PATH/swarm.key
I have a pre-shared swarm.key

Ok. Put that file in the default IPFS directory. On Linux that is /home/$USER/.ipfs/.

This directory should also contain configuration and keystores. If it does not, go back and check where ipfs init put these.

Great, now your node won't connect to anyone without the same swarm.key. Be sure to remove the default ipfs bootstrap addresses before continuing.


3. Connect to your swarm

  1. Start your ipfs node with ipfs daemon. You should see a message near the top. If you don't see the following message ensure the swarm.key file is in the correct location.

Swarm is limited to private network of peers with the swarm key
Swarm key fingerprint: xxxxxxxxxxxxxxxx

  1. In a new terminal, run ipfs id. You will see the peer id, public key, addresses, and versions. We are interested in the Addresses list.

  2. There will be an address for each active network interface. Copy the address which other nodes will be able to reach you with.
    It looks like /ip4/192.168.1.11/tcp/4001/ipfs/<peer_id>.

  3. Hopefully you will have other nodes you have set up with the same configuration as above. Add the above address to the bootstrap list of those nodes with ipfs bootstrap add /ip4/192.168.1.11/tcp/4001/ipfs/<peer_id>.

  4. You should have multiple nodes set as bootstrap nodes to ensure network connectivity.

Congrats, you now have a private ipfs swarm up and running. Now to learn ipfs!


Usage

Usage is congruent to the default usage of ipfs. Check out the documentation here.

  • Set up boot node to run IPFS deamon on boot: IPFS_SERVICE
  • Configure your local IPFS node for the private swarm: CONNECT
  • Enable the WebUI at localhost:5001/webui for your private swarm: WEBUI



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap