util

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2019 License: MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOrdererGroupNotFound = errors.New(`orderer addresses not found`)
)

Functions

func CreateCompositeKey added in v0.1.4

func CreateCompositeKey(objectType string, attributes []string) (string, error)

func GetConfigBlockFromOrderer added in v0.4.0

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 GetMSPFromPolicy

func GetMSPFromPolicy(policy string) ([]string, error)

func GetOrdererHostFromChannelConfig added in v0.4.0

func GetOrdererHostFromChannelConfig(conf *common.Config) (string, error)

func IsErrUnsupportedTxType added in v0.3.0

func IsErrUnsupportedTxType(err error) bool

func LoadKeyPairFromMSP

func LoadKeyPairFromMSP(mspPath string) ([]byte, []byte, error)

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 added in v0.4.2

func NewGRPCConnectionFromConfigs(ctx context.Context, log *zap.Logger, conf ...config.ConnectionConfig) (*grpc.ClientConn, error)

func NewGRPCOptionsFromConfig

func NewGRPCOptionsFromConfig(c config.ConnectionConfig, log *zap.Logger) ([]grpc.DialOption, error)

func NewPayloadFromHeader

func NewPayloadFromHeader(channelHeader, signatureHeader, data []byte) ([]byte, error)

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 added in v0.4.0

func ProceedChannelUpdate(ctx context.Context, channelName string, update *common.ConfigUpdate, orderer api.Orderer, id msp.SigningIdentity) error

func SeekEnvelope

func SeekEnvelope(channelName string, startPos *orderer.SeekPosition, stopPos *orderer.SeekPosition, identity msp.SigningIdentity) (*common.Envelope, error)

func SplitCompositeKey added in v0.1.4

func SplitCompositeKey(compositeKey string) (string, []string)

Types

type ErrUnsupportedTxType added in v0.3.0

type ErrUnsupportedTxType struct {
	Type string
}

func (*ErrUnsupportedTxType) Error added in v0.3.0

func (e *ErrUnsupportedTxType) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL