babble

package
v0.8.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2021 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Package babble implements a component that the TCP AppProxy can connect to.

Index

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

func (*SocketBabbleProxyClient) SubmitTx

func (p *SocketBabbleProxyClient) SubmitTx(tx []byte) (*bool, error)

SubmitTx submits a transaction to Babble

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

func (*SocketBabbleProxyServer) Restore

func (p *SocketBabbleProxyServer) Restore(snapshot []byte, stateHash *[]byte) (err error)

Restore implements the AppProxy interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL