app

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2019 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package app contains standard implementations of a number of components.

It is a good place to get started buuilding your first app, and to see how to wire together the various components. You can then replace them with custom implementations, as your project grows.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthCodec = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCodec   = fmt.Errorf("proto: integer overflow")
)

Functions

func Application

func Application(name string, h weave.Handler,
	tx weave.TxDecoder, dbPath string, debug bool) (app.BaseApp, error)

Application constructs a basic ABCI application with the given arguments. If you are not sure what to use for the Handler, just use Stack().

func Authenticator

func Authenticator() x.Authenticator

Authenticator returns the typical authentication, just using public key signatures

func CashControl

func CashControl() cash.Controller

CashControl returns a controller for cash functions

func Chain

func Chain(minFee coin.Coin, authFn x.Authenticator) app.Decorators

Chain returns a chain of decorators, to handle authentication, fees, logging, and recovery

func CommitKVStore

func CommitKVStore(dbPath string) (weave.CommitKVStore, error)

CommitKVStore returns an initialized KVStore that persists the data to the named path.

func Examples

func Examples() []commands.Example

Examples generates some example structs to dump out with testgen

func GenInitOptions

func GenInitOptions(args []string) (json.RawMessage, error)

GenInitOptions will produce some basic options for one rich account, to use for dev mode

You can set

func GenerateApp

func GenerateApp(options *server.Options) (abci.Application, error)

GenerateApp is used to create a stub for server/start.go command

func GenerateCoinKey

func GenerateCoinKey() (weave.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 QueryRouter

func QueryRouter() weave.QueryRouter

QueryRouter returns a default query router, allowing access to "/wallets", "/auth", and "/"

func Router

func Router(authFn x.Authenticator) app.Router

Router returns a default router, only dispatching to the cash.SendMsg

func Stack

func Stack(minFee coin.Coin) weave.Handler

Stack wires up a standard router with a standard decorator chain. This can be passed into BaseApp.

func TxDecoder

func TxDecoder(bz []byte) (weave.Tx, error)

TxDecoder creates a Tx and unmarshals bytes into it

Types

type Tx

type Tx struct {
	// msg is a sum type over all allowed messages on this chain.
	//
	// Types that are valid to be assigned to Sum:
	//	*Tx_SendMsg
	//	*Tx_SetValidatorsMsg
	Sum isTx_Sum `protobuf_oneof:"sum"`
	// fee info, autogenerates GetFees()
	Fees *cash.FeeInfo `protobuf:"bytes,20,opt,name=fees,proto3" json:"fees,omitempty"`
	// signatures, autogenerates GetSignatures()
	Signatures []*sigs.StdSignature `protobuf:"bytes,21,rep,name=signatures,proto3" json:"signatures,omitempty"`
}

Tx contains the message

func (*Tx) Descriptor

func (*Tx) Descriptor() ([]byte, []int)

func (*Tx) GetFees

func (m *Tx) GetFees() *cash.FeeInfo

func (*Tx) GetMsg

func (tx *Tx) GetMsg() (weave.Msg, error)

GetMsg switches over all types defined in the protobuf file

func (*Tx) GetSendMsg

func (m *Tx) GetSendMsg() *cash.SendMsg

func (*Tx) GetSetValidatorsMsg added in v0.8.0

func (m *Tx) GetSetValidatorsMsg() *validators.SetValidatorsMsg

func (*Tx) GetSignBytes

func (tx *Tx) GetSignBytes() ([]byte, error)

GetSignBytes returns the bytes to sign...

func (*Tx) GetSignatures

func (m *Tx) GetSignatures() []*sigs.StdSignature

func (*Tx) GetSum

func (m *Tx) GetSum() isTx_Sum

func (*Tx) Marshal

func (m *Tx) Marshal() (dAtA []byte, err error)

func (*Tx) MarshalTo

func (m *Tx) MarshalTo(dAtA []byte) (int, error)

func (*Tx) ProtoMessage

func (*Tx) ProtoMessage()

func (*Tx) Reset

func (m *Tx) Reset()

func (*Tx) Size

func (m *Tx) Size() (n int)

func (*Tx) String

func (m *Tx) String() string

func (*Tx) Unmarshal

func (m *Tx) Unmarshal(dAtA []byte) error

func (*Tx) XXX_DiscardUnknown added in v0.12.0

func (m *Tx) XXX_DiscardUnknown()

func (*Tx) XXX_Marshal added in v0.12.0

func (m *Tx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Tx) XXX_Merge added in v0.12.0

func (m *Tx) XXX_Merge(src proto.Message)

func (*Tx) XXX_OneofFuncs

func (*Tx) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

func (*Tx) XXX_Size added in v0.12.0

func (m *Tx) XXX_Size() int

func (*Tx) XXX_Unmarshal added in v0.12.0

func (m *Tx) XXX_Unmarshal(b []byte) error

type Tx_SendMsg

type Tx_SendMsg struct {
	SendMsg *cash.SendMsg `protobuf:"bytes,1,opt,name=send_msg,json=sendMsg,proto3,oneof"`
}

func (*Tx_SendMsg) MarshalTo

func (m *Tx_SendMsg) MarshalTo(dAtA []byte) (int, error)

func (*Tx_SendMsg) Size

func (m *Tx_SendMsg) Size() (n int)

type Tx_SetValidatorsMsg added in v0.8.0

type Tx_SetValidatorsMsg struct {
	SetValidatorsMsg *validators.SetValidatorsMsg `protobuf:"bytes,2,opt,name=set_validators_msg,json=setValidatorsMsg,proto3,oneof"`
}

func (*Tx_SetValidatorsMsg) MarshalTo added in v0.8.0

func (m *Tx_SetValidatorsMsg) MarshalTo(dAtA []byte) (int, error)

func (*Tx_SetValidatorsMsg) Size added in v0.8.0

func (m *Tx_SetValidatorsMsg) Size() (n int)

Jump to

Keyboard shortcuts

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