@chainstack/graph-cli
v0.0.101
Published
The Chainstack CLI to build, deploy, and index blockchain data.
Maintainers
Readme
The Chainstack Graph CLI (chainstack subgraph ..)
The Chainstack Subgraph Command
As of today, the command line interface supports the following commands:
chainstack subgraph init— Creates a new subgraph project from an example or an existing contract.chainstack subgraph create— Registers a subgraph name with a Graph Node.chainstack subgraph remove— Unregisters a subgraph name with a Graph Node.chainstack subgraph codegen— Generates AssemblyScript types for smart contract ABIs and the subgraph schema.chainstack subgraph build— Compiles a subgraph to WebAssembly.chainstack subgraph deploy— Deploys a subgraph to a Chainstack Node.chainstack subgraph add- Adds a new datasource to the yaml file and writes the necessary changes to other files - schema.graphql, abi and mapping.
How It Works
The Graph CLI takes a subgraph manifest (defaults to subgraph.yaml) with references to:
- A GraphQL schema,
- Smart contract ABIs, and
- Mappings written in AssemblyScript.
It compiles the mappings to WebAssembly, builds a ready-to-use version of the subgraph saved to IPFS or a local directory for debugging, and deploys the subgraph to a Chainstack Node.
Installation
The Graph CLI can be installed with npm or yarn:
# NPM
npm install -g @chainstack/graph-cli
# Yarn
yarn global add @chainstack/graph-cli