Documentation ¶
Overview ¶
Package babble implements a component that the TCP AppProxy can connect to.
Index ¶
- type SocketBabbleProxy
- type SocketBabbleProxyClient
- type SocketBabbleProxyServer
- func (p *SocketBabbleProxyServer) CommitBlock(block hashgraph.Block, response *proxy.CommitResponse) (err error)
- func (p *SocketBabbleProxyServer) GetSnapshot(blockIndex int, snapshot *[]byte) (err error)
- func (p *SocketBabbleProxyServer) OnStateChanged(state state.State, obj *struct{}) (err error)
- func (p *SocketBabbleProxyServer) Restore(snapshot []byte, stateHash *[]byte) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SocketBabbleProxy ¶
type SocketBabbleProxy struct {
// contains filtered or unexported fields
}
SocketBabbleProxy is a Golang implementation of a service that binds to a remote Babble over an RPC/TCP connection. It implements handlers for the RPC requests sent by the SocketAppProxy, and submits transactions to Babble via an RPC request. A SocketBabbleProxy can be implemented in any programming language as long as it implements the AppProxy interface over RPC.
func NewSocketBabbleProxy ¶
func NewSocketBabbleProxy( nodeAddr string, bindAddr string, handler proxy.ProxyHandler, timeout time.Duration, logger *logrus.Entry, ) (*SocketBabbleProxy, error)
NewSocketBabbleProxy creates a new SocketBabbleProxy
func (*SocketBabbleProxy) SubmitTx ¶
func (p *SocketBabbleProxy) SubmitTx(tx []byte) error
SubmitTx submits a transaction to Babble
type SocketBabbleProxyClient ¶
type SocketBabbleProxyClient struct {
// contains filtered or unexported fields
}
SocketBabbleProxyClient is the client component of the BabbleProxy that sends RPC requests to Babble
func NewSocketBabbleProxyClient ¶
func NewSocketBabbleProxyClient(nodeAddr string, timeout time.Duration) *SocketBabbleProxyClient
NewSocketBabbleProxyClient implements a new SocketBabbleProxyClient
type SocketBabbleProxyServer ¶
type SocketBabbleProxyServer struct {
// contains filtered or unexported fields
}
SocketBabbleProxyServer is the server component of the BabbleProxy which responds to RPC requests from the client component of the AppProxy
func NewSocketBabbleProxyServer ¶
func NewSocketBabbleProxyServer( bindAddress string, handler proxy.ProxyHandler, timeout time.Duration, logger *logrus.Entry, ) (*SocketBabbleProxyServer, error)
NewSocketBabbleProxyServer creates a new SocketBabbleProxyServer
func (*SocketBabbleProxyServer) CommitBlock ¶
func (p *SocketBabbleProxyServer) CommitBlock(block hashgraph.Block, response *proxy.CommitResponse) (err error)
CommitBlock implements the AppProxy interface
func (*SocketBabbleProxyServer) GetSnapshot ¶
func (p *SocketBabbleProxyServer) GetSnapshot(blockIndex int, snapshot *[]byte) (err error)
GetSnapshot implements the AppProxy interface
func (*SocketBabbleProxyServer) OnStateChanged ¶ added in v0.8.0
func (p *SocketBabbleProxyServer) OnStateChanged(state state.State, obj *struct{}) (err error)
OnStateChanged implements the AppProxy interface