-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
49 lines (38 loc) · 1.66 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
ENDPOINT ?= mainnet.eth.streamingfast.io:443
STOP_BLOCK ?= +10
# Deployement to `substreams-sink-postgres` config
IPFS_ENDPOINT ?= http://127.0.0.1:5001
GRAPH_NODE_ENDPOINT ?= http://127.0.0.1:8020
GRAPHMAN_CONFIG ?= ../graph-node-dev/config/graphman.toml
# Deployement to `graph-node` config (defaults is for a local deployment)
POSTGRESQL_DSN ?= psql://dev-node:insecure-change-me-in-prod@localhost:5432/dev-node?sslmode=disable
.PHONY: build
build:
cargo build --target wasm32-unknown-unknown --release
.PHONY: db_out
db_out: build
substreams run -e $(ENDPOINT) substreams.yaml db_out -t $(STOP_BLOCK) --debug-modules-output=store_block_meta_start,db_out
.PHONY: graph_out
graph_out: build
substreams run -e $(ENDPOINT) substreams.yaml graph_out -t $(STOP_BLOCK)
.PHONY: kv_out
kv_out: build
substreams run -e $(ENDPOINT) substreams.yaml kv_out -t $(STOP_BLOCK)
.PHONY: protogen
protogen:
substreams protogen ./substreams.yaml --exclude-paths="google,sf/substreams,substreams/sink/kv,database.proto"
.PHONE: pack
pack: build
substreams pack -o substreams.spkg substreams.yaml
.PHONE: deploy_graph_node
deploy_graph_node: pack
graph build --ipfs $(IPFS_ENDPOINT) subgraph.yaml
graph create block_meta --node $(GRAPH_NODE_ENDPOINT)
graph deploy --node $(GRAPH_NODE_ENDPOINT) --ipfs $(IPFS_ENDPOINT) --version-label v0.0.1 block_meta subgraph.yaml
.PHONE: undeploy_graph_node
undeploy_graph_node:
graphman --config "$(GRAPHMAN_CONFIG)" drop --force block_meta
.PHONE: sink_postgres
sink_postgres: pack
substreams-sink-postgres setup --ignore-duplicate-table-errors "$(POSTGRESQL_DSN)" schema.sql
substreams-sink-postgres run $(POSTGRESQL_DSN) $(ENDPOINT) "substreams.spkg" db_out