proxy

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppProxy

type AppProxy interface {
	SubmitCh() chan []byte
	CommitBlock(block hashgraph.Block) (CommitResponse, error)
	GetSnapshot(blockIndex int) ([]byte, error)
	Restore(snapshot []byte) error
}

AppProxy ...

type CommitCallback added in v0.4.1

type CommitCallback func(block hashgraph.Block) (CommitResponse, error)

CommitCallback ...

type CommitResponse added in v0.4.1

type CommitResponse struct {
	StateHash                   []byte
	InternalTransactionReceipts []hashgraph.InternalTransactionReceipt
}

CommitResponse ...

func DummyCommitCallback added in v0.4.1

func DummyCommitCallback(block hashgraph.Block) (CommitResponse, error)

DummyCommitCallback is used for testing

type ProxyHandler

type ProxyHandler interface {
	//CommitHandler is called when Babble commits a block to the application. It
	//returns the state hash resulting from applying the block's transactions to the
	//state
	CommitHandler(block hashgraph.Block) (response CommitResponse, err error)

	//SnapshotHandler is called by Babble to retrieve a snapshot corresponding to a
	//particular block
	SnapshotHandler(blockIndex int) (snapshot []byte, err error)

	//RestoreHandler is called by Babble to restore the application to a specific
	//state
	RestoreHandler(snapshot []byte) (stateHash []byte, err error)
}

ProxyHandler ...

Directories

Path Synopsis
socket
app

Jump to

Keyboard shortcuts

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