celestiaorg / go-square

A library for encoding blobs into a 2D square of evenly sized chunks designed for sampling and reconstruction
Apache License 2.0
13 stars 17 forks source link

Add command to generate Go types from `.proto` files #13

Closed rootulp closed 9 months ago

rootulp commented 9 months ago

Problem

This repo has a .proto file but no command to generate the Go types from that .proto file.

Proposal

  1. Create a Makefile
  2. Add a proto-gen command inspired by celestia-app

https://github.com/celestiaorg/celestia-app/blob/ebd733d1db2e75d849a637f68587534447ceccd0/Makefile#L55-L59

rootulp commented 9 months ago

Hmm started this by copying files from celestia-app but encountered:

$ make proto-gen
--> Generating Protobuf files
/opt/homebrew/bin/docker run --rm -v /Users/rootulp/git/rootulp/celestiaorg/go-square:/workspace --workdir /workspace tendermintdev/sdk-proto-gen:v0.7 sh ./scripts/protocgen.sh
Failure: could not unmarshal as YAML: yaml: unmarshal errors:
  line 3: field plugin not found in type bufgen.ExternalPluginConfigV1
make: *** [proto-gen] Error 1

which seems caused by the buf.gen.yaml in this repo diverging from the bug.gen.gogo.yaml in celestia-app. I'm assuming that was intentional

cmwaters commented 9 months ago

Yeah good point. I forgot that I generated the protos in a custom way and that we should add some command. I can look into this since I caused this mess