Skip to content

Commit

Permalink
feat: Code to deploy goerli (#709)
Browse files Browse the repository at this point in the history
* feat: Code to deploy goerli

* feat: Lower case contracts addresses

* chore: Add goerli graph to readme
  • Loading branch information
fzavalia authored Jul 12, 2022
1 parent a21e62d commit b0d5d69
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions indexer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Mainnet: https://thegraph.com/hosted-service/subgraph/decentraland/marketplace (QmWF9uXD9KokRU1hA5Gnmc3VKU5mPU3cAYmD15cfa8YDTT)
- Ropsten: https://thegraph.com/hosted-service/subgraph/decentraland/marketplace-ropsten (QmfHCGhLTZV8v2duxDkKtPZKMEdJM7X8YGRj2UvqmrAUBB)
- Goerli: https://thegraph.com/hosted-service/subgraph/decentraland/marketplace-goerli (QmVJ5XudhdALBoyYg8w4bPC62E2N6LKgDteVA2NFnETsL2)

It uses [thegraph](https://thegraph.com)

Expand Down
3 changes: 2 additions & 1 deletion indexer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"auth:studio": "graph auth https://api.studio.thegraph.com/deploy/",
"deploy-studio:mainnet": "graph deploy --node https://api.studio.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ decentraland-marketplace-ethereum-mainnet",
"deploy:ropsten": "ts-node ./scripts/buildData.ts --network ropsten && ts-node ./scripts/deploy.ts --network ropsten",
"deploy:mainnet": "ts-node ./scripts/buildData.ts --network mainnet && ts-node ./scripts/deploy.ts --network mainnet"
"deploy:mainnet": "ts-node ./scripts/buildData.ts --network mainnet && ts-node ./scripts/deploy.ts --network mainnet",
"deploy:goerli": "ts-node ./scripts/buildData.ts --network goerli && ts-node ./scripts/deploy.ts --network goerli"
},
"devDependencies": {
"@graphprotocol/graph-cli": "^0.21.1",
Expand Down
13 changes: 11 additions & 2 deletions indexer/scripts/buildData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import * as path from 'path'

enum Network {
MAINNET = 'mainnet',
ROPSTEN = 'ropsten'
ROPSTEN = 'ropsten',
GOERLI = 'goerli'
}
enum ContractName {
MANAToken = 'MANAToken',
Expand Down Expand Up @@ -33,6 +34,14 @@ const startBlockByNetwork: Record<Network, Record<ContractName, number>> = {
EstateProxy: 3890399,
MarketplaceProxy: 4202120,
DCLRegistrar: 7170497
},
[Network.GOERLI]: {
MANAToken: 4045806,
ERC721Bid: 7098754,
LANDProxy: 7059003,
EstateProxy: 7059236,
MarketplaceProxy: 7097561,
DCLRegistrar: 7098224
}
}

Expand Down Expand Up @@ -140,7 +149,7 @@ class Parser {
replaceAddresses(text = this.text) {
for (const placeholder of this.getPlaceholders('address')) {
const contractName = this.getPlaceholderValue(placeholder)
const address = this.ethereum.getAddress(contractName)
const address = this.ethereum.getAddress(contractName).toLowerCase()
text = text.replace(placeholder, address)
}
return text
Expand Down
7 changes: 4 additions & 3 deletions indexer/scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import { spawn, SpawnOptions } from 'child_process'

enum Network {
MAINNET = 'mainnet',
ROPSTEN = 'ropsten'
ROPSTEN = 'ropsten',
GOERLI = 'goerli'
}

const graphByNetwork: Record<Network, string> = {
[Network.MAINNET]: process.env.GRAPH_NAME || 'decentraland/marketplace',
[Network.ROPSTEN]:
process.env.GRAPH_NAME || 'decentraland/marketplace-ropsten'
[Network.ROPSTEN]: process.env.GRAPH_NAME || 'decentraland/marketplace-ropsten',
[Network.GOERLI]: process.env.GRAPH_NAME || 'decentraland/marketplace-goerli'
}

// TODO: Handle ctrl+C
Expand Down

0 comments on commit b0d5d69

Please sign in to comment.