ethereumjs-client › "net/server/rlpxserver" › RlpxServer
DevP2P/RLPx server
emits
connected
emits
disconnected
emits
error
memberof
module:net/server
↳ Server
↳ RlpxServer
- addListener
- addProtocols
- ban
- bootstrap
- emit
- error
- eventNames
- getMaxListeners
- getRlpxInfo
- initDpt
- initRlpx
- listenerCount
- listeners
- off
- on
- once
- prependListener
- prependOnceListener
- rawListeners
- removeAllListeners
- removeListener
- setMaxListeners
- start
- stop
+ 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
• bootnodes: Bootnode[] = []
Inherited from Server.bootnodes
Defined in lib/net/server/server.ts:28
• config: Config
Defined in lib/net/server/server.ts:26
• dpt: Devp2pDPT | null = null
Defined in lib/net/server/rlpxserver.ts:44
• ip: string = "::"
Defined in lib/net/server/rlpxserver.ts:45
• key: Buffer | undefined
Defined in lib/net/server/server.ts:27
• port: number
Defined in lib/net/server/rlpxserver.ts:40
• rlpx: Devp2pRLPx | null = null
Defined in lib/net/server/rlpxserver.ts:43
• started: boolean
Defined in lib/net/server/server.ts:33
• get name(): string
Defined in lib/net/server/rlpxserver.ts:74
Server name
type
{string}
Returns: string
• get running(): boolean
Defined in lib/net/server/server.ts:58
Check if server is running
Returns: boolean
▸ 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(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(peerId
: string, maxAge
: number): boolean
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(): Promise‹void›
Defined in lib/net/server/rlpxserver.ts:122
Bootstrap bootnode peers from the network
Returns: Promise‹void›
▸ emit(event
: string | symbol, ...args
: any[]): boolean
Defined in node_modules/@types/node/events.d.ts:72
Parameters:
Name | Type |
---|---|
event |
string | symbol |
...args |
any[] |
Returns: boolean
▸ 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(): Array‹string | symbol›
Inherited from Sender.eventNames
Defined in node_modules/@types/node/events.d.ts:77
Returns: Array‹string | symbol›
▸ getMaxListeners(): number
Inherited from Sender.getMaxListeners
Defined in node_modules/@types/node/events.d.ts:69
Returns: number
▸ getRlpxInfo(): object | object
Defined in lib/net/server/rlpxserver.ts:81
Return Rlpx info
Returns: object | object
▸ initDpt(): void
Defined in lib/net/server/rlpxserver.ts:187
Initializes DPT for peer discovery
Returns: void
▸ initRlpx(): void
Defined in lib/net/server/rlpxserver.ts:208
Initializes RLPx instance for peer management
Returns: void
▸ 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(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(event
: string | symbol, listener
: function): this
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(event
: string | symbol, listener
: function): this
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(event
: string | symbol, listener
: function): this
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(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(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(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(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(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(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(): Promise‹boolean›
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(): Promise‹boolean›
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›