Skip to content

Commit

Permalink
Add config variables for ropsten and mainnet deployments (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-dydx authored Oct 12, 2021
1 parent 7c26432 commit 099bae5
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/generated
/node_modules
/build
/subgraph.yaml
9 changes: 9 additions & 0 deletions config/mainnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"network": "mainnet",
"startBlock": 12809555,
"dydxTokenAddress": "0x92D6C1e31e14520e676a687F0a93788B716BEff5",
"dydxGovernorAddress": "0x7E9B1672616FF6D6629Ef2879419aaE79A9018D2",
"safetyModuleAddress": "0x65f7BA4Ec257AF7c55fd5854E5f6356bBd0fb8EC",
"merkleDistributorAddress": "0x01d3348601968aB85b4bb028979006eac235a588",
"liquidityStakingAddress": "0x5Aa653A076c1dbB47cec8C1B4d152444CAD91941"
}
9 changes: 9 additions & 0 deletions config/ropsten.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"network": "ropsten",
"startBlock": 10950559,
"dydxTokenAddress": "0x78b8ED55608F3db3f4e5A0A6f495f75cB8e0172F",
"dydxGovernorAddress": "0x5Fd2BfBba46f1EA4b5f7D468ddcd3Fa9Aca7Ce7F",
"safetyModuleAddress": "0xb9B802E34e646D383b85D9B9ad1B2baDf807603E",
"merkleDistributorAddress": "0x0968e47cBa485006d9CDC6a8eAa94eba779Ca309",
"liquidityStakingAddress": "0xf6c7cbb3381c819dD403a1b4B7669fE468cf738f"
}
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{
"name": "dydx-ropsten",
"name": "dydx-subgraph",
"license": "Apache 2.0",
"scripts": {
"codegen": "graph codegen",
"build": "graph build",
"deploy": "graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ dydxfoundation/dydx-ropsten",
"prepare:ropsten": "mustache config/ropsten.json subgraph.template.yaml > subgraph.yaml",
"prepare:mainnet": "mustache config/mainnet.json subgraph.template.yaml > subgraph.yaml",
"deploy:ropsten": "yarn prepare:ropsten && graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ dydxfoundation/dydx-ropsten",
"deploy:mainnet": "yarn prepare:mainnet && graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ dydxfoundation/dydx",
"create-local": "graph create --node http://localhost:8020/ fraypoint/merkle",
"remove-local": "graph remove --node http://localhost:8020/ fraypoint/merkle",
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 fraypoint/merkle"
},
"dependencies": {
"@graphprotocol/graph-cli": "0.22.1",
"@graphprotocol/graph-ts": "0.22.0"
"@graphprotocol/graph-ts": "0.22.0",
"mustache": "^4.2.0"
}
}
30 changes: 15 additions & 15 deletions subgraph.yaml → subgraph.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ schema:
dataSources:
- kind: ethereum/contract
name: DydxToken
network: ropsten
network: {{network}}
source:
address: "0x78b8ED55608F3db3f4e5A0A6f495f75cB8e0172F"
address: "{{dydxTokenAddress}}"
abi: DydxToken
startBlock: 10950559
startBlock: {{startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.5
Expand All @@ -26,11 +26,11 @@ dataSources:
file: ./src/token.ts
- kind: ethereum/contract
name: DydxGovernor
network: ropsten
network: {{network}}
source:
address: "0x5Fd2BfBba46f1EA4b5f7D468ddcd3Fa9Aca7Ce7F"
address: "{{dydxGovernorAddress}}"
abi: DydxGovernor
startBlock: 10950559
startBlock: {{startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.5
Expand All @@ -49,11 +49,11 @@ dataSources:
file: ./src/proposal.ts
- kind: ethereum/contract
name: SafetyModule
network: ropsten
network: {{network}}
source:
address: "0xb9B802E34e646D383b85D9B9ad1B2baDf807603E"
address: "{{safetyModuleAddress}}"
abi: SafetyModule
startBlock: 10950559
startBlock: {{startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.5
Expand All @@ -73,11 +73,11 @@ dataSources:
file: ./src/safety-module.ts
- kind: ethereum/contract
name: MerkleDistributor
network: ropsten
network: {{network}}
source:
address: "0x0968e47cBa485006d9CDC6a8eAa94eba779Ca309"
address: "{{merkleDistributorAddress}}"
abi: MerkleDistributor
startBlock: 10950559
startBlock: {{startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.5
Expand All @@ -93,11 +93,11 @@ dataSources:
file: ./src/merkle-distributor.ts
- kind: ethereum/contract
name: LiquidityStaking
network: ropsten
network: {{network}}
source:
address: "0xf6c7cbb3381c819dD403a1b4B7669fE468cf738f"
address: "{{liquidityStakingAddress}}"
abi: LiquidityStaking
startBlock: 10950559
startBlock: {{startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.5
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1996,6 +1996,11 @@ murmurhash3js@^3.0.1:
resolved "https://registry.yarnpkg.com/murmurhash3js/-/murmurhash3js-3.0.1.tgz#3e983e5b47c2a06f43a713174e7e435ca044b998"
integrity sha1-Ppg+W0fCoG9DpxMXTn5DXKBEuZg=

mustache@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/mustache/-/mustache-4.2.0.tgz#e5892324d60a12ec9c2a73359edca52972bf6f64"
integrity sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==

[email protected]:
version "0.0.8"
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d"
Expand Down

0 comments on commit 099bae5

Please sign in to comment.