Skip to content

Commit 388a41b

Browse files
committed
cleanup repo structure
1 parent 17c07e3 commit 388a41b

File tree

37 files changed

+127
-102
lines changed

37 files changed

+127
-102
lines changed

.github/workflows/docker.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Build & Push Docker Image
22

33
on:
44
push:
5+
paths:
6+
- "api-service/**"
7+
- "proto/**"
58
branches:
69
- "main"
710
tags:
@@ -58,4 +61,5 @@ jobs:
5861
GOPRIVATE: github.com/pinax-network,github.com/eosnationftw,github.com/pomelo-io
5962
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
6063
run: |
64+
cd api-service
6165
task build:docker

.github/workflows/go.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ jobs:
4646
GOPRIVATE: github.com/pinax-network,github.com/eosnationftw,github.com/pomelo-io
4747
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
4848
run: |
49+
cd api-service
4950
task build

.github/workflows/template-sync.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,6 @@
1-
# Ethereum Consensus Layer Blob Service
2-
3-
### From Source
4-
5-
- Build substreams and start KV sink
6-
```bash
7-
$ cd substreams
8-
$ task protogen # if needed
9-
$ task sink
10-
```
11-
12-
- Start Blobs service
13-
```bash
14-
$ task protogen
15-
$ task generate:go
16-
$ task start:service
17-
```
18-
19-
### Or, with Docker:
20-
21-
- Start KV sink
22-
```bash
23-
$ cd substreams
24-
$ task start:docker`
25-
```
26-
27-
- Start Blob service
28-
```bash
29-
$ task start:docker`
30-
```
31-
32-
33-
### Query
34-
```bash
35-
$ curl -v http://localhost:8080/eth/v1/beacon/blob_sidecars/7677000
36-
```
1+
# Ethereum Blobs Monorepo
2+
This repository contains several components:
3+
- `proto` - Blobs protobuf definitions
4+
- `substreams` - Substreams modules to stream blobs data from substreams-enabled Consensus Layer Firehose
5+
- `subgraph` - Substreams-based Subgraph that uses substreams module
6+
- `api-service` - REST API service to access to blobs via substreams sink that can be used as a drop-in replacement for Consensus Layer clients' blob_sidecar API

.gitignore renamed to api-service/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
config*.yaml
22
!config.example.yaml
3+
!config.docker.yaml
34
blob-service
45
__debug_bin*
56

File renamed without changes.
File renamed without changes.

api-service/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Blobs REST API Service
2+
This service provides REST API access to Ethereum blobs via KV sink backend.
3+
To run it you need to have KV sink backend running and consuming [blobs substreams](../substreams) locally or on the server
4+
5+
### Quick Start
6+
7+
- From source:
8+
```bash
9+
> task protogen # generate Go protobuf bindings
10+
> task generate:go # generate swagger docs
11+
> task start:service # build and start service
12+
```
13+
14+
- Or, with Docker:
15+
```bash
16+
> task start:docker
17+
```
18+
19+
20+
### Query
21+
```bash
22+
> curl -v http://localhost:8080/eth/v1/beacon/blob_sidecars/7677000
23+
> curl -v http://localhost:8080/health
24+
```

Taskfile.yaml renamed to api-service/Taskfile.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,15 @@ tasks:
102102
cmds:
103103
- docker run
104104
-p 8080:8080
105-
-v $(pwd)/docker-config.yaml:/app/config.yaml
105+
-v $(pwd)/config.docker.yaml:/app/config.yaml
106106
ghcr.io/pinax-network/blob-service:v0.6.2
107107
-config /app/config.yaml
108108

109109
protogen:
110110
desc: "Builds types from protobuf files"
111111
cmds:
112112
- mkdir -p pb
113-
- protoc --go_out=./pb --go_opt=paths=source_relative --proto_path=substreams/proto pinax/ethereum/blobs/v1/blobs.proto
113+
- protoc --go_out=./pb --go_opt=paths=source_relative --proto_path=../proto pinax/ethereum/blobs/v1/blobs.proto
114114
- ls pb/pinax/ethereum/blobs/v1/*.pb.go | xargs -n1 -IX bash -c 'sed s/,omitempty// X > X.tmp && mv X{.tmp,}'
115115

116116
test:format:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

test.http renamed to api-service/test.http

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ GET http://localhost:8080/eth/v1/beacon/blob_sidecars/7677000
22

33
###
44

5-
GET http://localhost:8080/eth/v1/beacon/blob_sidecars/7658912
5+
GET http://localhost:8080/eth/v1/beacon/blob_sidecars/head
66

77
###
88

9-
GET http://localhost:8080/eth/v1/beacon/blob_sidecars/head
10-
9+
GET http://localhost:8080/health
1110

1211

1312
###
@@ -16,4 +15,4 @@ GET http://goerli-arch41.mar.eosn.io:5052/eth/v1/beacon/blob_sidecars/7677000
1615

1716
###
1817

19-
GET http://goerli-arch41.mar.eosn.io:5052/eth/v1/beacon/blob_sidecars/7658912
18+
GET http://goerli-arch41.mar.eosn.io:5052/eth/v1/beacon/blob_sidecars/head

subgraph/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Ethereum Blobs Subgraph
2+
3+
### Running locally
4+
5+
- Set up `$SUBSTREAMS_ENDPOINT` and `$SUBSTREAMS_API_TOKEN` env variables
6+
7+
- Start Graph node, IPFS node and Postgres database in Docker:
8+
```bash
9+
> cd ./graph-node
10+
> ./up.sh -c # use -c flag to cleanup database and start from scratch
11+
```
12+
13+
- Build, create and deploy the subgraph
14+
```bash
15+
> yarn build
16+
> yarn create-local
17+
> yarn deploy-local
18+
```
19+
20+
- Query: http://localhost:8000/subgraphs/name/blobs/graphql

substreams/README.md

Lines changed: 65 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,92 @@
1-
# Ethereum Beacon chain Blobs Substream
1+
# Ethereum Blobs Substream
2+
This substreams package offers two sink map modules:
3+
- `kv_out` - to sink into KV store
4+
- `graph_out` - to sink into [substreams-based Subgraph](../subgraph)
25

3-
### [Latest Releases](https://github.com/pinax-network/substreams/releases)
6+
### [Latest Releases](https://github.com/pinax-network/blob-service/releases)
47

5-
### Quickstart
8+
### Quick Start
69

710
```bash
8-
$ make gui
11+
> make protogen # if needed
12+
> make gui
913
```
1014

1115
or
1216

1317
```bash
14-
$ substreams gui -e goerli-scdm37b.mar.eosn.io:10016 https://github.com/pinax-network/substreams/releases/download/blobs-v0.2.0/eth-blobs-v0.2.0.spkg map_blobs -s -100 --plaintext
18+
> substreams gui -e goerli-cl.substreams.pinax.network:443 map_blobs -s -100
1519
```
1620

17-
### Graph
21+
### Sink
22+
23+
To start sinking the data using KV sink into local KV store use
24+
```bash
25+
> task sink
26+
```
27+
28+
29+
- Or, with Docker:
30+
```bash
31+
> task start:docker
32+
```
33+
34+
35+
36+
### Package Info
1837

1938
```mermaid
2039
graph TD;
2140
map_blobs[map: map_blobs];
2241
sf.beacon.type.v1.Block[source: sf.beacon.type.v1.Block] --> map_blobs;
23-
42+
kv_out[map: kv_out];
43+
map_blobs --> kv_out;
44+
graph_out[map: graph_out];
45+
map_blobs --> graph_out;
2446
```
2547

26-
### Modules
27-
2848
```yaml
2949
Package name: eth_blobs
30-
Version: v0.2.0
50+
Version: v0.6.2
51+
Doc: This substreams package lets you stream Consensus Layer EIP-4844 blobs with attached meta data.
52+
53+
Among the supported chains are:
54+
- mainnet-cl: eth-cl.substreams.pinax.network:443
55+
- goerli-cl: goerli-cl.substreams.pinax.network:443
56+
- sepolia-cl: sepolia-cl.substreams.pinax.network:443
57+
- holesky-cl: holesky-cl.substreams.pinax.network:443
58+
- gnosis-cl: gnosis-cl.substreams.pinax.network:443
59+
- chiado-cl: chiado-cl.substreams.pinax.network:443
60+
61+
Image: [embedded image: 49353 bytes]
3162
Modules:
3263
----
3364
Name: map_blobs
3465
Initial block: 0
3566
Kind: map
3667
Input: source: sf.beacon.type.v1.Block
37-
Output Type: proto:eth.blobs.v1.Blobs
38-
Hash: ca9133543d1628df5681107b2ea68c4ade81cd8f
68+
Output Type: proto:pinax.ethereum.blobs.v1.Slot
69+
Hash: a110dc3d832afd7e85a0ff4a2d935b72b215d893
70+
71+
Name: kv_out
72+
Initial block: 0
73+
Kind: map
74+
Input: map: map_blobs
75+
Output Type: proto:sf.substreams.sink.kv.v1.KVOperations
76+
Hash: 800435f53200217af6c523f95b90e10db3ac9517
77+
78+
Name: graph_out
79+
Initial block: 0
80+
Kind: map
81+
Input: map: map_blobs
82+
Output Type: proto:sf.substreams.entity.v1.EntityChanges
83+
Hash: 46ef992415d463ec45bcbf6fe34b716b451b05ae
84+
85+
Network: goerli-cl
86+
87+
Sink config:
88+
----
89+
type: sf.substreams.sink.kv.v1.GenericService
90+
configs:
91+
- sink_config: <nil>
3992
```

substreams/substreams.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protobuf:
2323
files:
2424
- pinax/ethereum/blobs/v1/blobs.proto
2525
importPaths:
26-
- ./proto
26+
- ../proto
2727

2828
binaries:
2929
default:

0 commit comments

Comments
 (0)