Documentation ¶
Overview ¶
Package sawtooth_client_sdk_go provides an easy-to-use SDK for building Sawtooth client libraries.
Index ¶
- func Hexdigest(str string) string
- func HexdigestByte(data []byte) string
- type SawtoothClient
- func (self *SawtoothClient) CreateBatch(transactions []*transaction_pb2.Transaction) (*batch_pb2.Batch, error)
- func (self *SawtoothClient) CreateBatchList(batches []*batch_pb2.Batch) (*batch_pb2.BatchList, error)
- func (self *SawtoothClient) CreateTransaction(payload interface{}) (*transaction_pb2.Transaction, error)
- func (self *SawtoothClient) ExecutePayload(payload interface{}) (string, error)
- func (self *SawtoothClient) ExecutePayloadBatch(payloads []interface{}) (string, error)
- func (self *SawtoothClient) ExecutePayloadBatchSync(payloads []interface{}, timeout int, pollInterval int) error
- func (self *SawtoothClient) ExecutePayloadSync(payload interface{}, timeout int, pollInterval int) error
- func (self *SawtoothClient) WaitBatch(batchId string, timeout int, pollInterval int) (bool, error)
- type SawtoothClientArgs
- type SawtoothClientImpl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HexdigestByte ¶
HexdigestByte computes the SHA256 hash of a byte array and returns it as a byte array.
Types ¶
type SawtoothClient ¶
type SawtoothClient struct { Signer *signing.Signer Transport transport.SawtoothClientTransport ClientImpl SawtoothClientImpl }
SawtoothClient represents the core functionality of a Sawtooth application client.
func NewClient ¶
func NewClient(args *SawtoothClientArgs) (*SawtoothClient, error)
NewClient constructs a new instance of the SawtoothClient.
func (*SawtoothClient) CreateBatch ¶
func (self *SawtoothClient) CreateBatch(transactions []*transaction_pb2.Transaction) (*batch_pb2.Batch, error)
CreateBatch constructs a batch from a list of payloads.
func (*SawtoothClient) CreateBatchList ¶
func (self *SawtoothClient) CreateBatchList(batches []*batch_pb2.Batch) (*batch_pb2.BatchList, error)
CreateBatchList constructs a batch list from one or more batches.
func (*SawtoothClient) CreateTransaction ¶
func (self *SawtoothClient) CreateTransaction(payload interface{}) (*transaction_pb2.Transaction, error)
CreateTransaction constructs a single transaction from the provided payload.
func (*SawtoothClient) ExecutePayload ¶
func (self *SawtoothClient) ExecutePayload(payload interface{}) (string, error)
ExecutePayload submits a single transaction to the blockchain and returns the batch id.
func (*SawtoothClient) ExecutePayloadBatch ¶
func (self *SawtoothClient) ExecutePayloadBatch(payloads []interface{}) (string, error)
ExecutePayload submits a list of transactions to the blockchain (as a single batch) and returns the batch id.
func (*SawtoothClient) ExecutePayloadBatchSync ¶
func (self *SawtoothClient) ExecutePayloadBatchSync(payloads []interface{}, timeout int, pollInterval int) error
ExecutePayload submits a list of transactions to the blockchain (as a single batch) and waits for commit.
func (*SawtoothClient) ExecutePayloadSync ¶
func (self *SawtoothClient) ExecutePayloadSync(payload interface{}, timeout int, pollInterval int) error
ExecutePayloadSync submits a single transaction to the blockchain and waits for commit.
type SawtoothClientArgs ¶
type SawtoothClientArgs struct { URL string KeyFile string Impl SawtoothClientImpl TransportType transport.SawtoothClientTransportType }
SawtoothClientArgs holds arguments required to initialize SawtoothClient.
type SawtoothClientImpl ¶
type SawtoothClientImpl interface { GetFamilyName() string GetFamilyVersion() string EncodePayload(interface{}) ([]byte, error) DecodePayload([]byte, interface{}) error EncodeData(interface{}) ([]byte, error) DecodeData([]byte, interface{}) error GetPayloadInputAddresses(payload interface{}) []string GetPayloadOutputAddresses(payload interface{}) []string }
SawtoothClientImpl is the interface that must be implemented by each user of the library.
Directories ¶
Path | Synopsis |
---|---|
Package examples provides examples of clients implemented with sawtooth-client-sdk-go.
|
Package examples provides examples of clients implemented with sawtooth-client-sdk-go. |
intkey
Package intkey provides an alternative intkey client implementation using sawtooth-client-sdk-go.
|
Package intkey provides an alternative intkey client implementation using sawtooth-client-sdk-go. |
intkey/cli
intkey_cli is an alternative cli implementation for intkey that uses the example client implemented with sawtooth-client-sdk-go.
|
intkey_cli is an alternative cli implementation for intkey that uses the example client implemented with sawtooth-client-sdk-go. |
Package transport provides a generalized interface called SawtoothClientTransport.
|
Package transport provides a generalized interface called SawtoothClientTransport. |
errors
Package error provides a generalized error interface for transport implementations.
|
Package error provides a generalized error interface for transport implementations. |
rest
Package rest provides a SawtoothClientTransport implementation for the Sawtooth REST API.
|
Package rest provides a SawtoothClientTransport implementation for the Sawtooth REST API. |
types
Package types provides generalized types that are used across the transport interface.
|
Package types provides generalized types that are used across the transport interface. |
zmq
Package zmq provides a SawtoothClientTransport implementation for the Sawtooth validator ZMQ interface.
|
Package zmq provides a SawtoothClientTransport implementation for the Sawtooth validator ZMQ interface. |