Documentation
¶
Overview ¶
Package types provides generalized types that are used across the transport interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct {
Header BatchHeader `json:"header"`
HeaderSignature string `json:"header_signature"`
Trace bool `json:"trace"`
Transactions []Transaction `json:"transactions"`
}
Batch represents a Sawtooth batch.
type BatchHeader ¶
type BatchHeader struct {
SignerPublicKey string `json:"signer_public_key"`
TransactionIds []string `json:"transaction_ids"`
}
BatchHeader represents a Sawtooth batch header.
type BatchIterator ¶
type BatchIterator interface {
CommonIterator
Current() (*Batch, error)
}
BatchIterator is an interface that represents an iterator over batches.
type BatchStatus ¶
type BatchStatus string
BatchStatus represents a Sawtooth batch status.
const ( BATCH_STATUS_PENDING BatchStatus = "PENDING" BATCH_STATUS_COMMITTED BatchStatus = "COMMITTED" BATCH_STATUS_INVALID BatchStatus = "INVALID" BATCH_STATUS_UNKNOWN BatchStatus = "UNKNOWN" )
type Block ¶
type Block struct {
Batches []Batch `json:"batches"`
Header BlockHeader `json:"header"`
HeaderSignature string `json:"header_signature"`
}
Block represents a Sawtooth block.
type BlockHeader ¶
type BlockHeader struct {
BatchIds []string `json:"batch_ids"`
BlockNum string `json:"block_num"`
Consensus []byte `json:"consensus"`
PreviousBlockId string `json:"previous_block_id"`
SignerPublicKey string `json:"signer_public_key"`
StateRootHash string `json:"state_root_hash"`
}
BlockHeader represents a Sawtooth block header.
type BlockIterator ¶
type BlockIterator interface {
CommonIterator
Current() (*Block, error)
}
BlockIterator is an interface that represents an iterator over blocks.
type CommonIterator ¶
CommonIterator is an interface that provides methods common to all iterators.
type StateIterator ¶
type StateIterator interface {
CommonIterator
Current() (*State, error)
}
StateIterator is an interface that represents an iterator over state.
type Transaction ¶
type Transaction struct {
Header TransactionHeader `json:"header"`
HeaderSignature string `json:"header_signature"`
Payload []byte `json:"payload"`
}
Transaction represents a Sawtooth transaction.
func TransactionFromProto ¶
func TransactionFromProto(transactionProto *transaction_pb2.Transaction) (*Transaction, error)
TransactionFromProto converts a Transaction protobuf into our own Transaction object.
type TransactionHeader ¶
type TransactionHeader struct {
BatcherPublicKey string `json:"batcher_public_key"`
Dependencies []string `json:"dependencies"`
FamilyName string `json:"family_name"`
FamilyVersion string `json:"family_version"`
Inputs []string `json:"inputs"`
Nonce string `json:"nonce"`
Outputs []string `json:"outputs"`
PayloadSHA256 string `json:"payload_sha256"`
SignerPublicKey string `json:"signer_public_key"`
}
TransactionHeader represents a Sawtooth transaction header.
type TransactionIterator ¶
type TransactionIterator interface {
CommonIterator
Current() (*Transaction, error)
}
TransactionIterator is an interface that represents an iterator over transactions.