Documentation ¶
Index ¶
- Constants
- func VMOptions(vmOptions ...func(*evm.VM)) func(*executor)
- type Accounts
- func (accs *Accounts) GetSequentialSigningAccount(address, privateKey []byte) (*SequentialSigningAccount, error)
- func (accs *Accounts) SequentialSigningAccount(address crypto.Address) (*SequentialSigningAccount, error)
- func (accs *Accounts) SequentialSigningAccountFromPrivateKey(privateKeyBytes []byte) (*SequentialSigningAccount, error)
- func (accs *Accounts) SigningAccount(address crypto.Address, signer crypto.Signer) (*SigningAccount, error)
- type BatchCommitter
- type BatchExecutor
- type Call
- type ExecutionConfig
- type ExecutionOption
- type Executor
- type ExecutorState
- type SequentialSigningAccount
- type SigningAccount
- type State
- func (s *State) Copy(db dbm.DB) (*State, error)
- func (s *State) GetAccount(address crypto.Address) (acm.Account, error)
- func (s *State) GetEvents(startKey, endKey events.Key, consumer func(ev *events.Event) (stop bool)) (stopped bool, err error)
- func (s *State) GetNameEntry(name string) (*names.Entry, error)
- func (s *State) GetStorage(address crypto.Address, key binary.Word256) (binary.Word256, error)
- func (s *State) Hash() []byte
- func (s *State) IterateAccounts(consumer func(acm.Account) (stop bool)) (stopped bool, err error)
- func (s *State) IterateNameEntries(consumer func(*names.Entry) (stop bool)) (stopped bool, err error)
- func (s *State) IterateStorage(address crypto.Address, consumer func(key, value binary.Word256) (stop bool)) (stopped bool, err error)
- func (s *State) LatestEventKey() events.Key
- func (s *State) Update(updater func(up Updatable) error) ([]byte, error)
- type Transactor
- func (trans *Transactor) BroadcastTx(txEnv *txs.Envelope) (*txs.Receipt, error)
- func (trans *Transactor) BroadcastTxAsync(txEnv *txs.Envelope, callback func(res *abciTypes.Response)) error
- func (trans *Transactor) BroadcastTxAsyncRaw(txBytes []byte, callback func(res *abciTypes.Response)) error
- func (trans *Transactor) BroadcastTxRaw(txBytes []byte) (*txs.Receipt, error)
- func (trans *Transactor) Call(reader state.Reader, fromAddress, address crypto.Address, data []byte) (call *Call, err error)
- func (trans *Transactor) CallCode(reader state.Reader, fromAddress crypto.Address, code, data []byte) (*Call, error)
- func (trans *Transactor) Send(sequentialSigningAccount *SequentialSigningAccount, toAddress crypto.Address, ...) (*txs.Receipt, error)
- func (trans *Transactor) SendAndHold(ctx context.Context, sequentialSigningAccount *SequentialSigningAccount, ...) (*txs.Receipt, error)
- func (trans *Transactor) SignTx(txEnv *txs.Envelope, signingAccounts []acm.AddressableSigner) (*txs.Envelope, error)
- func (trans *Transactor) Transact(sequentialSigningAccount *SequentialSigningAccount, address *crypto.Address, ...) (*txs.Receipt, error)
- func (trans *Transactor) TransactAndHold(ctx context.Context, sequentialSigningAccount *SequentialSigningAccount, ...) (*events.EventDataCall, error)
- func (trans *Transactor) TransactNameReg(sequentialSigningAccount *SequentialSigningAccount, name, data string, ...) (*txs.Receipt, error)
- type UnlockFunc
- type Updatable
- type VMOption
Constants ¶
const BlockingTimeoutSeconds = 30
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Accounts ¶
type Accounts struct { burrow_sync.RingMutex state.Reader // contains filtered or unexported fields }
Accounts 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
func NewAccounts ¶
func (*Accounts) GetSequentialSigningAccount ¶ added in v0.19.0
func (accs *Accounts) GetSequentialSigningAccount(address, privateKey []byte) (*SequentialSigningAccount, error)
Gets signing account from onr of private key or address - failing if both are provided
func (*Accounts) SequentialSigningAccount ¶
func (accs *Accounts) SequentialSigningAccount(address crypto.Address) (*SequentialSigningAccount, error)
func (*Accounts) SequentialSigningAccountFromPrivateKey ¶
func (accs *Accounts) SequentialSigningAccountFromPrivateKey(privateKeyBytes []byte) (*SequentialSigningAccount, error)
func (*Accounts) SigningAccount ¶
type BatchCommitter ¶
type BatchCommitter interface { BatchExecutor // Commit execution results to underlying State and provide opportunity // to mutate state before it is saved Commit() (stateHash []byte, err error) }
Executes transactions
func NewBatchCommitter ¶
func NewBatchCommitter(backend ExecutorState, tip bcm.TipInfo, publisher event.Publisher, logger *logging.Logger, options ...ExecutionOption) BatchCommitter
type BatchExecutor ¶
type BatchExecutor interface { // Provides access to write lock for a BatchExecutor so reads can be prevented for the duration of a commit sync.Locker state.Reader // Execute transaction against block cache (i.e. block buffer) Executor // Reset executor to underlying State Reset() error }
func NewBatchChecker ¶
func NewBatchChecker(backend ExecutorState, tip bcm.TipInfo, logger *logging.Logger, options ...ExecutionOption) BatchExecutor
Wraps a cache of what is variously known as the 'check cache' and 'mempool'
type ExecutionConfig ¶
type ExecutionConfig struct {
VMOptions []VMOption `json:",omitempty" toml:",omitempty"`
}
func DefaultExecutionConfig ¶
func DefaultExecutionConfig() *ExecutionConfig
func (*ExecutionConfig) ExecutionOptions ¶
func (ec *ExecutionConfig) ExecutionOptions() ([]ExecutionOption, error)
type ExecutionOption ¶
type ExecutionOption func(*executor)
type ExecutorState ¶ added in v0.19.0
type SequentialSigningAccount ¶
type SequentialSigningAccount struct {
// contains filtered or unexported fields
}
func (*SequentialSigningAccount) Lock ¶
func (ssa *SequentialSigningAccount) Lock() (*SigningAccount, UnlockFunc, error)
type State ¶
type State struct { // Values not reassigned sync.RWMutex // contains filtered or unexported fields }
Writers to state are responsible for calling State.Lock() before calling
func LoadState ¶
Tries to load the execution state from DB, returns nil with no error if no state found
func MakeGenesisState ¶
Make genesis state from GenesisDoc and save to DB
func (*State) GetAccount ¶
Returns nil if account does not exist with given address.
func (*State) GetNameEntry ¶ added in v0.19.0
func (*State) GetStorage ¶
func (*State) IterateAccounts ¶
func (*State) IterateNameEntries ¶ added in v0.19.0
func (*State) IterateStorage ¶
func (*State) LatestEventKey ¶ added in v0.19.0
type Transactor ¶
type Transactor struct {
// contains filtered or unexported fields
}
Transactor is the controller/middleware for the v0 RPC
func NewTransactor ¶
func (*Transactor) BroadcastTx ¶
Broadcast 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.
func (*Transactor) BroadcastTxAsync ¶
func (*Transactor) BroadcastTxAsyncRaw ¶ added in v0.19.0
func (trans *Transactor) BroadcastTxAsyncRaw(txBytes []byte, callback func(res *abciTypes.Response)) error
func (*Transactor) BroadcastTxRaw ¶ added in v0.19.0
func (trans *Transactor) BroadcastTxRaw(txBytes []byte) (*txs.Receipt, error)
func (*Transactor) Call ¶
func (trans *Transactor) Call(reader state.Reader, fromAddress, address crypto.Address, data []byte) (call *Call, err error)
Run a contract's code on an isolated and unpersisted state Cannot be used to create new contracts
func (*Transactor) CallCode ¶
func (trans *Transactor) CallCode(reader state.Reader, fromAddress crypto.Address, code, data []byte) (*Call, error)
Run the given code on an isolated and unpersisted state Cannot be used to create new contracts.
func (*Transactor) Send ¶
func (trans *Transactor) Send(sequentialSigningAccount *SequentialSigningAccount, toAddress crypto.Address, amount uint64) (*txs.Receipt, error)
func (*Transactor) SendAndHold ¶
func (trans *Transactor) SendAndHold(ctx context.Context, sequentialSigningAccount *SequentialSigningAccount, toAddress crypto.Address, amount uint64) (*txs.Receipt, error)
func (*Transactor) SignTx ¶
func (trans *Transactor) SignTx(txEnv *txs.Envelope, signingAccounts []acm.AddressableSigner) (*txs.Envelope, error)
Sign a transaction
func (*Transactor) Transact ¶
func (trans *Transactor) Transact(sequentialSigningAccount *SequentialSigningAccount, address *crypto.Address, data []byte, gasLimit, fee uint64) (*txs.Receipt, error)
Orders calls to BroadcastTx using lock (waits for response from core before releasing)
func (*Transactor) TransactAndHold ¶
func (trans *Transactor) TransactAndHold(ctx context.Context, sequentialSigningAccount *SequentialSigningAccount, address *crypto.Address, data []byte, gasLimit, fee uint64) (*events.EventDataCall, error)
func (*Transactor) TransactNameReg ¶
func (trans *Transactor) TransactNameReg(sequentialSigningAccount *SequentialSigningAccount, name, data string, amount, fee uint64) (*txs.Receipt, error)
type UnlockFunc ¶
type UnlockFunc func()