-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Service Overview
Objective
Provide a Go-based backend service to facilitate the integration of Perun Payment into Neuron, acting as a bridge between the Channel Service and Wallet Service.
Background
During the integration of Perun Payment into Neuron, support from a Go service is required.
Neuron runs a Channel Service Client and a Wallet Service Server, and requires a corresponding service to operate the matching Channel Service Server and Wallet Service Client.
Based on the existing Neuron example, implement the following API.
Channel Service API
-
openChannel(me: Uint8Array, peerToConnectTo: Uint8Array, allocation: Allocation, challengeDuration: number): ServiceResponse<ChannelServiceImplementation["openChannel"]>;
-
getChannels(requester: Uint8Array): ServiceResponse<ChannelServiceImplementation["getChannels"]>;
-
updateChannel(channelId: Uint8Array, assetIdx: number, amount: bigint): ServiceResponse<ChannelServiceImplementation["updateChannel"]>;
-
closeChannel(channelId: Uint8Array): ServiceResponse<ChannelServiceImplementation["closeChannel"]>;
Wallet Service API
-
openChannelRequest(req: ValidOpenChannelRequest): ServiceResponse<WalletServiceImplementation["openChannel"]>;
-
updateNotificationRequest(req: ServiceRequest<WalletServiceImplementation["updateNotification"]>):
ServiceResponse<WalletServiceImplementation["updateNotification"]>; -
signMessageRequest(req: ValidSignMessageRequest): ServiceResponse<WalletServiceImplementation["signMessage"]>;
-
signTransactionRequest(req: ServiceRequest<WalletServiceImplementation["signTransaction"]>): ServiceResponse<WalletServiceImplementation["signTransaction"]>;
Core Implementation Workflow
-
Service Initialization
- Listens for ChannelServiceClient connection requests.
- Registers a ChannelServiceServer instance and initializes user context.
-
Wallet Service Integration
- Creates a WalletServiceClient to connect to Neuron’s WalletServiceServer.
- Forwards signing requests to Neuron and returns responses.
-
Channel Lifecycle Management
- OpenChannel
- UpdateChannel
- CloseChannel
-
Configuration Management
- Supports multi-environment (dev/test/prod) deployment:
Deliverables
- Neuron example: https://github.com/perun-network/neuron/pull/2/files
- Runnable Go service
Metadata
Metadata
Assignees
Labels
Type
Projects
Status