Documentation ¶
Index ¶
- Variables
- func NewHttpClient(cfg HttpConfig, c codec.Codec) *httpClient
- func NewIpcClient(cfg IpcConfig, codec codec.Codec) (*ipcClient, error)
- func StartHttp(cfg HttpConfig, codec codec.Codec, api shared.EthereumApi) error
- func StartIpc(cfg IpcConfig, codec codec.Codec, offeredApi shared.EthereumApi) error
- func StopHttp()
- type EthereumClient
- type HttpConfig
- type InProcClient
- type IpcConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // List with all API's which are offered over the in proc interface by default DefaultInProcApis = shared.AllApis // List with all API's which are offered over the IPC interface by default DefaultIpcApis = shared.AllApis // List with API's which are offered over thr HTTP/RPC interface by default DefaultHttpRpcApis = strings.Join([]string{ shared.DbApiName, shared.EthApiName, shared.NetApiName, shared.Web3ApiName, }, ",") )
Functions ¶
func NewHttpClient ¶
func NewHttpClient(cfg HttpConfig, c codec.Codec) *httpClient
Create a new in process client
func NewIpcClient ¶
Create a new IPC client, UNIX domain socket on posix, named pipe on Windows
func StartHttp ¶
func StartHttp(cfg HttpConfig, codec codec.Codec, api shared.EthereumApi) error
Types ¶
type EthereumClient ¶
type EthereumClient interface { // Close underlaying connection Close() // Send request Send(interface{}) error // Receive response Recv() (interface{}, error) // List with modules this client supports SupportedModules() (map[string]string, error) }
func ClientFromEndpoint ¶
func ClientFromEndpoint(endpoint string, c codec.Codec) (EthereumClient, error)
Endpoint must be in the form of: ${protocol}:${path} e.g. ipc:/tmp/geth.ipc
rpc:localhost:8545
type HttpConfig ¶
type InProcClient ¶
type InProcClient struct {
// contains filtered or unexported fields
}
func NewInProcClient ¶
func NewInProcClient(codec codec.Codec) *InProcClient
Create a new in process client
func (*InProcClient) Close ¶
func (self *InProcClient) Close()
func (*InProcClient) Initialize ¶
func (self *InProcClient) Initialize(offeredApi shared.EthereumApi)
Need to setup api support
func (*InProcClient) Recv ¶
func (self *InProcClient) Recv() (interface{}, error)
func (*InProcClient) Send ¶
func (self *InProcClient) Send(req interface{}) error
func (*InProcClient) SupportedModules ¶
func (self *InProcClient) SupportedModules() (map[string]string, error)
Click to show internal directories.
Click to hide internal directories.