-
Notifications
You must be signed in to change notification settings - Fork 85
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
Channel Integration #2878
Comments
The architecture of Neuron is not complicated. Neuron is based on Electron, so we can simply treat it as a web application but with the ability to interact with the OS, and its server is able to push messages to the UI. From a bird's view, it looks like this ![]() The arrows mean the directions of responsive messages ![]() So I imagine that, to integrate with Perun, Neuron needs
![]() This is a very high-level design, and I think that we may need to discuss the details, but the https://github.com/perun-network/perun-wallet-wrapper and https://github.com/perun-network/channel-service are not accessible, could you change their visibility to public? |
I have one question about the WCH: |
Thank you for your response and the illusttration. The WCH serves a RPC Interface which can easily be done via a websocket connection. It is correct that Neuron would in the best case start the channel service similar to the way it allows starting a default node IIRC. I will take a deeper look at your architecture and get back to you later today 🙏 |
The All methods there are supposed to be invoked by the user of the Neuron wallet. This interface should be all that is required to implement the actionable front-end part. Regarding the It can be seen that the
Open to any questions and happy to hear from you. |
Thank you for your response. Here is my understanding: |
Hi @ndzik I'm slightly confused by the following statement
I just had an inspection at https://github.com/perun-network/perun-wallet-wrapper/blob/main/src/services.ts#L161 and it returns a grpc server that connected to the channel service. Which detail should we check for it? |
Hi @Keith-CY, as you can see in the referenced constructor it receives a Furthermore, where would be the best place to create that Thanks for your help 💪 |
Got it, currently there isn't a unified API to inform users about a coming transaction request.
handle('sign-transaction-only', async (_, params) => {
return this.#offlineSignController.signTransaction(params)
}) It can be accessed by Menu => Tools => Offline sign
handle('wc-approve-request', async (_, params) => {
return this.#walletConnectController.approveRequest(params)
}) It's demonstrated in the first video in PR(#2880) message
|
Thank you for your input @Keith-CY ! |
Mark this issue stale because no activity for 60 days |
Close this issue because it's inactive since marked stale |
We would like to integrate Perun channels according to its specification into Neuron and propose our idea in this issue.
The things that have to be integrated are the following:
Wallet Callback handler (WCH):
Essentially a RPC service exposed by the Neuron wallet. To aid the implementation of these endpoints we will provide perun-wallet-wrapper. This repository will contain the interfaces and types as well as their conversions. We will also provide a higher-level interface to make it even easier for integration.
Question remaining: How would we expose any RPC interface in Neuron and how does it fit into your current architecture?
Channel Service Adapter (CSA):
A client implementation calling the endpoints of the perun-channel-service. The client implementation will also be contained in perun-wallet-wrapper.
Additionally, we will create a high-level interface, which the client implements. This eases splitting up the work-packages and lets someone else implement a UI against the interface.
UI tying together CSA & WCH:
Naively, we think of a tab within Neuron presenting the possibility to use Perun channels to the user.
Actions a user can take:
The WCH might receive notifications from the externally running channel-service. E.g.: The channel-service requests a signature on some payload. This would call an endpoint in WCH and it would be nice if the WCH would ultimately propagate this signing request to the user. Might be via a popup or something else.
Actions triggered externally by the channel-service like this might be a component of their own. It is also possible to use dependency injection and create an interface for a notification service which the implementation of WCH expects and calls when necessary. This is up for discussion.
Eager to see your replies (:
The text was updated successfully, but these errors were encountered: