fix missing logic (#751)

* fix missing logic

* remove goerli
This commit is contained in:
Alex Coseru 2024-03-21 10:45:33 +02:00 committed by GitHub
parent 4e939c70c0
commit d80ba60637
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 152 additions and 167 deletions

View File

@ -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

View File

@ -3,19 +3,14 @@ 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:
@ -24,11 +19,8 @@ SPDX-License-Identifier: Apache-2.0
- 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
@ -146,8 +138,6 @@ spec:
app: ipfs
```
##### Graph-node
The following annotated templated can be customized to deploy graph-node deployment and service:
@ -193,7 +183,7 @@ spec:
- name: ethereum
value: mumbai:https://polygon-mumbai.infura.io/v3/< INFURA ID>
- name: GRAPH_KILL_IF_UNRESPONSIVE
value: "true"
value: 'true'
image: graphprotocol/graph-node:v0.28.2
imagePullPolicy: IfNotPresent
livenessProbe:
@ -232,7 +222,7 @@ spec:
timeoutSeconds: 1
resources:
limits:
cpu: "2"
cpu: '2'
memory: 1536Mi
requests:
cpu: 1500m
@ -270,16 +260,13 @@ spec:
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,16 +395,12 @@ 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
@ -458,7 +431,6 @@ Skipping bsc
Skipping energyweb
Skipping moonriver
Skipping mainnet
Skipping goerli
Skipping polygonedge
Skipping gaiaxtestnet
Skipping alfajores

View File

@ -6,7 +6,6 @@
"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",

View File

@ -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 {