Documentation ¶
Index ¶
Constants ¶
View Source
const ( PublishProtocol = "/fcr-calibr/paynet/route/publish" ProtocolVersion = "/0.0.1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Opts ¶
type Opts struct { // The timeout for every network io operation. IOTimeout time.Duration // The timeout for every internal operation. OpTimeout time.Duration // The publish frequency PublishFreq time.Duration // The route expiry RouteExpiry time.Duration // Initial wait time for publish. PublishWait time.Duration }
Opts is the options for route protocol.
type RouteProtocol ¶
type RouteProtocol struct {
// contains filtered or unexported fields
}
RouteProtocol manages route protocol. It handles route publish and share.
func NewRouteProtocol ¶
func NewRouteProtocol( h host.Host, addrProto *addrproto.AddrProtocol, paychProto *paychproto.PaychProtocol, signer crypto.Signer, peerMgr peermgr.PeerManager, pservMgr pservmgr.PaychServingManager, rs routestore.RouteStore, sbs substore.SubStore, opts Opts, ) *RouteProtocol
NewRouteProtocol creates a new route protocol.
@input - host, addr protocol, signer, peer manager, payment serving manager,
route store, subscriber store, options.
@output - route protocol.
func (*RouteProtocol) Publish ¶
Publish publishes served route to a given peer.
@input - context, currency id, recipient address.
@output - error.
func (*RouteProtocol) Shutdown ¶
func (p *RouteProtocol) Shutdown()
Shutdown safely shuts down the component.
func (*RouteProtocol) StartPublish ¶
func (p *RouteProtocol) StartPublish(ctx context.Context) error
StartPublish publishes the routes to the network immediately.
@input - context.
@output - error.
Click to show internal directories.
Click to hide internal directories.