Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/kfsoftware/hlf-sync
- Owner: kfsoftware
- License: apache-2.0
- Created: 2021-03-13T19:58:27.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-13T14:44:57.000Z (almost 4 years ago)
- Last Synced: 2024-06-20T12:58:36.507Z (8 months ago)
- Topics: fabric, hyperledger, hyperledger-fabric
- Language: Go
- Homepage:
- Size: 253 KB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 databaseYou 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:
```