dab
Decentralized application backend for Cardano.
About • Installation • Usage • Contributing
About
Decentralized application backend (dab) is a toolset that help developers interact with the Cardano blockchain and its smart validators.
At its core, the component called chain-watcher
is following the chain looking for specific events expected by the application backend. It supports different providers to access the Cardano network.
Community
Decentralized application backend (dab) is a community project. We are releasing this minimal viable product in a modular form (at the moment it supports Blockfrost as a provider), we hope that it will gather developer community momentum and we will see many more different providers such as Oura, Koios or Ogmios emerge from the development community.
We strongly encourage community members to apply for Project Catalyst funding to make this project their own and better.
Installation
Building with Nix
Nix is the prefered way to build the chain-watcher and its components.
nix-build -A chain-watcher.components.exes.chain-watcher-blockfrost
Building with Docker
Please see docs/Docker.md.
Usage
Running the application backend demo
To run the application backend demo ⚡, do the following:
nix-shell
export BLOCKFROST_TOKEN_PATH=~/.blockfrost.testnet.token
cabal run chain-watcher-blockfrost
View the demo on http://localhost:8282/demo/index.html
Demo of demo
Client API
Register new client
To register a new client on the chain-watcher.
cid="$( curl -q -X POST -v localhost:8282/clients/new | jq -r)"
Remove client
To remove an exising client on the chain-watcher.
curl -X POST -v localhost:8282/clients/remove/${cid}
Subscribe to event
To subscribe your client to a specific event on the chain-watcher.
curl \
-X POST \
-H "Content-Type: application/json" \
-v localhost:8282/clients/request/${cid} \
--data '{"contents":"1075a1c98dbdf3486ec8f5050c84da30a057cb79ae0ce6d03d157c719c559332","tag":"TransactionStatusRequest"}'
Recurring request
To subscribe your client to a reoccuring specific event on the chain-watcher.
curl -X POST --data '{"contents":{"tag":"Ping"},"tag":"Recurring"}' -H "Content-Type: application/json" -v localhost:8282/clients/request/${cid}
Address change request
To change your address event watching.
curl -X POST --data '{"contents":"addr_test1wpzjtlyp6v4qx6gzjm4zc7lsdufw597507y060qhk84vpjsjd625n","tag":"AddressFundsRequest"}' -H "Content-Type: application/json" -v localhost:8282/clients/request/${cid}
Follow server-sent event stream
To follow on the even stream from the chain-watcher.
curl -v -N --http2 -H "Accept:text/event-stream" localhost:8282/sse/${cid}
Contributing
We are looking forward to your contributions!
💡 See Contributing and Code of conduct for more information about how to contribute your code.