Skip to content

Commit

Permalink
fix: support mainnet indexer for ethereum
Browse files Browse the repository at this point in the history
  • Loading branch information
hthieu1110 committed Jan 29, 2024
1 parent 3782294 commit 2099f21
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 26 deletions.
Binary file not shown.
11 changes: 9 additions & 2 deletions go/internal/substreams/ethereum/handlers/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ func (h *Handler) HandleETHTx(tx *pb.Tx) error {
return nil
}

// Ignore requestMint
if methodHex == "31a02bce" {
return nil
}

method, err := ParseMethod(contractABI, tx.Info.Input)
if err != nil {
return errors.Wrap(err, "failed to parse method. Tx: "+tx.Info.Hash)
Expand Down Expand Up @@ -135,9 +140,9 @@ func (h *Handler) HandleETHTx(tx *pb.Tx) error {
if err := h.handleBridgeNFT(contractABI, tx, args); err != nil {
return errors.Wrap(err, "failed to handle execute bridge NFT")
}
case "mintWithMetadata":
case "mint", "mintWithMetadata":
if err := h.handleMintWithMetadata(contractABI, tx, args); err != nil {
return errors.Wrap(err, "failed to handle mint with meta data")
return errors.Wrap(err, "failed to handle mint and mint with meta data")
}
case "transferFrom":
if err := h.handleTransferFrom(contractABI, tx, args); err != nil {
Expand All @@ -156,6 +161,8 @@ func (h *Handler) HandleETHTx(tx *pb.Tx) error {
if err := h.handleBuyNFT(contractABI, tx, args); err != nil {
return errors.Wrap(err, "failed to handle buyNFT")
}
default:
h.logger.Info(">>> ignore", zap.String("method", method.Name))
}
}

Expand Down
1 change: 0 additions & 1 deletion go/pkg/networks/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ type EthereumNetwork struct {
ChainID int32 `json:"chainId"`
RpcEndpoint string `json:"rpcEndpoint"`
AlchemyAPIKey string `json:"alchemyApiKey"`
TheGraphEndpoint string `json:"theGraphEndpoint"`
FirehoseEndpoint string `json:"firehoseEndpoint"`
SubstreamsManifest string `json:"substreamsManifest"`
IndexStartBlock string `json:"indexStartBlock"`
Expand Down
17 changes: 8 additions & 9 deletions networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -3112,14 +3112,16 @@
"backendEndpoint": "https://dapp-backend.mainnet.teritori.com",
"chainId": 1,
"alchemyApiKey": "xZ3FVF0o6q_4beg_afmCEzf4GSJErhId",
"theGraphEndpoint": "https://api.studio.thegraph.com/query/40379/teritori-mainnet/v1",
"vaultContractAddress": "0x6251B3384c8eD53e2Cc38d34c1f26ffE8d461B94",
"riotContractAddressGen0": "0x8f8304ea566affeb96ad0ffb593bbebd8876d124",
"riotSquadStakingContractAddress": "<must_fill>",
"firehoseEndpoint": "<must_fill>",
"indexStartBlock": "<must_fill>",
"indexStopBlock": "<must_fill>",
"substreamsManifest": "<must_fill>"
"riotSquadStakingContractAddress": "0x00---",
"firehoseEndpoint": "mainnet.eth.streamingfast.io:443",
"indexStartBlock": "16341067",
"indexStopBlock": "-1",
"substreamsManifest": "go/internal/substreams/ethereum/ethereum_mainnet.yaml",
"distributorContractAddress": "0x00---",
"riotBridgeAddressGen0": "0x00---",
"riotNFTAddressGen0": "0x39e45eca52965210e69f7e768f58550460e5e79a"
},
{
"id": "ethereum-goerli",
Expand Down Expand Up @@ -3152,7 +3154,6 @@
"backendEndpoint": "https://dapp-backend.testnet.teritori.com",
"chainId": 5,
"alchemyApiKey": "TCahW5rzmCaegxHVyhXh3vmCG2sS9Yu3",
"theGraphEndpoint": "https://api.studio.thegraph.com/query/40379/teritori-goerli-indexer/v-test-01",
"vaultContractAddress": "0xab30d7379ebfd146b77b0b4d6f3eb09bd725e4ef",
"riotContractAddressGen0": "0x43cc70bf324d716782628bed38af97e4afe92f69",
"riotContractAddressGen1": "0xdfff431d4c2275201dEd83dAd613A3DbDA1D11A7",
Expand Down Expand Up @@ -7580,7 +7581,6 @@
"backendEndpoint": "https://dapp-backend.testnet.teritori.com",
"chainId": 137,
"alchemyApiKey": "TCahW5rzmCaegxHVyhXh3vmCG2sS9Yu3",
"theGraphEndpoint": "https://api.studio.thegraph.com/query/40379/teritori-goerli-indexer/v-test-01",
"vaultContractAddress": "0xab30d7379ebfd146b77b0b4d6f3eb09bd725e4ef",
"riotContractAddressGen0": "0x40d2ed8611f7b4633adf162f788b67cae1811f24",
"riotContractAddressGen1": "",
Expand Down Expand Up @@ -7621,7 +7621,6 @@
"backendEndpoint": "https://dapp-backend.testnet.teritori.com",
"chainId": 80001,
"alchemyApiKey": "TCahW5rzmCaegxHVyhXh3vmCG2sS9Yu3",
"theGraphEndpoint": "https://api.studio.thegraph.com/query/40379/teritori-goerli-indexer/v-test-01",
"vaultContractAddress": "0xffc71bf3aca1355dc29b06c12bc8ef32f8f20c51",
"excludeFromLaunchpadList": [],
"riotSquadStakingContractAddress": "0xb080380ccb801d4a4c2e75d3aee7728f97cf4608",
Expand Down
2 changes: 0 additions & 2 deletions packages/networks/ethereum-goerli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ export const ethereumGoerliNetwork: EthereumNetworkInfo = {
// backendEndpoint: "http://localhost:9090",
chainId: 5,
alchemyApiKey: "TCahW5rzmCaegxHVyhXh3vmCG2sS9Yu3",
theGraphEndpoint:
"https://api.studio.thegraph.com/query/40379/teritori-goerli-indexer/v-test-01",
vaultContractAddress: "0xab30d7379ebfd146b77b0b4d6f3eb09bd725e4ef",
riotContractAddressGen0: "0x43cc70bf324d716782628bed38af97e4afe92f69",
riotContractAddressGen1,
Expand Down
15 changes: 8 additions & 7 deletions packages/networks/ethereum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ export const ethereumNetwork: EthereumNetworkInfo = {
backendEndpoint: "https://dapp-backend.mainnet.teritori.com",
chainId: 1,
alchemyApiKey: "xZ3FVF0o6q_4beg_afmCEzf4GSJErhId",
theGraphEndpoint:
"https://api.studio.thegraph.com/query/40379/teritori-mainnet/v1",
vaultContractAddress: "0x6251B3384c8eD53e2Cc38d34c1f26ffE8d461B94",
riotContractAddressGen0: "0x8f8304ea566affeb96ad0ffb593bbebd8876d124",
riotSquadStakingContractAddress: "<must_fill>",
riotSquadStakingContractAddress: "0x00---",
// Substreams
firehoseEndpoint: "<must_fill>",
indexStartBlock: "<must_fill>",
indexStopBlock: "<must_fill>",
substreamsManifest: "<must_fill>",
firehoseEndpoint: "mainnet.eth.streamingfast.io:443",
indexStartBlock: "16341067",
indexStopBlock: "-1",
substreamsManifest: "go/internal/substreams/ethereum/ethereum_mainnet.yaml",
distributorContractAddress: "0x00---",
riotBridgeAddressGen0: "0x00---",
riotNFTAddressGen0: "0x39e45eca52965210e69f7e768f58550460e5e79a",
};
2 changes: 0 additions & 2 deletions packages/networks/polygon-mumbai/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export const polygonMumbaiNetwork: EthereumNetworkInfo = {
// backendEndpoint: "http://localhost:9090",
chainId: 80001,
alchemyApiKey: "TCahW5rzmCaegxHVyhXh3vmCG2sS9Yu3",
theGraphEndpoint:
"https://api.studio.thegraph.com/query/40379/teritori-goerli-indexer/v-test-01",
vaultContractAddress: "0xffc71bf3aca1355dc29b06c12bc8ef32f8f20c51",
excludeFromLaunchpadList: [],
riotSquadStakingContractAddress: "0xb080380ccb801d4a4c2e75d3aee7728f97cf4608",
Expand Down
2 changes: 0 additions & 2 deletions packages/networks/polygon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export const polygonNetwork: EthereumNetworkInfo = {
backendEndpoint: "https://dapp-backend.testnet.teritori.com",
chainId: 137,
alchemyApiKey: "TCahW5rzmCaegxHVyhXh3vmCG2sS9Yu3",
theGraphEndpoint:
"https://api.studio.thegraph.com/query/40379/teritori-goerli-indexer/v-test-01",
vaultContractAddress: "0xab30d7379ebfd146b77b0b4d6f3eb09bd725e4ef",
riotContractAddressGen0: "0x40d2ed8611f7b4633adf162f788b67cae1811f24",
riotContractAddressGen1,
Expand Down
1 change: 0 additions & 1 deletion packages/networks/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export type EthereumNetworkInfo = NetworkInfoBase & {
endpoint: string;
chainId: number;
alchemyApiKey: string;
theGraphEndpoint: string;
vaultContractAddress: string;
riotSquadStakingContractAddress: string;
firehoseEndpoint?: string;
Expand Down

0 comments on commit 2099f21

Please sign in to comment.