fabex

command module
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

README

Block explorer for Hyperledger Fabric


Reference

Prerequisites

Microservice mode

UI

CLI usage

Testing


FabEx is inspired by ledgerfsck

Prerequisites

  1. Configure config.yaml (it's main config of the Fabex) and connection-profile.yaml (Hyperledger Fabric connection profile)

  2. Install and start database (MongoDB or CassandraDB)

    If you choose Mongo:

    1. set initial user name and password in db/mongo-compose/docker-compose.yaml
    2. start container:
    make mongo
    

    If you choose Cassandra:

    make cassandra
    
  3. (OPTIONAL) Start your Fabric blockchain network or sample test network with

    make fabric-test
    



Microservice mode

You can start Fabex as standalone microservice with Cassandra blocks storage:

./fabex -task=grpc -configpath=configs -configname=config -enrolluser=true -db=cassandra

or with Mongo storage

./fabex -task=grpc -configpath=configs -configname=config -enrolluser=true -db=mongo

Use fabex.proto as service contract.

Example of GRPC client implementation.



UI

UI is available on port 5252

UI



CLI

Build Fabex executable binary file:

go build

Enroll admin user:

./fabex -enrolluser=true

Save blocks data to db:

./fabex -task=explore -configpath=configs -configname=config -db=cassandra

Also you can start service for fetching blocks in daemon mode:

./fabex -task=explore -configpath=configs -configname=config -db=cassandra

Get transactions of specific block (chain operation):

./fabex -task=getblock -blocknum=14 -configpath=configs -configname=config -db=cassandra

Get all transactions (db operation):

./fabex -task=getall -configpath=configs -configname=config -db=cassandra

You can choose database for data saving and retrieving with -db flag (MongoDB or CassandraDB):

./fabex -task=explore -configpath=configs -configname=config -db=mongo
./fabex -task=explore -configpath=configs -configname=config -db=cassandra



Testing

unit tests: make unit-tests

integration tests: make integration-tests


Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package blockhandler provides functionality for fetching blocks from blockchain
Package blockhandler provides functionality for fetching blocks from blockchain
Package db provides database interface for storing and retrieving blocks and transactions
Package db provides database interface for storing and retrieving blocks and transactions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL