Documentation ¶
Overview ¶
Package owner contains
- chaincode methods names {service_name}Chaincode_{method_name}
- chaincode interface definition {service_name}Chaincode
- chaincode gateway definition {service_name}}Gateway
- chaincode service to cckit router registration func
Package owner is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Package owner provides method for storing in chaincode state information about chaincode owner
Index ¶
- Constants
- Variables
- func Event(ctx router.Context) state.Event
- func Get(c r.Context) (*identity.Entry, error)
- func IdentityEntryFromState(c r.Context) (identity.Entry, error)
- func Insert(c r.Context, mspID string, cert []byte) (*identity.Entry, error)
- func InvokeSetFromArgs(c router.Context) (interface{}, error)
- func InvokeSetFromCreator(c router.Context) (interface{}, error)
- func IsInvoker(ctx r.Context) (bool, error)
- func IsInvokerOr(c r.Context, allowedTo ...identity.Identity) (bool, error)
- func IsSet(c r.Context) (bool, error)
- func IsTxCreator(ctx r.Context) error
- func Only(next router.HandlerFunc, _ ...int) router.HandlerFunc
- func Query(c router.Context) (interface{}, error)
- func RegisterChaincodeOwnerServiceChaincode(r *cckit_router.Group, cc ChaincodeOwnerServiceChaincode) error
- func RegisterChaincodeOwnerServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterChaincodeOwnerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChaincodeOwnerServiceClient) error
- func RegisterChaincodeOwnerServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterChaincodeOwnerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChaincodeOwnerServiceServer) error
- func RegisterChaincodeOwnerServiceServer(s *grpc.Server, srv ChaincodeOwnerServiceServer)
- func SetFromArgs(c r.Context) (*identity.Entry, error)
- func SetFromCreator(c r.Context) (*identity.Entry, error)
- func State(ctx router.Context) m.MappedState
- type ChaincodeOwner
- func (*ChaincodeOwner) Descriptor() ([]byte, []int)deprecated
- func (x *ChaincodeOwner) GetCert() []byte
- func (x *ChaincodeOwner) GetExpiresAt() *timestamppb.Timestamp
- func (x *ChaincodeOwner) GetIssuer() string
- func (x *ChaincodeOwner) GetMSPIdentifier() string
- func (x *ChaincodeOwner) GetMspId() string
- func (x *ChaincodeOwner) GetSubject() string
- func (x *ChaincodeOwner) GetUpdatedAt() *timestamppb.Timestamp
- func (x *ChaincodeOwner) GetUpdatedByCert() []byte
- func (x *ChaincodeOwner) GetUpdatedByMspId() string
- func (*ChaincodeOwner) ProtoMessage()
- func (x *ChaincodeOwner) ProtoReflect() protoreflect.Message
- func (x *ChaincodeOwner) Reset()
- func (x *ChaincodeOwner) String() string
- func (this *ChaincodeOwner) Validate() error
- type ChaincodeOwnerCreated
- func (*ChaincodeOwnerCreated) Descriptor() ([]byte, []int)deprecated
- func (x *ChaincodeOwnerCreated) GetExpiresAt() *timestamppb.Timestamp
- func (x *ChaincodeOwnerCreated) GetIssuer() string
- func (x *ChaincodeOwnerCreated) GetMspId() string
- func (x *ChaincodeOwnerCreated) GetSubject() string
- func (*ChaincodeOwnerCreated) ProtoMessage()
- func (x *ChaincodeOwnerCreated) ProtoReflect() protoreflect.Message
- func (x *ChaincodeOwnerCreated) Reset()
- func (x *ChaincodeOwnerCreated) String() string
- func (this *ChaincodeOwnerCreated) Validate() error
- type ChaincodeOwnerDeleted
- func (*ChaincodeOwnerDeleted) Descriptor() ([]byte, []int)deprecated
- func (x *ChaincodeOwnerDeleted) GetMspId() string
- func (x *ChaincodeOwnerDeleted) GetSubject() string
- func (*ChaincodeOwnerDeleted) ProtoMessage()
- func (x *ChaincodeOwnerDeleted) ProtoReflect() protoreflect.Message
- func (x *ChaincodeOwnerDeleted) Reset()
- func (x *ChaincodeOwnerDeleted) String() string
- func (this *ChaincodeOwnerDeleted) Validate() error
- type ChaincodeOwnerService
- func (c *ChaincodeOwnerService) CreateOwner(ctx router.Context, create *CreateOwnerRequest) (*ChaincodeOwner, error)
- func (c *ChaincodeOwnerService) CreateOwnerTxCreator(ctx router.Context, _ *empty.Empty) (*ChaincodeOwner, error)
- func (c ChaincodeOwnerService) DeleteOwner(ctx router.Context, id *OwnerId) (*ChaincodeOwner, error)
- func (c *ChaincodeOwnerService) GetOwner(ctx router.Context, id *OwnerId) (*ChaincodeOwner, error)
- func (c *ChaincodeOwnerService) GetOwnerByTxCreator(ctx router.Context, _ *empty.Empty) (*ChaincodeOwner, error)
- func (c *ChaincodeOwnerService) IsTxCreator(ctx router.Context) (*ChaincodeOwner, error)
- func (c *ChaincodeOwnerService) ListOwners(ctx router.Context, _ *empty.Empty) (*ChaincodeOwners, error)
- func (c *ChaincodeOwnerService) RegisterTxCreator(ctx router.Context) (*ChaincodeOwner, error)
- func (c ChaincodeOwnerService) UpdateOwner(ctx router.Context, updateRequest *UpdateOwnerRequest) (*ChaincodeOwner, error)
- type ChaincodeOwnerServiceChaincode
- type ChaincodeOwnerServiceClient
- type ChaincodeOwnerServiceGateway
- func (c *ChaincodeOwnerServiceGateway) CreateOwner(ctx context.Context, in *CreateOwnerRequest) (*ChaincodeOwner, error)
- func (c *ChaincodeOwnerServiceGateway) CreateOwnerTxCreator(ctx context.Context, in *emptypb.Empty) (*ChaincodeOwner, error)
- func (c *ChaincodeOwnerServiceGateway) DeleteOwner(ctx context.Context, in *OwnerId) (*ChaincodeOwner, error)
- func (c *ChaincodeOwnerServiceGateway) GetOwner(ctx context.Context, in *OwnerId) (*ChaincodeOwner, error)
- func (c *ChaincodeOwnerServiceGateway) GetOwnerByTxCreator(ctx context.Context, in *emptypb.Empty) (*ChaincodeOwner, error)
- func (c *ChaincodeOwnerServiceGateway) Invoker() cckit_gateway.ChaincodeInstanceInvoker
- func (c *ChaincodeOwnerServiceGateway) ListOwners(ctx context.Context, in *emptypb.Empty) (*ChaincodeOwners, error)
- func (c *ChaincodeOwnerServiceGateway) ServiceDef() cckit_gateway.ServiceDef
- func (c *ChaincodeOwnerServiceGateway) UpdateOwner(ctx context.Context, in *UpdateOwnerRequest) (*ChaincodeOwner, error)
- type ChaincodeOwnerServiceServer
- type ChaincodeOwnerUpdated
- func (*ChaincodeOwnerUpdated) Descriptor() ([]byte, []int)deprecated
- func (x *ChaincodeOwnerUpdated) GetExpiresAt() *timestamppb.Timestamp
- func (x *ChaincodeOwnerUpdated) GetMspId() string
- func (x *ChaincodeOwnerUpdated) GetSubject() string
- func (*ChaincodeOwnerUpdated) ProtoMessage()
- func (x *ChaincodeOwnerUpdated) ProtoReflect() protoreflect.Message
- func (x *ChaincodeOwnerUpdated) Reset()
- func (x *ChaincodeOwnerUpdated) String() string
- func (this *ChaincodeOwnerUpdated) Validate() error
- type ChaincodeOwners
- func (*ChaincodeOwners) Descriptor() ([]byte, []int)deprecated
- func (x *ChaincodeOwners) GetItems() []*ChaincodeOwner
- func (*ChaincodeOwners) ProtoMessage()
- func (x *ChaincodeOwners) ProtoReflect() protoreflect.Message
- func (x *ChaincodeOwners) Reset()
- func (x *ChaincodeOwners) String() string
- func (this *ChaincodeOwners) Validate() error
- type CreateOwnerRequest
- func (*CreateOwnerRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateOwnerRequest) GetCert() []byte
- func (x *CreateOwnerRequest) GetMspId() string
- func (*CreateOwnerRequest) ProtoMessage()
- func (x *CreateOwnerRequest) ProtoReflect() protoreflect.Message
- func (x *CreateOwnerRequest) Reset()
- func (x *CreateOwnerRequest) String() string
- func (this *CreateOwnerRequest) Validate() error
- type OwnerId
- func (*OwnerId) Descriptor() ([]byte, []int)deprecated
- func (x *OwnerId) GetMspId() string
- func (x *OwnerId) GetSubject() string
- func (*OwnerId) ProtoMessage()
- func (x *OwnerId) ProtoReflect() protoreflect.Message
- func (x *OwnerId) Reset()
- func (x *OwnerId) String() string
- func (this *OwnerId) Validate() error
- type UnimplementedChaincodeOwnerServiceServer
- func (*UnimplementedChaincodeOwnerServiceServer) CreateOwner(context.Context, *CreateOwnerRequest) (*ChaincodeOwner, error)
- func (*UnimplementedChaincodeOwnerServiceServer) CreateOwnerTxCreator(context.Context, *emptypb.Empty) (*ChaincodeOwner, error)
- func (*UnimplementedChaincodeOwnerServiceServer) DeleteOwner(context.Context, *OwnerId) (*ChaincodeOwner, error)
- func (*UnimplementedChaincodeOwnerServiceServer) GetOwner(context.Context, *OwnerId) (*ChaincodeOwner, error)
- func (*UnimplementedChaincodeOwnerServiceServer) GetOwnerByTxCreator(context.Context, *emptypb.Empty) (*ChaincodeOwner, error)
- func (*UnimplementedChaincodeOwnerServiceServer) ListOwners(context.Context, *emptypb.Empty) (*ChaincodeOwners, error)
- func (*UnimplementedChaincodeOwnerServiceServer) UpdateOwner(context.Context, *UpdateOwnerRequest) (*ChaincodeOwner, error)
- type UpdateOwnerRequest
- func (*UpdateOwnerRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateOwnerRequest) GetCert() []byte
- func (x *UpdateOwnerRequest) GetMspId() string
- func (*UpdateOwnerRequest) ProtoMessage()
- func (x *UpdateOwnerRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateOwnerRequest) Reset()
- func (x *UpdateOwnerRequest) String() string
- func (this *UpdateOwnerRequest) Validate() error
Constants ¶
const ( // ChaincodeOwnerServiceChaincodeMethodPrefix allows to use multiple services with same method names in one chaincode ChaincodeOwnerServiceChaincodeMethodPrefix = "ChaincodeOwnerService." ChaincodeOwnerServiceChaincode_GetOwnerByTxCreator = ChaincodeOwnerServiceChaincodeMethodPrefix + "GetOwnerByTxCreator" ChaincodeOwnerServiceChaincode_ListOwners = ChaincodeOwnerServiceChaincodeMethodPrefix + "ListOwners" ChaincodeOwnerServiceChaincode_GetOwner = ChaincodeOwnerServiceChaincodeMethodPrefix + "GetOwner" ChaincodeOwnerServiceChaincode_CreateOwner = ChaincodeOwnerServiceChaincodeMethodPrefix + "CreateOwner" ChaincodeOwnerServiceChaincode_CreateOwnerTxCreator = ChaincodeOwnerServiceChaincodeMethodPrefix + "CreateOwnerTxCreator" ChaincodeOwnerServiceChaincode_UpdateOwner = ChaincodeOwnerServiceChaincodeMethodPrefix + "UpdateOwner" ChaincodeOwnerServiceChaincode_DeleteOwner = ChaincodeOwnerServiceChaincodeMethodPrefix + "DeleteOwner" )
ChaincodeOwnerServiceChaincode method names
const OwnerStateKey = `OWNER`
OwnerStateKey key used to store owner grant struct in chain code state "handler" part of owner extension supports only one owner "service" part of owner extension supports multiple owners
const QueryMethod = `owner`
Variables ¶
var ( ErrTxInvokerIsNotOwner = errors.New(`tx invoker is not owner`) ErrDeleteLastOwnerIsNotAllowed = errors.New(`delete last owner is not allowed`) ErrNewCertSameAsOldCert = errors.New(`new cert same as old cert`) )
var ( // ErrOwnerNotProvided occurs when providing owner identity in init arguments ErrOwnerNotProvided = errors.New(`owner not provided`) // ErrOwnerAlreadySet owner already set ErrOwnerAlreadySet = errors.New(`owner already set`) )
var ( StateMappings = m.StateMappings{}. Add(&ChaincodeOwner{}, m.PKeySchema(&OwnerId{}), m.List(&ChaincodeOwners{})) EventMappings = m.EventMappings{}. Add(&ChaincodeOwnerCreated{}). Add(&ChaincodeOwnerUpdated{}). Add(&ChaincodeOwnerDeleted{}) )
var ChaincodeOwnerServiceSwagger []byte
var ( // ErrOwnerOnly error occurs when trying to invoke chaincode func protected by onlyOwner middleware (modifier) ErrOwnerOnly = errors.New(`owner only`) )
var File_owner_chaincode_owner_proto protoreflect.FileDescriptor
Functions ¶
func Get ¶
Get returns current chaincode owner identity.Entry Service implementation recommended, see chaincode_owner.proto
func IdentityEntryFromState ¶
IdentityEntryFromState returns identity.Entry with chaincode owner certificate Service implementation recommended, see chaincode_owner.proto
func InvokeSetFromArgs ¶
InvokeSetFromArgs gets owner data from args[0] (Msp Id) and arg[1] (cert)
func InvokeSetFromCreator ¶
InvokeSetFromCreator sets tx creator as chaincode owner, if owner not previously set
func IsInvoker ¶
IsInvoker checks than tx creator is chain code owner Service implementation recommended, see chaincode_owner.proto
func IsInvokerOr ¶
IsInvokerOr checks tx creator and compares with owner of another identity Service implementation recommended, see chaincode_owner.proto
func IsTxCreator ¶
IsTxCreator returns error if owner identity (msp_id + certificate) did not match tx creator identity Service implementation recommended, see chaincode_owner.proto
func Only ¶
func Only(next router.HandlerFunc, _ ...int) router.HandlerFunc
Only allow access from chain code owner
func RegisterChaincodeOwnerServiceChaincode ¶
func RegisterChaincodeOwnerServiceChaincode(r *cckit_router.Group, cc ChaincodeOwnerServiceChaincode) error
RegisterChaincodeOwnerServiceChaincode registers service methods as chaincode router handlers
func RegisterChaincodeOwnerServiceHandler ¶
func RegisterChaincodeOwnerServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterChaincodeOwnerServiceHandler registers the http handlers for service ChaincodeOwnerService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterChaincodeOwnerServiceHandlerClient ¶
func RegisterChaincodeOwnerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChaincodeOwnerServiceClient) error
RegisterChaincodeOwnerServiceHandlerClient registers the http handlers for service ChaincodeOwnerService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ChaincodeOwnerServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ChaincodeOwnerServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ChaincodeOwnerServiceClient" to call the correct interceptors.
func RegisterChaincodeOwnerServiceHandlerFromEndpoint ¶
func RegisterChaincodeOwnerServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterChaincodeOwnerServiceHandlerFromEndpoint is same as RegisterChaincodeOwnerServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterChaincodeOwnerServiceHandlerServer ¶
func RegisterChaincodeOwnerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChaincodeOwnerServiceServer) error
RegisterChaincodeOwnerServiceHandlerServer registers the http handlers for service ChaincodeOwnerService to "mux". UnaryRPC :call ChaincodeOwnerServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterChaincodeOwnerServiceHandlerFromEndpoint instead.
func RegisterChaincodeOwnerServiceServer ¶
func RegisterChaincodeOwnerServiceServer(s *grpc.Server, srv ChaincodeOwnerServiceServer)
func SetFromArgs ¶
SetFromArgs set owner from first args
func SetFromCreator ¶
SetFromCreator sets chain code owner from stub creator Service implementation recommended, see chaincode_owner.proto
Types ¶
type ChaincodeOwner ¶
type ChaincodeOwner struct { // Msp Id MspId string `protobuf:"bytes,1,opt,name=msp_id,json=mspId,proto3" json:"msp_id,omitempty"` // certificate subject Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` // certificate issuer Issuer string `protobuf:"bytes,3,opt,name=issuer,proto3" json:"issuer,omitempty"` // cert valid not after ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` // Certificate Cert []byte `protobuf:"bytes,5,opt,name=cert,proto3" json:"cert,omitempty"` // Creator identity info UpdatedByMspId string `protobuf:"bytes,6,opt,name=updated_by_msp_id,json=updatedByMspId,proto3" json:"updated_by_msp_id,omitempty"` // Certificate UpdatedByCert []byte `protobuf:"bytes,7,opt,name=updated_by_cert,json=updatedByCert,proto3" json:"updated_by_cert,omitempty"` // Updated at UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // contains filtered or unexported fields }
State: information stored in chaincode state about chaincode owner
func (*ChaincodeOwner) Descriptor
deprecated
func (*ChaincodeOwner) Descriptor() ([]byte, []int)
Deprecated: Use ChaincodeOwner.ProtoReflect.Descriptor instead.
func (*ChaincodeOwner) GetCert ¶
func (x *ChaincodeOwner) GetCert() []byte
func (*ChaincodeOwner) GetExpiresAt ¶
func (x *ChaincodeOwner) GetExpiresAt() *timestamppb.Timestamp
func (*ChaincodeOwner) GetIssuer ¶
func (x *ChaincodeOwner) GetIssuer() string
func (*ChaincodeOwner) GetMSPIdentifier ¶
func (x *ChaincodeOwner) GetMSPIdentifier() string
func (*ChaincodeOwner) GetMspId ¶
func (x *ChaincodeOwner) GetMspId() string
func (*ChaincodeOwner) GetSubject ¶
func (x *ChaincodeOwner) GetSubject() string
func (*ChaincodeOwner) GetUpdatedAt ¶
func (x *ChaincodeOwner) GetUpdatedAt() *timestamppb.Timestamp
func (*ChaincodeOwner) GetUpdatedByCert ¶
func (x *ChaincodeOwner) GetUpdatedByCert() []byte
func (*ChaincodeOwner) GetUpdatedByMspId ¶
func (x *ChaincodeOwner) GetUpdatedByMspId() string
func (*ChaincodeOwner) ProtoMessage ¶
func (*ChaincodeOwner) ProtoMessage()
func (*ChaincodeOwner) ProtoReflect ¶
func (x *ChaincodeOwner) ProtoReflect() protoreflect.Message
func (*ChaincodeOwner) Reset ¶
func (x *ChaincodeOwner) Reset()
func (*ChaincodeOwner) String ¶
func (x *ChaincodeOwner) String() string
func (*ChaincodeOwner) Validate ¶
func (this *ChaincodeOwner) Validate() error
type ChaincodeOwnerCreated ¶
type ChaincodeOwnerCreated struct { // Msp Id MspId string `protobuf:"bytes,1,opt,name=msp_id,json=mspId,proto3" json:"msp_id,omitempty"` // certificate subject Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` // certificate issuer Issuer string `protobuf:"bytes,3,opt,name=issuer,proto3" json:"issuer,omitempty"` // cert valid not after ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` // contains filtered or unexported fields }
Event: new chaincode owner registered
func (*ChaincodeOwnerCreated) Descriptor
deprecated
func (*ChaincodeOwnerCreated) Descriptor() ([]byte, []int)
Deprecated: Use ChaincodeOwnerCreated.ProtoReflect.Descriptor instead.
func (*ChaincodeOwnerCreated) GetExpiresAt ¶
func (x *ChaincodeOwnerCreated) GetExpiresAt() *timestamppb.Timestamp
func (*ChaincodeOwnerCreated) GetIssuer ¶
func (x *ChaincodeOwnerCreated) GetIssuer() string
func (*ChaincodeOwnerCreated) GetMspId ¶
func (x *ChaincodeOwnerCreated) GetMspId() string
func (*ChaincodeOwnerCreated) GetSubject ¶
func (x *ChaincodeOwnerCreated) GetSubject() string
func (*ChaincodeOwnerCreated) ProtoMessage ¶
func (*ChaincodeOwnerCreated) ProtoMessage()
func (*ChaincodeOwnerCreated) ProtoReflect ¶
func (x *ChaincodeOwnerCreated) ProtoReflect() protoreflect.Message
func (*ChaincodeOwnerCreated) Reset ¶
func (x *ChaincodeOwnerCreated) Reset()
func (*ChaincodeOwnerCreated) String ¶
func (x *ChaincodeOwnerCreated) String() string
func (*ChaincodeOwnerCreated) Validate ¶
func (this *ChaincodeOwnerCreated) Validate() error
type ChaincodeOwnerDeleted ¶
type ChaincodeOwnerDeleted struct { // Msp Id MspId string `protobuf:"bytes,1,opt,name=msp_id,json=mspId,proto3" json:"msp_id,omitempty"` // certificate subject Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` // contains filtered or unexported fields }
Event: chaincode owner deleted`
func (*ChaincodeOwnerDeleted) Descriptor
deprecated
func (*ChaincodeOwnerDeleted) Descriptor() ([]byte, []int)
Deprecated: Use ChaincodeOwnerDeleted.ProtoReflect.Descriptor instead.
func (*ChaincodeOwnerDeleted) GetMspId ¶
func (x *ChaincodeOwnerDeleted) GetMspId() string
func (*ChaincodeOwnerDeleted) GetSubject ¶
func (x *ChaincodeOwnerDeleted) GetSubject() string
func (*ChaincodeOwnerDeleted) ProtoMessage ¶
func (*ChaincodeOwnerDeleted) ProtoMessage()
func (*ChaincodeOwnerDeleted) ProtoReflect ¶
func (x *ChaincodeOwnerDeleted) ProtoReflect() protoreflect.Message
func (*ChaincodeOwnerDeleted) Reset ¶
func (x *ChaincodeOwnerDeleted) Reset()
func (*ChaincodeOwnerDeleted) String ¶
func (x *ChaincodeOwnerDeleted) String() string
func (*ChaincodeOwnerDeleted) Validate ¶
func (this *ChaincodeOwnerDeleted) Validate() error
type ChaincodeOwnerService ¶
type ChaincodeOwnerService struct{}
func NewService ¶
func NewService() *ChaincodeOwnerService
func (*ChaincodeOwnerService) CreateOwner ¶
func (c *ChaincodeOwnerService) CreateOwner(ctx router.Context, create *CreateOwnerRequest) (*ChaincodeOwner, error)
func (*ChaincodeOwnerService) CreateOwnerTxCreator ¶
func (c *ChaincodeOwnerService) CreateOwnerTxCreator(ctx router.Context, _ *empty.Empty) (*ChaincodeOwner, error)
func (ChaincodeOwnerService) DeleteOwner ¶
func (c ChaincodeOwnerService) DeleteOwner(ctx router.Context, id *OwnerId) (*ChaincodeOwner, error)
func (*ChaincodeOwnerService) GetOwner ¶
func (c *ChaincodeOwnerService) GetOwner(ctx router.Context, id *OwnerId) (*ChaincodeOwner, error)
func (*ChaincodeOwnerService) GetOwnerByTxCreator ¶
func (c *ChaincodeOwnerService) GetOwnerByTxCreator(ctx router.Context, _ *empty.Empty) (*ChaincodeOwner, error)
func (*ChaincodeOwnerService) IsTxCreator ¶
func (c *ChaincodeOwnerService) IsTxCreator(ctx router.Context) (*ChaincodeOwner, error)
IsTxCreator - wrapper for TxCreatorIsOwner for local calls
func (*ChaincodeOwnerService) ListOwners ¶
func (c *ChaincodeOwnerService) ListOwners(ctx router.Context, _ *empty.Empty) (*ChaincodeOwners, error)
func (*ChaincodeOwnerService) RegisterTxCreator ¶
func (c *ChaincodeOwnerService) RegisterTxCreator(ctx router.Context) (*ChaincodeOwner, error)
RegisterTxCreator Wrapper for OwnerRegisterTxCreator
func (ChaincodeOwnerService) UpdateOwner ¶
func (c ChaincodeOwnerService) UpdateOwner(ctx router.Context, updateRequest *UpdateOwnerRequest) (*ChaincodeOwner, error)
type ChaincodeOwnerServiceChaincode ¶
type ChaincodeOwnerServiceChaincode interface { GetOwnerByTxCreator(cckit_router.Context, *emptypb.Empty) (*ChaincodeOwner, error) ListOwners(cckit_router.Context, *emptypb.Empty) (*ChaincodeOwners, error) GetOwner(cckit_router.Context, *OwnerId) (*ChaincodeOwner, error) CreateOwner(cckit_router.Context, *CreateOwnerRequest) (*ChaincodeOwner, error) CreateOwnerTxCreator(cckit_router.Context, *emptypb.Empty) (*ChaincodeOwner, error) UpdateOwner(cckit_router.Context, *UpdateOwnerRequest) (*ChaincodeOwner, error) DeleteOwner(cckit_router.Context, *OwnerId) (*ChaincodeOwner, error) }
ChaincodeOwnerServiceChaincode chaincode methods interface
type ChaincodeOwnerServiceClient ¶
type ChaincodeOwnerServiceClient interface { // Checks tx creator is owner GetOwnerByTxCreator(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ChaincodeOwner, error) // Get owners list ListOwners(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ChaincodeOwners, error) // Get owner by msp_id and certificate subject GetOwner(ctx context.Context, in *OwnerId, opts ...grpc.CallOption) (*ChaincodeOwner, error) // Register new chaincode owner, method can be call by current owner or if no owner exists // If chaincode owner with same MspID, certificate subject and issuer exists - throws error CreateOwner(ctx context.Context, in *CreateOwnerRequest, opts ...grpc.CallOption) (*ChaincodeOwner, error) // Register tx creator as chaincode owner CreateOwnerTxCreator(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ChaincodeOwner, error) // Update chaincode owner. Msp id and certificate subject must be equal to current owner certificate UpdateOwner(ctx context.Context, in *UpdateOwnerRequest, opts ...grpc.CallOption) (*ChaincodeOwner, error) // Delete owner DeleteOwner(ctx context.Context, in *OwnerId, opts ...grpc.CallOption) (*ChaincodeOwner, error) }
ChaincodeOwnerServiceClient is the client API for ChaincodeOwnerService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewChaincodeOwnerServiceClient ¶
func NewChaincodeOwnerServiceClient(cc grpc.ClientConnInterface) ChaincodeOwnerServiceClient
type ChaincodeOwnerServiceGateway ¶
type ChaincodeOwnerServiceGateway struct {
ChaincodeInstance cckit_gateway.ChaincodeInstance
}
gateway implementation gateway can be used as kind of SDK, GRPC or REST server ( via grpc-gateway or clay )
func NewChaincodeOwnerServiceGateway ¶
func NewChaincodeOwnerServiceGateway(sdk cckit_sdk.SDK, channel, chaincode string, opts ...cckit_gateway.Opt) *ChaincodeOwnerServiceGateway
NewChaincodeOwnerServiceGateway creates gateway to access chaincode method via chaincode service
func NewChaincodeOwnerServiceGatewayFromInstance ¶
func NewChaincodeOwnerServiceGatewayFromInstance(chaincodeInstance cckit_gateway.ChaincodeInstance) *ChaincodeOwnerServiceGateway
func (*ChaincodeOwnerServiceGateway) CreateOwner ¶
func (c *ChaincodeOwnerServiceGateway) CreateOwner(ctx context.Context, in *CreateOwnerRequest) (*ChaincodeOwner, error)
func (*ChaincodeOwnerServiceGateway) CreateOwnerTxCreator ¶
func (c *ChaincodeOwnerServiceGateway) CreateOwnerTxCreator(ctx context.Context, in *emptypb.Empty) (*ChaincodeOwner, error)
func (*ChaincodeOwnerServiceGateway) DeleteOwner ¶
func (c *ChaincodeOwnerServiceGateway) DeleteOwner(ctx context.Context, in *OwnerId) (*ChaincodeOwner, error)
func (*ChaincodeOwnerServiceGateway) GetOwner ¶
func (c *ChaincodeOwnerServiceGateway) GetOwner(ctx context.Context, in *OwnerId) (*ChaincodeOwner, error)
func (*ChaincodeOwnerServiceGateway) GetOwnerByTxCreator ¶
func (c *ChaincodeOwnerServiceGateway) GetOwnerByTxCreator(ctx context.Context, in *emptypb.Empty) (*ChaincodeOwner, error)
func (*ChaincodeOwnerServiceGateway) Invoker ¶
func (c *ChaincodeOwnerServiceGateway) Invoker() cckit_gateway.ChaincodeInstanceInvoker
func (*ChaincodeOwnerServiceGateway) ListOwners ¶
func (c *ChaincodeOwnerServiceGateway) ListOwners(ctx context.Context, in *emptypb.Empty) (*ChaincodeOwners, error)
func (*ChaincodeOwnerServiceGateway) ServiceDef ¶
func (c *ChaincodeOwnerServiceGateway) ServiceDef() cckit_gateway.ServiceDef
ServiceDef returns service definition
func (*ChaincodeOwnerServiceGateway) UpdateOwner ¶
func (c *ChaincodeOwnerServiceGateway) UpdateOwner(ctx context.Context, in *UpdateOwnerRequest) (*ChaincodeOwner, error)
type ChaincodeOwnerServiceServer ¶
type ChaincodeOwnerServiceServer interface { // Checks tx creator is owner GetOwnerByTxCreator(context.Context, *emptypb.Empty) (*ChaincodeOwner, error) // Get owners list ListOwners(context.Context, *emptypb.Empty) (*ChaincodeOwners, error) // Get owner by msp_id and certificate subject GetOwner(context.Context, *OwnerId) (*ChaincodeOwner, error) // Register new chaincode owner, method can be call by current owner or if no owner exists // If chaincode owner with same MspID, certificate subject and issuer exists - throws error CreateOwner(context.Context, *CreateOwnerRequest) (*ChaincodeOwner, error) // Register tx creator as chaincode owner CreateOwnerTxCreator(context.Context, *emptypb.Empty) (*ChaincodeOwner, error) // Update chaincode owner. Msp id and certificate subject must be equal to current owner certificate UpdateOwner(context.Context, *UpdateOwnerRequest) (*ChaincodeOwner, error) // Delete owner DeleteOwner(context.Context, *OwnerId) (*ChaincodeOwner, error) }
ChaincodeOwnerServiceServer is the server API for ChaincodeOwnerService service.
type ChaincodeOwnerUpdated ¶
type ChaincodeOwnerUpdated struct { // Msp Id MspId string `protobuf:"bytes,1,opt,name=msp_id,json=mspId,proto3" json:"msp_id,omitempty"` // certificate subject Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` // cert valid not after ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` // contains filtered or unexported fields }
Event: new chaincode owner registered
func (*ChaincodeOwnerUpdated) Descriptor
deprecated
func (*ChaincodeOwnerUpdated) Descriptor() ([]byte, []int)
Deprecated: Use ChaincodeOwnerUpdated.ProtoReflect.Descriptor instead.
func (*ChaincodeOwnerUpdated) GetExpiresAt ¶
func (x *ChaincodeOwnerUpdated) GetExpiresAt() *timestamppb.Timestamp
func (*ChaincodeOwnerUpdated) GetMspId ¶
func (x *ChaincodeOwnerUpdated) GetMspId() string
func (*ChaincodeOwnerUpdated) GetSubject ¶
func (x *ChaincodeOwnerUpdated) GetSubject() string
func (*ChaincodeOwnerUpdated) ProtoMessage ¶
func (*ChaincodeOwnerUpdated) ProtoMessage()
func (*ChaincodeOwnerUpdated) ProtoReflect ¶
func (x *ChaincodeOwnerUpdated) ProtoReflect() protoreflect.Message
func (*ChaincodeOwnerUpdated) Reset ¶
func (x *ChaincodeOwnerUpdated) Reset()
func (*ChaincodeOwnerUpdated) String ¶
func (x *ChaincodeOwnerUpdated) String() string
func (*ChaincodeOwnerUpdated) Validate ¶
func (this *ChaincodeOwnerUpdated) Validate() error
type ChaincodeOwners ¶
type ChaincodeOwners struct { Items []*ChaincodeOwner `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
List: Chaincode owners
func (*ChaincodeOwners) Descriptor
deprecated
func (*ChaincodeOwners) Descriptor() ([]byte, []int)
Deprecated: Use ChaincodeOwners.ProtoReflect.Descriptor instead.
func (*ChaincodeOwners) GetItems ¶
func (x *ChaincodeOwners) GetItems() []*ChaincodeOwner
func (*ChaincodeOwners) ProtoMessage ¶
func (*ChaincodeOwners) ProtoMessage()
func (*ChaincodeOwners) ProtoReflect ¶
func (x *ChaincodeOwners) ProtoReflect() protoreflect.Message
func (*ChaincodeOwners) Reset ¶
func (x *ChaincodeOwners) Reset()
func (*ChaincodeOwners) String ¶
func (x *ChaincodeOwners) String() string
func (*ChaincodeOwners) Validate ¶
func (this *ChaincodeOwners) Validate() error
type CreateOwnerRequest ¶
type CreateOwnerRequest struct { // Msp Id MspId string `protobuf:"bytes,1,opt,name=msp_id,json=mspId,proto3" json:"msp_id,omitempty"` // Certificate Cert []byte `protobuf:"bytes,2,opt,name=cert,proto3" json:"cert,omitempty"` // contains filtered or unexported fields }
Request: register owner
func (*CreateOwnerRequest) Descriptor
deprecated
func (*CreateOwnerRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateOwnerRequest.ProtoReflect.Descriptor instead.
func (*CreateOwnerRequest) GetCert ¶
func (x *CreateOwnerRequest) GetCert() []byte
func (*CreateOwnerRequest) GetMspId ¶
func (x *CreateOwnerRequest) GetMspId() string
func (*CreateOwnerRequest) ProtoMessage ¶
func (*CreateOwnerRequest) ProtoMessage()
func (*CreateOwnerRequest) ProtoReflect ¶
func (x *CreateOwnerRequest) ProtoReflect() protoreflect.Message
func (*CreateOwnerRequest) Reset ¶
func (x *CreateOwnerRequest) Reset()
func (*CreateOwnerRequest) String ¶
func (x *CreateOwnerRequest) String() string
func (*CreateOwnerRequest) Validate ¶
func (this *CreateOwnerRequest) Validate() error
type OwnerId ¶
type OwnerId struct { // Msp Id MspId string `protobuf:"bytes,1,opt,name=msp_id,json=mspId,proto3" json:"msp_id,omitempty"` // Certificate subject Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` // contains filtered or unexported fields }
Id: owner identifier
func (*OwnerId) Descriptor
deprecated
func (*OwnerId) GetSubject ¶
func (*OwnerId) ProtoMessage ¶
func (*OwnerId) ProtoMessage()
func (*OwnerId) ProtoReflect ¶
func (x *OwnerId) ProtoReflect() protoreflect.Message
type UnimplementedChaincodeOwnerServiceServer ¶
type UnimplementedChaincodeOwnerServiceServer struct { }
UnimplementedChaincodeOwnerServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedChaincodeOwnerServiceServer) CreateOwner ¶
func (*UnimplementedChaincodeOwnerServiceServer) CreateOwner(context.Context, *CreateOwnerRequest) (*ChaincodeOwner, error)
func (*UnimplementedChaincodeOwnerServiceServer) CreateOwnerTxCreator ¶
func (*UnimplementedChaincodeOwnerServiceServer) CreateOwnerTxCreator(context.Context, *emptypb.Empty) (*ChaincodeOwner, error)
func (*UnimplementedChaincodeOwnerServiceServer) DeleteOwner ¶
func (*UnimplementedChaincodeOwnerServiceServer) DeleteOwner(context.Context, *OwnerId) (*ChaincodeOwner, error)
func (*UnimplementedChaincodeOwnerServiceServer) GetOwner ¶
func (*UnimplementedChaincodeOwnerServiceServer) GetOwner(context.Context, *OwnerId) (*ChaincodeOwner, error)
func (*UnimplementedChaincodeOwnerServiceServer) GetOwnerByTxCreator ¶
func (*UnimplementedChaincodeOwnerServiceServer) GetOwnerByTxCreator(context.Context, *emptypb.Empty) (*ChaincodeOwner, error)
func (*UnimplementedChaincodeOwnerServiceServer) ListOwners ¶
func (*UnimplementedChaincodeOwnerServiceServer) ListOwners(context.Context, *emptypb.Empty) (*ChaincodeOwners, error)
func (*UnimplementedChaincodeOwnerServiceServer) UpdateOwner ¶
func (*UnimplementedChaincodeOwnerServiceServer) UpdateOwner(context.Context, *UpdateOwnerRequest) (*ChaincodeOwner, error)
type UpdateOwnerRequest ¶
type UpdateOwnerRequest struct { // Msp Id MspId string `protobuf:"bytes,1,opt,name=msp_id,json=mspId,proto3" json:"msp_id,omitempty"` // Current certificate Cert []byte `protobuf:"bytes,2,opt,name=cert,proto3" json:"cert,omitempty"` // contains filtered or unexported fields }
Request: update owner certificate
func (*UpdateOwnerRequest) Descriptor
deprecated
func (*UpdateOwnerRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateOwnerRequest.ProtoReflect.Descriptor instead.
func (*UpdateOwnerRequest) GetCert ¶
func (x *UpdateOwnerRequest) GetCert() []byte
func (*UpdateOwnerRequest) GetMspId ¶
func (x *UpdateOwnerRequest) GetMspId() string
func (*UpdateOwnerRequest) ProtoMessage ¶
func (*UpdateOwnerRequest) ProtoMessage()
func (*UpdateOwnerRequest) ProtoReflect ¶
func (x *UpdateOwnerRequest) ProtoReflect() protoreflect.Message
func (*UpdateOwnerRequest) Reset ¶
func (x *UpdateOwnerRequest) Reset()
func (*UpdateOwnerRequest) String ¶
func (x *UpdateOwnerRequest) String() string
func (*UpdateOwnerRequest) Validate ¶
func (this *UpdateOwnerRequest) Validate() error