Skip to content

Commit

Permalink
Deploy aragon-tokens-gnosis in subgraph studio
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddavo committed May 22, 2024
1 parent b31fc8c commit 33f052d
Show file tree
Hide file tree
Showing 13 changed files with 2,238 additions and 1,586 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
startBlock: {{startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.1
apiVersion: 0.0.5
language: wasm/assemblyscript
entities:
- NoEnt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"network": "xdai",
"network": "gnosis",
"dataSources": {
"Organizations": [],
"OrganizationFactories": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
startBlock: {{startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.1
apiVersion: 0.0.5
language: wasm/assemblyscript
entities:
- NoEnt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
startBlock: {{startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.1
apiVersion: 0.0.5
language: wasm/assemblyscript
entities:
- NoEnt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
startBlock: {{startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.1
apiVersion: 0.0.5
language: wasm/assemblyscript
entities:
- NoEnt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{{/startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.1
apiVersion: 0.0.5
language: wasm/assemblyscript
entities:
- NoEnt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{{/startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.1
apiVersion: 0.0.5
language: wasm/assemblyscript
entities:
- NoEnt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
startBlock: {{startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.1
apiVersion: 0.0.5
language: wasm/assemblyscript
entities:
- NoEnt
Expand Down
12 changes: 6 additions & 6 deletions packages/connect-tokens/subgraph/package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"name": "@aragon/subgraph-token-manager",
"version": "0.1.0",
"name": "@daviddavo/subgraph-token-manager",
"version": "0.1.1",
"scripts": {
"codegen": "rm -rf generated; graph codegen",
"build": "rm -rf build; graph build",
"manifest-mainnet": "scripts/build-manifest.sh mainnet",
"manifest-mainnet-staging": "env STAGING=true scripts/build-manifest.sh mainnet",
"manifest-rinkeby": "scripts/build-manifest.sh rinkeby",
"manifest-rinkeby-staging": "env STAGING=true scripts/build-manifest.sh rinkeby",
"manifest-xdai": "scripts/build-manifest.sh xdai",
"manifest-gnosis": "scripts/build-manifest.sh gnosis",
"deploy-mainnet": "scripts/deploy.sh grasia tokens mainnet",
"deploy-mainnet-staging": "env STAGING=true scripts/deploy.sh grasia tokens mainnet",
"deploy-rinkeby": "scripts/deploy.sh grasia tokens rinkeby",
"deploy-rinkeby-staging": "env STAGING=true scripts/deploy.sh grasia tokens rinkeby",
"deploy-xdai": "scripts/deploy.sh grasia tokens xdai"
"deploy-gnosis": "scripts/deploy.sh grasia tokens gnosis"
},
"devDependencies": {
"@graphprotocol/graph-cli": "^0.19.0",
"@graphprotocol/graph-ts": "^0.19.0",
"@graphprotocol/graph-cli": "^0.71.0",
"@graphprotocol/graph-ts": "^0.35.0",
"mustache": "^4.0.1"
},
"dependencies": {
Expand Down
13 changes: 2 additions & 11 deletions packages/connect-tokens/subgraph/scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ USER=$1
NAME=$2
NETWORK=$3

# Require $GRAPHKEY to be set
if [[ -z "${GRAPHKEY}" ]]; then
>&2 echo "Please set \$GRAPHKEY to your The Graph access token to run this command."
exit 1
fi

# Build manifest
echo ''
echo '> Building manifest file subgraph.yaml'
Expand All @@ -22,15 +16,12 @@ echo '> Generating types'
graph codegen

# Prepare subgraph name
FULLNAME=$USER/aragon-$NAME-$NETWORK
FULLNAME=aragon-$NAME-$NETWORK
if [ "$STAGING" ]; then
FULLNAME=$FULLNAME-staging
fi
echo ''
echo '> Deploying subgraph: '$FULLNAME

# Deploy subgraph
graph deploy $FULLNAME \
--ipfs https://api.thegraph.com/ipfs/ \
--node https://api.thegraph.com/deploy/ \
--access-token $GRAPHKEY
graph deploy --studio $FULLNAME
6 changes: 3 additions & 3 deletions packages/connect-tokens/subgraph/src/aragon/aragon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ function _isRegistered(address: Address, type: string): boolean {

let entities: Address[]
if (type == 'org') {
entities = aragon.orgs as Address[]
entities = aragon.orgs.map<Address>(b => Address.fromBytes(b))
} else if (type == 'app') {
entities = aragon.apps as Address[]
entities = aragon.apps.map<Address>(b => Address.fromBytes(b))
} else if (type == 'token') {
entities = aragon.tokens as Address[]
entities = aragon.tokens.map<Address>(b => Address.fromBytes(b))
} else {
throw new Error('Invalid entity type ' + type)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/connect-tokens/subgraph/subgraph.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ templates:
abi: TokenManager
mapping:
kind: ethereum/events
apiVersion: 0.0.4
apiVersion: 0.0.5
language: wasm/assemblyscript
entities:
- Token
Expand Down
Loading

0 comments on commit 33f052d

Please sign in to comment.