Skip to content

hawkingnetwork/cardano-node-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cardano GraphQL

Getting Started

Check the releases for the latest version.

git clone \
  --single-branch \
  --branch <VERSION> \
  https://github.com/hawkingnetwork/cardano-node-docker.git \
  && cd cardano-node-docker

Build and Run via Docker Compose

  1. Build Images
bash build.sh
  1. Config Explorer Change your server's IP in line 184 - GRAPHQL_API_HOST=192.168.1.219

  2. Run docker

docker-compose up -d && docker-compose logs -f

Check Cardano DB sync progress

Use the GraphQL Playground in the browser at http://localhost:3100/graphql:

{
  cardanoDbMeta {
    initialized
    syncPercentage
  }
}

or via command line:

curl \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"query": "{ cardanoDbMeta { initialized syncPercentage }}"}' \
  http://localhost:3100/graphql

ℹ️ Wait for initialized to be true to ensure the epoch dataset is complete.

Query the full dataset

{
  cardano {
    tip {
      number
      slotNo
      epoch {
        number
      }
    }
  }
}
curl \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"query": "{ cardano { tip { number slotNo epoch { number } } } }"}' http://localhost:3100/graphql

🎉

{
  "data": {
    "cardano": {
      "tip": {
        "number": 4391749,
        "slotNo": 4393973,
        "epoch": { "number": 203 }
      }
    }
  }
}

For more information, have a look at the Wiki 📖.

Documentation

Link Audience
API Documentation Users of the Cardano GraphQL API
Wiki Anyone interested in the project and our development process
Example Queries - Cardano DB Hasura Users of the Cardano DB Hasura API