Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kfsoftware/hlf-sync

Synchronize the ledger with your databases
https://github.com/kfsoftware/hlf-sync

fabric hyperledger hyperledger-fabric

Last synced: 3 months ago
JSON representation

Synchronize the ledger with your databases

Awesome Lists containing this project

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

- [x] Elasticsearch
- [x] PostgreSQL
- [x] MySQL
- [x] MariaDB
- [x] Meilisearch

## Get started

Pre requisites:
- A running Hyperledger Fabric network
- A running supported database

You can download the binary in the [release page](https://github.com/kfsoftware/hlf-sync/releases)

```bash
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](https://github.com/hyperledger/fabric-sdk-go/blob/main/test/fixtures/config/config_e2e.yaml).

## Configuration file
The configuration file for a meilisearch backend
```yaml
database:
type: meilisearch
url: "http://localhost:7700"
apiKey: ""
```

The configuration file for a postgresql backend
```yaml
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
```yaml
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
```yaml
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
```yaml
database:
type: elasticsearch
urls:
- http://localhost:9200
user:
password:
```