Closed daniel-farina closed 2 years ago
We will setup a call with @ValarDragon to discuss some issues related to chain/go.
Upon more research I found a go repository to generate typescript https://pkg.go.dev/github.com/ocavue/protoc-gen-typescript — this may be what @Thunnini had originally used? It seems to use namespaces which is what ts-proto
seems to be missing.
UPDATE keplr new proto
https://github.com/chainapsis/keplr-wallet/tree/proto-types/packages/proto-types/proto-types-gen
Another seemingly well-maintained protobuf to typescript repo in node: https://github.com/timostamm/protobuf-ts/tree/master/packages
I like how cosmjs-types uses git submodules to pull in the cosmos SDK protobufs: https://github.com/confio/cosmjs-types
other references we can learn from https://github.com/confio/cosmjs-types/blob/main/scripts/codegen.sh https://github.com/confio/cosmjs-types/blob/main/scripts/codegen-cosmos-sdk.sh
Terra has a repo called terra.proto
for generation, which also depends on ts-proto
https://github.com/terra-money/terra.proto
https://github.com/terra-money/terra.proto/blob/main/js/scripts/proto-gen.sh
https://github.com/tmc/protoc-gen-apidocs (for generating docs in markdown, interesting) https://github.com/tmc/grpcutil/tree/master/protoc-gen-tstypes
https://github.com/agreatfool/grpc_tools_node_protoc_ts#how-to-use
looks like secret uses the grpc-web option in ts-proto — likely because secret needs to use http2
The same team that built the grpc client that secret uses built their own gen tool: https://github.com/improbable-eng/ts-protoc-gen
Yeah git submodules seems a fit solution for that kind of problem.
Sprint 1
[x] #13
[x] #18
[x] #19
[x] #17
[x] #21
[x] name collisions that derive from the proto files
In regards to the prototype https://github.com/pyramation/osmosis-protobufs when running files as the input, getting this error, so I instead created a for loop and am generating the types for each proto file individually. filed issue here https://github.com/osmosis-labs/osmosis/issues/1185
some protobuf references version don’t exist (e.g. https://github.com/gogo/protobuf/issues/737 ) so I found them here https://github.com/regen-network/protobuf
https://github.com/cosmology-finance/cosmology/blob/master/packages/protobufs/src/proto/osmosis/gamm/v1beta1/tx.ts#L1560-L1563
https://github.com/cosmology-finance/cosmology/blob/master/packages/protobufs/bin/gen-proto.js
Backlog
[x] #20
[x] #31
[x] #16
[ ] existing research/prototype https://github.com/pyramation/osmosis-protobufs and https://github.com/cosmology-finance/cosmology/tree/master/packages/protobufs
[x] potentially use docker to containerize https://github.com/FedeBev/protobuf-node
[x] how to manage proto files
GOPATH