diff --git a/apps/mana/src/eth/rpc.ts b/apps/mana/src/eth/rpc.ts index 0d5ca46c2..db7558284 100644 --- a/apps/mana/src/eth/rpc.ts +++ b/apps/mana/src/eth/rpc.ts @@ -8,7 +8,8 @@ import { evmGoerli, evmSepolia, evmLineaGoerli, - EvmNetworkConfig + EvmNetworkConfig, + evmSkaleTestnet } from '@snapshot-labs/sx'; import fetch from 'cross-fetch'; import { createWalletProxy } from './dependencies'; @@ -21,7 +22,8 @@ export const NETWORKS = new Map([ [1, evmMainnet], [5, evmGoerli], [11155111, evmSepolia], - [59140, evmLineaGoerli] + [59140, evmLineaGoerli], + [1444673419, evmSkaleTestnet] ]); export const createNetworkHandler = (chainId: number) => { diff --git a/apps/subgraph-api/deploy.sh b/apps/subgraph-api/deploy.sh new file mode 100755 index 000000000..a02f1e152 --- /dev/null +++ b/apps/subgraph-api/deploy.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +set -e + + +if ! which docker 2>&1 > /dev/null; then + echo "Please install 'docker' first" + exit 1 +fi + +if ! which docker-compose 2>&1 > /dev/null; then + echo "Please install 'docker-compose' first" + exit 1 +fi + +# Start graph node +docker-compose up -d + + +until curl -o /dev/null -s http://localhost:8040/metrics; do + >&2 echo "Graph node is unavailable - sleeping for while......" + sleep 2 +done + +>&2 echo "Graph node is Up is up - executing command" + +echo "Installing dependencies" +yarn + +echo "Building app" +yarn run codegen +yarn run build + +echo "Pushing app to local graph node" +yarn run create-local +yarn run deploy-local \ No newline at end of file diff --git a/apps/subgraph-api/docker-compose.yml b/apps/subgraph-api/docker-compose.yml new file mode 100644 index 000000000..166aefde4 --- /dev/null +++ b/apps/subgraph-api/docker-compose.yml @@ -0,0 +1,36 @@ +version: '3.8' +services: + graph-node: + image: graphprotocol/graph-node + ports: + - '8000:8000' + - '8001:8001' + - '8020:8020' + - '8030:8030' + - '8040:8040' + depends_on: + - postgres + environment: + postgres_host: postgres + postgres_user: postgres + postgres_pass: password + postgres_db: graph + ipfs: 'https://api.thegraph.com/ipfs/' + ethereum: 'mainnet:https://testnet.skalenodes.com/v1/juicy-low-small-testnet' + GRAPH_LOG: info + postgres: + image: postgres:15.4 + ports: + - '5432:5432' + command: ['postgres', '-cshared_preload_libraries=pg_stat_statements', '-cmax_connections=200'] + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: password + POSTGRES_DB: graph + POSTGRES_INITDB_ARGS: '-E UTF8 --locale=C' + volumes: + - ./initdb.d:/docker-entrypoint-initdb.d + - pg:/var/lib/postgresql/data +volumes: + pg: + driver: local diff --git a/apps/subgraph-api/package.json b/apps/subgraph-api/package.json index 63b7dbe47..ab103e8cd 100644 --- a/apps/subgraph-api/package.json +++ b/apps/subgraph-api/package.json @@ -10,7 +10,7 @@ "deploy": "graph deploy --node https://api.thegraph.com/deploy/ snapshot-labs/sx-subgraph", "create-local": "graph create --node http://localhost:8020/ snapshot-labs/sx-subgraph", "remove-local": "graph remove --node http://localhost:8020/ snapshot-labs/sx-subgraph", - "deploy-local": "yarn create-local && graph deploy --node http://localhost:8020/ --network sepolia -l `LC_ALL=C tr -dc a-z0-9 () @@ -65,6 +65,7 @@ CHAIN_IDS.set('optimism', 10) CHAIN_IDS.set('matic', 137) CHAIN_IDS.set('arbitrum-one', 42161) CHAIN_IDS.set('linea-testnet', 59140) +CHAIN_IDS.set('skale-testnet', 1444673419) export function handleProxyDeployed(event: ProxyDeployed): void { let network = dataSource.network() diff --git a/apps/subgraph-api/subgraph.yaml b/apps/subgraph-api/subgraph.yaml index 12f01780f..ef6876e2c 100644 --- a/apps/subgraph-api/subgraph.yaml +++ b/apps/subgraph-api/subgraph.yaml @@ -4,11 +4,11 @@ schema: dataSources: - kind: ethereum name: ProxyFactory - network: sepolia + network: mainnet source: abi: ProxyFactory - address: '0x542922aF76e8b55076a54b15fD972156f5B143B0' - startBlock: 5386251 + address: '0x96f98916be07BCdB2556349b13D5F404B78E13D7' + startBlock: 1403270 mapping: kind: ethereum/events apiVersion: 0.0.7 @@ -31,7 +31,7 @@ dataSources: templates: - kind: ethereum name: Space - network: sepolia + network: mainnet source: abi: Space mapping: @@ -81,7 +81,7 @@ templates: file: ./src/mapping.ts - kind: ethereum name: AxiomExecutionStrategy - network: sepolia + network: mainnet source: abi: AxiomExecutionStrategy mapping: @@ -99,7 +99,7 @@ templates: file: ./src/mapping.ts - kind: ethereum name: TimelockExecutionStrategy - network: sepolia + network: mainnet source: abi: TimelockExecutionStrategy mapping: @@ -129,7 +129,7 @@ templates: abis: - name: Space file: ./abis/Space.json - network: sepolia + network: mainnet - name: ProposalMetadata kind: file/ipfs mapping: @@ -142,7 +142,7 @@ templates: abis: - name: Space file: ./abis/Space.json - network: sepolia + network: mainnet - name: StrategiesParsedMetadataData kind: file/ipfs mapping: @@ -155,7 +155,7 @@ templates: abis: - name: Space file: ./abis/Space.json - network: sepolia + network: mainnet - name: VotingPowerValidationStrategyMetadata kind: file/ipfs mapping: @@ -168,4 +168,4 @@ templates: abis: - name: Space file: ./abis/Space.json - network: sepolia + network: mainnet diff --git a/apps/ui/.env b/apps/ui/.env index c1596bceb..e1b107247 100644 --- a/apps/ui/.env +++ b/apps/ui/.env @@ -1,4 +1,4 @@ -VITE_ENABLED_NETWORKS=sep +VITE_ENABLED_NETWORKS=skale-testnet VITE_MANA_URL=https://mana.pizza VITE_HIGHLIGHT_URL=https://testnet.highlight.red VITE_IPFS_GATEWAY=snapshot.4everland.link diff --git a/apps/ui/src/components/App/Sidebar.vue b/apps/ui/src/components/App/Sidebar.vue index c18340f9c..179912aff 100644 --- a/apps/ui/src/components/App/Sidebar.vue +++ b/apps/ui/src/components/App/Sidebar.vue @@ -8,7 +8,7 @@ const spacesStore = useSpacesStore();