Skip to main content

Get Started with Dandelion APIs

Dandelion currently offer 2 different paths to get started:

  • For developers: A hosted instance of almost every available Cardano API offered as a free community service by Gimbalabs to start building instantly.
  • For SPOs/DevOps/sysadmins: An OpenSource project to deploy the community service using Kubernetes.

For developers

Start prototyping your project instantly by choosing the API that better suits your need.

They are all offered in the vanilla flavour of the opensource projects developed by IOG, Emurgo and other developers from the community, so you won't need to change anything in case you decide to host them by yourself.

These are the links to github repositories and a brief description for all of them:

  • hasura/graphql-api: use this GraphQL API to gather composed info from the blockchain and to send signed transactions to the blockchain
  • cardano-rest/explorer-api: use this REST API to gather basic info from the blockchain. DEPRECATED
  • cardano-rest/submit-api: use this REST API to send signed transactions to the blockchain DEPRECATED
  • KtorZ/ogmios-api: use this JSON-WSP (websocket) API to gather live blockchain info directly from a cardano-node instance
  • cardano-db-sync/postgrest-api: use this REST API to perform SQL queries to gather info directly from cardano-db-sync's database
  • rosetta-api: use this API to integrate your application with multiple blockchains in a simpler, faster, and more reliable way

Cardano GraphQL

img

Useful links:

  • Link to Gimbalabs's endpoints information
  • Link to project's official documentation
  • Link to the official collection of example queries. You can play with them directly from the GraphQL playground

Usage examples:

# testnet
curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-binary \
'{"query":"query cardanoDbSyncProgress {\n cardanoDbMeta {\n initialized\n syncPercentage\n }\n}\n"}' \
https://graphql-api.testnet.dandelion.link

Output example:

{"data":{"cardanoDbMeta":{"initialized":true,"syncPercentage":100}}}

Cardano Explorer

img

Useful links:

  • Link to Gimbalabs's endpoints information
  • Link to project's official documentation

Usage examples:

# testnet
curl -s https://explorer-api.testnet.dandelion.link/api/txs/last
# mainnet
curl -s https://explorer-api.mainnet.dandelion.link/api/txs/last

Output example (REDACTED):

{
"Right": [
{
"cteId": "12703a0f201c9596d4fc256924f98e38d33dc23c4be1c7c3bc9bbc373ee3dbdf",
"cteTimeIssued": 1621292369,
"cteAmount": {
"getCoin": "541898740"
}
},
{
"cteId": "f7f0be9988551b5179b143444f67215a06ef9794f3ed9e6f58a1b067db37f0a1",
"cteTimeIssued": 1621292297,
"cteAmount": {
"getCoin": "1019242"
}
},
...
]
}

Cardano Submit

img

Useful links:

  • Link to Gimbalabs's endpoints information
  • Link to project's official documentation

Usage examples assuming you have a valid application/cbor file containing a signed transaction (in e.g., from cardano-cli or any other library) located at /tmp/cbor-tx:

curl -X POST \
--header "Content-Type: application/cbor" \
--data-binary @/tmp/cbor-tx \
https://submit-api.testnet.dandelion.link/api/submit/tx

Output example (a transaction id):

92bcd06b25dfbd89b578d536b4d3b7dd269b7c2aa206ed518012cffe0444d67f

Cardano Rosetta

img

Useful links:

  • Link to Gimbalabs's endpoints information and official documentation
  • Link to project's official documentation

Usage examples:

curl -s -X POST \
-H 'Content-Type: application/json' \
--data '{"network_identifier":{"blockchain":"cardano","network":"testnet"},"block_identifier":{"index":100}}' \
https://rosetta-api.testnet.dandelion.link/block

Output example:

{
"block": {
"block_identifier": {
"index": 100,
"hash": "4c81fe7ddb7ab93a1973d674f1920bb1be980efdb819ea0a92d25706e72809fc"
},
"parent_block_identifier": {
"index": 99,
"hash": "e8b65f34c3b562a996b6bf6a9109e279536ae7efbc714ae0526bd222e7288eb4"
},
"timestamp": 1564022216000,
"transactions": [],
"metadata": {
"transactionsCount": 0,
"createdBy": "ByronGenesis-0df4205606dcb8ad",
"size": 668,
"epochNo": 0,
"slotNo": 1130
}
}
}

Ogmios

img

Useful links:

  • Link to Gimbalabs's endpoints information and official documentation
  • Link to project's official documentation

Usage examples:

echo '{ "type": "jsonwsp/request", "version": "1.0", "servicename": "ogmios", "methodname": "RequestNext", "args": {} }' \
| websocat --text -1 - wss://ogmios-api.testnet.dandelion.link

Output example:

{
"type": "jsonwsp/response",
"version": "1.0",
"servicename": "ogmios",
"methodname": "RequestNext",
"result": {
"RollBackward": {
"point": "origin",
"tip": {
"slot": 26925169,
"hash": "000a47936fed9bd76cfb52abcd9ab3172ba9118cff9b56767087544f295daba3",
"blockNo": 2591103
}
}
},
"reflection": null
}

PostgREST

img

Useful links:

  • Link to Gimbalabs's endpoints information and official documentation
  • Link to cardano-db-sync official documentation

Usage examples:

# query available metadatums
curl -s "https://postgrest-api.mainnet.dandelion.link/rpc/get_metadatum"
# query metadatum 20201210
curl -d metadatum=20201210 -s "https://postgrest-api.mainnet.dandelion.link/rpc/get_metadata" | jq .
# query metadatum 42 for epoch 234-235 and limit results to 1
curl -s -d metadatum=42 -d epochs="{234,235}" "https://postgrest-api.mainnet.dandelion.link/rpc/get_metadata?limit=1"
# query metadata entry number 15
curl -s "https://postgrest-api.mainnet.dandelion.link/tx_metadata?id=eq.15"
# query pool metadata whose URL contains "repsistance"
curl -s "https://postgrest-api.mainnet.dandelion.link/pool_meta_data?url=like.*repsistance*"
# query metadata entries for SPOCRA proposalId "80064c28-1b03-4f1c-abf0-ca8c5a98d5b9"
curl -s "https://postgrest-api.mainnet.dandelion.link/tx_metadata?json->>ProposalId=eq.80064c28-1b03-4f1c-abf0-ca8c5a98d5b9"
# query metadata entries for the whole SPOCRA network
curl -s "https://postgrest-api.mainnet.dandelion.link/tx_metadata?json->>NetworkId=eq.SPOCRA"

Deploy your own Dandelion

If you already have Docker installed, you are almost done for using Dandelion in your local development environment. Please refer to the official documentation to do so and do not hesitate to ask for support in our dedicated Discord channel, we know operating systems, networks and cloud providers might differ a lot and give random problems!