ethereumjs-client › "service/lightethereumservice" › LightEthereumService
Ethereum service
memberof
module:service
↳ LightEthereumService
- addListener
- close
- emit
- eventNames
- getMaxListeners
- handle
- listenerCount
- listeners
- off
- on
- once
- open
- prependListener
- prependOnceListener
- rawListeners
- removeAllListeners
- removeListener
- setMaxListeners
- start
- stop
+ new LightEthereumService(options
: EthereumServiceOptions): LightEthereumService
Overrides EthereumService.constructor
Defined in lib/service/lightethereumservice.ts:11
Create new ETH service
Parameters:
Name | Type | Description |
---|---|---|
options |
EthereumServiceOptions | constructor parameters |
Returns: LightEthereumService
• chain: Chain
Inherited from EthereumService.chain
Defined in lib/service/ethereumservice.ts:27
• config: Config
Defined in lib/service/service.ts:17
• flow: FlowControl
Inherited from EthereumService.flow
Defined in lib/service/ethereumservice.ts:26
• interval: number
Inherited from EthereumService.interval
Defined in lib/service/ethereumservice.ts:28
• opened: boolean
Defined in lib/service/service.ts:18
• pool: PeerPool
Defined in lib/service/service.ts:20
• running: boolean
Inherited from Service.running
Defined in lib/service/service.ts:19
• synchronizer: LightSynchronizer
Overrides EthereumService.synchronizer
Defined in lib/service/lightethereumservice.ts:11
• timeout: number
Inherited from EthereumService.timeout
Defined in lib/service/ethereumservice.ts:29
• get name(): string
Inherited from EthereumService.name
Defined in lib/service/ethereumservice.ts:50
Service name
type
{string}
Returns: string
• get protocols(): LesProtocol[]
Defined in lib/service/lightethereumservice.ts:33
Returns all protocols required by this service
Returns: LesProtocol[]
▸ 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
▸ close(): Promise‹void›
Defined in lib/service/service.ts:96
Close service.
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
▸ 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
▸ handle(_message
: any, _protocol
: string, _peer
: Peer): Promise‹void›
Defined in lib/service/lightethereumservice.ts:44
Handles incoming message from connected peer
Parameters:
Name | Type |
---|---|
_message |
any |
_protocol |
string |
_peer |
Peer |
Returns: Promise‹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
▸ open(): Promise‹undefined | false›
Inherited from EthereumService.open
Defined in lib/service/ethereumservice.ts:58
Open eth service. Must be called before service is started
Returns: Promise‹undefined | false›
▸ 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‹void | boolean›
Inherited from EthereumService.start
Defined in lib/service/ethereumservice.ts:74
Starts service and ensures blockchain is synchronized. Returns a promise that resolves once the service is started and blockchain is in sync.
Returns: Promise‹void | boolean›
▸ stop(): Promise‹void | boolean›
Inherited from EthereumService.stop
Defined in lib/service/ethereumservice.ts:86
Stop service. Interrupts blockchain synchronization if its in progress.
Returns: Promise‹void | boolean›