server

package
v0.15.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2018 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommands

func AddCommands(
	rootCmd *cobra.Command,
	appState GenAppState, appCreator AppCreator,
	context *Context)

func DefaultGenAppState

func DefaultGenAppState(args []string, addr sdk.Address, coinDenom string) (json.RawMessage, error)

DefaultGenAppState expects two args: an account address and a coin denomination, and gives lots of coins to that address.

func FreeTCPAddr

func FreeTCPAddr(t *testing.T) string

Get a free address for a test tendermint server protocol is either tcp, http, etc

func GenerateCoinKey

func GenerateCoinKey() (sdk.Address, string, error)

GenerateCoinKey returns the address of a public key, along with the secret phrase to recover the private key. You can give coins to this address and return the recovery phrase to the user to access them.

func InitCmd

func InitCmd(gen GenAppState, ctx *Context) *cobra.Command

InitCmd will initialize all files for tendermint, along with proper app_state. The application can pass in a function to generate proper state. And may want to use GenerateCoinKey to create default account(s).

func PersistentPreRunEFn

func PersistentPreRunEFn(context *Context) func(*cobra.Command, []string) error

PersistentPreRunEFn returns a PersistentPreRunE function for cobra that initailizes the passed in context with a properly configured logger and config objecy

func RunOrTimeout

func RunOrTimeout(cmd *cobra.Command, timeout time.Duration, t *testing.T) chan error

Run or Timout RunE of command passed in

func ShowNodeIDCmd

func ShowNodeIDCmd(ctx *Context) *cobra.Command

ShowNodeIDCmd - ported from Tendermint, dump node ID to stdout

func ShowValidatorCmd

func ShowValidatorCmd(ctx *Context) *cobra.Command

ShowValidator - ported from Tendermint, show this node's validator info

func StartCmd

func StartCmd(app AppCreator, ctx *Context) *cobra.Command

StartCmd runs the service passed in, either stand-alone, or in-process with tendermint

func StartServer

func StartServer(t *testing.T) chan error

Begin the server pass up the channel to close NOTE pass up the channel so it can be closed at the end of the process

func UnsafeResetAllCmd

func UnsafeResetAllCmd(ctx *Context) *cobra.Command

UnsafeResetAllCmd - extension of the tendermint command, resets initialization

Types

type AppCreator

type AppCreator func(string, log.Logger) (abci.Application, error)

AppCreator lets us lazily initialize app, using home dir and other flags (?) to start

type Context

type Context struct {
	Config *cfg.Config
	Logger log.Logger
}

func NewContext

func NewContext(config *cfg.Config, logger log.Logger) *Context

func NewDefaultContext

func NewDefaultContext() *Context

type GenAppState

type GenAppState func(args []string, addr sdk.Address, coinDenom string) (json.RawMessage, error)

GenAppState takes the command line args, as well as an address and coin denomination. It returns a default app_state to be included in in the genesis file. This is application-specific

type GenesisDoc

type GenesisDoc map[string]json.RawMessage

GenesisDoc involves some tendermint-specific structures we don't want to parse, so we just grab it into a raw object format, so we can add one line.

Jump to

Keyboard shortcuts

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