Coder Social home page Coder Social logo

suenchunhui / fabric-tutorial-vagrant Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 6.0 46 KB

Vagrant-based VM for running hyperledger fabric and composer examples and sample (include cloud9 IDE)

License: GNU General Public License v3.0

Shell 100.00%
hyperledger-fabric vagrant fabric-samples

fabric-tutorial-vagrant's Introduction

Introduction

This REPO contains a Vagrant-based VM for running hyperledger fabric and composer examples and sample (include cloud9 IDE)

Preparation

Settings

  • Adjust the VM memory and number of cores, in the Vagrantfile using a text editor at the lines:
v.memory = 2048
v.cpus = 2

Provisioning

  • change directory to the folder containing the downloaded Vagrantfile
  • run vagrant up from the commandline(OSX: terminal, Win: cmd.exe) to provision the entire system. Download and provisioning system can take a long up (up to 10-20mins)
  • Once you reach the success screen output,
==> default:
==> default: [email protected] node_modules/tern_from_ts
==> default: --------------------------------------------------------------------
==> default: Success!
==> default: run 'node server.js -p 8080 -a :' to launch Cloud9
==> default: ++ echo 'cd /cloud9 ; su ubuntu -c "nodejs server.js -l 0.0.0.0 -w /home/ubuntu --auth root:secret" &'
==> default: ++ cd /cloud9
==> default: ++ su ubuntu -c 'nodejs server.js -l 0.0.0.0 -w /home/ubuntu --auth root:secret'
  • and the terminal command exits, you can open the browser based IDE at localhost:8181
  • login into the IDE using the default credentials root and secret

Using fabric samples

The repo containing hyperledger fabric samples are already downloaded inside the provisioned VM. You can use the browser IDE to run the sample scripts directly in the cloud9 IDE.

Starting and stopping VM

Use vagrant halt to shutdown the VM (recommended before shutting down the computer)

Use vagrant up to start the VM again (After restarting computer, or after VM shutdown)

Use vagrant destroy to completely erase the entire VM, including all saved data.

Starting composer-playground

Going to the composer-playground folder and start ./playground.sh will bring up a 4-peer network with 1 orderer and 1 fabric-ca, and composer-playground at http://localhost:8080 Have fun!

Creating NetworkAdmin credentials for the playground

This command will enroll the root registrar inside the fabric-ca container itself, using the default password of fabric-ca.

docker exec -it ca.org1.example.com fabric-ca-client enroll -M registrar -u http://admin:adminpw@localhost:7054

Then, use this command to use the registrar credentials to register a new user (to be used as a NetworkAdmin for composer-playground).

docker exec -it ca.org1.example.com fabric-ca-client register -M registrar -u http://localhost:7054 --id.name <user_id> --id.affiliation org1 --id.attrs '"hf.Registrar.Roles=client"' --id.type user

Use the returned password and specified user_id as NetworkAdmin when deploying a new network inside the composer-playground. (ID and Secrets method in playground)

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.