Giter Club home page Giter Club logo

priv-ipfs's Introduction

priv-ipfs

Overview

This repository provides a Containerlab project for setting up a private IPFS network. The network consists of 3 IPFS nodes and 3 routers.

Topology

Deployment

1. Clone the repository

git clone https://hydrokhoos/priv-ipfs.git
cd priv-ipfs

2. Generate swarm key to make IPFS private

Note: Go needs to be installed first.

go install github.com/Kubuxu/go-ipfs-swarm-key-gen/ipfs-swarm-key-gen@latest
mkdir PC
touch PC/swarm.key
$(go env GOPATH)/bin/ipfs-swarm-key-gen > ./PC/swarm.key

3. Deploy containers using Containerlab

Note: Ensure you have Containerlab installed.

sudo clab deploy -t priv-ipfs.yaml

4. Check IPFS

docker exec clab-priv-ipfs-PC1 ipfs swarm peers
# Should return nothing initially.

5. Add bootstrap nodes

./addBootstrap.sh
added /ip4/192.168.12.2/tcp/4001/p2p/12D3KooWLq1iApFjaWd2shtC2rUNNGAhvd5gFKHYEdYMCLLAE2qv
added /ip4/192.168.13.2/tcp/4001/p2p/12D3KooWKRVxsh1JgcxeHW7k7URRoemrfHKYcoZ9qzyTAhdCQwz6

6. Check IPFS

Note: This step might take a little time.

docker exec clab-priv-ipfs-PC1 ipfs swarm peers
/ip4/192.168.12.2/tcp/4001/p2p/12D3KooWLq1iApFjaWd2shtC2rUNNGAhvd5gFKHYEdYMCLLAE2qv
/ip4/192.168.13.2/tcp/4001/p2p/12D3KooWKRVxsh1JgcxeHW7k7URRoemrfHKYcoZ9qzyTAhdCQwz6

Usage 1

1. Provide from PC1

docker exec clab-priv-ipfs-PC1 sh -c 'echo "Hello, world!" | ipfs add'
14 B / ? added QmeeLUVdiSTTKQqhWqsffYDtNvvvcTfJdotkNyi1KDEJtQ QmeeLUVdiSTTKQqhWqsffYDtNvvvcTfJdotkNyi1KDEJtQ

2. Retrieve from PC3

docker exec clab-priv-ipfs-PC3 ipfs cat QmeeLUVdiSTTKQqhWqsffYDtNvvvcTfJdotkNyi1KDEJtQ
Hello, world!

Usage 2

1. Adding contents

docker exec -it clab-priv-ipfs-PC1 bash
./pub_testcontents.sh

2. Find provider and peer

docker exec -it clab-priv-ipfs-PC2 bash
./get_testcontents.sh

3. Check results

Measurement results are saved in clab-priv-ipfs-PC2:/ipfs-find-provs-peer.csv

docker cp clab-priv-ipfs-PC2:/ipfs-find-provs-peer.csv .

Destroy

sudo clab destroy -t priv-ipfs.yaml

priv-ipfs's People

Contributors

hydrokhoos avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.