Comments (15)
There's some ongoing discussion about this here: informalsystems/tendermint-rs#654 (comment)
I suggested having a single repo where all of the protobufs could be managed consistently. So yes, I think it'd be a good idea to reuse the same infrastructure we have already for crates like tendermint-proto
and cosmos-sdk-proto
to be able to generate crates for the protos for other networks.
from cosmos-rust.
We could add a new osmosis-proto
crate here (which I've gone ahead and registered).
It could be structured similarly to (and dependent on) cosmos-sdk-proto
.
It will require modifying proto-build
to pull in the protos from https://github.com/osmosis-labs/osmosis/tree/main/proto/osmosis as a git submodule (similar to the other protos)
from cosmos-rust.
The MsgProto
trait is gone. I assume you're referring to the TypeUrl
trait?
If so, yes, that sure would be nice. There's an upstream issue about it on prost
here:
from cosmos-rust.
I think this makes a lot of sense. From a technical perspective, what exactly needs to be done to make the main.rs work for osmosis? Just adjust the paths or are blockchain specific customizations needed as well?
from cosmos-rust.
I got the cargo run
to finish without errors with added paths for osmosis.
'../cosmos-sdk-proto/src/prost/osmosisd'
What about the process for thelib.rs
andcargo.toml
do they need to be edited manually, or is there a script for that as well?
from cosmos-rust.
Since Osmosis is a completely separate network, I'd suggest putting its protos in a completely separate crate: osmosis-proto
You can get started by doing cp -r cosmos-sdk-proto osmosis-proto
and then editing the files accordingly. You'll also need to add osmosis-proto
to the workspace definition in the toplevel Cargo.toml
from cosmos-rust.
@Philipp-Sc I pushed up a branch with some initial boilerplate for an osmosis-proto
crate you can use to get started:
https://github.com/cosmos/cosmos-rust/tree/osmosis-proto
See this commit:
from cosmos-rust.
thank you, I just separated the code from the cosmos-sdk-proto
into osmosis-proto
. I tested it with a few queries and it seems to work fine with the Osmosis gRPC endpoint I have.
How Osmosis is setup, the endpoint sometimes return google.protobuf.Any
for that I will need to add some handcrafted code, so it can easily be casted into the type it acutally represents.
I will fork the branch you created and try to do a pull request.
from cosmos-rust.
@tony-iqlusion pull request is out #239
Let me know if you like me to make any changes before you merge it.
from cosmos-rust.
@tony-iqlusion I also have some changes for cosmrs
, I hope to add them.
Example for tx/msg.rs
#[cfg(feature = "osmosis")]
impl MsgProto for osmosis_proto::osmosis::gamm::v1beta1::Pool {
const TYPE_URL: &'static str = "/osmosis.gamm.v1beta1.Pool";
}
(this is needed to be able to work with google.protobuf.Any
types)
Is cosmrs
the right place for this, or do you want me to create a new crate just for osmosis?
from cosmos-rust.
Update:
See added osmosis specific cosmrs customization
I think this is a good way to do it. Let me know if you have any feedback.
Thanks and best regards,
Philipp
from cosmos-rust.
On another note: tx/msg.rs
it would be great if the MsgProto
implementations get generated by a script if possible. There are many types missing.
from cosmos-rust.
Closing this issue.
from cosmos-rust.
If there was a way to get a list of all the type urls
we could write a script to write the matching implementations.
Might be something to look into in the future. For the time being I am okay, with adding the types I need manually.
from cosmos-rust.
It will hopefully get fixed upstream in the next release. There's already a few PRs.
If it really ends up continuing to be an issue we can look at automating it.
from cosmos-rust.
Related Issues (20)
- MsgTransfer does not impl TypeUrl HOT 1
- Wasm32-unknown-unknown target HOT 1
- Upgrade `tendermint-proto` to `0.25.0` in `cosmos-sdk-proto` HOT 1
- cosmrs: better document BIP-32 `SigningKey` derivation HOT 8
- Add alternate type for proto::cosmos::tx::v1beta1::TxRaw that is compatible with ledger. HOT 20
- Error: goaway Frame with Invalid Size when trying gRPC Request HOT 4
- Proto-build fails for SDK 0.46 HOT 18
- Add a method to calculate `txhash` from a `TxRaw`
- Development Status HOT 1
- proto-build "No such file or directory" HOT 2
- Osmosis (cosmos-sdk v0.46.10) GetNodeInfo transport error HOT 5
- Is there a plan to have this module implement all the features of the Cosmos SDK? HOT 1
- Fail building any smart contract with cosmos-sdk-proto as dependency HOT 2
- TallyParams Undocumented Decimal Type HOT 2
- Enable cosmrs support `no_std` HOT 5
- Maybe Can Use only one crate `cosmos-sdk-proto` or `ibc-proto-rs` HOT 6
- Sync versions with tendermint-rs?
- wasm-bindgen issue when using cosmrs in CosmWasm HOT 10
- Type URLs for x/authz messages not present HOT 4
- Add additional derive macros to Prost generated types HOT 19
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cosmos-rust.