-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
ADR 35: Rosetta API Support #7492
Conversation
Co-authored-by: Alessio Treglia <[email protected]>
Co-authored-by: Alessio Treglia <[email protected]>
Co-authored-by: Alessio Treglia <[email protected]>
Co-authored-by: Alessio Treglia <[email protected]>
Co-authored-by: Alessio Treglia <[email protected]>
Co-authored-by: Alessio Treglia <[email protected]>
Co-authored-by: Alessio Treglia <[email protected]>
Co-authored-by: Alessio Treglia <[email protected]>
Co-authored-by: Alessio Treglia <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This generally looks okay, but would be useful to have a little more context on what adapters look like themselves.
func NewNetwork(options Options) service.Network { | ||
cosmosClient := cosmos.NewClient(fmt.Sprintf("http://%s", options.CosmosEndpoint)) | ||
tendermintClient := tendermint.NewClient(fmt.Sprintf("http://%s", options.TendermintEndpoint)) | ||
|
||
return service.Network{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This diverges from the constructor defined above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jgimeno bump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aaronc True that, yet this is an example, i.e. the actual code would diverge slightly between 0.39 and 0.40 - as described in the comment above: each Cosmos SDK release series will have version specific implementations of Network and Adapter, as well as a NewNetwork constructor.
For instance, that's the signature of this very constructor for Stargate:
NewNetwork(cdc codec.BinaryMarshaler, options Options) service.Network
The constructor's signature for Launchpad follows:
NewNetwork(cdc *codec.Codec, options Options) service.Network
I hope this helps.
Adapter: newAdapter( | ||
cosmosClient, | ||
tendermintClient, | ||
properties{ | ||
Blockchain: options.Blockchain, | ||
Network: options.Network, | ||
OfflineMode: options.OfflineMode, | ||
}, | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an example of the adapter that should be linked to in this ADR for reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jgimeno bump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use the one for launchpad, but is in a branch and not merged yet. Is that ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, go ahead @jgimeno. Use a permalink
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cosmos-sdk/server/rosetta/launchpad.go
Line 75 in eeb4c53
func newAdapter(cdc *codec.Codec, cosmos SdkClient, tendermint TendermintClient, options properties) rosetta.Adapter { |
This is the adapter constructor in the launchpad implementation, but the implementation itself is based in several files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The team is finalising the Stargate's Adapter
implementation. I think we can show some simplified code example here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not have to be complete - this is an ADR after all, not a code walkthrough. Either some pseudo code or a code snippet should it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. But please add to this ADR to the README! @alessio free to dismiss my change request once that's done.
@aaronc README.md updated. Hence dismissing your review. Thanks! |
Ref: #7492 Co-authored-by: Jonathan Gimeno <[email protected]> Co-authored-by: Alessio Treglia <[email protected]> Co-authored-by: Frojdi Dymylja <[email protected]> Co-authored-by: Robert Zaremba <[email protected]> Co-authored-by: Federico Kunze <[email protected]>
Ref: cosmos#7492 Co-authored-by: Jonathan Gimeno <[email protected]> Co-authored-by: Alessio Treglia <[email protected]> Co-authored-by: Frojdi Dymylja <[email protected]> Co-authored-by: Robert Zaremba <[email protected]> Co-authored-by: Federico Kunze <[email protected]>
Description
Related PR: #7602
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes