{"modulePath":"github.com/hyperledger/burrow","version":"v0.34.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package execution\n\n## Constants\n\n```go\nconst (\n\tSubscribeBufferSize = 10\n)\n```\n\n```go\nconst VersionOffset = int64(1)\n```\nSince we have an initial save of our state forest we start one version ahead of the block height, but from then on we should track height by this offset.\n\n## Functions\n\n```go\nfunc CallCodeSim(reader acmstate.Reader, blockchain bcm.BlockchainInfo, fromAddress, address crypto.Address, code, data []byte,\n\tlogger *logging.Logger) (*exec.TxExecution, error)\n```\nRun the given code on an isolated and unpersisted state Cannot be used to create new contracts.\n\n```go\nfunc CallSim(reader acmstate.Reader, blockchain bcm.BlockchainInfo, fromAddress, address crypto.Address, data []byte,\n\tlogger *logging.Logger) (*exec.TxExecution, error)\n```\nRun a contract's code on an isolated and unpersisted state Cannot be used to create new contracts\n\n```go\nfunc HeightAtVersion(version int64) uint64\n```\n\n```go\nfunc VMOptions(vmOptions engine.Options) func(*executor)\n```\n\n```go\nfunc VersionAtHeight(height uint64) int64\n```\n\n## Types\n\n```go\ntype Accounts struct {\n\tburrow_sync.RingMutex\n\tacmstate.Reader\n\t// contains filtered or unexported fields\n}\n```\nAccounts pairs an underlying state.Reader with a KeyClient to provide a signing variant of an account it also maintains a lock over addresses to provide a linearisation of signing events using SequentialSigningAccount\n\n```go\nfunc NewAccounts(reader acmstate.Reader, keyClient keys.KeyClient, mutexCount int) *Accounts\n```\n\n```go\nfunc (accs *Accounts) SequentialSigningAccount(address crypto.Address) (*SequentialSigningAccount, error)\n```\n\n```go\nfunc (accs *Accounts) SigningAccount(address crypto.Address) (*SigningAccount, error)\n```\n\n```go\ntype BatchCommitter interface {\n\tBatchExecutor\n\t// Commit execution results to underlying State and provide opportunity to mutate state before it is saved\n\tCommit(header *types.Header) (stateHash []byte, err error)\n}\n```\nExecutes transactions\n\n```go\nfunc NewBatchCommitter(backend ExecutorState, params Params, blockchain engine.Blockchain, emitter *event.Emitter,\n\tlogger *logging.Logger, options ...Option) (BatchCommitter, error)\n```\n\n```go\ntype BatchExecutor interface {\n\t// Provides access to write lock for a BatchExecutor so reads can be prevented for the duration of a commit\n\tsync.Locker\n\t// Used by execution.Accounts to implement memory pool signing\n\tacmstate.Reader\n\t// Execute transaction against block cache (i.e. block buffer)\n\tExecutor\n\t// Reset executor to underlying State\n\tReset() error\n}\n```\n\n```go\nfunc NewBatchChecker(backend ExecutorState, params Params, blockchain engine.Blockchain, logger *logging.Logger,\n\toptions ...Option) (BatchExecutor, error)\n```\nWraps a cache of what is variously known as the 'check cache' and 'mempool'\n\n```go\ntype ExecutionConfig struct {\n\t// This parameter scales the default Tendermint timeouts. A value of 1 gives the Tendermint defaults designed to\n\t// work for 100 node + public network. Smaller networks should be able to sustain lower values.\n\t// When running in no-consensus mode (Tendermint.Enabled = false) this scales the block duration with 1.0 meaning 1 second\n\t// and 0 meaning commit immediately\n\tTimeoutFactor            float64\n\tCallStackMaxDepth        uint64\n\tDataStackInitialCapacity uint64\n\tDataStackMaxDepth        uint64\n\tVMOptions                []VMOption `json:\",omitempty\" toml:\",omitempty\"`\n}\n```\n\n```go\nfunc DefaultExecutionConfig() *ExecutionConfig\n```\n\n```go\nfunc (ec *ExecutionConfig) ExecutionOptions() ([]Option, error)\n```\n\n```go\ntype Executor interface {\n\tExecute(txEnv *txs.Envelope) (*exec.TxExecution, error)\n}\n```\n\n```go\ntype ExecutorFunc func(txEnv *txs.Envelope) (*exec.TxExecution, error)\n```\n\n```go\nfunc (f ExecutorFunc) Execute(txEnv *txs.Envelope) (*exec.TxExecution, error)\n```\n\n```go\ntype ExecutorState interface {\n\tUpdate(updater func(ws state.Updatable) error) (hash []byte, version int64, err error)\n\tLastStoredHeight() (uint64, error)\n\tacmstate.IterableReader\n\tacmstate.MetadataReader\n\tnames.Reader\n\tregistry.Reader\n\tproposal.Reader\n\tvalidator.IterableReader\n}\n```\n\n```go\ntype Option func(*executor)\n```\n\n```go\ntype Params struct {\n\tChainID           string\n\tProposalThreshold uint64\n}\n```\n\n```go\nfunc ParamsFromGenesis(genesisDoc *genesis.GenesisDoc) Params\n```\n\n```go\ntype SequentialSigningAccount struct {\n\tAddress crypto.Address\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (ssa *SequentialSigningAccount) Lock() (*SigningAccount, UnlockFunc, error)\n```\n\n```go\ntype SigningAccount struct {\n\t*acm.Account\n\tcrypto.Signer\n}\n```\n\n```go\ntype Transactor struct {\n\tBlockchainInfo  bcm.BlockchainInfo\n\tEmitter         *event.Emitter\n\tMempoolAccounts *Accounts\n\t// contains filtered or unexported fields\n}\n```\nTransactor is responsible for helping to formulate, sign, and broadcast transactions to tendermint\n\nThe BroadcastTx\\* methods are able to work against the mempool Accounts (pending) state rather than the committed (final) Accounts state and can assign a sequence number based on all of the txs seen since the last block - provided these transactions are successfully committed (via DeliverTx) then subsequent transactions will have valid sequence numbers. This allows Burrow to coordinate sequencing and signing for a key it holds or is provided - it is down to the key-holder to manage the mutual information between transactions concurrent within a new block window.\n\n```go\nfunc NewTransactor(tip bcm.BlockchainInfo, emitter *event.Emitter, mempoolAccounts *Accounts,\n\tcheckTxAsync txChecker, id p2p.ID, txEncoder txs.Encoder, logger *logging.Logger) *Transactor\n```\n\n```go\nfunc (trans *Transactor) BroadcastTxAsync(ctx context.Context, txEnv *txs.Envelope) (*txs.Receipt, error)\n```\nBroadcast a transaction without waiting for confirmation - will attempt to sign server-side and set sequence numbers if no signatures are provided\n\n```go\nfunc (trans *Transactor) BroadcastTxSync(ctx context.Context, txEnv *txs.Envelope) (*exec.TxExecution, error)\n```\n\n```go\nfunc (trans *Transactor) CheckTxAsync(txEnv *txs.Envelope, callback func(res *abciTypes.Response)) error\n```\n\n```go\nfunc (trans *Transactor) CheckTxAsyncRaw(txBytes []byte, callback func(res *abciTypes.Response)) error\n```\n\n```go\nfunc (trans *Transactor) CheckTxSync(ctx context.Context, txEnv *txs.Envelope) (*txs.Receipt, error)\n```\nBroadcast a transaction and waits for a response from the mempool. Transactions to BroadcastTx will block during various mempool operations (managed by Tendermint) including mempool Reap, Commit, and recheckTx.\n\n```go\nfunc (trans *Transactor) CheckTxSyncRaw(ctx context.Context, txBytes []byte) (*txs.Receipt, error)\n```\n\n```go\nfunc (trans *Transactor) MaybeSignTxMempool(txEnv *txs.Envelope) (UnlockFunc, error)\n```\n\n```go\nfunc (trans *Transactor) SignTx(txEnv *txs.Envelope) (*txs.Envelope, error)\n```\n\n```go\nfunc (trans *Transactor) SignTxMempool(txEnv *txs.Envelope) (*txs.Envelope, UnlockFunc, error)\n```\n\n```go\ntype UnlockFunc func()\n```\n\n```go\ntype VMOption string\n```\n\n```go\nconst (\n\tDebugOpcodes VMOption = \"DebugOpcodes\"\n\tDumpTokens   VMOption = \"DumpTokens\"\n)\n```\n\n","path":"github.com/hyperledger/burrow/execution","name":"execution","synopsis":"","isRedistributable":true}
