Skip to content

Commit

Permalink
Add SubgraphAvailabilityManager graph (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maikol authored Mar 13, 2024
1 parent e53a031 commit 813151e
Show file tree
Hide file tree
Showing 13 changed files with 4,493 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Tests

on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

# Install commands
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
registry-url: https://registry.npmjs.org
- name: yarn add ts-node
run: yarn add ts-node
- name: yarn install
run: yarn install

# Run scripts
- name: Test
run: yarn test
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Ignore truffle stuff
build/

subgraph.yaml
generated/
node_modules/
src/types/
src/mappings/helpers/metadata.ts
.DS_STORE
yarn-error.log
subgraph.yaml
config/addresses.ts
config/generatedAddresses.json
tests/.bin
.vscode
.latest.json
276 changes: 276 additions & 0 deletions abis/SubgraphAvailabilityManager.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,276 @@
[
{
"inputs": [
{ "internalType": "address", "name": "_governor", "type": "address" },
{
"internalType": "address",
"name": "_rewardsManager",
"type": "address"
},
{
"internalType": "uint256",
"name": "_executionThreshold",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_voteTimeLimit",
"type": "uint256"
},
{ "internalType": "address[5]", "name": "_oracles", "type": "address[5]" }
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
}
],
"name": "NewOwnership",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
}
],
"name": "NewPendingOwnership",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "index",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "oracle",
"type": "address"
}
],
"name": "OracleSet",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "subgraphDeploymentID",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "bool",
"name": "deny",
"type": "bool"
},
{
"indexed": true,
"internalType": "uint256",
"name": "oracleIndex",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"name": "OracleVote",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "voteTimeLimit",
"type": "uint256"
}
],
"name": "VoteTimeLimitSet",
"type": "event"
},
{
"inputs": [],
"name": "NUM_ORACLES",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "acceptOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_subgraphDeploymentID",
"type": "bytes32"
},
{ "internalType": "bool", "name": "_deny", "type": "bool" }
],
"name": "checkVotes",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "currentNonce",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "executionThreshold",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "governor",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "", "type": "uint256" },
{ "internalType": "bytes32", "name": "", "type": "bytes32" },
{ "internalType": "uint256", "name": "", "type": "uint256" }
],
"name": "lastAllowVote",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "", "type": "uint256" },
{ "internalType": "bytes32", "name": "", "type": "bytes32" },
{ "internalType": "uint256", "name": "", "type": "uint256" }
],
"name": "lastDenyVote",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"name": "oracles",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pendingGovernor",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "_index", "type": "uint256" },
{ "internalType": "address", "name": "_oracle", "type": "address" }
],
"name": "setOracle",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "_voteTimeLimit", "type": "uint256" }
],
"name": "setVoteTimeLimit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_newGovernor", "type": "address" }
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_subgraphDeploymentID",
"type": "bytes32"
},
{ "internalType": "bool", "name": "_deny", "type": "bool" },
{ "internalType": "uint256", "name": "_oracleIndex", "type": "uint256" }
],
"name": "vote",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32[]",
"name": "_subgraphDeploymentID",
"type": "bytes32[]"
},
{ "internalType": "bool[]", "name": "_deny", "type": "bool[]" },
{ "internalType": "uint256", "name": "_oracleIndex", "type": "uint256" }
],
"name": "voteMany",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "voteTimeLimit",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
}
]
1 change: 1 addition & 0 deletions config/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
8 changes: 8 additions & 0 deletions networks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"arbitrum-sepolia": {
"SubgraphAvailabilityManager": {
"address": "0x9bDC3264596850E7F5d141A8D898dFA7001355CC",
"startBlock": 22552633
}
}
}
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "network-monitoring-subgraph",
"license": "UNLICENSED",
"scripts": {
"codegen": "graph codegen",
"build": "graph build",
"deploy": "graph deploy --node https://api.studio.thegraph.com/deploy/ network-monitoring-subgraph",
"create-local": "graph create --node http://localhost:8020/ network-monitoring-subgraph",
"remove-local": "graph remove --node http://localhost:8020/ network-monitoring-subgraph",
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 network-monitoring-subgraph",
"test": "yarn && yarn prep:test && yarn codegen && graph test",
"prep:test": "mustache ./config/test.json subgraph.template.yaml > subgraph.yaml"
},
"dependencies": {
"@graphprotocol/graph-cli": "0.61.0",
"@graphprotocol/graph-ts": "0.30.0"
},
"devDependencies": {
"matchstick-as": "0.5.0",
"mustache": "^4.2.0"
}
}
Loading

0 comments on commit 813151e

Please sign in to comment.