Documentation ¶
Index ¶
- Variables
- func CreateCompositeKey(objectType string, attributes []string) (string, error)
- func GetConfigBlockFromOrderer(ctx context.Context, id msp.SigningIdentity, orderer api.Orderer, ...) (*common.Block, error)
- func GetEventFromEnvelope(envelopeData []byte) (*peer.ChaincodeEvent, error)
- func GetOrdererHostFromChannelConfig(conf *common.Config) (string, error)
- func IsErrUnsupportedTxType(err error) bool
- func LoadKeyPairFromMSP(mspPath string) ([]byte, []byte, error)
- func NewChannelHeader(headerType common.HeaderType, txId string, channelId string, epoch uint64, ...) ([]byte, error)
- func NewGRPCConnectionFromConfigs(ctx context.Context, log *zap.Logger, conf ...config.ConnectionConfig) (*grpc.ClientConn, error)
- func NewGRPCOptionsFromConfig(c config.ConnectionConfig, log *zap.Logger) ([]grpc.DialOption, error)
- func NewPayloadFromHeader(channelHeader, signatureHeader, data []byte) ([]byte, error)
- func NewSignatureHeader(id msp.SigningIdentity, nonce []byte) ([]byte, error)
- func NewTxWithNonce(id msp.SigningIdentity) (string, []byte, error)
- func ProceedChannelUpdate(ctx context.Context, channelName string, update *common.ConfigUpdate, ...) error
- func RandStringBytesMaskImprSrc(n int) string
- func SeekEnvelope(channelName string, startPos *orderer.SeekPosition, ...) (*common.Envelope, error)
- func SplitCompositeKey(compositeKey string) (string, []string)
- type ErrUnsupportedTxType
Constants ¶
This section is empty.
Variables ¶
var ( DefaultGRPCRetryConfig = &config.GRPCRetryConfig{ Max: 10, Timeout: config.Duration{Duration: 10 * time.Second}, } DefaultGRPCKeepAliveConfig = &config.GRPCKeepAliveConfig{ Time: 60, Timeout: 5, } )
var (
ErrOrdererGroupNotFound = errors.New(`orderer addresses not found`)
)
Functions ¶
func CreateCompositeKey ¶
func GetConfigBlockFromOrderer ¶
func GetConfigBlockFromOrderer(ctx context.Context, id msp.SigningIdentity, orderer api.Orderer, channelName string) (*common.Block, error)
GetConfigBlockFromOrderer returns config block from orderer by channel name
func GetEventFromEnvelope ¶
func GetEventFromEnvelope(envelopeData []byte) (*peer.ChaincodeEvent, error)
func IsErrUnsupportedTxType ¶
func NewChannelHeader ¶
func NewChannelHeader(headerType common.HeaderType, txId string, channelId string, epoch uint64, extension *peer.ChaincodeHeaderExtension) ([]byte, error)
NewChannelHeader returns new channel header bytes for presented transaction and channel
func NewGRPCConnectionFromConfigs ¶
func NewGRPCConnectionFromConfigs(ctx context.Context, log *zap.Logger, conf ...config.ConnectionConfig) (*grpc.ClientConn, error)
NewGRPCConnectionFromConfigs - initilizes grpc connection with pool of adderesses with round-robin client balancer
func NewGRPCOptionsFromConfig ¶
func NewGRPCOptionsFromConfig(c config.ConnectionConfig, log *zap.Logger) ([]grpc.DialOption, error)
NewGRPCOptionsFromConfig - adds tracing, TLS certs and connection limits
func NewPayloadFromHeader ¶
NewPayloadFromHeader returns marshalled payload from headers and data
func NewSignatureHeader ¶
func NewSignatureHeader(id msp.SigningIdentity, nonce []byte) ([]byte, error)
NewChannelHeader returns marshalled signature header for presented identity
func NewTxWithNonce ¶
func NewTxWithNonce(id msp.SigningIdentity) (string, []byte, error)
NewTxWithNonce generates new transaction id with crypto nonce
func ProceedChannelUpdate ¶
func ProceedChannelUpdate(ctx context.Context, channelName string, update *common.ConfigUpdate, orderer api.Orderer, id msp.SigningIdentity) error
func RandStringBytesMaskImprSrc ¶
RandStringBytesMaskImprSrc inspired by https://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-go
func SeekEnvelope ¶
func SeekEnvelope(channelName string, startPos *orderer.SeekPosition, stopPos *orderer.SeekPosition, identity msp.SigningIdentity) (*common.Envelope, error)
func SplitCompositeKey ¶
Types ¶
type ErrUnsupportedTxType ¶
type ErrUnsupportedTxType struct {
Type string
}
func (*ErrUnsupportedTxType) Error ¶
func (e *ErrUnsupportedTxType) Error() string