lcd

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2018 License: Apache-2.0 Imports: 68 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CLIVersionRequestHandler added in v0.20.0

func CLIVersionRequestHandler(w http.ResponseWriter, r *http.Request)

cli version REST handler endpoint

func CreateAddr added in v0.19.0

func CreateAddr(t *testing.T, name, password string, kb crkeys.Keybase) (sdk.AccAddress, string)

CreateAddr adds an address to the key store and returns an address and seed. It also requires that the key could be created.

func CreateAddrs added in v0.25.0

func CreateAddrs(t *testing.T, kb crkeys.Keybase, numAddrs int) (addrs []sdk.AccAddress, seeds, names, passwords []string)

CreateAddr adds multiple address to the key store and returns the addresses and associated seeds in lexographical order by address. It also requires that the keys could be created.

func GetConfig

func GetConfig() *tmcfg.Config

GetConfig returns a Tendermint config for the test cases.

func GetKeyBase added in v0.24.0

func GetKeyBase(t *testing.T) crkeys.Keybase

GetKeyBase returns the LCD test keybase. It also requires that a directory could be made and a keybase could be fetched.

NOTE: memDB cannot be used because the request is expecting to interact with the default location.

func GetTestKeyBase added in v0.27.0

func GetTestKeyBase(t *testing.T) crkeys.Keybase

GetTestKeyBase fetches the current testing keybase

func InitializeTestLCD added in v0.19.0

func InitializeTestLCD(
	t *testing.T, nValidators int, initAddrs []sdk.AccAddress,
) (cleanup func(), valConsPubKeys []crypto.PubKey, valOperAddrs []sdk.ValAddress, port string)

TODO: Make InitializeTestLCD safe to call in multiple tests at the same time InitializeTestLCD starts Tendermint and the LCD in process, listening on their respective sockets where nValidators is the total number of validators and initAddrs are the accounts to initialize with some steak tokens. It returns a cleanup function, a set of validator public keys, and a port.

func NodeVersionRequestHandler added in v0.20.0

func NodeVersionRequestHandler(cliCtx context.CLIContext) http.HandlerFunc

connected node version REST handler endpoint

func Request added in v0.19.0

func Request(t *testing.T, port, method, path string, payload []byte) (*http.Response, string)

Request makes a test LCD test request. It returns a response object and a stringified response body.

func ServeCommand

func ServeCommand(cdc *codec.Codec, registerRoutesFn func(*RestServer)) *cobra.Command

ServeCommand will start a Gaia Lite REST service as a blocking process. It takes a codec to create a RestServer object and a function to register all necessary routes.

Types

type AddrSeed added in v0.25.0

type AddrSeed struct {
	Address  sdk.AccAddress
	Seed     string
	Name     string
	Password string
}

Type that combines an Address with the pnemonic of the private key to that address

type AddrSeedSlice added in v0.25.0

type AddrSeedSlice []AddrSeed

implement `Interface` in sort package.

func (AddrSeedSlice) Len added in v0.25.0

func (b AddrSeedSlice) Len() int

func (AddrSeedSlice) Less added in v0.25.0

func (b AddrSeedSlice) Less(i, j int) bool

Sorts lexographically by Address

func (AddrSeedSlice) Swap added in v0.25.0

func (b AddrSeedSlice) Swap(i, j int)

type RestServer added in v0.27.0

type RestServer struct {
	Mux     *mux.Router
	CliCtx  context.CLIContext
	KeyBase keybase.Keybase
	Cdc     *codec.Codec
	// contains filtered or unexported fields
}

RestServer represents the Light Client Rest server

func NewRestServer added in v0.27.0

func NewRestServer(cdc *codec.Codec) *RestServer

NewRestServer creates a new rest server instance

func (*RestServer) Start added in v0.27.0

func (rs *RestServer) Start(listenAddr string, sslHosts string,
	certFile string, keyFile string, maxOpen int, insecure bool) (err error)

Start starts the rest server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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