Skip to content

Commit

Permalink
Remove exodvs and deploy mainnet (#7)
Browse files Browse the repository at this point in the history
* Update subquery-node image version in docker-compose

The docker-compose file has been updated to use a newer version of the subquery-node image. The version has been updated from v3.2.0 to v3.11.2 to leverage new features and bug fixes. This change will be effective the next time the services are deployed.

* Update @subql/cli version in package.json

The version of @subql/cli in the project's package.json file has been updated. The change involves an upgrade from version 4.0.5 to 4.13.1 to ensure compatibility with the latest features and improvements.

* Set non-unique index on authenticator field in schema.graphql

This was done for speed and it reflects a change the subquery team already made to the deployed graph

* Remove exodvs entities and handlers

* Deploy mainnet indexer

* Remove unique=false requirement

* Add publish script target

* Publish project
  • Loading branch information
justinbarry authored Oct 4, 2024
1 parent 2b0ad06 commit d0efdce
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 473 deletions.
2 changes: 1 addition & 1 deletion .project-cid
Original file line number Diff line number Diff line change
@@ -1 +1 @@
QmdKg5RktekMJbH1RjoTSfc8Uji9y4HVHpVVHBQW2z29qR
Qmbm4CY7si2mZQQYeyAH71mkxDgTn1zZskK65xt1bc1atK
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ This project is a working example of a SubQuery project that indexes data from t

Currently, this project indexes the following contracts:
- [Smart Accounts](https://github.com/burnt-labs/contracts)
- [Hubs and seats](https://github.com/burnt-labs/burnt-cw-hubs)

## Start

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ services:
retries: 5

subquery-node:
image: subquerynetwork/subql-node-cosmos:v3.2.0
image: subquerynetwork/subql-node-cosmos:v3.11.2
depends_on:
"postgres":
condition: service_healthy
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"build": "subql build",
"build:docker": "dotenv -c docker subql build",
"codegen": "subql codegen",
"subql:publish": "subql publish",
"start:docker": "docker-compose pull && docker-compose up --remove-orphans",
"dev": "docker compose down && subql codegen && dotenv -c docker subql build && docker compose build --no-cache && docker-compose up --remove-orphans",
"prepack": "rm -rf dist && yarn run build",
Expand All @@ -26,7 +27,7 @@
"license": "MIT",
"devDependencies": {
"@cosmjs/stargate": "^0.28.9",
"@subql/cli": "^4.0.5",
"@subql/cli": "^4.13.1",
"@subql/node-cosmos": "latest",
"@subql/testing": "latest",
"@types/uuid": "^9.0.5",
Expand Down
58 changes: 1 addition & 57 deletions project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import {
} from "@subql/types-cosmos";

// These defaults are the testnet values
const HUB_CONTRACT_CODE_ID = process.env.HUB_CONTRACT_CODE_ID || "7";
const SMART_ACCOUNT_CONTRACT_CODE_ID =
process.env.SMART_ACCOUNT_CONTRACT_CODE_ID || "793";

const CHAIN_ID = process.env.CHAIN_ID || "xion-testnet-1";
const ENDPOINT_URL =
process.env.ENDPOINT_URL || "https://rpc.xion-testnet-1.burnt.com:443";
const START_BLOCK = Number(process.env.START_BLOCK || "9238800");
const START_BLOCK = Number(process.env.START_BLOCK || "3371922");

const project: CosmosProject = {
specVersion: "1.0.0",
Expand Down Expand Up @@ -69,61 +68,6 @@ const project: CosmosProject = {
mapping: {
file: "./dist/index.js",
handlers: [
// Hub contract handlers
{
handler: "handleHubContractInstantiate",
kind: CosmosHandlerKind.Event,
filter: {
type: "instantiate",
messageFilter: {
type: "/cosmwasm.wasm.v1.MsgInstantiateContract",
values: {
codeId: HUB_CONTRACT_CODE_ID,
},
},
},
},
{
handler: "handleHubContractInstantiateMetadata",
kind: CosmosHandlerKind.Event,
filter: {
type: "wasm-metadata-instantiate",
messageFilter: {
type: "/cosmwasm.wasm.v1.MsgInstantiateContract",
},
},
},
// Seat contract handlers
{
handler: "handleSeatContractInstantiateMetadata",
kind: CosmosHandlerKind.Event,
filter: {
type: "wasm-metadata-instantiate",
messageFilter: {
type: "/cosmwasm.wasm.v1.MsgInstantiateContract",
},
},
},
{
handler: "handleSeatContractPrimarySaleCreated",
kind: CosmosHandlerKind.Event,
filter: {
type: "wasm-sales-add_primary_sale",
messageFilter: {
type: "/cosmwasm.wasm.v1.MsgExecuteContract",
},
},
},
{
handler: "handleSeatContractPrimarySaleHalted",
kind: CosmosHandlerKind.Event,
filter: {
type: "wasm-sales-halt_sale",
messageFilter: {
type: "/cosmwasm.wasm.v1.MsgExecuteContract",
},
},
},
{
handler: "handleSmartAccountContractInstantiateMetadata",
kind: CosmosHandlerKind.Event,
Expand Down
71 changes: 0 additions & 71 deletions schema.graphql
Original file line number Diff line number Diff line change
@@ -1,77 +1,6 @@
# To improve query performance, we strongly suggest adding indexes to any field that you plan to filter or sort by
# Add the `@index` or `@index(unique: true)` annotation after any non-key field
# https://academy.subquery.network/build/graphql.html#indexing-by-non-primary-key-field

type AllHub @entity {
id: ID! # The block height
hub: Hub @derivedFrom(field: "allHub") # This is a lookup for the hub contract deployed by hub
}

# This entity stores hub's seat details
type HubSeat @entity {
id: ID! # The hub contract address
seatContracts: [String]! # Array of seat contract addresses for this hub
latestSeat: Seat @derivedFrom(field: "hubSeat") # This is a lookup for the latest seat contract deployed by hub
}

type Hub @entity {
id: ID! # The hub contract address
allHub: AllHub! # This id is always pointing to the "hubs" key
name: String!
hub_url: String!
description: String!
tags: [String]!
social_links: [SocialLink]! @derivedFrom(field: "hub")
creator: String!
owner: String! # The owner of the hub can change e.g. when the hub is transferred
thumbnail_image_url: String!
banner_image_url: String!
seat_contracts: [Seat] @derivedFrom(field: "hub")
}

type SocialLink @entity {
id: ID!
hub: Hub! # The hub contract address
name: String!
url: String!
}

type Seat @entity {
id: ID! # The seat contract address
hub: Hub! # Hub this Seat belongs to
hubSeat: HubSeat! # HubSeat container this seat belongs to
name: String!
image_uri: String!
description: String!
benefits: [SeatBenefit!]! @derivedFrom(field: "benefitSeat")
saleDetail: Sale! @derivedFrom(field: "saleSeat") # Lookup for the sale details of this seat
}

type SeatBenefit @entity {
id: ID! # The seat contract address
benefitSeat: Seat!
name: String!
status: String!
}

type Sale @entity {
id: ID! # The seat contract address
saleSeat: Seat! # The seat contract address this sale belongs to
totalSupply: BigInt!
tokensMinted: BigInt!
startTime: BigInt!
endTime: BigInt!
price: [Coin]! @derivedFrom(field: "sale")
disabled: Boolean!
}

type Coin @entity {
id: ID! # The seat contract address
sale: Sale! # The seat address + sale time to make this unique
denom: String!
amount: BigInt!
}

type SmartAccount @entity {
id: ID! # The smart wallet contract address
latestAuthenticatorId: Int! # The id of the latest authenticator
Expand Down
81 changes: 0 additions & 81 deletions src/hubs/index.ts

This file was deleted.

44 changes: 0 additions & 44 deletions src/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,3 @@
export interface HubMetadata {
name: string;
hub_url: string;
description: string;
tags: Array<string>;
social_links: Array<SocialLink>;
creator: string;
thumbnail_image_url: string;
banner_image_url: string;
seat_contract?: string;
}

export interface SeatMetadata {
name: string;
image_uri: string;
description: string;
benefits: Array<SeatBenefit>;
hub_contract: string;
}

type SocialLink = {
name: string;
url: string;
};

type SeatBenefit = {
name: string;
status: string;
};

export type ISale = {
total_supply: string;
tokens_minted: string;
start_time: string;
end_time: string;
price: Array<ICoin>;
disabled: boolean;
};

export type ICoin = {
denom: string;
amount: string;
};

export type IAuthenticator = {
Secp256K1?: { pubkey: string };
Ed25519?: { pubkey: string };
Expand Down
34 changes: 0 additions & 34 deletions src/mappings/mappingHandlers.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,10 @@
import { CosmosEvent } from "@subql/types-cosmos";
import {
handleHubContractInstantiateHelper,
handleHubContractInstantiateMetadataHelper,
} from "../hubs";
import { handleSeatContractInstantiateMetadataHelper } from "../seat";
import { handleSeatContractPrimarySaleCreatedHelper } from "../sale";
import {
handleSmartAccountContractAddAuthenticatorHelper,
handleSmartAccountContractInstantiateMetadataHelper,
handleSmartAccountContractRemoveAuthenticatorHelper,
} from "../smartContract";

export async function handleHubContractInstantiate(
event: CosmosEvent,
): Promise<void> {
await handleHubContractInstantiateHelper(event);
}

export async function handleHubContractInstantiateMetadata(
event: CosmosEvent,
): Promise<void> {
await handleHubContractInstantiateMetadataHelper(event);
}

export async function handleSeatContractInstantiateMetadata(
event: CosmosEvent,
): Promise<void> {
await handleSeatContractInstantiateMetadataHelper(event);
}

export async function handleSeatContractPrimarySaleCreated(
event: CosmosEvent,
): Promise<void> {
await handleSeatContractPrimarySaleCreatedHelper(event);
}

export async function handleSeatContractPrimarySaleHalted(): Promise<void> {
await handleSeatContractPrimarySaleHalted();
}

export async function handleSmartAccountContractInstantiateMetadata(
event: CosmosEvent,
): Promise<void> {
Expand Down
Loading

0 comments on commit d0efdce

Please sign in to comment.