This project is the outcome of a mini-hackathon in which the BigchainDB and TheLedger teams participated on the 16-17 of August 2018.
The high level design specification is available at - ./specs/design.md
The directory structure of this project is as below :
.
├── LICENSE
├── README.md
├── bdb-hyperledger-oracle/
│
├── data_job/
│
├── hyperledger-chainservice/
│
├── specs/
│
└── ui/
This is a node based cron job that posts transactions to BigchainDB network.
This is a react based app to access REST API of Hyperledger Fabric chain service. This UI is for demo usage of the BigchainDB-Hyperledger Fabric oracle. The web form first creates a BigchainDB asset by taking passphrase and asset data (a number). Once the asset is created, the asset id is passed to a Hyperledger chain-code which internally passes it to the oracle. The oracle then queries BigchainDB with the asset id and executes a callback passed by the Hyperledger chain-code. The oracle then sends back the results to Hyperledger chain service.
This is hyperledger chain-service that interacts with the fabric network.
This project is an express API that functions as an oracle between Hyperledger Fabric (here in hyperledger-chainservice/
) and BigchainDB.
In a real scenario, the chain-code can do pre-processing and create a dynamic callback before sending the request to the oracle.
- BigchainDB network is up and running
- Hyperledger network is up and running (to run the Hyperledger fabric network, run the
startFabric.sh
script in the/hyperledger-network/scripts
directory)
-
Create
.env
files in the root of each of oracle, chainservice and ui based on their.env.example
files, respectively. -
Update the
.env
values as per your network and node IP addresses and ports. -
From new terminal, in
hyperledger-chainservice/
executeyarn
andyarn run start:watch
. This will start Hyperledger-chaincode REST server to be consumed by UI. -
From new terminal, in
ui/
, executenpm install
and thennpm start
. This will start react application on port 3000. -
From another new terminal, run
docker-compose build
anddocker-compose up
from the root directory. This will bring up the oracle.
- In your browser, visit
http://localhost:3000
, you will see UI for this project. - Follow the instructions on the web page.