
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@graphprotocol/graph-cli
Advanced tools
The Graph command line interface.
As of today, the command line interface consists of two commands:
graph codegen
— generates TypeScript code for smart contract ABIs used in subgraphs.graph build
— compiles subgraphs to WebAssembly and deploys them to IPFS.graph
takes a subgraph.yaml
subgraph manifest with
compiles the mappings to WebAssmebly and deploys a ready-to-use version of the subgraph to IPFS or a local directory for debugging.
Subgraphs for The Graph are set up just like any regular TypeScript
project. It is recommended to install graph-cli
as a local dependency
via package.json
and use npm
scripts for code generation and
building.
An example of this can be found in the Decentraland repository.
package.json
etc.subgraph.yaml
subgraph manifest with a GraphQL schema etc.graph-cli
as a local dependency with one of
npm install --save-dev graph-cli # NPM
yarn add --dev graph-cli # Yarn
tsconfig.json
:
{
"extends": "./node_modules/graph-cli/tsconfig.json",
"files": ["mapping.ts"]
}
Note: Replace "mapping.ts"
with your own mapping fil(e)s.package.json
:
{
"scripts": {
"codegen": "graph generate-types subgraph.yaml",
"build": "graph build subgraph.yaml",
"build-ipfs": "graph build --ipfs /ip4/127.0.0.1/tcp/5001 subgraph.yaml"
}
}
Note: Replace the IPFS address with any IPFS node you want to deploy the subgraph to.yarn codegen
mapping.ts
against these generated types.yarn build # Will drop the results in dist/
yarn build-ipfs # Will also deploy to IPFS and output an IPFS hash
Copyright © 2018 Graph Protocol, Inc. and contributors.
The Graph CLI is dual-licensed under the MIT license and the Apache License, Version 2.0.
FAQs
CLI for building for and deploying to The Graph
The npm package @graphprotocol/graph-cli receives a total of 13,858 weekly downloads. As such, @graphprotocol/graph-cli popularity was classified as popular.
We found that @graphprotocol/graph-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.