Skip to content

Commit

Permalink
Merge branch 'main' into lok52/lookup-methods-verify
Browse files Browse the repository at this point in the history
  • Loading branch information
lok52 committed Nov 29, 2023
2 parents a8cf95f + b015e4b commit 6adbcca
Show file tree
Hide file tree
Showing 79 changed files with 16,932 additions and 155 deletions.
4 changes: 2 additions & 2 deletions .github/actions/deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ runs:
- id: install-protoc
shell: bash
run: |
wget https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-x86_64.zip -O ./protoc.zip
wget https://github.com/protocolbuffers/protobuf/releases/download/v25.0/protoc-25.0-linux-x86_64.zip -O ./protoc.zip
unzip protoc.zip
sudo mv ./include/* /usr/include/
sudo mv ./bin/protoc /usr/bin/protoc
- id: install-protoc-gen-openapiv2
shell: bash
run: |
wget https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v2.15.0/protoc-gen-openapiv2-v2.15.0-linux-x86_64 -O ./protoc-gen-openapiv2
wget https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v2.18.1/protoc-gen-openapiv2-v2.18.1-linux-x86_64 -O ./protoc-gen-openapiv2
chmod +x protoc-gen-openapiv2
sudo mv ./protoc-gen-openapiv2 /usr/bin/protoc-gen-openapiv2
2 changes: 2 additions & 0 deletions blockscout-ens/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
data
node_modules
3 changes: 3 additions & 0 deletions blockscout-ens/graph-node/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data
node_modules
*.ipynb
25 changes: 25 additions & 0 deletions blockscout-ens/graph-node/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Graph-node

`graph-node` indexes events in ethereum blockchain

One can submit subgraph to `graph-node` -- actual code how to handle new events of contracts

## Start locally

+ Edit `docker-compose.yml` and change `ethereum` ENV variable of `graph-node` services to add your own network and RPC url.

+ Start your own graph-node with docker-compose:

```bash
docker-compose up -d
```

+ Load small version of ens-rainbow

```bash
./rainbow.small.sh
```

+ Or use [full ens-rainbow](https://github.com/graphprotocol/ens-rainbow/) dump

+ Read [subgraphs/README.md](./subgraphs/README.md) to build and deploy subgraph to graph-node
60 changes: 60 additions & 0 deletions blockscout-ens/graph-node/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
version: '3'
services:
graph-node:
container_name: graph-node-dev
image: graphprotocol/graph-node
ports:
- '8000:8000'
- '8001:8001'
- '8020:8020'
- '8030:8030'
- '8040:8040'
depends_on:
- ipfs
- postgres
extra_hosts:
- host.docker.internal:host-gateway
environment:
postgres_host: postgres
postgres_user: graph-node
postgres_pass: let-me-in
postgres_db: graph-node
ipfs: 'ipfs:5001'
ethereum: 'mainnet:https://api.zmok.io/mainnet/oaen6dy8ff6hju9k'
GRAPH_LOG: info
volumes:
- ./gn-config.toml:/root/gn-config.toml
ipfs:
container_name: gn-ipfs-dev
image: ipfs/kubo:v0.14.0
ports:
- '5001:5001'
volumes:
- ./data/ipfs:/data/ipfs
postgres:
container_name: gn-postgres-dev
image: postgres:14
ports:
- '5432:5432'
command:
[
"postgres",
"-cshared_preload_libraries=pg_stat_statements",
"-cmax_connections=200"
]
environment:
POSTGRES_USER: graph-node
POSTGRES_PASSWORD: let-me-in
POSTGRES_DB: graph-node
# FIXME: remove this env. var. which we shouldn't need. Introduced by
# <https://github.com/graphprotocol/graph-node/pull/3511>, maybe as a
# workaround for https://github.com/docker/for-mac/issues/6270?
PGDATA: "/var/lib/postgresql/data"
POSTGRES_INITDB_ARGS: "-E UTF8 --locale=C"
volumes:
- ./data/postgres:/var/lib/postgresql/data





15 changes: 15 additions & 0 deletions blockscout-ens/graph-node/gn-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[general]

[store]
[store.primary]
connection = "postgresql://graph-node:let-me-in@postgres:5432/graph-node"
weight = 1
pool_size = 10

[chains]
ingestor = "block_ingestor_node"

[deployment]
[[deployment.rule]]
shard = "primary"
indexers = [ "default" ]
485 changes: 485 additions & 0 deletions blockscout-ens/graph-node/rainbow.small.sh

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions blockscout-ens/graph-node/subgraphs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Domains subgraph

## Current supported domains

+ `ens-subgraph`: Ethereum (.eth)
+ `rns-subgraph`: Rootstock (.rsk)

## To start

> For every directory, it's posibble to deploy subgraph to blockscout graph-node

1. Initially:

```bash
cd <subgraph_directory>
just init
just codegen
just build
```

2. Deploy to blockscout:

+ Make sure you have access to graph, for example using port forwarding to staging graph-node:

```bash
kubectl port-forward -n graph-node svc/graph-node 8020:8020
```

+ Create subgraph

```bash
just create
```

+ Push it to graph-node

```bash
just deploy-remote
```
76 changes: 76 additions & 0 deletions blockscout-ens/graph-node/subgraphs/ens-subgraph/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Graph cli generated
src/types
build/
.DS_STORE
data
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Built output
dist

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/
dist/


# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# intellij
.idea

/tests/.bin
3 changes: 3 additions & 0 deletions blockscout-ens/graph-node/subgraphs/ens-subgraph/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ENS Subgraph

> forked from [https://github.com/ensdomains/ens-subgraph](https://github.com/ensdomains/ens-subgraph)
Loading

0 comments on commit 6adbcca

Please sign in to comment.