Skip to content

Latest commit

 

History

History
 
 

core-graphql

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

ARK Core

ARK Core - GraphQL

Installation

yarn add @arkecosystem/core-graphql

Configuration

module.exports = {
  enabled: !process.env.ARK_GRAPHQL_DISABLED,
  host: process.env.ARK_GRAPHQL_HOST || '0.0.0.0',
  port: process.env.ARK_GRAPHQL_PORT || 4005,
  path: '/graphql',
  graphiql: true
}

Usage

You can play with the data using the GraphQL Playground, or programmatically posting querys directly to the endpoint. By default the endpoint is http://0.0.0.0:4005/graphql, but can be changed in your configuration.

Query Examples

Get first blocks

{
  blocks(orderBy: {field: "height", direction: ASC}) {
    id,
    payloadHash,
    height,
    numberOfTransactions
  }
}

Get the list of transactions from a specific block

{
  block(id: "13114381566690093367") {
    timestamp,
    generatorPublicKey,
    transactions {
      id,
      type,
      amount
    }
  }
}

Get the recipient info of each transaction

{
  block(id: "13114381566690093367") {
    generatorPublicKey,
    transactions {
      id,
      recipient {
        address,
        balance
      }
    }
  }
}

Security

If you discover a security vulnerability within this package, please send an e-mail to security@ark.io. All security vulnerabilities will be promptly addressed.

Credits

License

MIT © ArkEcosystem