当前位置:网站首页>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
边栏推荐
- Local Oracle reported ora-12514: tns: the listener cannot recognize the requested service at present
- Is redis really slowing down?
- Opengauss stopped from the library and found that the main library could not write data
- 【飞控开发基础教程4】疯壳·开源编队无人机-串口(光流数据获取)
- docker 安装mysql后进入容器内部发现登录不了mysql
- 一文速览EMNLP 2020中的Transformer量化论文
- Five day travels to Beijing
- 代码接口自动化的有点
- 抽象工厂模式
- How to log in multiple wechat on the computer
猜你喜欢

SETTA 2020 国际学术会议即将召开,欢迎大家参加!

DEMO SUBMIT 某程序并获取该程序ALV数据

大家节日快乐哈

The seta 2020 international academic conference will be held soon. Welcome to attend!

1024 | in the fourth year officially called Menon, the original intention is still there, and continue to move forward

Promise详解

QingChuang technology joined dragon lizard community to build a new ecosystem of intelligent operation and maintenance platform

C commissioned use cases

浅谈数据安全

Gossip: is rotting meat in the pot to protect students' rights and interests?
随机推荐
"Intermediate and advanced test questions": what is the implementation principle of mvcc?
代码接口自动化的有点
C language: optimized Hill sort
反弹shell是什么?反弹shell有什么用?
Stored procedure trial 2 -- establish a test table to test different types of stored procedures
My senior
Modification case of Ruixin micro rk3399-i2c4 mounting EEPROM
Enhancement: BTE process introduction
综合案例、
实用的新药研发项目管理平台
Data extraction 2
opengauss从库停掉,发现主库无法写入数据
Dormitory access control system made by imitating the boss (III)
鲁迅:我不记得说没说过,要不你自己查!
数据提取2
What are the software tuning methods? Let's see what Feiteng technology experts say about dragon lizard technology
How to update PIP3? And running PIP as the 'root' user can result in broken permissions and conflicting behavior
Combined use of C WinForm form form event and delegate
Lua有状态迭代器
File name wildcard rules for kettle