This project will setup and run a local cluster of Blockchain and IPFS nodes.
- Layer 1 - A network of Ethereum blockchain nodes with Tendermint consensus.
- Layer 2 - A network of IPFS nodes with Permissioned Access Control.
-
Docker client https://www.docker.com/products/docker-desktop/
-
Kebernetes Controller (kubectl) https://kubernetes.io/docs/tasks/tools/
-
Minikube https://minikube.sigs.k8s.io/
- Clone this github repository
$ git clone [email protected]:lightstreams-network/lightstreams-local-demo.git
$ cd lightstreams-local-demo
- Start Minikube
$ minikube start --memory=4096 --cpus=2
- Create Lightchain Validators
$ helm install validators ./validators
- Create Lightchain Agents
$ helm install agents ./agents
- In new consoles, launch the agent apps:
$ minikube service agent-node1
$ minikube service agent-node2
$ minikube service agent-node3
$ minikube service agent-node4
- Uninstall helm charts
$ helm uninstall agents
$ helm uninstall validators
- Delete minikube cluster
$ minikube delete --all
- Ensure the pods are running
$ kubectl get pods
- Check the state of the pods and logs
$ kubectl describe pod <podName>
$ kubectl log -f <podName>
- Download IPFS version 0.4.18 for your OS https://github.com/ipfs/kubo/releases/tag/v0.4.18
Example for macOS:
$ wget "https://github.com/ipfs/kubo/releases/download/v0.4.18/go-ipfs_v0.4.18_darwin-amd64.tar.gz"
$ tar -xzvf go-ipfs_v0.4.18_darwin-amd64.tar.gz
$ mv ./go-ipfs/ipfs /usr/local/bin/ipfs
$ chmod u+x /usr/local/bin/ipfs
- Install and run ipfs
$ ipfs init
$ ipfs daemon
- Create tunnel to cluster
$ minikube service agent-node1-ipfs --url
- In another console:
$ kubectl port-forward svc/agent-node1-ipfs 4002:4002
- In another console:
$ ipfs swarm connect /ip4/127.0.0.1/tcp/4002/ipfs/QmbrCC1nUnyGYzPuLHdu31mQG8Qf17trdDYqfnqxYtdAmG
Then you can pull a file:
$ ipfs cat Qmd...