You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by alex-pakalniskis April 22, 2024
Problem
Even though Substreams packages contain relevant protobuf definitions, Substreams-powered subgraph developers are unable to reference those protobuf definitions when generating AssemblyScript types for their subgraph with protoc. See this example protoc command supporting wildcard matching of protobuf files.
protoc does not natively parse Substreams packages, so users are left unable to proceed unless they source the required files. Furthermore, protobuf files are not easily found on the Substreams registry, so users must search GitHub and hope for the best. Locating the exactly correct protobuf definition files for a Substreams package adds unnecessary friction to the Substreams-powered subgraph developer experience.
Potential solution
Enable Graph CLI to generate AssemblyScript types from the *.proto files contained in a Substreams package (perhaps its just a nice wrapper for protoc + protobuf-as)
graph protogen #create a new command specific to protobuf files to look for `*.proto` files in `*.spkg`# or
graph codegen #extend codegen to look for `*.proto` files in `*.spkg` if Substreams-powered subgraph
The text was updated successfully, but these errors were encountered:
Discussed in #1639
Originally posted by alex-pakalniskis April 22, 2024
Problem
Even though Substreams packages contain relevant protobuf definitions, Substreams-powered subgraph developers are unable to reference those protobuf definitions when generating AssemblyScript types for their subgraph with
protoc
. See this exampleprotoc
command supporting wildcard matching of protobuf files.protoc --plugin=./node_modules/protobuf-as/bin/protoc-gen-as --as_out=src/pb/ ./proto/*.proto
protoc
does not natively parse Substreams packages, so users are left unable to proceed unless they source the required files. Furthermore, protobuf files are not easily found on the Substreams registry, so users must search GitHub and hope for the best. Locating the exactly correct protobuf definition files for a Substreams package adds unnecessary friction to the Substreams-powered subgraph developer experience.Potential solution
Enable Graph CLI to generate AssemblyScript types from the
*.proto
files contained in a Substreams package (perhaps its just a nice wrapper forprotoc
+protobuf-as
)The text was updated successfully, but these errors were encountered: