Documentation ¶
Index ¶
- func AddDirectoryEntry(getIndex func(*url.URL, ...interface{}) Value, u ...*url.URL) error
- type AcmeFaucet
- type AddCredits
- type BurnTokens
- type CreateDataAccount
- type CreateIdentity
- type CreateKeyBook
- type CreateKeyPage
- type CreateToken
- type CreateTokenAccount
- type Executor
- func (m *Executor) BeginBlock(req abci.BeginBlockRequest) (resp abci.BeginBlockResponse, err error)
- func (m *Executor) CheckTx(env *protocol.Envelope) (protocol.TransactionResult, *protocol.Error)
- func (m *Executor) Commit() ([]byte, error)
- func (m *Executor) DeliverTx(env *protocol.Envelope) (protocol.TransactionResult, *protocol.Error)
- func (m *Executor) EndBlock(req abci.EndBlockRequest) abci.EndBlockResponse
- func (m *Executor) Genesis(time time.Time, callback func(st *StateManager) error) ([]byte, error)
- func (m *Executor) InitChain(data []byte, time time.Time, blockIndex int64) ([]byte, error)
- func (m *Executor) Query(q *query.Query, _ int64, prove bool) (k, v []byte, err *protocol.Error)
- func (m *Executor) Start() error
- func (m *Executor) Stop() error
- type ExecutorOptions
- type InternalSendTransactions
- type InternalTransactionsSent
- type InternalTransactionsSigned
- type IssueTokens
- type RemoveManager
- type SendTokens
- type StateManager
- func (m *StateManager) AddChainEntry(u *url.URL, name string, typ protocol.ChainType, entry []byte, ...) error
- func (m *StateManager) AddDirectoryAnchor(anchor *protocol.SyntheticAnchor)
- func (c *StateManager) AddDirectoryEntry(u ...*url.URL) error
- func (m *StateManager) AddSyntheticTxns(txid []byte, synth [][32]byte)
- func (m *StateManager) AddValidator(pubKey ed25519.PubKey)
- func (m *StateManager) Commit() ([]*submission, error)
- func (m *StateManager) Create(record ...state.Chain)
- func (m *StateManager) DisableValidator(pubKey ed25519.PubKey)
- func (c *StateManager) GetHeight(u *url.URL) (uint64, error)
- func (c *StateManager) LoadTxn(txid [32]byte) (*state.Transaction, *protocol.TransactionStatus, []protocol.Signature, error)
- func (c *StateManager) LoadUrl(u *url.URL) (state.Chain, error)
- func (c *StateManager) LoadUrlAs(u *url.URL, v interface{}) error
- func (c *StateManager) ReadChain(u *url.URL, name string) (*database.Chain, error)
- func (c *StateManager) RecordIndex(u *url.URL, key ...interface{}) *writeIndex
- func (m *StateManager) Reset()
- func (m *StateManager) SignTransaction(txid []byte, signature protocol.Signature)
- func (m *StateManager) Submit(url *url.URL, body protocol.TransactionPayload)
- func (c *StateManager) TxnExists(txid []byte) bool
- func (c *StateManager) TxnIndex(id []byte, key ...interface{}) *writeIndex
- func (m *StateManager) Update(record ...state.Chain)
- func (m *StateManager) UpdateData(record state.Chain, entryHash []byte, dataEntry *protocol.DataEntry)
- func (m *StateManager) UpdateSignator(record state.Chain) error
- type SyntheticAnchor
- type SyntheticBurnTokens
- type SyntheticCreateChain
- type SyntheticDepositCredits
- type SyntheticDepositTokens
- type SyntheticMirror
- type SyntheticWriteData
- type TxExecutor
- type UpdateKeyPage
- type UpdateManager
- type Value
- type WriteData
- type WriteDataTo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AcmeFaucet ¶
type AcmeFaucet struct{}
func (AcmeFaucet) Type ¶
func (AcmeFaucet) Type() types.TxType
func (AcmeFaucet) Validate ¶
func (AcmeFaucet) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type AddCredits ¶
type AddCredits struct{}
func (AddCredits) Type ¶
func (AddCredits) Type() types.TxType
func (AddCredits) Validate ¶
func (AddCredits) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type BurnTokens ¶
type BurnTokens struct{}
func (BurnTokens) Type ¶
func (BurnTokens) Type() types.TxType
func (BurnTokens) Validate ¶
func (BurnTokens) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type CreateDataAccount ¶
type CreateDataAccount struct{}
func (CreateDataAccount) Type ¶
func (CreateDataAccount) Type() types.TransactionType
func (CreateDataAccount) Validate ¶
func (CreateDataAccount) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type CreateIdentity ¶
type CreateIdentity struct{}
func (CreateIdentity) Type ¶
func (CreateIdentity) Type() types.TxType
func (CreateIdentity) Validate ¶
func (CreateIdentity) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type CreateKeyBook ¶
type CreateKeyBook struct{}
func (CreateKeyBook) Type ¶
func (CreateKeyBook) Type() types.TxType
func (CreateKeyBook) Validate ¶
func (CreateKeyBook) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type CreateKeyPage ¶
type CreateKeyPage struct{}
func (CreateKeyPage) Type ¶
func (CreateKeyPage) Type() types.TxType
func (CreateKeyPage) Validate ¶
func (CreateKeyPage) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type CreateToken ¶
type CreateToken struct{}
func (CreateToken) Type ¶
func (CreateToken) Type() types.TxType
func (CreateToken) Validate ¶
func (CreateToken) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type CreateTokenAccount ¶
type CreateTokenAccount struct{}
func (CreateTokenAccount) Type ¶
func (CreateTokenAccount) Type() types.TxType
func (CreateTokenAccount) Validate ¶
func (CreateTokenAccount) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type Executor ¶
type Executor struct { ExecutorOptions // contains filtered or unexported fields }
func NewGenesisExecutor ¶
func NewGenesisExecutor(db *database.Database, logger log.Logger, network config.Network) (*Executor, error)
NewGenesisExecutor creates a transaction executor that can be used to set up the genesis state.
func NewNodeExecutor ¶
func NewNodeExecutor(opts ExecutorOptions) (*Executor, error)
NewNodeExecutor creates a new Executor for a node.
func (*Executor) BeginBlock ¶
func (m *Executor) BeginBlock(req abci.BeginBlockRequest) (resp abci.BeginBlockResponse, err error)
BeginBlock implements ./abci.Chain
func (*Executor) EndBlock ¶
func (m *Executor) EndBlock(req abci.EndBlockRequest) abci.EndBlockResponse
EndBlock implements ./abci.Chain
type ExecutorOptions ¶
type InternalSendTransactions ¶
type InternalSendTransactions struct{}
func (InternalSendTransactions) Type ¶
func (InternalSendTransactions) Type() types.TxType
func (InternalSendTransactions) Validate ¶
func (InternalSendTransactions) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type InternalTransactionsSent ¶
type InternalTransactionsSent struct{}
func (InternalTransactionsSent) Type ¶
func (InternalTransactionsSent) Type() types.TxType
func (InternalTransactionsSent) Validate ¶
func (InternalTransactionsSent) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type InternalTransactionsSigned ¶
type InternalTransactionsSigned struct{}
func (InternalTransactionsSigned) Type ¶
func (InternalTransactionsSigned) Type() types.TxType
func (InternalTransactionsSigned) Validate ¶
func (InternalTransactionsSigned) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type IssueTokens ¶
type IssueTokens struct{}
func (IssueTokens) Type ¶
func (IssueTokens) Type() types.TxType
func (IssueTokens) Validate ¶
func (IssueTokens) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type RemoveManager ¶
type RemoveManager struct{}
func (RemoveManager) Type ¶
func (RemoveManager) Type() protocol.TransactionType
func (RemoveManager) Validate ¶
func (RemoveManager) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type SendTokens ¶
type SendTokens struct{}
func (SendTokens) Type ¶
func (SendTokens) Type() types.TxType
func (SendTokens) Validate ¶
func (SendTokens) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type StateManager ¶
type StateManager struct { Origin state.Chain OriginUrl *url.URL OriginChainId [32]byte Signator creditChain SignatorUrl *url.URL // contains filtered or unexported fields }
func NewStateManager ¶
func NewStateManager(batch *database.Batch, nodeUrl *url.URL, env *transactions.Envelope) (*StateManager, error)
NewStateManager creates a new state manager and loads the transaction's origin. If the origin is not found, NewStateManager returns a valid state manager along with a not-found error.
func (*StateManager) AddChainEntry ¶
func (*StateManager) AddDirectoryAnchor ¶
func (m *StateManager) AddDirectoryAnchor(anchor *protocol.SyntheticAnchor)
func (*StateManager) AddDirectoryEntry ¶
func (*StateManager) AddSyntheticTxns ¶
func (*StateManager) AddValidator ¶
func (m *StateManager) AddValidator(pubKey ed25519.PubKey)
func (*StateManager) Commit ¶
func (m *StateManager) Commit() ([]*submission, error)
commit writes pending records to the database.
func (*StateManager) Create ¶
Create queues a record for a synthetic chain create transaction. Will panic if called by a synthetic transaction. Will panic if the record is a transaction.
func (*StateManager) DisableValidator ¶ added in v0.5.1
func (m *StateManager) DisableValidator(pubKey ed25519.PubKey)
func (*StateManager) LoadTxn ¶
func (c *StateManager) LoadTxn(txid [32]byte) (*state.Transaction, *protocol.TransactionStatus, []protocol.Signature, error)
LoadTxn loads and unmarshals a saved transaction
func (*StateManager) LoadUrlAs ¶
LoadUrlAs loads a chain by URL and unmarshals it as a specific type.
func (*StateManager) RecordIndex ¶
func (*StateManager) Reset ¶
func (m *StateManager) Reset()
func (*StateManager) SignTransaction ¶
func (*StateManager) Submit ¶
func (m *StateManager) Submit(url *url.URL, body protocol.TransactionPayload)
Submit queues a synthetic transaction for submission.
func (*StateManager) TxnIndex ¶
func (c *StateManager) TxnIndex(id []byte, key ...interface{}) *writeIndex
func (*StateManager) Update ¶
Update queues a record for storage in the database. The queued update will fail if the record does not already exist, unless it is created by a synthetic transaction, or the record is a transaction.
func (*StateManager) UpdateData ¶
func (m *StateManager) UpdateData(record state.Chain, entryHash []byte, dataEntry *protocol.DataEntry)
UpdateData will cache a data associated with a DataAccount chain. the cache data will not be stored directly in the state but can be used upstream for storing a chain in the state database.
func (*StateManager) UpdateSignator ¶
type SyntheticAnchor ¶
func (SyntheticAnchor) Type ¶
func (SyntheticAnchor) Type() protocol.TransactionType
func (SyntheticAnchor) Validate ¶
func (x SyntheticAnchor) Validate(st *StateManager, tx *protocol.Envelope) (protocol.TransactionResult, error)
type SyntheticBurnTokens ¶
type SyntheticBurnTokens struct{}
func (SyntheticBurnTokens) Type ¶
func (SyntheticBurnTokens) Type() types.TxType
func (SyntheticBurnTokens) Validate ¶
func (SyntheticBurnTokens) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type SyntheticCreateChain ¶
type SyntheticCreateChain struct{}
func (SyntheticCreateChain) Type ¶
func (SyntheticCreateChain) Type() types.TxType
func (SyntheticCreateChain) Validate ¶
func (SyntheticCreateChain) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type SyntheticDepositCredits ¶
type SyntheticDepositCredits struct{}
func (SyntheticDepositCredits) Type ¶
func (SyntheticDepositCredits) Type() types.TxType
func (SyntheticDepositCredits) Validate ¶
func (SyntheticDepositCredits) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type SyntheticDepositTokens ¶
type SyntheticDepositTokens struct{}
func (SyntheticDepositTokens) Type ¶
func (SyntheticDepositTokens) Type() types.TxType
func (SyntheticDepositTokens) Validate ¶
func (SyntheticDepositTokens) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type SyntheticMirror ¶
type SyntheticMirror struct{}
func (SyntheticMirror) Type ¶
func (SyntheticMirror) Type() types.TxType
func (SyntheticMirror) Validate ¶
func (SyntheticMirror) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type SyntheticWriteData ¶
type SyntheticWriteData struct{}
func (SyntheticWriteData) Type ¶
func (SyntheticWriteData) Type() types.TransactionType
func (SyntheticWriteData) Validate ¶
func (SyntheticWriteData) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type TxExecutor ¶
type TxExecutor interface { // Type is the transaction type the executor can execute. Type() types.TransactionType // Validate fully validates and executes the transaction. Validate(*StateManager, *transactions.Envelope) (protocol.TransactionResult, error) }
TxExecutor executes a specific type of transaction.
type UpdateKeyPage ¶
type UpdateKeyPage struct{}
func (UpdateKeyPage) Type ¶
func (UpdateKeyPage) Type() types.TxType
func (UpdateKeyPage) Validate ¶
func (UpdateKeyPage) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type UpdateManager ¶
type UpdateManager struct{}
func (UpdateManager) Type ¶
func (UpdateManager) Type() protocol.TransactionType
func (UpdateManager) Validate ¶
func (UpdateManager) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type WriteData ¶
type WriteData struct{}
func (WriteData) Type ¶
func (WriteData) Type() types.TransactionType
func (WriteData) Validate ¶
func (WriteData) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
type WriteDataTo ¶
type WriteDataTo struct{}
func (WriteDataTo) Type ¶
func (WriteDataTo) Type() types.TransactionType
func (WriteDataTo) Validate ¶
func (WriteDataTo) Validate(st *StateManager, tx *transactions.Envelope) (protocol.TransactionResult, error)
Source Files ¶
- acme_faucet.go
- add_credits.go
- burn_tokens.go
- chain.go
- create_data_account.go
- create_identity.go
- create_key_book.go
- create_key_page.go
- create_token.go
- create_token_account.go
- executor.go
- executor_query.go
- executor_synthetic.go
- executor_txn.go
- governor.go
- internal_send_transactions.go
- internal_transactions_sent.go
- internal_transactions_signed.go
- issue_tokens.go
- remove_manager.go
- send_tokens.go
- state.go
- state_cache.go
- state_operation.go
- synthetic_anchor.go
- synthetic_burn_tokens.go
- synthetic_create_chain.go
- synthetic_deposit_credits.go
- synthetic_deposit_tokens.go
- synthetic_mirror.go
- synthetic_write_data.go
- txn_dispatch.go
- types.go
- update_key_page.go
- update_manager.go
- utils.go
- write_data.go
- write_data_to.go