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

Latest commit

 

History

History
649 lines (359 loc) · 15.3 KB

_net_server_rlpxserver_.rlpxserver.md

File metadata and controls

649 lines (359 loc) · 15.3 KB

ethereumjs-client"net/server/rlpxserver"RlpxServer

Class: RlpxServer

DevP2P/RLPx server

emits connected

emits disconnected

emits error

memberof module:net/server

Hierarchy

Server

RlpxServer

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

+ new RlpxServer(options: RlpxServerOptions): RlpxServer

Overrides Server.constructor

Defined in lib/net/server/rlpxserver.ts:45

Create new DevP2P/RLPx server

Parameters:

Name Type
options RlpxServerOptions

Returns: RlpxServer

Properties

bootnodes

bootnodes: Bootnode[] = []

Inherited from Server.bootnodes

Defined in lib/net/server/server.ts:28


config

config: Config

Inherited from Server.config

Defined in lib/net/server/server.ts:26


dpt

dpt: Devp2pDPT | null = null

Defined in lib/net/server/rlpxserver.ts:44


ip

ip: string = "::"

Defined in lib/net/server/rlpxserver.ts:45


key

key: Buffer | undefined

Inherited from Server.key

Defined in lib/net/server/server.ts:27


port

port: number

Defined in lib/net/server/rlpxserver.ts:40


rlpx

rlpx: Devp2pRLPx | null = null

Defined in lib/net/server/rlpxserver.ts:43


started

started: boolean

Inherited from Server.started

Defined in lib/net/server/server.ts:33

Accessors

name

get name(): string

Overrides Server.name

Defined in lib/net/server/rlpxserver.ts:74

Server name

type {string}

Returns: string


running

get running(): boolean

Inherited from Server.running

Defined in lib/net/server/server.ts:58

Check if server is running

Returns: boolean

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


addProtocols

addProtocols(protocols: Protocol[]): boolean

Inherited from Server.addProtocols

Defined in lib/net/server/server.ts:92

Specify which protocols the server must support

Parameters:

Name Type Description
protocols Protocol[] protocol classes

Returns: boolean

True if protocol added successfully


ban

ban(peerId: string, maxAge: number): boolean

Overrides Server.ban

Defined in lib/net/server/rlpxserver.ts:157

Ban peer for a specified time

Parameters:

Name Type Default Description
peerId string - id of peer
maxAge number 60000 -

Returns: boolean

True if ban was successfully executed


bootstrap

bootstrap(): Promise‹void›

Defined in lib/net/server/rlpxserver.ts:122

Bootstrap bootnode peers from the network

Returns: Promise‹void›


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


Private error

error(error: Error, peer?: RlpxPeer): void

Defined in lib/net/server/rlpxserver.ts:172

Handles errors from server and peers

emits error

Parameters:

Name Type
error Error
peer? RlpxPeer

Returns: void


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


getRlpxInfo

getRlpxInfo(): object | object

Defined in lib/net/server/rlpxserver.ts:81

Return Rlpx info

Returns: object | object


Private initDpt

initDpt(): void

Defined in lib/net/server/rlpxserver.ts:187

Initializes DPT for peer discovery

Returns: void


Private initRlpx

initRlpx(): void

Defined in lib/net/server/rlpxserver.ts:208

Initializes RLPx instance for peer management

Returns: void


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


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


start

start(): Promise‹boolean›

Overrides Server.start

Defined in lib/net/server/rlpxserver.ts:106

Start Devp2p/RLPx server. Returns a promise that resolves once server has been started.

Returns: Promise‹boolean›

Resolves with true if server successfully started


stop

stop(): Promise‹boolean›

Overrides Server.stop

Defined in lib/net/server/rlpxserver.ts:141

Stop Devp2p/RLPx server. Returns a promise that resolves once server has been stopped.

Returns: Promise‹boolean›