You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 18, 2023. It is now read-only.
### Clone Set Protocol v2 fork (in separate directory)
47
+
### Clone Set Protocol v2 fork
48
+
49
+
In separate directory:
47
50
48
51
1.`git clone https://github.com/jgrizzled/set-protocol-v2.git -b subgraph-dev && cd set-protocol-v2`
49
52
2.`cp .env.default .env`
50
53
3.`yarn install`
51
-
4.`yarn chain`
52
-
5.`yarn deploy-mock`
53
54
54
-
Restart `yarn chain` if redeploying.
55
+
To run the hardhat node:
56
+
57
+
1.`yarn chain --hostname 0.0.0.0`
58
+
2. Wait for node to start
59
+
3. (in separate terminal) `yarn deploy-mock`
55
60
56
61
### Install Graph Node
57
62
63
+
In separate directory:
64
+
58
65
1.`git clone -q --depth=1 https://github.com/graphprotocol/graph-node.git && cd graph-node/docker`
59
-
2. Edit line 20 of docker-compose.yml to `ethereum: hardhat:http://host.docker.internal:8545` (May need to replace host.docker.internal with local IP)
66
+
2. Edit line 20 of docker-compose.yml to `ethereum: hardhat:http://host.docker.internal:8545` (May need to replace host.docker.internal with LAN IP)
60
67
3. Run with `sudo docker-compose up`
61
68
62
-
`rm -rf ./data` and restart containers if hardhat chain changes
69
+
`rm -rf ./data` and restart containers if blockchain changes.
63
70
64
71
`sudo docker-compose build` if updated via `git pull`
65
72
66
73
### Deploy subgraph locally
67
74
75
+
From subgraph repo:
76
+
68
77
1.`yarn gen-deployment hardhat`
69
78
2.`yarn deploy-local`
70
79
71
80
Graph-node may take a few minutes to sync the subgraph.
72
81
73
82
Visit `http://localhost:8000/subgraphs/name/desert-defi/setprotocolv2/graphql` to view subgraph data
74
83
84
+
## Syncing to mainnet
85
+
86
+
Syncing the subgraph to mainnet requires an Ethereum archive node. We recommend [Turbogeth](https://github.com/ledgerwatch/turbo-geth) as it syncs fast and will fit on a 2TB SSD at present. Note that it takes a few hours for the subgraph to sync and re-deploying the subgraph will re-sync from scratch.
87
+
88
+
### Turbogeth
89
+
90
+
In separate directory:
91
+
92
+
1.`git clone -q --depth=1 https://github.com/ledgerwatch/turbo-geth.git && cd turbo-geth`
93
+
2.`sudo docker-compose build` (re-run if updated via `git pull`)
94
+
3.`sudo XDG_DATA_HOME=/preferred/data/folder docker-compose up -d`
0 commit comments