Types
AddConn = proc (conn: Connection): Future[void] {....gcsafe, raises: [Defect].}
- Source Edit
Relay = ref object of LPProtocol switch*: Switch peerId: PeerId dialer: Dial canHop: bool streamCount: int hopCount: CountTable[PeerId] addConn: AddConn maxCircuit*: int maxCircuitPerPeer*: int msgSize*: int
- Source Edit
RelayError = object of LPError
- Source Edit
RelayMessage = object msgType*: Option[RelayType] srcPeer*: Option[RelayPeer] dstPeer*: Option[RelayPeer] status*: Option[RelayStatus]
- Source Edit
RelayPeer = object peerId*: PeerId addrs*: seq[MultiAddress]
- Source Edit
RelayStatus = enum Success = 100, HopSrcAddrTooLong = 220, HopDstAddrTooLong = 221, HopSrcMultiaddrInvalid = 250, HopDstMultiaddrInvalid = 251, HopNoConnToDst = 260, HopCantDialDst = 261, HopCantOpenDstStream = 262, HopCantSpeakRelay = 270, HopCantRelayToSelf = 280, StopSrcAddrTooLong = 320, StopDstAddrTooLong = 321, StopSrcMultiaddrInvalid = 350, StopDstMultiaddrInvalid = 351, StopRelayRefused = 390, MalformedMessage = 400
- Source Edit
RelayTransport = ref object of Transport relay*: Relay queue: AsyncQueue[Connection] relayRunning: bool
- Source Edit
Consts
MaxCircuit = 1024
- Source Edit
MaxCircuitPerPeer = 64
- Source Edit
RelayCodec = "/libp2p/circuit/relay/0.1.0"
- Source Edit
Procs
proc decodeMsg(buf: seq[byte]): Option[RelayMessage] {....raises: [Defect], tags: [RootEffect].}
- Source Edit
proc dial(self: RelayTransport; ma: MultiAddress): Future[Connection] {....gcsafe, stackTrace: false, ...gcsafe, raises: [Defect], raises: [Defect], tags: [RootEffect].}
- Source Edit
proc encodeMsg(msg: RelayMessage): ProtoBuffer {....raises: [Defect], tags: [].}
- Source Edit
proc new(T: typedesc[Relay]; switch: Switch; canHop: bool): T:type {. ...raises: [Defect].}
- Source Edit
proc new(T: typedesc[RelayTransport]; relay: Relay; upgrader: Upgrade): T:type {. ...raises: [Defect].}
- Source Edit
proc sendStatus(conn: Connection; code: RelayStatus): Future[void] {....gcsafe, stackTrace: false, ...gcsafe, raises: [Defect], raises: [Defect], tags: [RootEffect].}
- Source Edit
Methods
method accept(self: RelayTransport): Future[Connection] {....gcsafe, stackTrace: false, ...gcsafe, raises: [Defect], raises: [Defect], tags: [RootEffect].}
- Source Edit
method dial(self: RelayTransport; hostname: string; address: MultiAddress): Future[ Connection] {....gcsafe, stackTrace: false, ...gcsafe, raises: [Defect], raises: [Defect], tags: [RootEffect].}
- Source Edit
method handles(self: RelayTransport; ma: MultiAddress): bool {....gcsafe, raises: [Defect], tags: [].}
- Source Edit
method start(self: RelayTransport; ma: seq[MultiAddress]): Future[void] {. stackTrace: false, ...gcsafe, raises: [Defect], raises: [Defect], tags: [RootEffect].}
- Source Edit
method stop(self: RelayTransport): Future[void] {....gcsafe, stackTrace: false, ...gcsafe, raises: [Defect], raises: [Defect], tags: [RootEffect].}
- Source Edit