tmpop

package
v0.0.5-dev Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name of the Tendermint Application
	Name = "TMPop"

	// Description of this Tendermint Application
	Description = "Agent Store in a Blockchain"
)

Variables

This section is empty.

Functions

func BuildQueryBinary

func BuildQueryBinary(name string, args interface{}) ([]byte, error)

BuildQueryBinary outputs the marshalled Query

func Run

func Run(a store.Adapter, config *Config, addrPtr, abciPtr *string)

Run launches a TMPop Tendermint App

Types

type Config

type Config struct {
	// A version string that will be set in the store's information.
	Version string

	// A git commit hash that will be set in the store's information.
	Commit string

	// Where godb will be saved.
	DbDir string
}

Config contains configuration options for the App.

type Info

type Info struct {
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Version     string      `json:"version"`
	Commit      string      `json:"commit"`
	AdapterInfo interface{} `json:"adapterInfo"`
}

Info is the info returned by GetInfo.

type LastBlockInfo

type LastBlockInfo struct {
	Height  uint64
	AppHash []byte
}

LastBlockInfo stores information about the last block

type Query

type Query struct {
	Name string `json:"Name"`
	Args []byte `json:"Args"`
}

Query is the type used to query the tendermint App

type TMPop

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

TMPop is the type of the application that implements github.com/tendermint/abci/types.Application, the tendermint socket protocol (ABCI)

func New

func New(a store.Adapter, config *Config) *TMPop

New creates a new instance of a TMPop

func (*TMPop) BeginBlock

func (t *TMPop) BeginBlock(hash []byte, header *tmtypes.Header)

BeginBlock implements github.com/tendermint/abci/types.BlockchainAware.BeginBlock

func (*TMPop) CheckTx

func (t *TMPop) CheckTx(tx []byte) tmtypes.Result

CheckTx implements github.com/tendermint/abci/types.Application.CheckTx

func (*TMPop) Commit

func (t *TMPop) Commit() tmtypes.Result

Commit implements github.com/tendermint/abci/types.Application.Commit

func (*TMPop) DeliverTx

func (t *TMPop) DeliverTx(tx []byte) tmtypes.Result

DeliverTx implements github.com/tendermint/abci/types.Application.DeliverTx

func (*TMPop) EndBlock

func (t *TMPop) EndBlock(height uint64) tmtypes.ResponseEndBlock

EndBlock implements github.com/tendermint/abci/types.BlockchainAware.EndBlock

func (*TMPop) Info

func (t *TMPop) Info() tmtypes.ResponseInfo

Info implements github.com/tendermint/abci/types.Application.Info

func (*TMPop) InitChain

func (t *TMPop) InitChain(validators []*tmtypes.Validator)

InitChain implements github.com/tendermint/abci/types.BlockchainAware.InitChain

func (*TMPop) LoadLastBlock

func (t *TMPop) LoadLastBlock() (lastBlock LastBlockInfo)

LoadLastBlock gets the last block from the db

func (*TMPop) Query

func (t *TMPop) Query(q []byte) tmtypes.Result

Query implements github.com/tendermint/abci/types.Application.Query it unmarshalls the read queries and forward them to the adapter

func (*TMPop) SetAdapter

func (t *TMPop) SetAdapter(a store.Adapter)

SetAdapter sets the adapter

func (*TMPop) SetOption

func (t *TMPop) SetOption(key string, value string) (log string)

SetOption implements github.com/tendermint/abci/types.Application.SetOption

Jump to

Keyboard shortcuts

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