Git Product home page Git Product logo

magic's Introduction

Introduction

Makes it easier those are using Hyperledger Composer. Using this you can able to run some basic command for creating a Business network Application

Before going to use it !!

NOTE: If you already install your environment then skip these steps
1 . Installation of development environment

Step-1

mkdir ~/fabric-dev-servers && cd ~/fabric-dev-servers
curl -O https://raw.githubusercontent.com/hyperledger/composer-tools/master/packages/fabric-dev-servers/fabric-dev-servers.tar.gz
tar -xvf fabric-dev-servers.tar.gz

Step-2

Download and start the docker images

./downloadFabric.sh 
./startFabric.sh 

Note: For error: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.38/images/json: dial unix /var/run/docker.sock: connect: permission denied Do: sudo chmod 666 /var/run/docker.sock

Step-4

For non-destructive restarts of dev environment

curl -O https://github.com/acloudfan/HLF-Windows-Fabric-Tool/blob/master/fabricUtil.sh
chmod 755 fabricUtil.sh

First time launch:

./startFabric.sh

After that:

./fabricUtil.sh stop
./fabricUtil.sh start

To get docker images:

docker images
REPOSITORY                   TAG                 IMAGE ID            CREATED             SIZE
hyperledger/fabric-ca        1.2.0               66cc132bd09c        2 months ago        252MB
hyperledger/fabric-ccenv     1.2.0               6acf31e2d9a4        2 months ago        1.43GB
hyperledger/fabric-orderer   1.2.0               4baf7789a8ec        2 months ago        152MB
hyperledger/fabric-peer      1.2.0               82c262e65984        2 months ago        159MB
hyperledger/fabric-couchdb   0.4.10              3092eca241fc        2 months ago        1.61GB

And, the running containers:

docker ps
CONTAINER ID        IMAGE                               COMMAND                  CREATED             STATUS              PORTS                                            NAMES
3010cb6c712b        hyperledger/fabric-peer:1.2.0       "peer node start"        2 minutes ago       Up 2 minutes        0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp   peer0.org1.example.com
72afa9a59096        hyperledger/fabric-couchdb:0.4.10   "tini -- /docker-ent…"   2 minutes ago       Up 2 minutes        4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp       couchdb
a253164631d4        hyperledger/fabric-ca:1.2.0         "sh -c 'fabric-ca-se…"   2 minutes ago       Up 2 minutes        0.0.0.0:7054->7054/tcp                           ca.org1.example.com
9a14513db2a1        hyperledger/fabric-orderer:1.2.0    "orderer"                2 minutes ago       Up 2 minutes        0.0.0.0:7050->7050/tcp                          orderer.example.com

Installation of Yeoman

npm install -g yo

Installation of hyperledger-composer yo generator

npm install -g generator-hyperledger-composer

Check installed generators

yo --generators

Creating a BNA

  • Generate BNA scaffolding using the Yo generator.
yo hyperledger-composer

To change the HLF version

export FABRIC_VERSION=hlfv1
export FABRIC_VERSION=hlfv11
export FABRIC_VERSION=hlfv12

How to use !!

Step-1 First you go to the Download page( Where you download this file ) and give .sh file permission by using

chmod 777 magic.sh

Step-2 Note If you are interested to make a shell script global then do otherwise you can skip these step and move magic.sh file to your project location

ok, so First you go to the Download page( Where you download this file ) and open your terminal and type

sudo cp magic.sh /usr/local/bin

OK !! now you can use it anywhere by using

bash magic.sh 

Step-3 Before going to step-3, those are skip the Installation of development environment setup, only one thing you do that your fabric-dev-server folder move to home/host_name/ or if you have better understand the shell script then before using it you can edit your folder location into the magic.sh Ok in step-3, first you understand what is in the .sh file

  • you can easily start your server first open your terminal and type bash magic.sh startServer ( magic.sh automatically go to fabric-dev-server folder and start the fabric )

  • for deleting your composer-card bash magic.sh composerCard

  • for create your PeerAdmin bash magic.sh createPeer ( magic.sh automatically go to fabric-dev-server folder and create your PeerAdmin card )

  • for create your Admin card and import it bash magic.sh createAdmin

  • for upgrade your network bash magic.sh upgradeNetwork ( Don't forgot to update your package.json file )

  • for temporary stop your network bash magic.sh tempStop

Thank u!!

magic's People

Contributors

imainak avatar

Stargazers

Shubham Suyal 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.