Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update Marketplace mainnet graph with a new rarity #2215

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions indexer/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
# Blockchain indexer

|Network|Provider|URL|Current|Previous|
|-|-|-|-|-|
|Mainnet|Hosted Services|https://thegraph.com/hosted-service/subgraph/decentraland/marketplace|Qmc9dMhcgUqH77cTtDfnXduxMfavrKjX2SSDBhiwWpEvKx|QmPdVPhDvK3bs8cmUeFeMAYRYky6yqYE9jYwpcMdi4QCdB|
|Mainnet|Satsuma|https://subgraph.satsuma-prod.com/decentraland/marketplace/playground|Qmc9dMhcgUqH77cTtDfnXduxMfavrKjX2SSDBhiwWpEvKx|QmPdVPhDvK3bs8cmUeFeMAYRYky6yqYE9jYwpcMdi4QCdB|
|Mainnet Temp|Hosted Services|https://thegraph.com/hosted-service/subgraph/decentraland/marketplace-temp|QmPdVPhDvK3bs8cmUeFeMAYRYky6yqYE9jYwpcMdi4QCdB|QmPT9v6EsqqCA8BzrYtArJL54mVgfH81FzFTX2gLv9XcSp|
|Sepolia|Graph Studio|https://api.studio.thegraph.com/query/49472/marketplace-sepolia/version/latest|QmVvJsoaTLi5HVfdUaLTsKcbvxB3ZE2ksZH9ENh8EoStaE|QmTu8KKidkfRaCCvEHdBnWhRfLRLwPmhHpfRFxTk2wPAzN|
|Goerli|Hosted Services|https://thegraph.com/hosted-service/subgraph/decentraland/marketplace-goerli|QmcWhGQxQ3gnkqPNhx4mTZti3jcKjp7vo8JenreUqytzF8|QmS2GCuAkzH2kNDYe2pA9HkRTPLpC5DpbXRqhQW93exZEM|
|Goerli|Satsuma|https://subgraph.satsuma-prod.com/decentraland/marketplace-goerli/playground|QmcWhGQxQ3gnkqPNhx4mTZti3jcKjp7vo8JenreUqytzF8|QmS2GCuAkzH2kNDYe2pA9HkRTPLpC5DpbXRqhQW93exZEM|
|Ropsten|Hosted Services|https://thegraph.com/hosted-service/subgraph/decentraland/marketplace-ropsten|QmZTADndoP4XRoWGVoQuaz8WTATx3UDXMn5SdE3GfkErkW|QmfHCGhLTZV8v2duxDkKtPZKMEdJM7X8YGRj2UvqmrAUBB|
| Network | Provider | URL | Current | Previous |
| ------------ | --------------- | ------------------------------------------------------------------------------ | ---------------------------------------------- | ---------------------------------------------- |
| Mainnet | Hosted Services | https://thegraph.com/hosted-service/subgraph/decentraland/marketplace | QmXPFoaeZjJrukrFRFLh1RheK2PWF1hAb6K3kYbHvqffZK | Qmc9dMhcgUqH77cTtDfnXduxMfavrKjX2SSDBhiwWpEvKx |
| Mainnet | Satsuma | https://subgraph.satsuma-prod.com/decentraland/marketplace/playground | QmXPFoaeZjJrukrFRFLh1RheK2PWF1hAb6K3kYbHvqffZK | Qmc9dMhcgUqH77cTtDfnXduxMfavrKjX2SSDBhiwWpEvKx |
| Mainnet Temp | Hosted Services | https://thegraph.com/hosted-service/subgraph/decentraland/marketplace-temp | QmPdVPhDvK3bs8cmUeFeMAYRYky6yqYE9jYwpcMdi4QCdB | QmPT9v6EsqqCA8BzrYtArJL54mVgfH81FzFTX2gLv9XcSp |
| Sepolia | Graph Studio | https://api.studio.thegraph.com/query/49472/marketplace-sepolia/version/latest | QmVvJsoaTLi5HVfdUaLTsKcbvxB3ZE2ksZH9ENh8EoStaE | QmTu8KKidkfRaCCvEHdBnWhRfLRLwPmhHpfRFxTk2wPAzN |
| Goerli | Hosted Services | https://thegraph.com/hosted-service/subgraph/decentraland/marketplace-goerli | QmcWhGQxQ3gnkqPNhx4mTZti3jcKjp7vo8JenreUqytzF8 | QmS2GCuAkzH2kNDYe2pA9HkRTPLpC5DpbXRqhQW93exZEM |
| Goerli | Satsuma | https://subgraph.satsuma-prod.com/decentraland/marketplace-goerli/playground | QmcWhGQxQ3gnkqPNhx4mTZti3jcKjp7vo8JenreUqytzF8 | QmS2GCuAkzH2kNDYe2pA9HkRTPLpC5DpbXRqhQW93exZEM |

Using [The Graph](https://thegraph.com) and [Satsuma](https://www.satsuma.xyz/)

**Deploy**

```bash
npm run codegen
npm run deploy:ropsten # or deploy:mainnet
npm run deploy:sepolia # or deploy:mainnet
```

If a new collection in Ethereum is added you will need to add it as following
Expand Down
2 changes: 0 additions & 2 deletions indexer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
"build-data": "ts-node ./scripts/buildData.ts",
"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:goerli": "ts-node ./scripts/buildData.ts --network goerli && ts-node ./scripts/deploy.ts --network goerli",
"deploy:sepolia": "ts-node ./scripts/buildData.ts --network sepolia && ts-node ./scripts/deploy.ts --network sepolia",
"deploy:temp": "ts-node ./scripts/buildData.ts --network mainnet && ts-node ./scripts/deploy.ts --network temp",
"calculate-proximities": "ts-node ./scripts/calculateProximities.ts"
Expand Down
6 changes: 1 addition & 5 deletions indexer/scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ import { spawn, SpawnOptions } from 'child_process'

enum Network {
MAINNET = 'mainnet',
ROPSTEN = 'ropsten',
GOERLI = 'goerli',
SEPOLIA = 'sepolia',
TEMP = 'temp'
}

const graphByNetwork: Record<Network, string> = {
[Network.MAINNET]: process.env.GRAPH_NAME || 'decentraland/marketplace',
[Network.ROPSTEN]: process.env.GRAPH_NAME || 'decentraland/marketplace-ropsten',
[Network.GOERLI]: process.env.GRAPH_NAME || 'decentraland/marketplace-goerli',
[Network.SEPOLIA]: process.env.GRAPH_NAME || 'marketplace-sepolia',
[Network.TEMP]: process.env.GRAPH_NAME || 'decentraland/marketplace-temp'
}
Expand Down Expand Up @@ -68,7 +64,7 @@ async function run(command: string, args: string[], options?: SpawnOptions) {
// Args -------------------------------------------------------------

function getNetwork() {
let network: Network
let network: Network | undefined
for (let i = 0; i < process.argv.length; i++) {
if (process.argv[i] === '--network') {
network = process.argv[i + 1] as Network
Expand Down
3 changes: 2 additions & 1 deletion indexer/scripts/importWearableCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ enum RarityId {
EPIC = 'epic',
LENGENDARY = 'legendary',
MYTHIC = 'mythic',
UNIQUE = 'unique'
UNIQUE = 'unique',
EXOTIC = 'exotic'
}
type Wearable = {
id: string
Expand Down
Loading