@ethereumjs/devp2p / KBucketOptions
Defined in: packages/devp2p/src/types.ts:230
optionalarbiter: (incumbent,candidate) =>Contact
Defined in: packages/devp2p/src/types.ts:256
An optional arbiter function that given two contact objects with the same id,
returns the desired object to be used for updating the k-bucket.
Defaults to vectorClock arbiter function.
optionaldistance: (firstId,secondId) =>number
Defined in: packages/devp2p/src/types.ts:250
An optional distance function that gets two id Uint8Arrays and return distance between them as a number.
Uint8Array
Uint8Array
number
optionallocalNodeId:Uint8Array<ArrayBufferLike>
Defined in: packages/devp2p/src/types.ts:235
An optional Uint8Array representing the local node id.
If not provided, a local node id will be created via randomBytes(20).
optionalmetadata:object
Defined in: packages/devp2p/src/types.ts:263
Optional satellite data to include
with the k-bucket. metadata property is guaranteed not be altered by,
it is provided as an explicit container for users of k-bucket to store
implementation-specific data.
optionalnumberOfNodesPerKBucket:number
Defined in: packages/devp2p/src/types.ts:240
The number of nodes that a k-bucket can contain before being full or split. Defaults to 20.
optionalnumberOfNodesToPing:number
Defined in: packages/devp2p/src/types.ts:246
The number of nodes to ping when a bucket that should not be split becomes full.
KBucket will emit a ping event that contains numberOfNodesToPing nodes that have not been contacted the longest.
Defaults to 3.