libp2p/protocols/pubsub/pubsubpeer

    Dark Mode
Search:
Group by:
  Source   Edit

Types

DropConn = proc (peer: PubSubPeer) {....gcsafe, raises: [].}
  Source   Edit
GetConn = proc (): Future[Connection] {....gcsafe, raises: [].}
  Source   Edit
OnEvent = proc (peer: PubSubPeer; event: PubSubPeerEvent) {....gcsafe, raises: [].}
  Source   Edit
PubSubObserver = ref object
  onRecv*: proc (peer: PubSubPeer; msgs: var RPCMsg) {....gcsafe, raises: [].}
  onSend*: proc (peer: PubSubPeer; msgs: var RPCMsg) {....gcsafe, raises: [].}
  Source   Edit
PubSubPeer = ref object of RootObj
  getConn*: GetConn
  onEvent*: OnEvent
  codec*: string
  sendConn*: Connection
  connectedFut: Future[void]
  address*: Option[MultiAddress]
  peerId*: PeerId
  handler*: RPCHandler
  banwidthEstimator: BandwidthEstimator
  observers*: ref seq[PubSubObserver]
  score*: float64
  sentIHaves*: Deque[HashSet[MessageId]]
  iHaveBudget*: int
  maxMessageSize: int
  appScore*: float64
  behaviourPenalty*: float64
  Source   Edit
PubSubPeerEventKind {.pure.} = enum
  Connected, Disconnected
  Source   Edit
RPCHandler = proc (peer: PubSubPeer; msg: RPCMsg): Future[void] {....gcsafe,
    raises: [].}
  Source   Edit

Procs

func `==`(a, b: PubSubPeer): bool {....raises: [], tags: [].}
  Source   Edit
proc canAskIWant(p: PubSubPeer; msgId: MessageId): bool {....raises: [], tags: [].}
  Source   Edit
proc connect(p: PubSubPeer) {....raises: [], tags: [RootEffect].}
  Source   Edit
proc connected(p: PubSubPeer): bool {....raises: [], tags: [].}
  Source   Edit
proc handle(p: PubSubPeer; conn: Connection): Future[void] {.stackTrace: false,
    ...gcsafe, raises: [], raises: [], raises: [], tags: [RootEffect].}
  Source   Edit
func hash(p: PubSubPeer): Hash {....raises: [], tags: [].}
  Source   Edit
proc hasObservers(p: PubSubPeer): bool {....raises: [], tags: [].}
  Source   Edit
proc hasSendConn(p: PubSubPeer): bool {....raises: [], tags: [].}
  Source   Edit
proc new(T: typedesc[PubSubPeer]; peerId: PeerId; getConn: GetConn;
         onEvent: OnEvent; codec: string; maxMessageSize: int): T:type {.
    ...raises: [].}
  Source   Edit
func outbound(p: PubSubPeer): bool {....raises: [], tags: [].}
  Source   Edit
proc send(p: PubSubPeer; msg: RPCMsg; anonymize: bool) {....raises: [], raises: [],
    tags: [RootEffect].}
  Source   Edit
proc sendEncoded(p: PubSubPeer; msg: seq[byte]): Future[void] {....raises: [],
    stackTrace: false, ...gcsafe, raises: [], raises: [], raises: [],
    tags: [RootEffect].}
  Source   Edit
func shortLog(p: PubSubPeer): string {....raises: [], tags: [].}
  Source   Edit

Templates

template formatItIMPL(it: PubSubPeer): auto
  Source   Edit

Exports

formatItIMPL, init, safeConvert, getField, shortLog, >=, shortLog, getBytes, compilesOr, init, public, shortLog, PeerId, ==, toBytes, <=, match, random, write, init, hex, init, validate, hash, init, init, $, hasPublicKey, match, <, write, >, len, maxInlineKeyLength, exceptionToAssert, cmp, extractPublicKey, newLPStreamWriteError, DNS_OR_IP, shortLog, init, random, UDP_DNS, $, <=, MaError, ephemeral, decode, MaPatternOp, ==, WS_DNS, initVBuffer, getProtoHeader, MaxSizeError, decodeProposal, ProtoFlags, ==, getLen, ECDHEScheme, shortLog, init, closed, [], macOpenArray, random, init, Secret, peekVarint, random, $, validate, mapOr, init, bytes, maxInlineKeyLength, TranscoderDNS, QUIC, [], init, getRequiredField, getField, init, supported, WS_IP, write, public, MAKind, getBytes, write, init, getField, checkFieldNumber, key, getRepeatedField, matchPartial, getBytes, len, readLp, HTTP, initVBuffer, atEof, LPStreamTrackerName, peekSeq, fullAddrs, payloadType, getProtoHeader, LPStreamError, init, IP, protoAddress, newRng, DefaultConnectionTimeout, checkValid, getPublicKey, exceptionToAssert, ProtoHeader, len, CircuitRelay, extractPublicKey, mapAnd, new, verify, UDP_IP, new, newLPStreamEOFError, init, ==, DNSADDR, AddressMapper, readVarint, write, WSS, LPStream, TCP_IP, close, writePacked, init, init, closeImpl, readSeq, toBytes, TCP_DNS, shortLog, encode, TranscoderIP4, init, protoName, ==, toRawBytes, TranscoderIP6Zone, initProtoBuffer, newLPStreamReadError, ProtoBuffer, WSS_DNS, match, writeLPVarint, CryptoResult, ProtoResult, WebRTCDirect, init, init, UDP, TranscoderOnion, StreamTracker, write, init, LPStreamResetError, isEmpty, writeArray, writeLp, parseFullAddress, LPStreamIncompleteError, PeerId, [], LPStreamEOFError, IP6, shortLog, initVBuffer, PKScheme, init, payload, init, stretchKeys, Connection, write, init, TCP, PrivateKey, getBytes, write, init, &=, PeerInfoError, newLPStreamClosedError, random, compilesOr, init, $, initProtoBuffer, toException, DNS, readVarint, init, UTP, goffset, >, KeyPair, finish, init, high, toString, init, cmp, init, SupportedWireTypes, formatItIMPL, formatItIMPL, formatItIMPL, Signature, formatItIMPL, toBytes, DigestSheme, IPFS, getField, readOnce, libp2p_pki_schemes, isEmpty, ProtoScalar, shortLog, LPStreamIncorrectDefect, hex, protocols, hash, HTTPS, tryAndWarn, hash, WebSockets, LPError, getPtr, write, sign, encode, update, MaResult, ProtoField, TimeoutHandler, toBytes, writeSeq, &, DNS6, IpTransportProtocol, toOpenArray, allFuturesThrowing, IP4, TranscoderPort, isEnough, safeConvert, getField, createExchange, >=, init, mac, ephemeral, payloadDomain, $, getRawBytes, init, LPStreamLimitError, TranscoderOnion3, SignedPayload, init, toBytes, protoArgument, newLPStreamLimitError, newLPStreamIncorrectDefect, keyOpenArray, match, createProposal, parseFullAddress, $, isEmpty, LPStreamReadError, getRequiredRepeatedField, init, newLPStreamIncompleteError, newLPStreamReadError, write, initProtoBuffer, MAProtocol, newLPStreamResetError, decode, getPackedRepeatedField, initStream, contains, init, shortLog, DNS4, data, getWrapped, readArray, selectBest, write, P2PPattern, Envelope, hasPublicKey, toException, init, isEnough, init, Reliable, addrs, hex, closeImpl, write, WS, init, encode, DNSANY, getField, match, getField, <, iv, readLine, Eof, CryptoError, getField, hash, append, MaPattern, vsizeof, init, WebSockets_DNS, WSS_IP, LPStreamConnDownError, peekArray, UNIX, PeerRecord, SupportedSchemes, getRepeatedField, LPStreamWriteError, getField, Unreliable, SupportedSchemesInt, random, checkFutures, shuffle, validate, $, protoCode, mapEq, getField, init, Onion3, write, TcpOnion3, concat, TranscoderP2P, PeerInfo, AddressInfo, ConnectionTrackerName, TranscoderIP6, write, EnvelopeError, encode, len, newLPStreamRemoteClosedError, MaPatResult, Direction, init, InvalidVarintError, shortLog, write, getBytes, write, finish, PublicKey, WebSockets_IP, VBuffer, writeLp, decode, writePBVarint, ProtoFieldKind, readExactly, protoArgument, getRepeatedField, ProtoError, newLPStreamConnDownError, initStream, MultiAddress, ivOpenArray, closeWithEOF, orError, decodeExchange, getField, LPStreamRemoteClosedError, setupStreamTracker, MaInvalidAddress, LPStreamClosedError, RsaDefaultKeySize, items, write, getOrder, TranscoderUnix, SignedPeerRecord, join, writeVarint