Documentation ¶
Index ¶
- type Server
- func (s *Server) AccountStatus(ctx context.Context, req *pb.AccountRequest) (rep *pb.AccountReply, err error)
- func (s *Server) LiveUpdates(stream pb.TRISADemo_LiveUpdatesServer) (err error)
- func (s *Server) Serve() (err error)
- func (s *Server) Shutdown() (err error)
- func (s *Server) Transfer(ctx context.Context, req *pb.TransferRequest) (*pb.TransferReply, error)
- type TRISA
- func (s *TRISA) AsyncHandler(stop <-chan struct{})
- func (s *TRISA) ConfirmAddress(ctx context.Context, in *protocol.Address) (out *protocol.AddressConfirmation, err error)
- func (s *TRISA) KeyExchange(ctx context.Context, in *protocol.SigningKey) (out *protocol.SigningKey, err error)
- func (s *TRISA) Run(sock net.Listener)
- func (s *TRISA) Serve() (err error)
- func (s *TRISA) Shutdown() (err error)
- func (s *TRISA) Status(ctx context.Context, in *protocol.HealthCheck) (out *protocol.ServiceState, err error)
- func (s *TRISA) Transfer(ctx context.Context, in *protocol.SecureEnvelope) (out *protocol.SecureEnvelope, err error)
- func (s *TRISA) TransferStream(stream protocol.TRISANetwork_TransferStreamServer) (err error)
- type UpdateManager
- func (u *UpdateManager) Add(client string, stream pb.TRISADemo_LiveUpdatesServer) (err error)
- func (u *UpdateManager) Broadcast(requestID uint64, update string, cat pb.MessageCategory) (err error)
- func (u *UpdateManager) Del(client string)
- func (u *UpdateManager) Send(client string, msg *pb.Message) (err error)
- func (u *UpdateManager) SendTransferError(client string, id uint64, err *pb.Error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { pb.UnimplementedTRISADemoServer pb.UnimplementedTRISAIntegrationServer // contains filtered or unexported fields }
Server implements the GRPC TRISAIntegration and TRISADemo services.
func New ¶
New creates a rVASP server with the specified configuration and prepares it to listen for and serve GRPC requests.
func NewServerMock ¶ added in v1.0.0
NewServerMock returns a mock rVASP server that can be used for testing.
func (*Server) AccountStatus ¶
func (s *Server) AccountStatus(ctx context.Context, req *pb.AccountRequest) (rep *pb.AccountReply, err error)
AccountStatus is a demo RPC to allow demo clients to fetch their recent transactions.
func (*Server) LiveUpdates ¶
func (s *Server) LiveUpdates(stream pb.TRISADemo_LiveUpdatesServer) (err error)
LiveUpdates is a demo bidirectional RPC that allows demo clients to explicitly show the message interchange between VASPs during the InterVASP protocol. The demo client connects to both sides of a transaction and can push commands to the stream; any messages received by the VASP as they perform the protocol are sent down to the UI.
func (*Server) Transfer ¶
func (s *Server) Transfer(ctx context.Context, req *pb.TransferRequest) (*pb.TransferReply, error)
Transfer accepts a transfer request from a beneficiary and begins the InterVASP protocol to perform identity verification prior to establishing the transaction in the blockchain between crypto wallet addresses.
type TRISA ¶
type TRISA struct { protocol.UnimplementedTRISANetworkServer protocol.UnimplementedTRISAHealthServer // contains filtered or unexported fields }
TRISA implements the GRPC TRISANetwork and TRISAHealth services.
func NewTRISAMock ¶ added in v1.0.0
func NewTRISAMock(conf *config.Config) (s *TRISA, remotePeers *peers.Peers, mockDB sqlmock.Sqlmock, certs *trust.Provider, chain trust.ProviderPool, err error)
NewTRISAMock returns a mock TRISA server that can be used for testing.
func (*TRISA) AsyncHandler ¶ added in v1.0.0
func (s *TRISA) AsyncHandler(stop <-chan struct{})
AsyncHandler is a go routine that periodically reads pending messages off the rVASP database and initiates TRISA transfers back to the originator. This allows the rVASPs to simulate asynchronous transactions.
func (*TRISA) ConfirmAddress ¶
func (s *TRISA) ConfirmAddress(ctx context.Context, in *protocol.Address) (out *protocol.AddressConfirmation, err error)
ConfirmAddress allows the rVASP to respond to proof-of-control requests.
func (*TRISA) KeyExchange ¶
func (s *TRISA) KeyExchange(ctx context.Context, in *protocol.SigningKey) (out *protocol.SigningKey, err error)
KeyExchange facilitates signing key exchange between VASPs.
func (*TRISA) Run ¶ added in v1.0.0
Run the gRPC server. This method is extracted from the Serve function so that it can be run in its own go routine and to allow tests to Run a bufconn server without starting a live server with all of the various go routines and channels running.
func (*TRISA) Serve ¶
Serve initializes the GRPC server and returns any errors during intitialization, it then kicks off a go routine to handle requests. Not thread safe, should not be called multiple times.
func (*TRISA) Status ¶
func (s *TRISA) Status(ctx context.Context, in *protocol.HealthCheck) (out *protocol.ServiceState, err error)
Status returns a directory health check status as online and requests half an hour checks.
func (*TRISA) Transfer ¶
func (s *TRISA) Transfer(ctx context.Context, in *protocol.SecureEnvelope) (out *protocol.SecureEnvelope, err error)
Transfer enables a quick one-off transaction between peers.
func (*TRISA) TransferStream ¶
func (s *TRISA) TransferStream(stream protocol.TRISANetwork_TransferStreamServer) (err error)
TransferStream allows for high-throughput transactions.
type UpdateManager ¶
UpdateManager sends update messages to all connected clients.
func NewUpdateManager ¶
func NewUpdateManager() *UpdateManager
NewUpdateManager creates a new update manager ready to work. For thread safety, this is the only object that can send messages on update streams.
func (*UpdateManager) Add ¶
func (u *UpdateManager) Add(client string, stream pb.TRISADemo_LiveUpdatesServer) (err error)
Add a new client update stream.
func (*UpdateManager) Broadcast ¶
func (u *UpdateManager) Broadcast(requestID uint64, update string, cat pb.MessageCategory) (err error)
Broadcast a message to all streams.
func (*UpdateManager) Del ¶
func (u *UpdateManager) Del(client string)
Del an old client update stream. No-op if client odesn't exist.
func (*UpdateManager) Send ¶
func (u *UpdateManager) Send(client string, msg *pb.Message) (err error)
Send a message to a specific stream
func (*UpdateManager) SendTransferError ¶
SendTransferError to client
Directories ¶
Path | Synopsis |
---|---|
* Package jsonpb uses protojson (not the deprecated jsonpb module) to set defaults for * marshaling and unmarshaling rVASP protobuf messages to and from JSON format.
|
* Package jsonpb uses protojson (not the deprecated jsonpb module) to set defaults for * marshaling and unmarshaling rVASP protobuf messages to and from JSON format. |
pb
|
|