Class: Reth::JSONRPC::Service

Inherits:
DEVp2p::Service
  • Object
show all
Defined in:
lib/reth/jsonrpc/service.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, host, port) ⇒ Service

Returns a new instance of Service.



21
22
23
24
25
26
27
# File 'lib/reth/jsonrpc/service.rb', line 21

def initialize(app, host, port)
  super(app)

  @app = app
  @host = host
  @port = port
end

Class Method Details

.register_with_app(app) ⇒ Object



7
8
9
10
# File 'lib/reth/jsonrpc/service.rb', line 7

def register_with_app(app)
  config = default_config[:jsonrpc]
  app.register_service self, app, config[:host], config[:port]
end

Instance Method Details

#startObject



29
30
31
32
# File 'lib/reth/jsonrpc/service.rb', line 29

def start
  @server = Server.new @app, @host, @port
  @server.async.start
end