Skip to content

Go Service for Neuron-Perun Payment Integration #459

@devchenyan

Description

@devchenyan

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

Deliverables

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is needed

Projects

Status

🏗 In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions