Skip to content

Commit a8ff62a

Browse files
authored
Merge pull request #59 from maticnetwork/statesync-fix
Block-number and logIndex in stateSync events
2 parents abf8aa0 + 1cc5ae2 commit a8ff62a

File tree

5 files changed

+12
-2
lines changed

5 files changed

+12
-2
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ Subgraph for Matic contracts
33

44
Please take a look at [Graph protocol](https://github.com/graphprotocol/graph-node) for more information.
55

6+
## Polygon hosted node endpoints
7+
8+
**Root**
9+
- Mainnet: `https://thegraph.com/hosted-service/subgraph/maticnetwork/mainnet-root-subgraphs`
10+
- Goerli: `https://thegraph.com/hosted-service/subgraph/maticnetwork/mumbai-root-subgraphs`
11+
612
## For Mumbai hosted node endpoints
713
- Graph node: `https://mumbai-graph.matic.today`
814
- GraphQL endpoint: `https://api.mumbai-graph.matic.today/subgraphs/name/<YOUR_GITHUB_USERNAME>/<SUBGRAPH_NAME>/graphql`

root/config/goerli.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"network": "goerli",
33
"subgraphId": "QmPuwKiewn7sczRV6LwGPWuNtDZTscKECz6NB6V1gE57bm",
4-
"graftingStartBlock": 5996697,
4+
"graftingStartBlock": 2815580,
55
"contracts": {
66
"rootChain": {
77
"address": "0x2890bA17EfE978480615e330ecB65333b880928e",

root/config/mainnet.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"network": "mainnet",
33
"subgraphId": "QmQTfDsLaqbT8VzCAE8zLDi4jjzXxDSkgw79r6VeLemv7b",
4-
"graftingStartBlock": 13977920,
4+
"graftingStartBlock": 10167760,
55
"contracts": {
66
"rootChain": {
77
"address": "0x86E4Dc95c7FBdBf52e33D563BbDB00823894C287",

root/schema.graphql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ type StateSync @entity {
1919
depositorOrRootToken: String!
2020
depositedTokenOrChildToken: String!
2121
data: String!
22+
logIndex: String!
2223
transactionHash: Bytes!
2324
timestamp: BigInt!
25+
blockNumber: BigInt!
2426
}
2527

2628
type StateRegistration @entity {

root/src/mappings/state-sync.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export function handleStateSynced(event: StateSynced): void {
1313

1414
entity.transactionHash = event.transaction.hash
1515
entity.timestamp = event.block.timestamp
16+
entity.blockNumber = event.block.number
17+
entity.logIndex = event.logIndex.toString()
1618

1719
// Attempting to create an instance of `Decoder` smart contract
1820
// to be used for decoding valid state sync data

0 commit comments

Comments
 (0)