Compare commits
10 Commits
Author | SHA1 | Date |
---|---|---|
dependabot[bot] | 2f322ee016 | |
dependabot[bot] | ecc9092f5b | |
dependabot[bot] | ae1a33755f | |
dependabot[bot] | 63bc3f8409 | |
dependabot[bot] | b9bfe07a92 | |
Alex Coseru | d80ba60637 | |
dependabot[bot] | 4e939c70c0 | |
Alex Coseru | ba5e514ddf | |
alexcos20 | 8930eef827 | |
Alex Coseru | 36ae877984 |
|
@ -37,8 +37,6 @@ jobs:
|
|||
with:
|
||||
repository: 'oceanprotocol/barge'
|
||||
path: 'barge'
|
||||
ref: feature/bump_contracts_and_subgraph
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: ${{ env.DOCKERHUB_PASSWORD && env.DOCKERHUB_USERNAME }}
|
||||
run: |
|
||||
|
|
|
@ -4,8 +4,14 @@ All notable changes to this project will be documented in this file. Dates are d
|
|||
|
||||
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
||||
|
||||
#### [v4.0.2](https://github.com/oceanprotocol/ocean-subgraph/compare/v4.0.1...v4.0.2)
|
||||
|
||||
- fix deps [`#744`](https://github.com/oceanprotocol/ocean-subgraph/pull/744)
|
||||
|
||||
#### [v4.0.1](https://github.com/oceanprotocol/ocean-subgraph/compare/v4.0.0...v4.0.1)
|
||||
|
||||
> 22 November 2023
|
||||
|
||||
- Feature/add_optimism & use graph-node 0.33.0 [`#742`](https://github.com/oceanprotocol/ocean-subgraph/pull/742)
|
||||
- Bump chai and @types/chai [`#729`](https://github.com/oceanprotocol/ocean-subgraph/pull/729)
|
||||
- Bump @graphprotocol/graph-cli from 0.56.0 to 0.61.0 [`#738`](https://github.com/oceanprotocol/ocean-subgraph/pull/738)
|
||||
|
@ -14,6 +20,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|||
- Bump minimist from 1.2.5 to 1.2.6 [`#740`](https://github.com/oceanprotocol/ocean-subgraph/pull/740)
|
||||
- Bump tar from 4.4.13 to 4.4.19 [`#741`](https://github.com/oceanprotocol/ocean-subgraph/pull/741)
|
||||
- Bump @graphprotocol/graph-ts from 0.30.0 to 0.31.0 [`#730`](https://github.com/oceanprotocol/ocean-subgraph/pull/730)
|
||||
- Release 4.0.1 [`cf58c9a`](https://github.com/oceanprotocol/ocean-subgraph/commit/cf58c9aae4aa16f7a30b4c93de72786b1d4b3b3f)
|
||||
|
||||
### [v4.0.0](https://github.com/oceanprotocol/ocean-subgraph/compare/v3.0.10...v4.0.0)
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ This subgraph is deployed under `/subgraphs/name/oceanprotocol/ocean-subgraph/`
|
|||
- [v4.subgraph.bsc.oceanprotocol.com](https://v4.subgraph.bsc.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql)
|
||||
- [v4.subgraph.moonriver.oceanprotocol.com](https://v4.subgraph.moonriver.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql)
|
||||
- [v4.subgraph.energyweb.oceanprotocol.com](https://v4.subgraph.energyweb.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql)
|
||||
- [v4.subgraph.goerli.oceanprotocol.com](https://v4.subgraph.goerli.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql)
|
||||
- [v4.subgraph.mumbai.oceanprotocol.com](https://v4.subgraph.mumbai.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql)
|
||||
|
||||
## ⛵ Example Queries
|
||||
|
|
|
@ -3,32 +3,24 @@ Copyright 2023 Ocean Protocol Foundation
|
|||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
|
||||
|
||||
- [Kubernetes deployment](#kubernetes-deployment)
|
||||
* [Postgresql](#postgresql)
|
||||
* [IPFS](#ipfs)
|
||||
* [Graph-node](#graph-node)
|
||||
- [Postgresql](#postgresql)
|
||||
- [IPFS](#ipfs)
|
||||
- [Graph-node](#graph-node)
|
||||
- [Docker Compose deployment](#docker-compose-deployment)
|
||||
* [Single systemd service (Graph-node+Postgresql+IPFS)](#single-systemd-service-graph-nodepostgresqlipfs)
|
||||
- [Single systemd service (Graph-node+Postgresql+IPFS)](#single-systemd-service-graph-nodepostgresqlipfs)
|
||||
- [Ocean-subgraph deployment](#ocean-subgraph-deployment)
|
||||
|
||||
|
||||
|
||||
|
||||
#### Kubernetes deployment
|
||||
|
||||
[ocean-subgraph](https://github.com/oceanprotocol/ocean-subgraph) must be deployed on top of [graph-node](https://github.com/graphprotocol/graph-node) which has the following dependencies:
|
||||
[ocean-subgraph](https://github.com/oceanprotocol/ocean-subgraph) must be deployed on top of [graph-node](https://github.com/graphprotocol/graph-node) which has the following dependencies:
|
||||
|
||||
- PostgreSQL
|
||||
|
||||
- IPFS
|
||||
|
||||
|
||||
Templates (yaml files) provided and could be customized based on the environment's specifics.
|
||||
|
||||
|
||||
|
||||
##### Postgresql
|
||||
|
||||
It is recommended to deploy PostgreSQL as helm chart
|
||||
|
@ -63,41 +55,41 @@ spec:
|
|||
app: ipfs
|
||||
spec:
|
||||
containers:
|
||||
- image: ipfs/go-ipfs:v0.4.22
|
||||
imagePullPolicy: IfNotPresent
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
httpGet:
|
||||
path: /debug/metrics/prometheus
|
||||
port: api
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 3
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 1
|
||||
name: s1-ipfs
|
||||
ports:
|
||||
- containerPort: 5001
|
||||
name: api
|
||||
protocol: TCP
|
||||
- containerPort: 8080
|
||||
name: gateway
|
||||
protocol: TCP
|
||||
readinessProbe:
|
||||
failureThreshold: 3
|
||||
httpGet:
|
||||
path: /debug/metrics/prometheus
|
||||
port: api
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 3
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 1
|
||||
terminationMessagePath: /dev/termination-log
|
||||
terminationMessagePolicy: File
|
||||
volumeMounts:
|
||||
- mountPath: /data/ipfs
|
||||
name: ipfs-storage
|
||||
- image: ipfs/go-ipfs:v0.4.22
|
||||
imagePullPolicy: IfNotPresent
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
httpGet:
|
||||
path: /debug/metrics/prometheus
|
||||
port: api
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 3
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 1
|
||||
name: s1-ipfs
|
||||
ports:
|
||||
- containerPort: 5001
|
||||
name: api
|
||||
protocol: TCP
|
||||
- containerPort: 8080
|
||||
name: gateway
|
||||
protocol: TCP
|
||||
readinessProbe:
|
||||
failureThreshold: 3
|
||||
httpGet:
|
||||
path: /debug/metrics/prometheus
|
||||
port: api
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 3
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 1
|
||||
terminationMessagePath: /dev/termination-log
|
||||
terminationMessagePolicy: File
|
||||
volumeMounts:
|
||||
- mountPath: /data/ipfs
|
||||
name: ipfs-storage
|
||||
dnsPolicy: ClusterFirst
|
||||
restartPolicy: Always
|
||||
schedulerName: default-scheduler
|
||||
|
@ -110,20 +102,20 @@ spec:
|
|||
partition: 0
|
||||
type: RollingUpdate
|
||||
volumeClaimTemplates:
|
||||
- apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
name: ipfs-storage
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1G
|
||||
volumeMode: Filesystem
|
||||
status:
|
||||
phase: Pending
|
||||
- apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
name: ipfs-storage
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1G
|
||||
volumeMode: Filesystem
|
||||
status:
|
||||
phase: Pending
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
|
@ -135,19 +127,17 @@ spec:
|
|||
clusterIP:
|
||||
clusterIPs:
|
||||
ipFamilies:
|
||||
- IPv4
|
||||
- IPv4
|
||||
ipFamilyPolicy: SingleStack
|
||||
ports:
|
||||
- name: api
|
||||
port: 5001
|
||||
- name: gateway
|
||||
port: 8080
|
||||
- name: api
|
||||
port: 5001
|
||||
- name: gateway
|
||||
port: 8080
|
||||
selector:
|
||||
app: ipfs
|
||||
```
|
||||
|
||||
|
||||
|
||||
##### Graph-node
|
||||
|
||||
The following annotated templated can be customized to deploy graph-node deployment and service:
|
||||
|
@ -179,66 +169,66 @@ spec:
|
|||
app: mumbai-graph-node
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: ipfs
|
||||
value: ipfs.<namespace>.svc.cluster.local:5001
|
||||
- name: postgres_host
|
||||
value: postgresql.<namespace>.svc.cluster.local
|
||||
- name: postgres_user
|
||||
value: < postgresql user >
|
||||
- name: postgres_pass
|
||||
value: < postgresql database password >
|
||||
- name: postgres_db
|
||||
value: < postgresql database >
|
||||
- name: ethereum
|
||||
value: mumbai:https://polygon-mumbai.infura.io/v3/< INFURA ID>
|
||||
- name: GRAPH_KILL_IF_UNRESPONSIVE
|
||||
value: "true"
|
||||
image: graphprotocol/graph-node:v0.28.2
|
||||
imagePullPolicy: IfNotPresent
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8000
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 1
|
||||
name: mumbai-graph-node
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
name: graphql
|
||||
protocol: TCP
|
||||
- containerPort: 8020
|
||||
name: jsonrpc
|
||||
protocol: TCP
|
||||
- containerPort: 8030
|
||||
name: indexnode
|
||||
protocol: TCP
|
||||
- containerPort: 8040
|
||||
name: metrics
|
||||
protocol: TCP
|
||||
readinessProbe:
|
||||
failureThreshold: 3
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8000
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 1
|
||||
resources:
|
||||
limits:
|
||||
cpu: "2"
|
||||
memory: 1536Mi
|
||||
requests:
|
||||
cpu: 1500m
|
||||
memory: 1536Mi
|
||||
terminationMessagePath: /dev/termination-log
|
||||
terminationMessagePolicy: File
|
||||
- env:
|
||||
- name: ipfs
|
||||
value: ipfs.<namespace>.svc.cluster.local:5001
|
||||
- name: postgres_host
|
||||
value: postgresql.<namespace>.svc.cluster.local
|
||||
- name: postgres_user
|
||||
value: < postgresql user >
|
||||
- name: postgres_pass
|
||||
value: < postgresql database password >
|
||||
- name: postgres_db
|
||||
value: < postgresql database >
|
||||
- name: ethereum
|
||||
value: mumbai:https://polygon-mumbai.infura.io/v3/< INFURA ID>
|
||||
- name: GRAPH_KILL_IF_UNRESPONSIVE
|
||||
value: 'true'
|
||||
image: graphprotocol/graph-node:v0.28.2
|
||||
imagePullPolicy: IfNotPresent
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8000
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 1
|
||||
name: mumbai-graph-node
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
name: graphql
|
||||
protocol: TCP
|
||||
- containerPort: 8020
|
||||
name: jsonrpc
|
||||
protocol: TCP
|
||||
- containerPort: 8030
|
||||
name: indexnode
|
||||
protocol: TCP
|
||||
- containerPort: 8040
|
||||
name: metrics
|
||||
protocol: TCP
|
||||
readinessProbe:
|
||||
failureThreshold: 3
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8000
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 1
|
||||
resources:
|
||||
limits:
|
||||
cpu: '2'
|
||||
memory: 1536Mi
|
||||
requests:
|
||||
cpu: 1500m
|
||||
memory: 1536Mi
|
||||
terminationMessagePath: /dev/termination-log
|
||||
terminationMessagePolicy: File
|
||||
dnsPolicy: ClusterFirst
|
||||
restartPolicy: Always
|
||||
schedulerName: default-scheduler
|
||||
|
@ -249,37 +239,34 @@ kind: Service
|
|||
metadata:
|
||||
labels:
|
||||
app: mumbai-graph-node
|
||||
name: mumbai-graph-node
|
||||
name: mumbai-graph-node
|
||||
spec:
|
||||
clusterIP:
|
||||
clusterIPs:
|
||||
internalTrafficPolicy: Cluster
|
||||
ipFamilies:
|
||||
- IPv4
|
||||
- IPv4
|
||||
ipFamilyPolicy: SingleStack
|
||||
ports:
|
||||
- name: graphql
|
||||
port: 8000
|
||||
- name: jsonrpc
|
||||
port: 8020
|
||||
- name: indexnode
|
||||
port: 8030
|
||||
- name: metrics
|
||||
port: 8040
|
||||
- name: graphql
|
||||
port: 8000
|
||||
- name: jsonrpc
|
||||
port: 8020
|
||||
- name: indexnode
|
||||
port: 8030
|
||||
- name: metrics
|
||||
port: 8040
|
||||
selector:
|
||||
app: mumbai-graph-node
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
#### Docker Compose deployment
|
||||
|
||||
##### Single systemd service (Graph-node+Postgresql+IPFS)
|
||||
|
||||
a) create */etc/docker/compose/graph-node/docker-compose.yml* file
|
||||
a) create _/etc/docker/compose/graph-node/docker-compose.yml_ file
|
||||
|
||||
*/etc/docker/compose/graph-node/docker-compose.yml* (annotated - example for `mumbai` network)
|
||||
_/etc/docker/compose/graph-node/docker-compose.yml_ (annotated - example for `mumbai` network)
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
|
@ -318,7 +305,7 @@ services:
|
|||
restart: on-failure
|
||||
ports:
|
||||
- '5432:5432'
|
||||
command: ["postgres", "-cshared_preload_libraries=pg_stat_statements"]
|
||||
command: ['postgres', '-cshared_preload_libraries=pg_stat_statements']
|
||||
environment:
|
||||
POSTGRES_USER: graph-node
|
||||
POSTGRES_PASSWORD: < password >
|
||||
|
@ -332,9 +319,7 @@ volumes:
|
|||
driver: local
|
||||
```
|
||||
|
||||
|
||||
|
||||
b) create */etc/systemd/system/docker-compose@graph-node.service* file
|
||||
b) create _/etc/systemd/system/docker-compose@graph-node.service_ file
|
||||
|
||||
```shell
|
||||
[Unit]
|
||||
|
@ -357,8 +342,6 @@ ExecStopPost=/usr/bin/env docker-compose -p $PROJECT down
|
|||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
|
||||
|
||||
c) run:
|
||||
|
||||
```shell
|
||||
|
@ -371,16 +354,12 @@ optional - enable service to start at boot:
|
|||
$ sudo systemctl enable docker-compose@graph-node.service
|
||||
```
|
||||
|
||||
|
||||
|
||||
d) start aquarius service:
|
||||
|
||||
```shell
|
||||
$ sudo systemctl start docker-compose@graph-node.service
|
||||
```
|
||||
|
||||
|
||||
|
||||
check status:
|
||||
|
||||
```shell
|
||||
|
@ -406,8 +385,6 @@ Jun 25 17:05:25 testvm systemd[1]: Finished graph-node service with docker compo
|
|||
|
||||
```
|
||||
|
||||
|
||||
|
||||
- check containers status
|
||||
|
||||
```shell
|
||||
|
@ -418,35 +395,31 @@ ipfs/go-ipfs:v0.4.23 4001/tcp, 8080-8081/tcp, 0.0.0.0:5001->5001/t
|
|||
postgres:15.3 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp postgres Up 55 minutes
|
||||
```
|
||||
|
||||
|
||||
|
||||
- check logs for graph-node container
|
||||
|
||||
```shell
|
||||
$ docker logs graph-node [--follow]
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Ocean-subgraph deployment
|
||||
|
||||
- install Node.js locally
|
||||
|
||||
- download and extract [Ocean-subgraph](https://github.com/oceanprotocol/ocean-subgraph) (check [here](https://github.com/oceanprotocol/ocean-subgraph/releases) the available releases)
|
||||
- download and extract [Ocean-subgraph](https://github.com/oceanprotocol/ocean-subgraph) (check [here](https://github.com/oceanprotocol/ocean-subgraph/releases) the available releases)
|
||||
- run inside the extracted directory:
|
||||
|
||||
```shell
|
||||
$ npm i
|
||||
```
|
||||
|
||||
then
|
||||
then
|
||||
|
||||
(Note: in this example we are deploying on graph-node running for `mumbai` testnet )
|
||||
|
||||
Note: for `ocean-subgraph` deployment in kubernetes environment, both `graph-node` and `ipfs` services must be locally forwarded using `kubectl port-forward` command.
|
||||
Note: for `ocean-subgraph` deployment in kubernetes environment, both `graph-node` and `ipfs` services must be locally forwarded using `kubectl port-forward` command.
|
||||
|
||||
```shell
|
||||
$ npm run quickstart:mumbai
|
||||
$ npm run quickstart:mumbai
|
||||
|
||||
> ocean-subgraph@3.0.8 quickstart:mumbai
|
||||
> node ./scripts/generatenetworkssubgraphs.js mumbai && npm run codegen && npm run create:local && npm run deploy:local
|
||||
|
@ -458,7 +431,6 @@ Skipping bsc
|
|||
Skipping energyweb
|
||||
Skipping moonriver
|
||||
Skipping mainnet
|
||||
Skipping goerli
|
||||
Skipping polygonedge
|
||||
Skipping gaiaxtestnet
|
||||
Skipping alfajores
|
||||
|
|
File diff suppressed because it is too large
Load Diff
15
package.json
15
package.json
|
@ -1,12 +1,11 @@
|
|||
{
|
||||
"name": "ocean-subgraph",
|
||||
"version": "4.0.1",
|
||||
"version": "4.0.2",
|
||||
"scripts": {
|
||||
"start": "",
|
||||
"quickstart:development": "node ./scripts/generatenetworkssubgraphs.js development && npm run codegen && npm run create:local && npm run deploy:local",
|
||||
"quickstart:barge": "node ./scripts/generatenetworkssubgraphs.js development && npm run codegen && npm run create:local-barge && npm run deploy:local-barge",
|
||||
"quickstart:rinkeby": "node ./scripts/generatenetworkssubgraphs.js rinkeby && npm run codegen && npm run create:local && npm run deploy:local",
|
||||
"quickstart:goerli": "node ./scripts/generatenetworkssubgraphs.js goerli && npm run codegen && npm run create:local && npm run deploy:local",
|
||||
"quickstart:ropsten": "node ./scripts/generatenetworkssubgraphs.js ropsten && npm run codegen && npm run create:local && npm run deploy:local",
|
||||
"quickstart:mumbai": "node ./scripts/generatenetworkssubgraphs.js mumbai && npm run codegen && npm run create:local && npm run deploy:local",
|
||||
"quickstart:moonbase": "node ./scripts/generatenetworkssubgraphs.js moonbase && npm run codegen && npm run create:local && npm run deploy:local",
|
||||
|
@ -50,14 +49,12 @@
|
|||
"changelog": "auto-changelog -p"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@graphprotocol/graph-cli": "^0.61.0",
|
||||
"@graphprotocol/graph-ts": "^0.31.0",
|
||||
"@types/chai": "^4.3.11",
|
||||
"@types/chai-spies": "^1.0.3",
|
||||
"@types/mocha": "^10.0.2",
|
||||
"@types/node": "^20.8.2",
|
||||
"@typescript-eslint/eslint-plugin": "^6.7.4",
|
||||
"@typescript-eslint/parser": "^6.7.4",
|
||||
"@typescript-eslint/parser": "^6.19.0",
|
||||
"auto-changelog": "^2.4.0",
|
||||
"chai": "^4.3.10",
|
||||
"chai-spies": "^1.0.0",
|
||||
|
@ -78,13 +75,13 @@
|
|||
"ts-node": "^10.9.1",
|
||||
"ts-node-dev": "^2.0.0",
|
||||
"ts-node-register": "^1.0.0",
|
||||
"typescript": "^5.2.2"
|
||||
"typescript": "^5.4.5",
|
||||
"@oceanprotocol/lib": "^2.7.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@oceanprotocol/contracts": "^2.0.3",
|
||||
"@oceanprotocol/lib": "^2.7.0",
|
||||
"cross-fetch": "^3.1.6",
|
||||
"ethereumjs-util": "^7.1.5"
|
||||
"@graphprotocol/graph-cli": "^0.71.0",
|
||||
"@graphprotocol/graph-ts": "^0.31.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -118,6 +118,21 @@ export function handlePredictionPayout(event: PredictionPayout): void {
|
|||
|
||||
predictPrediction.payout = predictionPayout.id
|
||||
predictPrediction.save()
|
||||
|
||||
let shouldUpdateSlot = false
|
||||
const predictSlot = getPredictSlot(
|
||||
event.address.toHexString(),
|
||||
event.params.slot.toI32()
|
||||
)
|
||||
if (event.params.status == 1 && predictSlot.status !== 'Paying') {
|
||||
predictSlot.status = 'Paying'
|
||||
shouldUpdateSlot = true
|
||||
}
|
||||
if (event.params.status == 2 && predictSlot.status !== 'Canceled') {
|
||||
predictSlot.status = 'Canceled'
|
||||
shouldUpdateSlot = true
|
||||
}
|
||||
if (shouldUpdateSlot == true) predictSlot.save()
|
||||
}
|
||||
|
||||
export function handleNewSubscription(event: NewSubscription): void {
|
||||
|
|
|
@ -13,7 +13,7 @@ export function getGlobalStats(): GlobalStatistic {
|
|||
let globalStats = GlobalStatistic.load(GLOBAL_ID)
|
||||
if (!globalStats) {
|
||||
globalStats = new GlobalStatistic(GLOBAL_ID)
|
||||
globalStats.version = '4.0.1'
|
||||
globalStats.version = '4.0.2'
|
||||
globalStats.orderCount = 0
|
||||
globalStats.fixedCount = 0
|
||||
globalStats.datatokenCount = 0
|
||||
|
|
Loading…
Reference in New Issue