当前位置:网站首页>Graph node deployment and testing
Graph node deployment and testing
2022-07-27 08:06:00 【I don't want to be bald】
Graph-node Deployment and testing
One 、 Environmental preparation
Two 、 Run this map node
- In the terminal , clone https://github.com/graphprotocol/example-subgraph, And install dependencies and contract ABI Generation type :(yarn install )
yarn
yarn codegen
- In the terminal , clone https://github.com/graphprotocol/graph-node, And then run
cargo build
- function ganache
./ganache-2.5.4-linux-x86_64.AppImage &

- function ipfs
ipfs daemon

- stay subgraph Compile and deploy smart contracts under folder
// compile
truffle compile
// Deploy
truffle migrate

- stay postgreSQL Created in graphnode database
sudo su postgres
psql
create database graphnode;

- stay graph-node Enter the following command under the folder , function graph-node:
cargo run -p graph-node --release -- \
--postgres-url postgresql://postgres:[email protected]:5432/graphnode \
--ethereum-rpc mainnet:http://127.0.0.1:7545 \
--ipfs 127.0.0.1:5001 --debug

- modify subgraph In folder subgraph.yaml, Change the contract address to the previously deployed address
sudo gedit subgraph.yaml


- Use this Gravatar Example , Let the subgraph run locally , stay subgraph Run under folder :
yarn create-local

- Deploy subgraphs
yarn deploy-local

- here graph-node You can see that the subgraph has been deployed

- Try calling the smart contract to create a gravatar
// Access control
truffle console
// Create contract instance
GravatarRegistry.deployed().then(instance=>contract=instance)
// Create a displayName by Tom Of Gravatar
contract.createGravatar('Tom','Url')
// Specify the account to call the contract
contract.createGravatar('Lucy','Url2',{from: '0x761AE16Df0bF66E6d461F1C936F40e61F2fE1Ed7'})
- Transaction success interface

- graph-node Get the call contract record and log

- visit http://127.0.0.1:8000/subgraphs/name/example/graphql Can be done graphql

END
边栏推荐
- 物联网工业级UART串口转WiFi转有线网口转以太网网关WiFi模块选型
- Design and development of GUI programming for fixed-point one click query
- QingChuang technology joined dragon lizard community to build a new ecosystem of intelligent operation and maintenance platform
- Lua iterator
- SQL labs SQL injection platform - level 1 less-1 get - error based - Single Quotes - string (get single quote character injection based on errors)
- Redison 3.17.5 release, officially recommended redis client
- How to update PIP3? And running PIP as the 'root' user can result in broken permissions and conflicting behavior
- [resolved] the new version of pychart (2022) connects to the server to upload files and reports an error of "command Rsync is not found in path", and the files cannot be synchronized
- C language: random number + Hill sort
- C#委托的使用案例
猜你喜欢

Is redis really slowing down?

Data extraction 1

Record a PG master-slave setup and data synchronization performance test process

Grandson's questions are difficult, and his son's invigilation is strict. I can't do it. Pay back my school money

Teach you to build a nail warning robot hand in hand

I can't figure out why MySQL uses b+ trees for indexing?
![[ten thousand words long article] thoroughly understand load balancing, and have a technical interview with Alibaba Daniel](/img/fc/1ee8b77d675e34da2eb8574592c489.png)
[ten thousand words long article] thoroughly understand load balancing, and have a technical interview with Alibaba Daniel

如何更新pip3?和Running pip as the ‘root‘ user can result in broken permissions and conflicting behaviour

2020国际机器翻译大赛:火山翻译力夺五项冠军

【目标检测】YOLOv6理论解读+实践测试VisDrone数据集
随机推荐
How to log in multiple wechat on the computer
Shenzhi Kalan Temple
Use of NPM
C language: random number + Hill sort
Promise details
【飞控开发基础教程4】疯壳·开源编队无人机-串口(光流数据获取)
一文速览EMNLP 2020中的Transformer量化论文
【Day42 文献精读】A Bayesian Model of Perceived Head-Centered Velocity during Smooth Pursuit Eye Movement
数据提取1
opengauss从库停掉,发现主库无法写入数据
杂谈:手里有竿儿,肩上有网,至于背篓里有多少鱼真的重要吗?
How to play with the purchase of SAP variant materials? Look at this article and you will understand
Dasctf2022.07 enabling game password WP
MySQL table name area in Linux is not case sensitive
综合案例、
The code interface is a little automated
C#winform 窗体事件和委托结合用法
Grandson's questions are difficult, and his son's invigilation is strict. I can't do it. Pay back my school money
实用的新药研发项目管理平台
[ten thousand words long article] thoroughly understand load balancing, and have a technical interview with Alibaba Daniel