Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

Latest commit

 

History

History
601 lines (335 loc) · 15.2 KB

_net_protocol_lesprotocol_.lesprotocol.md

File metadata and controls

601 lines (335 loc) · 15.2 KB

ethereumjs-client"net/protocol/lesprotocol"LesProtocol

Class: LesProtocol

Implements les/1 and les/2 protocols

memberof module:net/protocol

Hierarchy

Protocol

LesProtocol

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

+ new LesProtocol(options: LesProtocolOptions): LesProtocol

Overrides Protocol.constructor

Defined in lib/net/protocol/lesprotocol.ts:75

Create les protocol

Parameters:

Name Type
options LesProtocolOptions

Returns: LesProtocol

Properties

config

config: Config

Inherited from EthProtocol.config

Defined in lib/net/protocol/protocol.ts:41


opened

opened: boolean

Inherited from EthProtocol.opened

Defined in lib/net/protocol/protocol.ts:43


timeout

timeout: number

Inherited from EthProtocol.timeout

Defined in lib/net/protocol/protocol.ts:42

Accessors

messages

get messages(): any

Overrides Protocol.messages

Defined in lib/net/protocol/lesprotocol.ts:111

Messages defined by this protocol

type {Protocol~Message[]}

Returns: any


name

get name(): string

Overrides Protocol.name

Defined in lib/net/protocol/lesprotocol.ts:95

Name of protocol

type {string}

Returns: string


versions

get versions(): number[]

Overrides Protocol.versions

Defined in lib/net/protocol/lesprotocol.ts:103

Protocol versions supported

type {number[]}

Returns: number[]

Methods

addListener

addListener(event: string | symbol, listener: function): this

Inherited from Sender.addListener

Defined in node_modules/@types/node/events.d.ts:62

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


bind

bind(peer: Peer, sender: Sender): Promise‹BoundProtocol

Inherited from EthProtocol.bind

Defined in lib/net/protocol/protocol.ts:171

Binds this protocol to a given peer using the specified sender to handle message communication.

Parameters:

Name Type Description
peer Peer peer
sender Sender sender

Returns: Promise‹BoundProtocol


Protected decode

decode(message: Message, payload: any): any

Inherited from EthProtocol.decode

Defined in lib/net/protocol/protocol.ts:157

Decodes message payload

Parameters:

Name Type Description
message Message message definition
payload any message payload

Returns: any


decodeStatus

decodeStatus(status: any): any

Overrides Protocol.decodeStatus

Defined in lib/net/protocol/lesprotocol.ts:164

Decodes ETH status message payload into a status object

Parameters:

Name Type Description
status any status message payload

Returns: any


emit

emit(event: string | symbol, ...args: any[]): boolean

Inherited from Sender.emit

Defined in node_modules/@types/node/events.d.ts:72

Parameters:

Name Type
event string | symbol
...args any[]

Returns: boolean


Protected encode

encode(message: Message, args: any): any

Inherited from EthProtocol.encode

Defined in lib/net/protocol/protocol.ts:142

Encodes message into proper format before sending

Parameters:

Name Type Description
message Message message definition
args any message arguments

Returns: any


encodeStatus

encodeStatus(): any

Overrides Protocol.encodeStatus

Defined in lib/net/protocol/lesprotocol.ts:131

Encodes status into LES status message payload

Returns: any


eventNames

eventNames(): Array‹string | symbol›

Inherited from Sender.eventNames

Defined in node_modules/@types/node/events.d.ts:77

Returns: Array‹string | symbol›


getMaxListeners

getMaxListeners(): number

Inherited from Sender.getMaxListeners

Defined in node_modules/@types/node/events.d.ts:69

Returns: number


Private handshake

handshake(sender: Sender): Promise‹unknown›

Inherited from EthProtocol.handshake

Defined in lib/net/protocol/protocol.ts:71

Perform handshake given a sender from subclass.

Parameters:

Name Type
sender Sender

Returns: Promise‹unknown›


listenerCount

listenerCount(event: string | symbol): number

Inherited from Sender.listenerCount

Defined in node_modules/@types/node/events.d.ts:73

Parameters:

Name Type
event string | symbol

Returns: number


listeners

listeners(event: string | symbol): Function[]

Inherited from Sender.listeners

Defined in node_modules/@types/node/events.d.ts:70

Parameters:

Name Type
event string | symbol

Returns: Function[]


off

off(event: string | symbol, listener: function): this

Inherited from Sender.off

Defined in node_modules/@types/node/events.d.ts:66

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


on

on(event: string | symbol, listener: function): this

Inherited from Sender.on

Defined in node_modules/@types/node/events.d.ts:63

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


once

once(event: string | symbol, listener: function): this

Inherited from Sender.once

Defined in node_modules/@types/node/events.d.ts:64

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


open

open(): Promise‹boolean | void›

Overrides Protocol.open

Defined in lib/net/protocol/lesprotocol.ts:119

Opens protocol and any associated dependencies

Returns: Promise‹boolean | void›


prependListener

prependListener(event: string | symbol, listener: function): this

Inherited from Sender.prependListener

Defined in node_modules/@types/node/events.d.ts:75

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


prependOnceListener

prependOnceListener(event: string | symbol, listener: function): this

Inherited from Sender.prependOnceListener

Defined in node_modules/@types/node/events.d.ts:76

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


rawListeners

rawListeners(event: string | symbol): Function[]

Inherited from Sender.rawListeners

Defined in node_modules/@types/node/events.d.ts:71

Parameters:

Name Type
event string | symbol

Returns: Function[]


removeAllListeners

removeAllListeners(event?: string | symbol): this

Inherited from Sender.removeAllListeners

Defined in node_modules/@types/node/events.d.ts:67

Parameters:

Name Type
event? string | symbol

Returns: this


removeListener

removeListener(event: string | symbol, listener: function): this

Inherited from Sender.removeListener

Defined in node_modules/@types/node/events.d.ts:65

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


setMaxListeners

setMaxListeners(n: number): this

Inherited from Sender.setMaxListeners

Defined in node_modules/@types/node/events.d.ts:68

Parameters:

Name Type
n number

Returns: this