hlf-sync

command module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

README

HLF Sync

Introduction

Hyperledger Fabric stores the information in blocks, but this information is not structured and lacks search/processing capabilities of new databases.

This project aims to store all the information in an OffChain database to access the blockchain data as well as add as a means to see the data for other purposes, such as validating, dashboards, statistics, etc.

Databases supported

  • Elasticsearch
  • PostgreSQL
  • MySQL
  • MariaDB
  • Meilisearch

Get started

Pre requisites:

  • A running Hyperledger Fabric network
  • A running supported database

You can download the binary in the release page

hlf-sync --network=./hlf.yaml --config=config.yaml --channel=mychannelname

Network Config

Network config file needs to be compliant with fabric-sdk-go. You can find examples in the official repo.

Configuration file

The configuration file for a meilisearch backend

database:
  type: meilisearch
  url: "http://localhost:7700"
  apiKey: ""

The configuration file for a postgresql backend

database:
  type: sql
  driver: postgres
  dataSource: host=localhost port=5432 user=postgres password=postgres dbname=hlf sslmode=disable

The configuration file for a mysql backend

database:
  type: sql
  driver: mysql
  dataSource: root:my-secret-pw@tcp(127.0.0.1:3306)/hlf?charset=utf8mb4&parseTime=True&loc=Local

The configuration file for a mariadb backend

database:
  type: sql
  driver: mysql
  dataSource: root:my-secret-pw@tcp(127.0.0.1:3306)/hlf?charset=utf8mb4&parseTime=True&loc=Local

The configuration file for an Elasticsearch backend

database:
  type: elasticsearch
  urls:
    - http://localhost:9200
  user:
  password:

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
pkg

Jump to

Keyboard shortcuts

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