在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):input-output-hk/cardano-graphql开源软件地址(OpenSource Url):https://github.com/input-output-hk/cardano-graphql开源编程语言(OpenSource Language):TypeScript 47.2%开源软件介绍(OpenSource Introduction):Cardano GraphQL OverviewCross-platform, typed, and queryable API for Cardano. The project contains multiple packages for composing
GraphQL services to meet specific application demands, and a docker-compose stack serving the included
cardano-graphql-server Dockerfile, the extended hasura Dockerfile, cardano-node-ogmios. The schema is defined in
native Apollo Server exposes the NodeJS execution engine over a HTTP endpoint, and includes support for open source metrics
via Prometheus, and implementing operation filtering to deny unexpected queries. Should you wish to have more control
over the server, or stitch the schema with an existing service, consider importing the executable schema from the
GraphQL is a query language and execution environment with server and client implementations across many programming languages. The language can be serialized for network transmission, schema implementations hashed for assurance, and is suited for describing most domains. TypeScript (and JS) has the largest pool of production-ready libraries, developers, and interoperability in the GraphQL and web ecosystem in general. TypeScript definitions for the schema, generated by GraphQL Code Generator, are available on npm. Ogmios is a protocol translation service written in Haskell running on top of cardano-node. It offers a JSON interface through WebSockets and enables applications to speak Ouroboros' client mini-protocols via remote procedure calls. Getting StartedCheck the releases for the latest version. git clone \
--single-branch \
--branch 6.2.0 \
--recurse-submodules \
https://github.com/input-output-hk/cardano-graphql.git \
&& cd cardano-graphql UpChoose one of the following: A) Build and Run via Docker ComposeBoot the docker-compose stack using a convention for container and volume scoping based on the network, as well as optionally hitting the remote cache to speed up the build. The containers are detached, so you can terminate the log console session freely. See Docker Compose docs to tailor for your use-case mainnetGet the most recent weekly snapshot link here, and set it as DOCKER_BUILDKIT=1 \
COMPOSE_DOCKER_CLI_BUILD=1 \
RESTORE_SNAPSHOT=https://update-cardano-mainnet.iohk.io/cardano-db-sync/12/db-sync-snapshot-schema-12-block-6764999-x86_64.tgz \
docker-compose up -d --build &&\
docker-compose logs -f testnetGet the most recent weekly snapshot link here, and set it as DOCKER_BUILDKIT=1 \
COMPOSE_DOCKER_CLI_BUILD=1 \
NETWORK=testnet \
RESTORE_SNAPSHOT=https://updates-cardano-testnet.s3.amazonaws.com/cardano-db-sync/12/db-sync-snapshot-schema-12-block-3185999-x86_64.tgz \
API_PORT=3101 \
HASURA_PORT=8091 \
OGMIOS_PORT=1338 \
POSTGRES_PORT=5433 \
METADATA_SERVER_URI="https://metadata.cardano-testnet.iohkdev.io" \
docker-compose -p testnet up -d --build &&\
docker-compose -p testnet logs -f B) Pull and Run via Docker ComposePull images from Docker Hub and run using a convention for container and volume scoping based on the network. The containers are detached, so you can terminate the log console session freely. See Docker Compose docs to tailor for your use-case. mainnetGet the most recent weekly snapshot link here, and set it as export NETWORK=mainnet &&\
docker pull inputoutput/cardano-graphql:6.2.0-${NETWORK} &&\
docker pull inputoutput/cardano-graphql-hasura:6.2.0 &&\
docker pull cardanosolutions/cardano-node-ogmios:v5.1.0-${NETWORK} &&\
RESTORE_SNAPSHOT=https://update-cardano-mainnet.iohk.io/cardano-db-sync/12/db-sync-snapshot-schema-12-block-6764999-x86_64.tgz \
docker-compose up -d &&\
docker-compose logs -f testnetGet the most recent weekly snapshot link here, and set it as export NETWORK=testnet &&\
docker pull inputoutput/cardano-graphql:6.2.0-${NETWORK} &&\
docker pull inputoutput/cardano-graphql-hasura:6.2.0 &&\
docker pull cardanosolutions/cardano-node-ogmios:v5.1.0-${NETWORK} &&\
RESTORE_SNAPSHOT=https://updates-cardano-testnet.s3.amazonaws.com/cardano-db-sync/12/db-sync-snapshot-schema-12-block-3185999-x86_64.tgz \
API_PORT=3101 \
HASURA_PORT=8091 \
OGMIOS_PORT=1338 \
POSTGRES_PORT=5433 \
docker-compose -p ${NETWORK} up -d &&\
docker-compose -p ${NETWORK} logs -f DownThe following commands will not remove volumes, however should you wish to do so, append mainnetdocker-compose down testnetdocker-compose -p testnet down Check Cardano DB sync progressUse 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
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 |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论