Giter VIP home page Giter VIP logo

quorum-deploy's Introduction

quorum-deploy

Create quorum based consortium chain painless, deploy it to Docker-compose & Kubernetes

Dependencies

  • docker
  • kubectl
  • minikube

Installation

git clone https://github.com/ATNIO/quorum-deploy.git
cd quorum-deploy
docker build -t quorum -f quorum.Dockerfile .
docker tag quorum asia.gcr.io/consortiumchain/quorum
docker build -t explorer-ui -f ui.Dockerfile .
docker tag explorer-ui asia.gcr.io/consortiumchain/explorer-ui
docker build -t explorer-backend -f backend.Dockerfile .
docker tag explorer-backend asia.gcr.io/consortiumchain/explorer-backend

Usage

Docker-compose

Edit ip.cfg, enable the config for docker and disable the others, then run

./setup.sh && docker-compose up -d

Now you have a consortium chain and it's explorer running inside docker, you can test them by

geth --exec 'loadScript("examples/contract_pub.js") attach http://0.0.0.0:22001
open http://localhost:5000

If the explorer doesn't sync block data correctly, you should restart it by

docker-compose restart explorer_backend

Minikube

Edit ip.cfg, enable the config for minikube and disable the other ones, then run

eval $(minikube docker-env)
docker build -t quorum -f quorum.Dockerfile .
docker tag quorum asia.gcr.io/consortiumchain/quorum
docker build -t explorer-ui -f ui.Dockerfile .
docker tag explorer-ui asia.gcr.io/consortiumchain/explorer-ui
docker build -t explorer-backend -f backend.Dockerfile .
docker tag explorer-backend asia.gcr.io/consortiumchain/explorer-backend
./setup.sh
minikube start
kubectl config use-context minikube
kubectl create -f consortium.yaml,explorer.yaml

Now you have a local consortium chain cluster and it's explorer running inside minikube, have a try by

geth --exec 'loadScript("examples/contract_pub.js")' attach http://$(minikube ip):31710
open http://$(minikube ip):31710

If the explorer doesn't sync block data correctly, you should restart it by

cd scripts && ./recreate explorer

Production

Similar to minikube, one important additional thing is that you must have a static ip address for explorer_ip in ip.cfg. For GCP, follow this In addition, there are several scripts in the scripts/ directory may help you. To use them, you must cd scripts

./attach node-1 # geth attach to node-1
./inspect node-1 # get into container of node-1
./inspect expl mongodb # get into container of mongodb of explore
./pubkey node-1 # get constellation public key of node-1

For other scripts, just run it and it will do the thing as it's name says.

Try on testnet

Our consortium chain is now living on the GCP Kubernetes Engine, named consortiumchain.

  • Consortium chain explorer url:
http://35.229.221.95:5000/
  • Consortium node rpc urls:
# node-1
http://35.229.229.248:8545
# node-2
http://35.201.215.219:8545
# node-3
http://35.189.163.25:8545
  • Loadbalanced nodes' rpc url:
http://35.194.196.250:8545
  • Consortium node public keys:
# node-1
fsOD/f81FUBcO84u4EGkoHx1ymvPhPcUc7qTuiJX6VY=
# node-2
JEpO9gLgPcQM3II8MP4Hzf0mHrS1vcGIao+AWrK1qCA=
# node-3
RHoXgVLqX9KwMvBfi3os6xylk1+XhPslDW4rLge+Hj4=

You may play with them in this way

  • Public contract creation
# deploy a public contract to node-1
geth --exec 'loadScript("examples/contract_pub.js")' attach http://35.229.229.248:8545
  • Private contract creation
# deploy a private contract to node-1, private for node-2
geth --exec 'loadScript("examples/contract_pri.js")' attach http://35.229.229.248:8545

Now open http://35.229.221.95:5000/ on your web explorer to explorer blocks & transactions.

quorum-deploy's People

Contributors

pplam avatar denny60004 avatar hujw77 avatar ovsoil avatar

Watchers

James Cloos 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.