Code Monkey home page Code Monkey logo

gbaas's Introduction

Hyperledger Fabric multi-nodes deployment in GCP

  1. Modify src/main/resources/application.properties file. Set gcloud.dir property to the directory where gcloud installed. Default value is /usr/bin/

    The default value of working.dir property is "./blockchain/artifacts/". The service will use that directory to store templates and files generated by the service.

  2. In project directory, run ./gradlew bootRun

  3. The restful service endpoint is POST: localhost:9000/gbaas/fabric?create_instance=false&install_software=false$install_example_chaincode=true

    The request body looks like below:

    {
        "domain": "sample-network",
        "gcpProjectName": "hyperledger-poc",
        "gcpZoneName": "us-east1-b",
        "ordererName": "orderer-google-boa",
        "channelName": "common",
        "properties": [
            {
                "org": "google",
                "numOfPeers": 2
            },
            {
                "org": "boa",
                "numOfPeers": 2
            }
        ]
    }
    

    The domain property will be used for setting up the instance name, e.g orderer.sample-network.

  4. If you choose to install the example chaincode, you can ssh to a peer, e.g. boa-peer0, the initiate chaincode with command like: peer chaincode instantiate -o orderer.sample.com:7050 --tls --cafile /etc/hyperledger/crypto/orderer/tls/ca.crt -C common -n example -v 1.0 -c '{"Args":["init","a","100","b","200"]}' then query from another peer: peer chaincode query -C common -n example -c '{"Args":["query","a"]}'

Make sure you cryptogen and configtx command are in ~/bin/

if you don't have those binaries, simply run curl -sSL https://goo.gl/6wtTN5 | bash

Make sure you set up JDK for Gradle

It's easier to use IDE to set up the project

Don't forget to run watch -n60 gcloud compute --project=hyperledger-poc firewall-rules create all --direction=INGRESS --priority=1000 --network=default --action=ALLOW --rules=all --source-ranges=0.0.0.0/0

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.