Documentation ¶
Index ¶
- func ReadSnapshot(file ioutil2.SectionReader) (*snapshotHeader, int64, error)
- func UpdateAccount[T protocol.Account](batch *Batch, url *url.URL, fn func(T) error) (T, error)
- type Account
- func (r *Account) AddPending(txid *url.TxID) error
- func (r *Account) AddSyntheticForAnchor(anchor [32]byte, txid *url.TxID) error
- func (c *Account) AnchorChain(partition string) *AccountAnchorChain
- func (c *Account) AnchorSequenceChain() *Chain2
- func (a *Account) BptReceipt() (*managed.Receipt, error)
- func (a *Account) ChainByName(name string) (*Chain2, error)
- func (c *Account) Chains() *record.Set[*protocol.ChainMetadata]
- func (a *Account) Commit() error
- func (c *Account) Data() *AccountData
- func (c *Account) Directory() *record.Set[*url.URL]
- func (a *Account) GetChainByName(name string) (*Chain, error)
- func (a *Account) GetIndexChainByName(name string) (*Chain, error)
- func (r *Account) GetPending() (*protocol.TxIdSet, error)
- func (r *Account) GetState() (protocol.Account, error)
- func (r *Account) GetStateAs(state interface{}) error
- func (r *Account) GetSyntheticForAnchor(anchor [32]byte) ([]*url.TxID, error)
- func (c *Account) IsDirty() bool
- func (c *Account) Main() *record.Value[protocol.Account]
- func (c *Account) MainChain() *Chain2
- func (c *Account) MajorBlockChain() *Chain2
- func (c *Account) Pending() *record.Set[*url.TxID]
- func (r *Account) PutState(state protocol.Account) error
- func (r *Account) RemovePending(txid *url.TxID) error
- func (c *Account) Resolve(key record.Key) (record.Record, record.Key, error)
- func (c *Account) RootChain() *Chain2
- func (c *Account) ScratchChain() *Chain2
- func (c *Account) SignatureChain() *Chain2
- func (a *Account) StateReceipt() (*managed.Receipt, error)
- func (c *Account) SyntheticAnchors() *record.Set[[32]byte]
- func (c *Account) SyntheticForAnchor(anchor [32]byte) *record.Set[*url.TxID]
- func (c *Account) SyntheticSequenceChain(partition string) *Chain2
- type AccountAnchorChain
- type AccountData
- type Batch
- func (c *Batch) Account(url *url.URL) *Account
- func (b *Batch) AccountByID(id []byte) (*Account, error)deprecated
- func (b *Batch) Begin(writable bool) *Batch
- func (c *Batch) BlockChainUpdates(partition *url.URL, index uint64) *record.List[*ChainUpdate]
- func (c *Batch) BlockState(partition *url.URL) *record.Set[*BlockStateSynthTxnEntry]
- func (b *Batch) BptReceipt(key storage.Key, value [32]byte) (*managed.Receipt, error)
- func (b *Batch) BptRoot() []byte
- func (b *Batch) Commit() error
- func (b *Batch) DeleteAccountState_TESTONLY(url *url.URL) error
- func (b *Batch) Discard()
- func (b *Batch) GetMinorRootChainAnchor(describe *config.Describe) ([]byte, error)
- func (b *Batch) GetValue(key record.Key, value record.ValueWriter) error
- func (b *Batch) Import(db interface{ ... }) error
- func (c *Batch) IsDirty() bool
- func (b *Batch) PutValue(key record.Key, value record.ValueReader) error
- func (c *Batch) Resolve(key record.Key) (record.Record, record.Key, error)
- func (b *Batch) RestoreSnapshot(file ioutil2.SectionReader) error
- func (b *Batch) SaveSnapshot(file io.WriteSeeker, network *config.Describe) error
- func (b *Batch) Transaction(id []byte) *Transaction
- func (b *Batch) Update(fn func(batch *Batch) error) error
- func (b *Batch) View(fn func(batch *Batch) error) error
- type BlockStateSynthTxnEntry
- func (e *BlockStateSynthTxnEntry) Compare(f *BlockStateSynthTxnEntry) int
- func (v *BlockStateSynthTxnEntry) Copy() *BlockStateSynthTxnEntry
- func (v *BlockStateSynthTxnEntry) CopyAsInterface() interface{}
- func (v *BlockStateSynthTxnEntry) Equal(u *BlockStateSynthTxnEntry) bool
- func (v *BlockStateSynthTxnEntry) IsValid() error
- func (v *BlockStateSynthTxnEntry) MarshalBinary() ([]byte, error)
- func (v *BlockStateSynthTxnEntry) MarshalJSON() ([]byte, error)
- func (v *BlockStateSynthTxnEntry) UnmarshalBinary(data []byte) error
- func (v *BlockStateSynthTxnEntry) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *BlockStateSynthTxnEntry) UnmarshalJSON(data []byte) error
- type Chain
- func (c *Chain) AddEntry(entry []byte, unique bool) error
- func (c *Chain) Anchor() []byte
- func (c *Chain) AnchorAt(height uint64) ([]byte, error)
- func (c *Chain) CurrentState() *managed.MerkleState
- func (c *Chain) Entries(start int64, end int64) ([][]byte, error)
- func (c *Chain) Entry(height int64) ([]byte, error)
- func (c *Chain) EntryAs(height int64, value encoding.BinaryUnmarshaler) error
- func (c *Chain) Height() int64
- func (c *Chain) HeightOf(hash []byte) (int64, error)
- func (c *Chain) Pending() []managed.Hash
- func (c *Chain) Receipt(from, to int64) (*managed.Receipt, error)
- func (c *Chain) State(height int64) (*managed.MerkleState, error)
- type Chain2
- func (c *Chain2) Account() *url.URL
- func (c *Chain2) Commit() error
- func (c *Chain2) Get() (*Chain, error)
- func (c *Chain2) Index() *Chain2
- func (c *Chain2) IsDirty() bool
- func (c *Chain2) Key(i int) interface{}
- func (c *Chain2) Name() string
- func (c *Chain2) Resolve(key record.Key) (record.Record, record.Key, error)
- func (c *Chain2) Type() managed.ChainType
- func (c *Chain2) Url() *url.URL
- type ChainUpdate
- func (u *ChainUpdate) Compare(v *ChainUpdate) int
- func (v *ChainUpdate) Copy() *ChainUpdate
- func (v *ChainUpdate) CopyAsInterface() interface{}
- func (v *ChainUpdate) Equal(u *ChainUpdate) bool
- func (v *ChainUpdate) IsValid() error
- func (v *ChainUpdate) MarshalBinary() ([]byte, error)
- func (v *ChainUpdate) MarshalJSON() ([]byte, error)
- func (v *ChainUpdate) UnmarshalBinary(data []byte) error
- func (v *ChainUpdate) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *ChainUpdate) UnmarshalJSON(data []byte) error
- type Database
- func New(store storage.KeyValueStore, logger log.Logger) *Database
- func Open(cfg *config.Config, logger log.Logger) (*Database, error)
- func OpenBadger(filepath string, logger log.Logger) (*Database, error)
- func OpenEtcd(prefix string, config *clientv3.Config, logger log.Logger) (*Database, error)
- func OpenInMemory(logger log.Logger) *Database
- type SigOrTxn
- func (v *SigOrTxn) Copy() *SigOrTxn
- func (v *SigOrTxn) CopyAsInterface() interface{}
- func (v *SigOrTxn) Equal(u *SigOrTxn) bool
- func (v *SigOrTxn) IsValid() error
- func (v *SigOrTxn) MarshalBinary() ([]byte, error)
- func (v *SigOrTxn) MarshalJSON() ([]byte, error)
- func (v *SigOrTxn) UnmarshalBinary(data []byte) error
- func (v *SigOrTxn) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *SigOrTxn) UnmarshalJSON(data []byte) error
- type SigSetEntry
- func (s *SigSetEntry) Compare(t *SigSetEntry) int
- func (v *SigSetEntry) Copy() *SigSetEntry
- func (v *SigSetEntry) CopyAsInterface() interface{}
- func (v *SigSetEntry) Equal(u *SigSetEntry) bool
- func (v *SigSetEntry) IsValid() error
- func (v *SigSetEntry) MarshalBinary() ([]byte, error)
- func (v *SigSetEntry) MarshalJSON() ([]byte, error)
- func (v *SigSetEntry) UnmarshalBinary(data []byte) error
- func (v *SigSetEntry) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *SigSetEntry) UnmarshalJSON(data []byte) error
- type SignatureSet
- type Transaction
- func (t *Transaction) AddSignature(keyEntryIndex uint64, newSignature protocol.Signature) (int, error)
- func (t *Transaction) AddSyntheticTxns(txids ...*url.TxID) error
- func (t *Transaction) AddSystemSignature(net *config.Describe, newSignature protocol.Signature) (int, error)
- func (c *Transaction) Chains() *record.Set[*TransactionChainEntry]
- func (c *Transaction) Commit() error
- func (t *Transaction) GetState() (*SigOrTxn, error)
- func (t *Transaction) GetStatus() (*protocol.TransactionStatus, error)
- func (t *Transaction) GetSyntheticTxns() (*protocol.TxIdSet, error)
- func (c *Transaction) IsDirty() bool
- func (c *Transaction) Main() *record.Value[*SigOrTxn]
- func (c *Transaction) Produced() *record.Set[*url.TxID]
- func (t *Transaction) PutState(v *SigOrTxn) error
- func (t *Transaction) PutStatus(v *protocol.TransactionStatus) error
- func (t *Transaction) PutSyntheticTxns(v *protocol.TxIdSet) error
- func (t *Transaction) ReadSignatures(signer *url.URL) (*SignatureSet, error)
- func (t *Transaction) ReadSignaturesForSigner(signer protocol.Signer) (*SignatureSet, error)
- func (c *Transaction) Resolve(key record.Key) (record.Record, record.Key, error)
- func (t *Transaction) Signatures(signer *url.URL) (*SignatureSet, error)
- func (t *Transaction) SignaturesForSigner(signer protocol.Signer) (*SignatureSet, error)
- func (c *Transaction) Status() *record.Value[*protocol.TransactionStatus]
- type TransactionChainEntry
- func (e *TransactionChainEntry) Compare(f *TransactionChainEntry) int
- func (v *TransactionChainEntry) Copy() *TransactionChainEntry
- func (v *TransactionChainEntry) CopyAsInterface() interface{}
- func (v *TransactionChainEntry) Equal(u *TransactionChainEntry) bool
- func (v *TransactionChainEntry) IsValid() error
- func (v *TransactionChainEntry) MarshalBinary() ([]byte, error)
- func (v *TransactionChainEntry) UnmarshalBinary(data []byte) error
- func (v *TransactionChainEntry) UnmarshalBinaryFrom(rd io.Reader) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadSnapshot ¶
func ReadSnapshot(file ioutil2.SectionReader) (*snapshotHeader, int64, error)
ReadSnapshot reads a snapshot file, returning the header values and a reader.
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func (*Account) AddSyntheticForAnchor ¶ added in v0.6.0
func (*Account) AnchorChain ¶ added in v1.0.0
func (c *Account) AnchorChain(partition string) *AccountAnchorChain
func (*Account) AnchorSequenceChain ¶ added in v1.0.0
func (*Account) BptReceipt ¶ added in v1.0.0
BptReceipt builds a BPT receipt for the account.
func (*Account) ChainByName ¶ added in v1.0.0
ChainByName returns account Chain2 for the named chain, or a not found error if there is no such chain.
func (*Account) Chains ¶ added in v1.0.0
func (c *Account) Chains() *record.Set[*protocol.ChainMetadata]
func (*Account) Data ¶
func (c *Account) Data() *AccountData
func (*Account) GetChainByName ¶ added in v1.0.0
GetChainByName calls ChainByName and Get.
func (*Account) GetIndexChainByName ¶ added in v1.0.0
GetChainByName calls ChainByName, Index, and Get.
func (*Account) GetPending ¶ added in v1.0.0
func (*Account) GetStateAs ¶
GetStateAs loads the record state and unmarshals into the given value. In most cases `state` should be a double pointer.
func (*Account) GetSyntheticForAnchor ¶ added in v1.0.0
func (*Account) MajorBlockChain ¶ added in v1.0.0
func (*Account) RemovePending ¶ added in v1.0.0
func (*Account) ScratchChain ¶ added in v1.0.0
func (*Account) SignatureChain ¶ added in v1.0.0
func (*Account) StateReceipt ¶ added in v0.5.1
StateReceipt returns a Merkle receipt for the account state in the BPT.
func (*Account) SyntheticAnchors ¶ added in v1.0.0
func (*Account) SyntheticForAnchor ¶ added in v0.6.0
func (*Account) SyntheticSequenceChain ¶ added in v1.0.0
type AccountAnchorChain ¶ added in v1.0.0
type AccountAnchorChain struct {
// contains filtered or unexported fields
}
func (*AccountAnchorChain) BPT ¶ added in v1.0.0
func (c *AccountAnchorChain) BPT() *Chain2
func (*AccountAnchorChain) Commit ¶ added in v1.0.0
func (c *AccountAnchorChain) Commit() error
func (*AccountAnchorChain) IsDirty ¶ added in v1.0.0
func (c *AccountAnchorChain) IsDirty() bool
func (*AccountAnchorChain) Root ¶ added in v1.0.0
func (c *AccountAnchorChain) Root() *Chain2
type AccountData ¶ added in v1.0.0
type AccountData struct {
// contains filtered or unexported fields
}
func (*AccountData) Commit ¶ added in v1.0.0
func (c *AccountData) Commit() error
func (*AccountData) IsDirty ¶ added in v1.0.0
func (c *AccountData) IsDirty() bool
func (*AccountData) Transaction ¶ added in v1.0.0
func (c *AccountData) Transaction(entryHash [32]byte) *record.Value[[32]byte]
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
func (*Batch) AccountByID
deprecated
func (*Batch) BlockChainUpdates ¶
func (*Batch) BlockState ¶
func (*Batch) BptReceipt ¶ added in v0.5.1
BptReceipt builds a BPT receipt for the given key.
func (*Batch) BptRoot ¶ added in v1.0.0
BptRoot returns the root of the BPT. BptRoot panics if there are any uncommitted BPT changes.
func (*Batch) Commit ¶
Commit commits pending writes to the key-value store or the parent batch. Attempting to use the Batch after calling Commit or Discard will result in a panic.
func (*Batch) DeleteAccountState_TESTONLY ¶ added in v1.0.0
DeleteAccountState_TESTONLY is intended for testing purposes only. It deletes an account from the database.
func (*Batch) Discard ¶
func (b *Batch) Discard()
Discard discards pending writes. Attempting to use the Batch after calling Discard will result in a panic.
func (*Batch) GetMinorRootChainAnchor ¶ added in v0.5.1
func (*Batch) RestoreSnapshot ¶
func (b *Batch) RestoreSnapshot(file ioutil2.SectionReader) error
RestoreSnapshot loads the full state of the partition from a file.
func (*Batch) SaveSnapshot ¶
SaveSnapshot writes the full state of the partition out to a file.
func (*Batch) Transaction ¶
func (b *Batch) Transaction(id []byte) *Transaction
Transaction returns an Transaction for the given hash.
type BlockStateSynthTxnEntry ¶ added in v1.0.0
type BlockStateSynthTxnEntry struct { Transaction []byte `json:"transaction,omitempty" form:"transaction" query:"transaction" validate:"required"` ChainEntry uint64 `json:"chainEntry,omitempty" form:"chainEntry" query:"chainEntry" validate:"required"` // contains filtered or unexported fields }
func (*BlockStateSynthTxnEntry) Compare ¶ added in v1.0.0
func (e *BlockStateSynthTxnEntry) Compare(f *BlockStateSynthTxnEntry) int
func (*BlockStateSynthTxnEntry) Copy ¶ added in v1.0.0
func (v *BlockStateSynthTxnEntry) Copy() *BlockStateSynthTxnEntry
func (*BlockStateSynthTxnEntry) CopyAsInterface ¶ added in v1.0.0
func (v *BlockStateSynthTxnEntry) CopyAsInterface() interface{}
func (*BlockStateSynthTxnEntry) Equal ¶ added in v1.0.0
func (v *BlockStateSynthTxnEntry) Equal(u *BlockStateSynthTxnEntry) bool
func (*BlockStateSynthTxnEntry) IsValid ¶ added in v1.0.0
func (v *BlockStateSynthTxnEntry) IsValid() error
func (*BlockStateSynthTxnEntry) MarshalBinary ¶ added in v1.0.0
func (v *BlockStateSynthTxnEntry) MarshalBinary() ([]byte, error)
func (*BlockStateSynthTxnEntry) MarshalJSON ¶ added in v1.0.0
func (v *BlockStateSynthTxnEntry) MarshalJSON() ([]byte, error)
func (*BlockStateSynthTxnEntry) UnmarshalBinary ¶ added in v1.0.0
func (v *BlockStateSynthTxnEntry) UnmarshalBinary(data []byte) error
func (*BlockStateSynthTxnEntry) UnmarshalBinaryFrom ¶ added in v1.0.0
func (v *BlockStateSynthTxnEntry) UnmarshalBinaryFrom(rd io.Reader) error
func (*BlockStateSynthTxnEntry) UnmarshalJSON ¶ added in v1.0.0
func (v *BlockStateSynthTxnEntry) UnmarshalJSON(data []byte) error
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
Chain manages a Merkle tree (chain).
func (*Chain) AnchorAt ¶ added in v0.5.1
AnchorAt calculates the anchor of the chain at the given height.
func (*Chain) CurrentState ¶ added in v0.5.1
func (c *Chain) CurrentState() *managed.MerkleState
CurrentState returns the current state of the chain.
func (*Chain) EntryAs ¶ added in v0.5.1
func (c *Chain) EntryAs(height int64, value encoding.BinaryUnmarshaler) error
EntryAs loads and unmarshals the entry in the chain at the given height.
type Chain2 ¶ added in v1.0.0
type Chain2 struct {
// contains filtered or unexported fields
}
Chain2 is a wrapper for managed.Chain.
func (*Chain2) Get ¶ added in v1.0.0
Get converts the Chain2 to a Chain, updating the account's chains index and loading the chain head.
func (*Chain2) Index ¶ added in v1.0.0
Index returns the index chain of this chain. Index will panic if called on an index chain.
type ChainUpdate ¶
type ChainUpdate struct { Account *url.URL `json:"account,omitempty" form:"account" query:"account" validate:"required"` Name string `json:"name,omitempty" form:"name" query:"name" validate:"required"` Type protocol.ChainType `json:"type,omitempty" form:"type" query:"type" validate:"required"` Index uint64 `json:"index,omitempty" form:"index" query:"index" validate:"required"` SourceIndex uint64 `json:"sourceIndex,omitempty" form:"sourceIndex" query:"sourceIndex" validate:"required"` SourceBlock uint64 `json:"sourceBlock,omitempty" form:"sourceBlock" query:"sourceBlock" validate:"required"` Entry []byte `json:"entry,omitempty" form:"entry" query:"entry" validate:"required"` // contains filtered or unexported fields }
func (*ChainUpdate) Compare ¶
func (u *ChainUpdate) Compare(v *ChainUpdate) int
func (*ChainUpdate) Copy ¶
func (v *ChainUpdate) Copy() *ChainUpdate
func (*ChainUpdate) CopyAsInterface ¶
func (v *ChainUpdate) CopyAsInterface() interface{}
func (*ChainUpdate) Equal ¶
func (v *ChainUpdate) Equal(u *ChainUpdate) bool
func (*ChainUpdate) IsValid ¶
func (v *ChainUpdate) IsValid() error
func (*ChainUpdate) MarshalBinary ¶
func (v *ChainUpdate) MarshalBinary() ([]byte, error)
func (*ChainUpdate) MarshalJSON ¶
func (v *ChainUpdate) MarshalJSON() ([]byte, error)
func (*ChainUpdate) UnmarshalBinary ¶
func (v *ChainUpdate) UnmarshalBinary(data []byte) error
func (*ChainUpdate) UnmarshalBinaryFrom ¶
func (v *ChainUpdate) UnmarshalBinaryFrom(rd io.Reader) error
func (*ChainUpdate) UnmarshalJSON ¶
func (v *ChainUpdate) UnmarshalJSON(data []byte) error
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database is an Accumulate database.
func New ¶
func New(store storage.KeyValueStore, logger log.Logger) *Database
New creates a new database using the given key-value store.
func OpenBadger ¶ added in v0.5.1
func OpenInMemory ¶ added in v0.5.1
type SigOrTxn ¶ added in v0.6.0
type SigOrTxn struct { Transaction *protocol.Transaction `json:"transaction,omitempty" form:"transaction" query:"transaction" validate:"required"` Signature protocol.Signature `json:"signature,omitempty" form:"signature" query:"signature" validate:"required"` Txid *url.TxID `json:"txid,omitempty" form:"txid" query:"txid" validate:"required"` // contains filtered or unexported fields }
func (*SigOrTxn) CopyAsInterface ¶ added in v0.6.0
func (v *SigOrTxn) CopyAsInterface() interface{}
func (*SigOrTxn) MarshalBinary ¶ added in v0.6.0
func (*SigOrTxn) MarshalJSON ¶ added in v0.6.0
func (*SigOrTxn) UnmarshalBinary ¶ added in v0.6.0
func (*SigOrTxn) UnmarshalBinaryFrom ¶ added in v0.6.0
func (*SigOrTxn) UnmarshalJSON ¶ added in v0.6.0
type SigSetEntry ¶ added in v1.0.0
type SigSetEntry struct { System bool `json:"system,omitempty" form:"system" query:"system" validate:"required"` Type protocol.SignatureType `json:"type,omitempty" form:"type" query:"type" validate:"required"` KeyEntryIndex uint64 `json:"keyEntryIndex,omitempty" form:"keyEntryIndex" query:"keyEntryIndex" validate:"required"` SignatureHash [32]byte `json:"signatureHash,omitempty" form:"signatureHash" query:"signatureHash" validate:"required"` // contains filtered or unexported fields }
func (*SigSetEntry) Compare ¶ added in v1.0.0
func (s *SigSetEntry) Compare(t *SigSetEntry) int
func (*SigSetEntry) Copy ¶ added in v1.0.0
func (v *SigSetEntry) Copy() *SigSetEntry
func (*SigSetEntry) CopyAsInterface ¶ added in v1.0.0
func (v *SigSetEntry) CopyAsInterface() interface{}
func (*SigSetEntry) Equal ¶ added in v1.0.0
func (v *SigSetEntry) Equal(u *SigSetEntry) bool
func (*SigSetEntry) IsValid ¶ added in v1.0.0
func (v *SigSetEntry) IsValid() error
func (*SigSetEntry) MarshalBinary ¶ added in v1.0.0
func (v *SigSetEntry) MarshalBinary() ([]byte, error)
func (*SigSetEntry) MarshalJSON ¶ added in v1.0.0
func (v *SigSetEntry) MarshalJSON() ([]byte, error)
func (*SigSetEntry) UnmarshalBinary ¶ added in v1.0.0
func (v *SigSetEntry) UnmarshalBinary(data []byte) error
func (*SigSetEntry) UnmarshalBinaryFrom ¶ added in v1.0.0
func (v *SigSetEntry) UnmarshalBinaryFrom(rd io.Reader) error
func (*SigSetEntry) UnmarshalJSON ¶ added in v1.0.0
func (v *SigSetEntry) UnmarshalJSON(data []byte) error
type SignatureSet ¶ added in v0.5.1
type SignatureSet struct {
// contains filtered or unexported fields
}
func (*SignatureSet) Add ¶ added in v0.5.1
Add adds a signature to the signature set. Add does nothing if the signature set already includes the signer's public key. The entry hash must refer to a signature chain entry.
func (*SignatureSet) Count ¶ added in v0.5.1
func (s *SignatureSet) Count() int
func (*SignatureSet) Entries ¶ added in v1.0.0
func (s *SignatureSet) Entries() []SigSetEntry
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func (*Transaction) AddSignature ¶ added in v0.5.1
func (t *Transaction) AddSignature(keyEntryIndex uint64, newSignature protocol.Signature) (int, error)
AddSignature loads the appropriate siganture set and adds the signature to it.
func (*Transaction) AddSyntheticTxns ¶
func (t *Transaction) AddSyntheticTxns(txids ...*url.TxID) error
AddSyntheticTxns is a convenience method that calls GetSyntheticTxns, adds the IDs, and calls PutSyntheticTxns.
func (*Transaction) AddSystemSignature ¶ added in v1.0.0
func (t *Transaction) AddSystemSignature(net *config.Describe, newSignature protocol.Signature) (int, error)
AddSystemSignature adds a system signature to the operator signature set. AddSystemSignature panics if the signature is not a system signature.
func (*Transaction) Chains ¶ added in v1.0.0
func (c *Transaction) Chains() *record.Set[*TransactionChainEntry]
func (*Transaction) Commit ¶ added in v1.0.0
func (c *Transaction) Commit() error
func (*Transaction) GetState ¶
func (t *Transaction) GetState() (*SigOrTxn, error)
GetState loads the transaction state.
func (*Transaction) GetStatus ¶
func (t *Transaction) GetStatus() (*protocol.TransactionStatus, error)
GetStatus loads the transaction status.
func (*Transaction) GetSyntheticTxns ¶
func (t *Transaction) GetSyntheticTxns() (*protocol.TxIdSet, error)
GetSyntheticTxns loads the IDs of synthetic transactions produced by the transaction.
func (*Transaction) IsDirty ¶ added in v1.0.0
func (c *Transaction) IsDirty() bool
func (*Transaction) Produced ¶ added in v1.0.0
func (c *Transaction) Produced() *record.Set[*url.TxID]
func (*Transaction) PutState ¶
func (t *Transaction) PutState(v *SigOrTxn) error
PutState stores the transaction state.
func (*Transaction) PutStatus ¶
func (t *Transaction) PutStatus(v *protocol.TransactionStatus) error
PutStatus stores the transaction status.
func (*Transaction) PutSyntheticTxns ¶ added in v0.5.1
func (t *Transaction) PutSyntheticTxns(v *protocol.TxIdSet) error
PutSyntheticTxns stores the IDs of synthetic transactions produced by the transaction.
func (*Transaction) ReadSignatures ¶ added in v0.5.1
func (t *Transaction) ReadSignatures(signer *url.URL) (*SignatureSet, error)
ReadSignatures returns a read-only signature set for the given signer.
func (*Transaction) ReadSignaturesForSigner ¶ added in v0.6.0
func (t *Transaction) ReadSignaturesForSigner(signer protocol.Signer) (*SignatureSet, error)
SignaturesForSigner returns a read-only signature set for the given signer account.
func (*Transaction) Signatures ¶ added in v0.5.1
func (t *Transaction) Signatures(signer *url.URL) (*SignatureSet, error)
Signatures returns a signature set for the given signer.
func (*Transaction) SignaturesForSigner ¶ added in v0.6.0
func (t *Transaction) SignaturesForSigner(signer protocol.Signer) (*SignatureSet, error)
SignaturesForSigner returns a signature set for the given signer account.
func (*Transaction) Status ¶ added in v1.0.0
func (c *Transaction) Status() *record.Value[*protocol.TransactionStatus]
type TransactionChainEntry ¶ added in v1.0.0
type TransactionChainEntry struct { Account *url.URL `json:"account,omitempty" form:"account" query:"account" validate:"required"` // Chain is the name of the chain. Chain string `json:"chain,omitempty" form:"chain" query:"chain" validate:"required"` // ChainIndex is the index of the entry in the chain's index chain. ChainIndex uint64 `json:"chainIndex,omitempty" form:"chainIndex" query:"chainIndex" validate:"required"` // AnchorIndex is the index of the entry in the anchor chain's index chain. AnchorIndex uint64 `json:"anchorIndex,omitempty" form:"anchorIndex" query:"anchorIndex" validate:"required"` // contains filtered or unexported fields }
func (*TransactionChainEntry) Compare ¶ added in v1.0.0
func (e *TransactionChainEntry) Compare(f *TransactionChainEntry) int
func (*TransactionChainEntry) Copy ¶ added in v1.0.0
func (v *TransactionChainEntry) Copy() *TransactionChainEntry
func (*TransactionChainEntry) CopyAsInterface ¶ added in v1.0.0
func (v *TransactionChainEntry) CopyAsInterface() interface{}
func (*TransactionChainEntry) Equal ¶ added in v1.0.0
func (v *TransactionChainEntry) Equal(u *TransactionChainEntry) bool
func (*TransactionChainEntry) IsValid ¶ added in v1.0.0
func (v *TransactionChainEntry) IsValid() error
func (*TransactionChainEntry) MarshalBinary ¶ added in v1.0.0
func (v *TransactionChainEntry) MarshalBinary() ([]byte, error)
func (*TransactionChainEntry) UnmarshalBinary ¶ added in v1.0.0
func (v *TransactionChainEntry) UnmarshalBinary(data []byte) error
func (*TransactionChainEntry) UnmarshalBinaryFrom ¶ added in v1.0.0
func (v *TransactionChainEntry) UnmarshalBinaryFrom(rd io.Reader) error