Skip to content

Commit

Permalink
update and add amoy configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
orionstardust committed Jun 22, 2024
1 parent ed440d4 commit 5f1078d
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 2,942 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/deploy-tags-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy to Satsuma Service on testnet

on:
push:
tags:
- "test-*"

jobs:
buildAndDeploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install node
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install Yarn
run: npm i -g yarn
- name: Install Libs
run: yarn --frozen-lockfile
- name: Codegen
run: yarn codegen:testnet
- name: Build
run: yarn build:testnet
- name: Deploy to Satsuma on test
run: |
npx graph deploy aavegotchi-svg-amoy \
--deploy-key ${{secrets.SATSUMA_ACCESS_TOKEN}} \
--node https://subgraphs.alchemy.com/api/subgraphs/deploy \
--ipfs https://ipfs.satsuma.xyz \
--version-label ${GITHUB_REF#refs/*/} \
subgraph.testnet.yaml
shell: bash
32 changes: 32 additions & 0 deletions .github/workflows/deploy-tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deploy to Satsuma Service

on:
push:
tags:
- "prod-*"

jobs:
buildAndDeploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install node
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install Yarn
run: npm i -g yarn
- name: Install Libs
run: yarn --frozen-lockfile
- name: Codegen
run: yarn codegen
- name: Build
run: yarn build
- name: Deploy to Satsuma
run: |
npx graph deploy aavegotchi-svg-matic \
--deploy-key ${{secrets.SATSUMA_ACCESS_TOKEN}} \
--node https://subgraphs.alchemy.com/api/subgraphs/deploy \
--ipfs https://ipfs.satsuma.xyz \
--version-label ${GITHUB_REF#refs/*/}
shell: bash
24 changes: 0 additions & 24 deletions .github/workflows/graph.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build/
generated/
node_modules/
yarn-error.log
yarn-error.log
.idea
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
"scripts": {
"codegen": "graph codegen",
"build": "graph build",
"codegen:testnet": "graph codegen subgraph.testnet.yaml",
"build:testnet": "graph build subgraph.testnet.yaml",
"deploy": "graph deploy --node https://api.studio.thegraph.com/deploy/ aavegotchi-svgs-subgraph",
"create-local": "graph create --node http://localhost:8020/ aavegotchi-svgs-subgraph",
"remove-local": "graph remove --node http://localhost:8020/ aavegotchi-svgs-subgraph",
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 aavegotchi-svgs-subgraph"
},
"dependencies": {
"@graphprotocol/graph-cli": "0.23.2",
"@graphprotocol/graph-ts": "0.23.1",
"@graphprotocol/graph-cli": "0.60.0",
"@graphprotocol/graph-ts": "0.31.0",
"apollo-fetch": "^0.7.0"
}
}
8 changes: 7 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import { BigInt } from "@graphprotocol/graph-ts";

export let BLOCK_SIDEVIEWS_ACTIVATED = BigInt.fromI32(39130900);
// matic
// export let BLOCK_SIDEVIEWS_ACTIVATED = BigInt.fromI32(39130900);
// export const AAVEGOTCHI_DIAMOND = "0x86935F11C86623deC8a25696E1C19a8659CbF95d"

// amoy
export let BLOCK_SIDEVIEWS_ACTIVATED = BigInt.fromI32(8159213);
export const AAVEGOTCHI_DIAMOND = "0xd4275abb81e8D30A42B69A588634570e56D25ada"
5 changes: 3 additions & 2 deletions src/helper.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Address, BigInt } from "@graphprotocol/graph-ts";
import { Contract } from "../generated/Contract/Contract";
import { Aavegotchi } from "../generated/schema";
import {AAVEGOTCHI_DIAMOND} from "./constants";

export function updateSvg(gotchi: BigInt): Aavegotchi | null {
let contract = Contract.bind(Address.fromString("0x86935F11C86623deC8a25696E1C19a8659CbF95d"))
let contract = Contract.bind(Address.fromString(AAVEGOTCHI_DIAMOND))
let svg = contract.try_getAavegotchiSvg(gotchi);
if(svg.reverted) {
return null; // just skip
Expand All @@ -15,7 +16,7 @@ export function updateSvg(gotchi: BigInt): Aavegotchi | null {
}

export function updateSideViews(gotchi: BigInt): Aavegotchi | null {
let contract = Contract.bind(Address.fromString("0x86935F11C86623deC8a25696E1C19a8659CbF95d"))
let contract = Contract.bind(Address.fromString(AAVEGOTCHI_DIAMOND))
let svgs = contract.try_getAavegotchiSideSvgs(gotchi);

if(svgs.reverted) {
Expand Down
29 changes: 29 additions & 0 deletions subgraph.testnet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
specVersion: 0.0.4
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum/contract
name: Contract
network: polygon-amoy
source:
address: "0xd4275abb81e8D30A42B69A588634570e56D25ada"
abi: Contract
startBlock: 6760900
mapping:
kind: ethereum/events
apiVersion: 0.0.6
language: wasm/assemblyscript
entities:
- ClaimAavegotchi
- EquipWearables
abis:
- name: Contract
file: ./abis/Contract.json
eventHandlers:
- event: EquipWearables(indexed uint256,uint16[16],uint16[16])
handler: handleEquipWearables
- event: ClaimAavegotchi(indexed uint256)
handler: handleClaimAavegotchi
blockHandlers:
- handler: handleBlock
file: ./src/mapping.ts
4 changes: 2 additions & 2 deletions subgraph.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
specVersion: 0.0.2
specVersion: 0.0.4
schema:
file: ./schema.graphql
dataSources:
Expand All @@ -11,7 +11,7 @@ dataSources:
startBlock: 39130899
mapping:
kind: ethereum/events
apiVersion: 0.0.5
apiVersion: 0.0.6
language: wasm/assemblyscript
entities:
- ClaimAavegotchi
Expand Down
Loading

0 comments on commit 5f1078d

Please sign in to comment.