Skip to content

Commit

Permalink
Move files around, now all substreams init regardless of sink will ge…
Browse files Browse the repository at this point in the history
…nerate db_out and graph_out, schema.sql and schema.graphql. Only the subtreams.yaml will change respectively of the sink configuration chosen
  • Loading branch information
Eduard-Voiculescu committed Oct 13, 2023
1 parent 2dd10d9 commit 77f7018
Show file tree
Hide file tree
Showing 26 changed files with 1,167 additions and 427 deletions.
19 changes: 19 additions & 0 deletions codegen/templates/ethereum/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions codegen/templates/ethereum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ prost-types = "0.11"
substreams = "0.5"
substreams-ethereum = "0.9"
substreams-database-change = "1"
substreams-entity-change = "1"

# Required so that ethabi > ethereum-types build correctly under wasm32-unknown-unknown
[target.wasm32-unknown-unknown.dependencies]
Expand Down
3 changes: 0 additions & 3 deletions codegen/templates/ethereum/Cargo.toml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ prost = "0.11"
prost-types = "0.11"
substreams = "0.5"
substreams-ethereum = "0.9"
{{- if eq .sinkChoice 1 }}
substreams-database-change = "1"
{{- else if eq .sinkChoice 2 }}
substreams-entity-change = "1"
{{- end }}

# Required so that ethabi > ethereum-types build correctly under wasm32-unknown-unknown
[target.wasm32-unknown-unknown.dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ prost-types = "0.11"
substreams = "0.5"
substreams-ethereum = "0.9"
substreams-database-change = "1"
substreams-entity-change = "1"

# Required so that ethabi > ethereum-types build correctly under wasm32-unknown-unknown
[target.wasm32-unknown-unknown.dependencies]
Expand Down
10 changes: 10 additions & 0 deletions codegen/templates/ethereum/results/dbsink/substreams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ package:

imports:
sql: https://github.com/streamingfast/substreams-sink-sql/releases/download/protodefs-v1.0.2/substreams-sink-sql-protodefs-v1.0.2.spkg
graph: https://github.com/streamingfast/substreams-subgraph-sink/releases/download/v0.1.0/substreams-subgraph-sink-protodefs-v0.1.0.spkg
database_change: https://github.com/streamingfast/substreams-sink-database-changes/releases/download/v1.2.1/substreams-database-change-v1.2.1.spkg
entity: https://github.com/streamingfast/substreams-entity-change/releases/download/v1.1.0/substreams-entity-change-v1.1.0.spkg

protobuf:
files:
Expand Down Expand Up @@ -35,6 +37,14 @@ modules:
output:
type: proto:sf.substreams.sink.database.v1.DatabaseChanges

- name: graph_out
kind: map
initialBlock: 123
inputs:
- map: map_events
output:
type: proto:sf.substreams.entity.v1.EntityChanges

network: mainnet

sink:
Expand Down
33 changes: 0 additions & 33 deletions codegen/templates/ethereum/results/graphsink/Cargo.toml

This file was deleted.

162 changes: 0 additions & 162 deletions codegen/templates/ethereum/results/graphsink/lib.rs

This file was deleted.

16 changes: 12 additions & 4 deletions codegen/templates/ethereum/results/graphsink/substreams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ package:

imports:
sql: https://github.com/streamingfast/substreams-sink-sql/releases/download/protodefs-v1.0.2/substreams-sink-sql-protodefs-v1.0.2.spkg
graph: https://github.com/streamingfast/substreams-subgraph-sink/releases/download/v0.1.0/substreams-subgraph-sink-protodefs-v0.1.0.spkg
database_change: https://github.com/streamingfast/substreams-sink-database-changes/releases/download/v1.2.1/substreams-database-change-v1.2.1.spkg
entity: https://github.com/streamingfast/substreams-entity-change/releases/download/v1.1.0/substreams-entity-change-v1.1.0.spkg

protobuf:
Expand All @@ -27,6 +29,14 @@ modules:
output:
type: proto:contract.v1.Events

- name: db_out
kind: map
initialBlock: 123
inputs:
- map: map_events
output:
type: proto:sf.substreams.sink.database.v1.DatabaseChanges

- name: graph_out
kind: map
initialBlock: 123
Expand All @@ -39,11 +49,9 @@ network: mainnet

sink:
module: graph_out
type: sf.substreams.sink.sql.v1.Service
type: sf.substreams.subgraph.sink.v1.Service
config:
schema: "./schema.graphql"
wire_protocol_access: true
postgraphile_frontend:
enabled: true
postgres_direct_protocol_access: true
pgweb_frontend:
enabled: true
Loading

0 comments on commit 77f7018

Please sign in to comment.