Code Monkey home page Code Monkey logo

fabric-cli's Introduction

Note: Issue tracking is handled in Jira. If you find any issues or you want to add new features, please work with Jira.

This repo is going to be used to implement FAB-10734 Fabric CLI Redesign. This is NOT the "official" Fabric CLI and there is not yet any commitment that it is going to be.

Hyperledger Fabric CLI

The Hyperledger Fabric CLI is a tool used to interact with Fabric networks.

Installation

  1. Clone this repo
  2. Run make
  3. Locate the binary in the bin directory
  4. Add the binary to your PATH
  5. Execute fabric for more information

Getting Started

  1. Add a Network with fabric network set
  2. Add a Context with fabric context set
  3. Use the new context with fabric context use
  4. You're all set... Have fun!

Network

A network is a direct reference to a Fabric-SDK-Go configuration. This configuration contains all of the necessary details for interacting with a Fabric network at a global scope.

Context

A context defines the scope for interactions with the network. An example of this would be: As Admin, I want peer peer0.org1.example.com in organization Org1 to join channel mychannel. In this example, the context would include the identity, peer, organization, and channel.

Built-in Commands

Built-in commands can be found in /cmd/fabric/commands. These commands can serve as examples for building future commands like plugin chaincode install ....

Plugins

Users can create and install custom commands to the Fabric CLI. The only requirement is that all external commands must provide a plugin.yaml.

The YAML must specify:

  • Name - command name
  • Usage - usage syntax
  • Description - short description shown for help
  • Command - plugin execution

Example plugins can be found in pkg/plugin/testdata/plugins.

For example,if you want to integrate cryptogen into fabric cmd:

  1. Prepare the plugin.yaml:
     name: cryptogen
     usage: cryptogen [<flags>] <command> [<args> ...]
     description: Utility for generating Hyperledger Fabric key material
     command: cryptogen
  2. Exec the command:
    #PATH is the location of `plugin.yaml`.
    $fabric plugin install $PATH
  3. To enjoy the command:
    $fabric cryptogen ...
    

You can integrate some Go Plugins or External Command into fabric cmd,

Documentation

Contributing

  1. Fork this repo on github.
  2. Clone the forked repo to your local enviroment (git clone https://github.com/you_username/fabric-cli.git && cd fabric-cli).
  3. Create your feature branch (git checkout -b feature-branch).
  4. Install gobin using GO111MODULE=off go get -u github.com/myitcv/gobin
  5. Make changes and use make test to finish the test.
  6. If test passed, add them (git add .).
  7. Use make lint to verify your code.
  8. If correct, commit your changes (git commit -s).
  9. Push to github (git push origin feature-branch).
  10. Create new Pull Request.

License

Hyperledger Project source code files are made available under the Apache License, Version 2.0 (Apache-2.0), located in the LICENSE file. Hyperledger Project documentation files are made available under the Creative Commons Attribution 4.0 International License (CC-BY-4.0), available at http://creativecommons.org/licenses/by/4.0/.

fabric-cli's People

Contributors

bstasyszyn avatar denyeart avatar jwagantall avatar lehors avatar lindluni avatar mastersingh24 avatar muralisrini avatar ryjones avatar topjohn avatar troyronda 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.