ethereumjs-monorepo

@ethereumjs/devp2p / KBucket

Class: KBucket

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new KBucket(localNodeId)

Parameters

Name Type
localNodeId Uint8Array

Defined in

packages/devp2p/src/dpt/kbucket.ts:15

Properties

events

events: EventEmitter

Defined in

packages/devp2p/src/dpt/kbucket.ts:12

Methods

add

add(peer): void | KBucket

Parameters

Name Type
peer PeerInfo

Returns

void | KBucket

Defined in

packages/devp2p/src/dpt/kbucket.ts:53


closest

closest(id): PeerInfo[]

Parameters

Name Type
id Uint8Array

Returns

PeerInfo[]

Defined in

packages/devp2p/src/dpt/kbucket.ts:71


get

get(obj): null | PeerInfo

Parameters

Name Type
obj string | Uint8Array | PeerInfo

Returns

null | PeerInfo

Defined in

packages/devp2p/src/dpt/kbucket.ts:58


getAll

getAll(): PeerInfo[]

Returns

PeerInfo[]

Defined in

packages/devp2p/src/dpt/kbucket.ts:67


remove

remove(obj): void

Parameters

Name Type
obj string | Uint8Array | PeerInfo

Returns

void

Defined in

packages/devp2p/src/dpt/kbucket.ts:75


getKeys

Static getKeys(obj): string[]

Parameters

Name Type
obj string | Uint8Array | PeerInfo

Returns

string[]

Defined in

packages/devp2p/src/dpt/kbucket.ts:42