babble

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit struct {
	Block    hashgraph.Block
	RespChan chan<- CommitResponse
}

Commit provides a response mechanism.

func (*Commit) Respond

func (r *Commit) Respond(stateHash []byte, err error)

Respond is used to respond with a response, error or both

type CommitResponse

type CommitResponse struct {
	StateHash []byte
	Error     error
}

CommitResponse captures both a response and a potential error.

type RestoreRequest

type RestoreRequest struct {
	Snapshot []byte
	RespChan chan<- RestoreResponse
}

RestoreRequest provides a response mechanism.

func (*RestoreRequest) Respond

func (r *RestoreRequest) Respond(snapshot []byte, err error)

Respond is used to respond with a response, error or both

type RestoreResponse

type RestoreResponse struct {
	StateHash []byte
	Error     error
}

RestoreResponse captures both an error.

type Snapshot

type Snapshot struct {
	Bytes []byte
}

type SnapshotRequest

type SnapshotRequest struct {
	BlockIndex int
	RespChan   chan<- SnapshotResponse
}

SnapshotRequest provides a response mechanism.

func (*SnapshotRequest) Respond

func (r *SnapshotRequest) Respond(snapshot []byte, err error)

Respond is used to respond with a response, error or both

type SnapshotResponse

type SnapshotResponse struct {
	Snapshot []byte
	Error    error
}

SnapshotResponse captures both a response and a potential error.

type SocketBabbleProxy

type SocketBabbleProxy struct {
	// contains filtered or unexported fields
}

func NewSocketBabbleProxy

func NewSocketBabbleProxy(nodeAddr string,
	bindAddr string,
	timeout time.Duration,
	logger *logrus.Logger) (*SocketBabbleProxy, error)

func (*SocketBabbleProxy) CommitCh

func (p *SocketBabbleProxy) CommitCh() chan Commit

func (*SocketBabbleProxy) RestoreCh

func (p *SocketBabbleProxy) RestoreCh() chan RestoreRequest

func (*SocketBabbleProxy) SnapshotRequestCh

func (p *SocketBabbleProxy) SnapshotRequestCh() chan SnapshotRequest

func (*SocketBabbleProxy) SubmitTx

func (p *SocketBabbleProxy) SubmitTx(tx []byte) error

type SocketBabbleProxyClient

type SocketBabbleProxyClient struct {
	// contains filtered or unexported fields
}

func NewSocketBabbleProxyClient

func NewSocketBabbleProxyClient(nodeAddr string, timeout time.Duration) *SocketBabbleProxyClient

func (*SocketBabbleProxyClient) SubmitTx

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

type SocketBabbleProxyServer

type SocketBabbleProxyServer struct {
	// contains filtered or unexported fields
}

func NewSocketBabbleProxyServer

func NewSocketBabbleProxyServer(bindAddress string,
	timeout time.Duration,
	logger *logrus.Logger) (*SocketBabbleProxyServer, error)

func (*SocketBabbleProxyServer) CommitBlock

func (p *SocketBabbleProxyServer) CommitBlock(block hashgraph.Block, stateHash *StateHash) (err error)

func (*SocketBabbleProxyServer) GetSnapshot

func (p *SocketBabbleProxyServer) GetSnapshot(blockIndex int, snapshot *Snapshot) (err error)

func (*SocketBabbleProxyServer) Restore

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

type StateHash

type StateHash struct {
	Hash []byte
}

Jump to

Keyboard shortcuts

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