Documentation ¶
Index ¶
- Constants
- Variables
- func ArgBytes(arg interface{}) ([]byte, error)
- func ArgsBytes(args ...interface{}) ([][]byte, error)
- func ChooseSigner(ctx context.Context, signer, defaultSigner msp.SigningIdentity) msp.SigningIdentity
- func ContextWithEndorserMSPs(ctx context.Context, endorserMSPs []string) context.Context
- func ContextWithSigner(ctx context.Context, signer msp.SigningIdentity) context.Context
- func ContextWithTransientMap(ctx context.Context, transient map[string][]byte) context.Context
- func ContextWithTransientValue(ctx context.Context, key string, value []byte) context.Context
- func ContextWithTxWaiter(ctx context.Context, txWaiterType string) context.Context
- func EndorserMSPsFromContext(ctx context.Context) []string
- func FnArgs(fn string, args ...[]byte) [][]byte
- func GenerateID(creator msp.SigningIdentity) (id string, nonce []byte, err error)
- func GenerateIDForSerializedIdentity(creator []byte) (id string, nonce []byte, err error)
- func InvokeBytesProto(ctx context.Context, invoker api.Invoker, channel, chaincode string, ...) (proto.Message, error)
- func InvokeProto(ctx context.Context, invoker api.Invoker, channel, chaincode string, ...) (proto.Message, error)
- func InvokeStringsProto(ctx context.Context, invoker api.Invoker, channel, chaincode string, ...) (proto.Message, error)
- func NewEndorsementSignedProposal(channel, chaincode string, args [][]byte, signer msp.SigningIdentity, ...) (signedProposal *peer.SignedProposal, txID string, err error)
- func NewSeekBlockEnvelope(channel string, signer msp.SigningIdentity, start, stop *orderer.SeekPosition, ...) (*common.Envelope, error)
- func NewSeekGenesisEnvelope(channel string, signer msp.SigningIdentity, tlsCertHash []byte) (*common.Envelope, error)
- func QueryBytesProto(ctx context.Context, querier api.Querier, channel, chaincode string, ...) (proto.Message, error)
- func QueryProto(ctx context.Context, querier api.Querier, channel, chaincode string, ...) (proto.Message, error)
- func QueryStringsProto(ctx context.Context, querier api.Querier, channel, chaincode string, ...) (proto.Message, error)
- func SignerFromContext(ctx context.Context) msp.SigningIdentity
- func StringArgsBytes(args ...string) [][]byte
- func TimestampNow() *timestamp.Timestamp
- func TransientFromContext(ctx context.Context) map[string][]byte
- func TxWaiterFromContext(ctx context.Context) string
- type Endorsement
- type Params
- type ProtoInvoker
- type ProtoQuerier
- func (c *ProtoQuerier) Query(ctx context.Context, args ...interface{}) (*peer.Response, error)
- func (c *ProtoQuerier) QueryBytes(ctx context.Context, args ...[]byte) (*peer.Response, error)
- func (c *ProtoQuerier) QueryBytesProto(ctx context.Context, args [][]byte, target proto.Message) (proto.Message, error)
- func (c *ProtoQuerier) QueryProto(ctx context.Context, args []interface{}, target proto.Message) (proto.Message, error)
- func (c *ProtoQuerier) QueryStringsProto(ctx context.Context, args []string, target proto.Message) (proto.Message, error)
- type SeekBlock
Constants ¶
View Source
const ( CtxTransientKey = `TransientMap` CtxSignerKey = `SigningIdentity` CtxTxWaiterKey = `TxWaiter` CtxEndorserMSPsKey = `EndorserMSPs` )
Variables ¶
View Source
var ( ErrSignerNotDefined = errors.New(`signer not defined`) ErrChaincodeNotDefined = errors.New(`chaincode not defined`) )
View Source
var ( // ErrSignerNotDefinedInContext msp.SigningIdentity is not defined in context ErrSignerNotDefinedInContext = errors.New(`signer is not defined in context`) )
View Source
var (
ErrUnknownArgType = errors.New(`unknown arg type`)
)
Functions ¶
func ChooseSigner ¶
func ChooseSigner(ctx context.Context, signer, defaultSigner msp.SigningIdentity) msp.SigningIdentity
func ContextWithEndorserMSPs ¶
func ContextWithSigner ¶
func ContextWithTransientMap ¶
func ContextWithTxWaiter ¶
func EndorserMSPsFromContext ¶
func GenerateID ¶
func GenerateID(creator msp.SigningIdentity) (id string, nonce []byte, err error)
func InvokeBytesProto ¶
func InvokeProto ¶
func InvokeStringsProto ¶
func NewEndorsementSignedProposal ¶
func NewEndorsementSignedProposal( channel, chaincode string, args [][]byte, signer msp.SigningIdentity, transientMap map[string][]byte) ( signedProposal *peer.SignedProposal, txID string, err error)
func NewSeekBlockEnvelope ¶
func NewSeekBlockEnvelope(channel string, signer msp.SigningIdentity, start, stop *orderer.SeekPosition, tlsCertHash []byte) ( *common.Envelope, error)
func NewSeekGenesisEnvelope ¶
func QueryBytesProto ¶
func QueryProto ¶
func QueryStringsProto ¶
func SignerFromContext ¶
func SignerFromContext(ctx context.Context) msp.SigningIdentity
func StringArgsBytes ¶
func TimestampNow ¶
func TxWaiterFromContext ¶
TxWaiterFromContext - fetch 'txWaiterType' param which identify transaction waiting policy what params you'll have depends on your implementation for example, in hlf-sdk: available: 'self'(wait for one peer of endorser org), 'all'(wait for each organizations from endorsement policy) default is 'self'(even if you pass empty string)
Types ¶
type Endorsement ¶
type Endorsement struct { Channel string Chaincode string Args [][]byte Signer msp.SigningIdentity TransientMap map[string][]byte }
func (Endorsement) SignedProposal ¶
func (e Endorsement) SignedProposal() (signedProposal *peer.SignedProposal, txID string, err error)
type Params ¶
func GenerateParams ¶
func GenerateParams(creator msp.SigningIdentity) (*Params, error)
type ProtoInvoker ¶
type ProtoInvoker struct { *ProtoQuerier Invoker api.Invoker Channel string Chaincode string }
func NewProtoInvoker ¶
func NewProtoInvoker(invoker api.Invoker, channel, chaincode string) *ProtoInvoker
type ProtoQuerier ¶
func NewProtoQuerier ¶
func NewProtoQuerier(querier api.Querier, channel, chaincode string) *ProtoQuerier
func (*ProtoQuerier) QueryBytes ¶
func (*ProtoQuerier) QueryBytesProto ¶
func (*ProtoQuerier) QueryProto ¶
type SeekBlock ¶
type SeekBlock struct { Channel string Signer msp.SigningIdentity Start *orderer.SeekPosition Stop *orderer.SeekPosition }
Click to show internal directories.
Click to hide internal directories.