第0节:命令速查
小白入门:https://github.com/dukedaily/solidity-expert ,欢迎star转发,文末加V入群。
职场进阶: https://dukeweb3.com
1. graph node搭建相关
clone graph-node
git clone git@github.com:graphprotocol/graph-node.git
accessing Docker directory of the graph node
cd graph-node/docker
Replacing host IP(Linux only)
./setup.sh
starting the local graph node
docker-compose up
accessing
cd <you-subgraph> graph codegen graph build
create subgraph
npm run create-local
deploy
npm run deploy-local
2. host service搭建相关
安装graph命令
npm install -g @graphprotocol/graph-cli
场景一:合约已经部署&verify,准备生成subgraph
graph init \ --product hosted-service --from-contract <CONTRACT_ADDRESS> \ <GITHUB_USER>/<SUBGRAPH_NAME> [<DIRECTORY>]
场景二:获取官方demo
graph init --from-example --product hosted-service <GITHUB_USER>/<SUBGRAPH_NAME> [<DIRECTORY>]
auth
graph auth --product hosted-service <AuthKey>
生成&编译
graph codegen graph build
3. Studio方式搭建(去中心化)
TODO