streamingfast / substreams-sink-sql

Apache License 2.0
12 stars 15 forks source link

`make protogen` error in the docs/tutorial #62

Open taobig opened 3 months ago

taobig commented 3 months ago

cd /docs/tutorial && make protogen

substreams protogen ./substreams.yaml --exclude-paths="sf/substreams,google" Error: reading manifest "./substreams.yaml": unable to get package: unable to convert manifest to package: loading protobuf: WARNING: proto file block_meta.proto already exists in system protobufs, do not include it in your manifest make: *** [protogen] Error 1

taobig commented 3 months ago
  1. I found out that it's because there's a problem with the config file docs/tutorial/substreams.yaml. We must comment out the protobuf.files property.

  2. I need to manually modify docs/tutorial/src/lib.rs after run make protogen. mod.rs in develop branch:

    #[path = "eth.block_meta.v1.rs"]
    #[allow(dead_code)]
    pub mod block_meta;

    But, after run make protogen, mod.rs is auto updated:

    // @generated
    pub mod eth {
    pub mod block_meta {
        // @@protoc_insertion_point(attribute:eth.block_meta.v1)
        pub mod v1 {
            include!("eth.block_meta.v1.rs");
            // @@protoc_insertion_point(eth.block_meta.v1)
        }
    }
    }
    ...

    Than, I should change the file docs/tutorial/src/lib.rs use pb::block_meta::BlockMeta; => use crate::pb::eth::block_meta::v1::BlockMeta;

Is there something wrong with my procedure or with the demo's code?