Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

there are various erros in the generated proto file when use sol-anchor-beta #9

Closed
cxp-13 opened this issue Dec 22, 2024 · 1 comment

Comments

@cxp-13
Copy link

cxp-13 commented Dec 22, 2024

@cxp-13 ➜ /workspace (main) $ substreams build
Building manifest file: /workspace/substreams.yaml
Running command in /workspace: `substreams protogen /workspace/substreams.yaml --exclude-paths sf/substreams/rpc,sf/substreams/v1,sf/substreams/sink,sf/substreams/index,sf/substreams/index/v1,instructions.proto,transactions.proto,google`...
Error: reading manifest "/workspace/substreams.yaml": unable to get package: unable to convert manifest to package: loading protobuf: error parsing proto files ["program.proto"] (import paths: ["/workspace/proto" "/workspace"]): program.proto:157:17: syntax error: unexpected '='
Error: error running protogen: error running protogen: error running `substreams protogen /workspace/substreams.yaml --exclude-paths sf/substreams/rpc,sf/substreams/v1,sf/substreams/sink,sf/substreams/index,sf/substreams/index/v1,instructions.proto,transactions.proto,google`: exit status 1
@cxp-13 ➜ /workspace (main) $ substreams build
Building manifest file: /workspace/substreams.yaml
Running command in /workspace: `substreams protogen /workspace/substreams.yaml --exclude-paths sf/substreams/rpc,sf/substreams/v1,sf/substreams/sink,sf/substreams/index,sf/substreams/index/v1,instructions.proto,transactions.proto,google`...
Error: reading manifest "/workspace/substreams.yaml": unable to get package: unable to convert manifest to package: loading protobuf: error parsing proto files ["program.proto"] (import paths: ["/workspace/proto" "/workspace"]): program.proto:159:9: symbol "substreams.v1.program.LendingAccountBorrowEvent" already defined at program.proto:20:9
Error: error running protogen: error running protogen: error running `substreams protogen /workspace/substreams.yaml --exclude-paths sf/substreams/rpc,sf/substreams/v1,sf/substreams/sink,sf/substreams/index,sf/substreams/index/v1,instructions.proto,transactions.proto,google`: exit status 1

It generate program.proto has problem, when execute substreams init and choose the sol-anchor-beta - Given an Anchor JSON IDL, create a Substreams that decodes instructions and events

there are various erros in the generated proto file.

question 1: Produce two same pieces of message.

message LendingAccountBorrowEvent {
  string trx_hash = 1;
}
message LendingAccountBorrowEvent {
      AccountEventHeader header = 1;
      string bank = 2;
      string mint = 3;
      uint64 amount = 4;
}
@cxp-13 ➜ /workspace (main) $ substreams build
Building manifest file: /workspace/substreams.yaml
Running command in /workspace: `substreams protogen /workspace/substreams.yaml --exclude-paths sf/substreams/rpc,sf/substreams/v1,sf/substreams/sink,sf/substreams/index,sf/substreams/index/v1,instructions.proto,transactions.proto,google`...
Error: reading manifest "/workspace/substreams.yaml": unable to get package: unable to convert manifest to package: loading protobuf: error parsing proto files ["program.proto"] (import paths: ["/workspace/proto" "/workspace"]): program.proto:157:17: syntax error: unexpected '='
Error: error running protogen: error running protogen: error running `substreams protogen /workspace/substreams.yaml --exclude-paths sf/substreams/rpc,sf/substreams/v1,sf/substreams/sink,sf/substreams/index,sf/substreams/index/v1,instructions.proto,transactions.proto,google`: exit status 1

There are even missing parts:

message LendingAccount {
       balances = 1;
}

Should be :

message LendingAccount {
     repeated Balance  balances = 1;
}

My IDL File: https://gist.github.com/cxp-13/3e5b6880cdd218d1fc4d35d8fe249641
The generated proto file: https://gist.github.com/cxp-13/7173242746d4f07ecc68ae599411f080

@maoueh
Copy link
Contributor

maoueh commented Jan 6, 2025

Closing to keep it tracked under streamingfast/substreams#570

@maoueh maoueh closed this as completed Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants