customd

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package app is where blockchain app wraps up.

Weave blockchain components such as QueryRouter, Router, Decorators, Database, Application stack are combined here. App uses weave modules defined below:

  • cash
  • sigs
  • multisig
  • migration
  • validators
  • custom

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")
)
View Source
var CronTaskMarshaler = taskMarshaler{}

CronTaskMarshaler is a task marshaler implementation to be used by the weave applications when dealing with scheduled tasks.

This implementation relies on the CronTask protobuf declaration.

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.

func Authenticator

func Authenticator() x.Authenticator

Authenticator returns authentication with multisigs and public key signatues

func CashControl

func CashControl() cash.Controller

CashControl returns a controller for cash functions

func Chain

func Chain(authFn x.Authenticator, minFee coin.Coin) 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 CronStack

func CronStack() weave.Handler

CronStack wires up a standard router with a cron specific decorator chain. This can be passed into BaseApp. Cron stack configuration is a subset of the main stack. It is using the same components but not all functionalities are needed or expected (ie no message fee).

func DecorateApp

func DecorateApp(application app.BaseApp, logger log.Logger) app.BaseApp

DecorateApp adds initializers and Logger to an Application

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

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 InlineApp

func InlineApp(kv weave.CommitKVStore, logger log.Logger, debug bool) abci.Application

InlineApp will take a previously prepared CommitStore and return a complete Application

func QueryRouter

func QueryRouter() weave.QueryRouter

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

func Router

func Router(authFn x.Authenticator, issuer weave.Address) *app.Router

Router returns a default router

func Stack

func Stack(issuer weave.Address, 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 CronTask

type CronTask struct {
	// Authenticators contains a list of conditions that authenticate execution
	// of this task.
	// This is one of the main differences between the CronTask and Tx entities.
	// CronTask is created interanlly and does not have to be signed. Because we
	// use the same handlers as for the Tx to process a cron task, we must
	// provide authentication method. This attribute contains all authentication
	// conditions required for execution, that will be inserted into the context.
	Authenticators []github_com_iov_one_weave.Condition `protobuf:"bytes,1,rep,name=authenticators,proto3,casttype=github.com/iov-one/weave.Condition" json:"authenticators,omitempty"`
	// Use the same indexes for the messages as the Tx message.
	//
	// Types that are valid to be assigned to Sum:
	//	*CronTask_CustomDeleteTimedStateMsg
	Sum isCronTask_Sum `protobuf_oneof:"sum"`
}

CronTask is a format used by the CronMarshaler to marshal and unmarshal cron task.

When there is a gap in message sequence numbers - that most likely means some old fields got deprecated. This is done to maintain binary compatibility.

func (*CronTask) Descriptor

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

func (*CronTask) GetAuthenticators

func (m *CronTask) GetAuthenticators() []github_com_iov_one_weave.Condition

func (*CronTask) GetCustomDeleteTimedStateMsg

func (m *CronTask) GetCustomDeleteTimedStateMsg() *custom.DeleteTimedStateMsg

func (*CronTask) GetSum

func (m *CronTask) GetSum() isCronTask_Sum

func (*CronTask) Marshal

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

func (*CronTask) MarshalTo

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

func (*CronTask) ProtoMessage

func (*CronTask) ProtoMessage()

func (*CronTask) Reset

func (m *CronTask) Reset()

func (*CronTask) Size

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

func (*CronTask) String

func (m *CronTask) String() string

func (*CronTask) Unmarshal

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

func (*CronTask) XXX_DiscardUnknown

func (m *CronTask) XXX_DiscardUnknown()

func (*CronTask) XXX_Marshal

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

func (*CronTask) XXX_Merge

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

func (*CronTask) XXX_OneofFuncs

func (*CronTask) 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 (*CronTask) XXX_Size

func (m *CronTask) XXX_Size() int

func (*CronTask) XXX_Unmarshal

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

type CronTask_CustomDeleteTimedStateMsg

type CronTask_CustomDeleteTimedStateMsg struct {
	CustomDeleteTimedStateMsg *custom.DeleteTimedStateMsg `protobuf:"bytes,101,opt,name=custom_delete_timed_state_msg,json=customDeleteTimedStateMsg,proto3,oneof"`
}

func (*CronTask_CustomDeleteTimedStateMsg) MarshalTo

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

func (*CronTask_CustomDeleteTimedStateMsg) Size

type ExecuteBatchMsg

type ExecuteBatchMsg struct {
	Messages []ExecuteBatchMsg_Union `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages"`
}

ExecuteBatchMsg encapsulates multiple messages to support batch transaction

func (*ExecuteBatchMsg) Descriptor

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

func (*ExecuteBatchMsg) GetMessages

func (m *ExecuteBatchMsg) GetMessages() []ExecuteBatchMsg_Union

func (*ExecuteBatchMsg) Marshal

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

func (*ExecuteBatchMsg) MarshalTo

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

func (*ExecuteBatchMsg) MsgList

func (msg *ExecuteBatchMsg) MsgList() ([]weave.Msg, error)

MsgList decode msg.Messages to weave.Msg array

func (*ExecuteBatchMsg) Path

func (*ExecuteBatchMsg) Path() string

Path returns path of execute message

func (*ExecuteBatchMsg) ProtoMessage

func (*ExecuteBatchMsg) ProtoMessage()

func (*ExecuteBatchMsg) Reset

func (m *ExecuteBatchMsg) Reset()

func (*ExecuteBatchMsg) Size

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

func (*ExecuteBatchMsg) String

func (m *ExecuteBatchMsg) String() string

func (*ExecuteBatchMsg) Unmarshal

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

func (*ExecuteBatchMsg) Validate

func (msg *ExecuteBatchMsg) Validate() error

Validate validates execute message

func (*ExecuteBatchMsg) XXX_DiscardUnknown

func (m *ExecuteBatchMsg) XXX_DiscardUnknown()

func (*ExecuteBatchMsg) XXX_Marshal

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

func (*ExecuteBatchMsg) XXX_Merge

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

func (*ExecuteBatchMsg) XXX_Size

func (m *ExecuteBatchMsg) XXX_Size() int

func (*ExecuteBatchMsg) XXX_Unmarshal

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

type ExecuteBatchMsg_Union

type ExecuteBatchMsg_Union struct {
	// No recursive batches!
	//
	// Types that are valid to be assigned to Sum:
	//	*ExecuteBatchMsg_Union_CashSendMsg
	//	*ExecuteBatchMsg_Union_MultisigCreateMsg
	//	*ExecuteBatchMsg_Union_MultisigUpdateMsg
	Sum isExecuteBatchMsg_Union_Sum `protobuf_oneof:"sum"`
}

func (*ExecuteBatchMsg_Union) Descriptor

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

func (*ExecuteBatchMsg_Union) GetCashSendMsg

func (m *ExecuteBatchMsg_Union) GetCashSendMsg() *cash.SendMsg

func (*ExecuteBatchMsg_Union) GetMultisigCreateMsg

func (m *ExecuteBatchMsg_Union) GetMultisigCreateMsg() *multisig.CreateMsg

func (*ExecuteBatchMsg_Union) GetMultisigUpdateMsg

func (m *ExecuteBatchMsg_Union) GetMultisigUpdateMsg() *multisig.UpdateMsg

func (*ExecuteBatchMsg_Union) GetSum

func (m *ExecuteBatchMsg_Union) GetSum() isExecuteBatchMsg_Union_Sum

func (*ExecuteBatchMsg_Union) Marshal

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

func (*ExecuteBatchMsg_Union) MarshalTo

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

func (*ExecuteBatchMsg_Union) ProtoMessage

func (*ExecuteBatchMsg_Union) ProtoMessage()

func (*ExecuteBatchMsg_Union) Reset

func (m *ExecuteBatchMsg_Union) Reset()

func (*ExecuteBatchMsg_Union) Size

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

func (*ExecuteBatchMsg_Union) String

func (m *ExecuteBatchMsg_Union) String() string

func (*ExecuteBatchMsg_Union) Unmarshal

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

func (*ExecuteBatchMsg_Union) XXX_DiscardUnknown

func (m *ExecuteBatchMsg_Union) XXX_DiscardUnknown()

func (*ExecuteBatchMsg_Union) XXX_Marshal

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

func (*ExecuteBatchMsg_Union) XXX_Merge

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

func (*ExecuteBatchMsg_Union) XXX_OneofFuncs

func (*ExecuteBatchMsg_Union) 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 (*ExecuteBatchMsg_Union) XXX_Size

func (m *ExecuteBatchMsg_Union) XXX_Size() int

func (*ExecuteBatchMsg_Union) XXX_Unmarshal

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

type ExecuteBatchMsg_Union_CashSendMsg

type ExecuteBatchMsg_Union_CashSendMsg struct {
	CashSendMsg *cash.SendMsg `protobuf:"bytes,51,opt,name=cash_send_msg,json=cashSendMsg,proto3,oneof"`
}

func (*ExecuteBatchMsg_Union_CashSendMsg) MarshalTo

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

func (*ExecuteBatchMsg_Union_CashSendMsg) Size

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

type ExecuteBatchMsg_Union_MultisigCreateMsg

type ExecuteBatchMsg_Union_MultisigCreateMsg struct {
	MultisigCreateMsg *multisig.CreateMsg `protobuf:"bytes,56,opt,name=multisig_create_msg,json=multisigCreateMsg,proto3,oneof"`
}

func (*ExecuteBatchMsg_Union_MultisigCreateMsg) MarshalTo

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

func (*ExecuteBatchMsg_Union_MultisigCreateMsg) Size

type ExecuteBatchMsg_Union_MultisigUpdateMsg

type ExecuteBatchMsg_Union_MultisigUpdateMsg struct {
	MultisigUpdateMsg *multisig.UpdateMsg `protobuf:"bytes,57,opt,name=multisig_update_msg,json=multisigUpdateMsg,proto3,oneof"`
}

func (*ExecuteBatchMsg_Union_MultisigUpdateMsg) MarshalTo

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

func (*ExecuteBatchMsg_Union_MultisigUpdateMsg) Size

type Tx

type Tx struct {
	// Enables coin.GetFees()
	Fees *cash.FeeInfo `protobuf:"bytes,1,opt,name=fees,proto3" json:"fees,omitempty"`
	//StdSignature represents the signature, the identity of the signer
	// (the Pubkey), and a sequence number to prevent replay attacks.
	Signatures []*sigs.StdSignature `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"`
	// ID of a multisig contract.
	Multisig [][]byte `protobuf:"bytes,4,rep,name=multisig,proto3" json:"multisig,omitempty"`
	// sum defines over all allowed messages on this chain.
	//
	// Types that are valid to be assigned to Sum:
	//	*Tx_CashSendMsg
	//	*Tx_MultisigCreateMsg
	//	*Tx_MultisigUpdateMsg
	//	*Tx_ValidatorsApplyDiffMsg
	//	*Tx_ExecuteBatchMsg
	//	*Tx_MigrationUpgradeSchemaMsg
	//	*Tx_CustomCreateTimedStateMsg
	//	*Tx_CustomCreateStateMsg
	Sum isTx_Sum `protobuf_oneof:"sum"`
}

Tx contains the message When extending Tx, follow the rules:

  • Range 1-50 is reserved for middlewares,
  • Range 51-inf is reserved for different message types,
  • Keep the same numbers for the same message types in weave based applications to sustain compatibility between blockchains. For example, FeeInfo field is used by both and indexed at first position. Skip unused fields (leave index unused or comment out for clarity).

When there is a gap in message sequence numbers - that most likely means some old fields got deprecated. This is done to maintain binary compatibility.

func (*Tx) Descriptor

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

func (*Tx) GetCashSendMsg

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

func (*Tx) GetCustomCreateStateMsg

func (m *Tx) GetCustomCreateStateMsg() *custom.CreateStateMsg

func (*Tx) GetCustomCreateTimedStateMsg

func (m *Tx) GetCustomCreateTimedStateMsg() *custom.CreateTimedStateMsg

func (*Tx) GetExecuteBatchMsg

func (m *Tx) GetExecuteBatchMsg() *ExecuteBatchMsg

func (*Tx) GetFees

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

func (*Tx) GetMigrationUpgradeSchemaMsg

func (m *Tx) GetMigrationUpgradeSchemaMsg() *migration.UpgradeSchemaMsg

func (*Tx) GetMsg

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

GetMsg returns a single message instance that is represented by this transaction.

func (*Tx) GetMultisig

func (m *Tx) GetMultisig() [][]byte

func (*Tx) GetMultisigCreateMsg

func (m *Tx) GetMultisigCreateMsg() *multisig.CreateMsg

func (*Tx) GetMultisigUpdateMsg

func (m *Tx) GetMultisigUpdateMsg() *multisig.UpdateMsg

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) GetValidatorsApplyDiffMsg

func (m *Tx) GetValidatorsApplyDiffMsg() *validators.ApplyDiffMsg

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

func (m *Tx) XXX_DiscardUnknown()

func (*Tx) XXX_Marshal

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

func (*Tx) XXX_Merge

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

func (m *Tx) XXX_Size() int

func (*Tx) XXX_Unmarshal

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

type Tx_CashSendMsg

type Tx_CashSendMsg struct {
	CashSendMsg *cash.SendMsg `protobuf:"bytes,51,opt,name=cash_send_msg,json=cashSendMsg,proto3,oneof"`
}

func (*Tx_CashSendMsg) MarshalTo

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

func (*Tx_CashSendMsg) Size

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

type Tx_CustomCreateStateMsg

type Tx_CustomCreateStateMsg struct {
	CustomCreateStateMsg *custom.CreateStateMsg `protobuf:"bytes,102,opt,name=custom_create_state_msg,json=customCreateStateMsg,proto3,oneof"`
}

func (*Tx_CustomCreateStateMsg) MarshalTo

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

func (*Tx_CustomCreateStateMsg) Size

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

type Tx_CustomCreateTimedStateMsg

type Tx_CustomCreateTimedStateMsg struct {
	CustomCreateTimedStateMsg *custom.CreateTimedStateMsg `protobuf:"bytes,100,opt,name=custom_create_timed_state_msg,json=customCreateTimedStateMsg,proto3,oneof"`
}

func (*Tx_CustomCreateTimedStateMsg) MarshalTo

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

func (*Tx_CustomCreateTimedStateMsg) Size

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

type Tx_ExecuteBatchMsg

type Tx_ExecuteBatchMsg struct {
	ExecuteBatchMsg *ExecuteBatchMsg `protobuf:"bytes,60,opt,name=execute_batch_msg,json=executeBatchMsg,proto3,oneof"`
}

func (*Tx_ExecuteBatchMsg) MarshalTo

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

func (*Tx_ExecuteBatchMsg) Size

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

type Tx_MigrationUpgradeSchemaMsg

type Tx_MigrationUpgradeSchemaMsg struct {
	MigrationUpgradeSchemaMsg *migration.UpgradeSchemaMsg `protobuf:"bytes,69,opt,name=migration_upgrade_schema_msg,json=migrationUpgradeSchemaMsg,proto3,oneof"`
}

func (*Tx_MigrationUpgradeSchemaMsg) MarshalTo

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

func (*Tx_MigrationUpgradeSchemaMsg) Size

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

type Tx_MultisigCreateMsg

type Tx_MultisigCreateMsg struct {
	MultisigCreateMsg *multisig.CreateMsg `protobuf:"bytes,56,opt,name=multisig_create_msg,json=multisigCreateMsg,proto3,oneof"`
}

func (*Tx_MultisigCreateMsg) MarshalTo

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

func (*Tx_MultisigCreateMsg) Size

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

type Tx_MultisigUpdateMsg

type Tx_MultisigUpdateMsg struct {
	MultisigUpdateMsg *multisig.UpdateMsg `protobuf:"bytes,57,opt,name=multisig_update_msg,json=multisigUpdateMsg,proto3,oneof"`
}

func (*Tx_MultisigUpdateMsg) MarshalTo

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

func (*Tx_MultisigUpdateMsg) Size

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

type Tx_ValidatorsApplyDiffMsg

type Tx_ValidatorsApplyDiffMsg struct {
	ValidatorsApplyDiffMsg *validators.ApplyDiffMsg `protobuf:"bytes,58,opt,name=validators_apply_diff_msg,json=validatorsApplyDiffMsg,proto3,oneof"`
}

func (*Tx_ValidatorsApplyDiffMsg) MarshalTo

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

func (*Tx_ValidatorsApplyDiffMsg) Size

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

Jump to

Keyboard shortcuts

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