-
Notifications
You must be signed in to change notification settings - Fork 3
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
chore: Add gRPC Gnokey Mobile service #2
Merged
jefft0
merged 5 commits into
gnolang:main
from
jefft0:chore/add-gRPC-GnokeyMobileService
Aug 14, 2024
Merged
chore: Add gRPC Gnokey Mobile service #2
jefft0
merged 5 commits into
gnolang:main
from
jefft0:chore/add-gRPC-GnokeyMobileService
Aug 14, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Jeff Thompson <[email protected]>
Signed-off-by: Jeff Thompson <[email protected]>
Signed-off-by: Jeff Thompson <[email protected]>
Signed-off-by: Jeff Thompson <[email protected]>
jefft0
force-pushed
the
chore/add-gRPC-GnokeyMobileService
branch
from
August 8, 2024 08:04
a1c72f7
to
6cfa2cc
Compare
iuricmp
approved these changes
Aug 14, 2024
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.
Just one single modification to use npm instead of yarn.
We don't need yarn for now.
Co-authored-by: Iuri <[email protected]>
jefft0
added a commit
to gnolang/gnonative
that referenced
this pull request
Aug 14, 2024
…rvice (#163) PR gnolang/gnokey-mobile#2 creates the Gnokey Mobile service. This PR updates `GnoNativeService` with the option to use the remote Gnokey Mobile service as needed (for example, to sign a transaction). * In BridgeConfig and service.Config, add the config flag `UseGnokeyMobile`. * In `initService`, if `UseGnokeyMobile` then set `gnokeyMobileClient` to a gRPC client connected to the remote Gnokey Mobile service. Set `client` to a gnoclient without a Keybase (because the purpose is to use Keybase in the remote Gnokey Mobile service). * In `gnoNativeService`, add `getClient` which returns the correct `gnoclient.Client`. If not `useGnokeyMobile` then simply return `s.client` . If `useGnokeyMobile` then it's possible that Gnokey Mobile has been changed to use a different gno.land remote, so we must call the Gnokey Mobile method `GetRemote` . If this is different from our local `s.remote` then reconfigure the `RPCClient` of the gnoclient and save the new `s.remote`. Change `QueryAccount`, `Query`, `Render` and `QEval` to call `getClient` and then proceed as normal. This means that if an app is using Gno Native Kit with `UseGnokeyMobile`, then the app can send these queries directly to the gno.land remote node, but we must make sure that it is the correct remote. * In `GetRemote` and `ListKeyInfo`, if `useGnokeyMobile` then we directly use the Gnokey Mobile service. * In `Call`, if `useGnokeyMobile` then use the local `MakeCallTx` to make the transaction. Use the `SignTx` API of the remote Gnokey Mobile service to sign the transaction. Then use the local `BroadcastTxCommit` to broadcast the signed transaction and get the streaming result. The above changes allow an app to configure its Gno Native Kit to use a gRPC client with the Gnokey Mobile service. But we still need the Gnokey Mobile app to start the Gnokey Mobile gRPC server. The following changes allow the Gnokey Mobile app to set `start_gnokey_mobile_service` in [the configuration](https://github.com/gnolang/dsocial/blob/925846f2055e9f107cd91ddb776afa3e7be06820/mobile/app/_layout.tsx#L10-L13) for its `GnoNativeProvider`. * In the Go `Bridge`, add `StartGnokeyMobileService`. See the description comment. Add this method to the TypeScript `GoBridgeInterface` and to the Java and Swift `GnonativeModule`. * In the TypeScript `Config`, add a flag `start_gnokey_mobile_service`. Check this flag in the `GnoNativeApi` `initClient` and call `startGnokeyMobileService()`. --------- Signed-off-by: Jeff Thompson <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for the gRPC GnokeyMobile service.
GnokeyMobileService
withGetRemote
,ListKeyInfo
andSignTx
. These re-use request and response types from Gno Native Kit.GnokeyMobileService
and api.go to implement it.make regenerate
.test_1
account. (After we update the Gnokey Mobile app to start this service, we may remove this test.)