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

How to share *.proto files with other repositories #381

Open
3 of 4 tasks
torao opened this issue Mar 7, 2022 · 2 comments
Open
3 of 4 tasks

How to share *.proto files with other repositories #381

torao opened this issue Mar 7, 2022 · 2 comments
Labels
C: proposal Classification: Proposal for specification, algorithm, architecture, or communication P: nice to have Priority: nice to have Stale For github bot

Comments

@torao
Copy link
Contributor

torao commented Mar 7, 2022

Summary

Ostracon's API request/response is defined in ProtocolBuffers *.proto files, and we need to discuss how the *.proto files should be shared when creating another application related to Ostracon.

Problem Definition

The current *.proto file is located in the same place as the regular Ostracon source files. Eath related-applications will have to copy the *.proto file when developing them, which isn't easy to maintain and may cause version differences.

Proposal

One solution is to create an independent repository that defines the schema of the inter-system interfaces, such as ProtocolBuffers, and have each project, including Ostracon, reference that repository (e.g., as a submodule).


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@torao torao added the C: proposal Classification: Proposal for specification, algorithm, architecture, or communication label Mar 7, 2022
@torao torao changed the title How to share *.pb files with other repositories How to share *.proto files with other repositories Mar 8, 2022
@torao
Copy link
Contributor Author

torao commented Mar 9, 2022

Currently-known issues for sharing ProtocolBuffers definitions with other languages:

  1. A lot of *.proto files contains gogoproto-specific import "gogoproto/goto.proto" and attribute such as [(gogoproto.nullable) = false] or (gogoproto.customname) = "ID"].
  2. There is no way to specify a Rust mod name (values like option rust_module cannot specify). As a result, types/types.proto and privval/types.proto are output to the same file types.rs.

@torao torao added the P: nice to have Priority: nice to have label Mar 14, 2022
@torao
Copy link
Contributor Author

torao commented Mar 14, 2022

There are two possible schemas for creating client projects that use ProtocolBuffers to communicate with Ostracon.

  1. each project must copy and use the *.proto files from http://github.com/line/ostracon (better to copy from github at build time).
  2. separate the *.proto files currently stored in the Ostracon repository into an independent repo, and each project will refer to that one. Optionally it's better to create a library for each language (e.g. libXXX.a for C, crate for Rust, etc.).

Currently, the only projects that need to share *.proto are internal attempts, so I think schema 1 is fine. If more projects connect to Ostracon in the future, we can do 2.

We will leave this issue for the future use of *.proto files by multiple projects.

@github-actions github-actions bot added the Stale For github bot label Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: proposal Classification: Proposal for specification, algorithm, architecture, or communication P: nice to have Priority: nice to have Stale For github bot
Projects
None yet
Development

No branches or pull requests

1 participant