Documentation ¶
Index ¶
- func UnmarshalCommand(raw []byte) (*token.Command, error)
- type ACLProvider
- type ACLResources
- type CapabilityChecker
- type Issuer
- type Manager
- type Marshaler
- type PeerLedgerManager
- type PolicyBasedAccessControl
- type PolicyChecker
- type Prover
- func (s *Prover) ListUnspentTokens(ctxt context.Context, header *token.Header, listRequest *token.ListRequest) (*token.CommandResponse_UnspentTokens, error)
- func (s *Prover) MarshalErrorResponse(command []byte, e error) (*token.SignedCommandResponse, error)
- func (s *Prover) ProcessCommand(ctx context.Context, sc *token.SignedCommand) (*token.SignedCommandResponse, error)
- func (s *Prover) RequestApprove(ctx context.Context, header *token.Header, request *token.ApproveRequest) (*token.CommandResponse_TokenTransaction, error)
- func (s *Prover) RequestExpectation(ctx context.Context, header *token.Header, request *token.ExpectationRequest) (*token.CommandResponse_TokenTransaction, error)
- func (s *Prover) RequestImport(ctx context.Context, header *token.Header, requestImport *token.ImportRequest) (*token.CommandResponse_TokenTransaction, error)
- func (s *Prover) RequestRedeem(ctx context.Context, header *token.Header, request *token.RedeemRequest) (*token.CommandResponse_TokenTransaction, error)
- func (s *Prover) RequestTransfer(ctx context.Context, header *token.Header, request *token.TransferRequest) (*token.CommandResponse_TokenTransaction, error)
- func (s *Prover) RequestTransferFrom(ctx context.Context, header *token.Header, request *token.TransferRequest) (*token.CommandResponse_TokenTransaction, error)
- func (s *Prover) ValidateHeader(header *token.Header) error
- type ResponseMarshaler
- type Signer
- type SignerIdentity
- type TMSManager
- type TimeFunc
- type TokenCapabilityChecker
- type Transactor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ACLProvider ¶
type ACLResources ¶
type CapabilityChecker ¶
CapabilityChecker用于检查通道是否支持令牌函数。
type Issuer ¶
type Issuer interface { //问题创建导入请求事务。 RequestImport(tokensToIssue []*token.TokenToIssue) (*token.TokenTransaction, error) //RequestExpectation允许基于期望进行间接导入。 //它创建一个具有预期中指定的输出的令牌事务。 RequestExpectation(request *token.ExpectationRequest) (*token.TokenTransaction, error) }
颁发者创建令牌导入请求。
type Manager ¶
type Manager struct {
LedgerManager ledger.LedgerManager
}
管理器实现令牌/服务器/tmsmanager接口 TODO:将在lscc baased tms配置可用后更新
func (*Manager) GetIssuer ¶
func (manager *Manager) GetIssuer(channel string, privateCredential, publicCredential []byte) (Issuer, error)
现在它返回一个普通的发行者。 当基于LSCC的TMS配置可用后,它将被更新。 返回为特定通道配置的颁发者
func (*Manager) GetTransactor ¶
func (manager *Manager) GetTransactor(channel string, privateCredential, publicCredential []byte) (Transactor, error)
GetTransactor返回绑定到已传递通道的事务处理程序及其凭据 是元组(privatecredential、publiccredential)。
type Marshaler ¶
type Marshaler interface {
MarshalCommandResponse(command []byte, responsePayload interface{}) (*token.SignedCommandResponse, error)
}
编组人员负责编组和签署命令响应。
type PeerLedgerManager ¶
type PeerLedgerManager struct { }
PeerledgerManager实现了ledgerManager接口 通过使用对等基础设施
func (*PeerLedgerManager) GetLedgerReader ¶
func (*PeerLedgerManager) GetLedgerReader(channel string) (ledger.LedgerReader, error)
type PolicyBasedAccessControl ¶
type PolicyBasedAccessControl struct { ACLProvider ACLProvider ACLResources *ACLResources }
PolicyBasedAccessControl实现令牌命令访问控制功能。
func (*PolicyBasedAccessControl) Check ¶
func (ac *PolicyBasedAccessControl) Check(sc *token.SignedCommand, c *token.Command) error
type PolicyChecker ¶
type PolicyChecker interface {
Check(sc *token.SignedCommand, c *token.Command) error
}
PolicyChecker负责执行基于策略的访问控制 与令牌命令相关的检查。
type Prover ¶
type Prover struct { CapabilityChecker CapabilityChecker Marshaler Marshaler PolicyChecker PolicyChecker TMSManager TMSManager }
提供程序负责处理令牌命令。
func NewProver ¶
func NewProver(policyChecker PolicyChecker, signingIdentity SignerIdentity) (*Prover, error)
newprover创建prover
func (*Prover) ListUnspentTokens ¶
func (s *Prover) ListUnspentTokens(ctxt context.Context, header *token.Header, listRequest *token.ListRequest) (*token.CommandResponse_UnspentTokens, error)
func (*Prover) MarshalErrorResponse ¶
func (*Prover) ProcessCommand ¶
func (s *Prover) ProcessCommand(ctx context.Context, sc *token.SignedCommand) (*token.SignedCommandResponse, error)
func (*Prover) RequestApprove ¶
func (s *Prover) RequestApprove(ctx context.Context, header *token.Header, request *token.ApproveRequest) (*token.CommandResponse_TokenTransaction, error)
func (*Prover) RequestExpectation ¶
func (s *Prover) RequestExpectation(ctx context.Context, header *token.Header, request *token.ExpectationRequest) (*token.CommandResponse_TokenTransaction, error)
请求期望获取颁发者或事务处理者并创建令牌事务响应 用于进口、转让或赎回。
func (*Prover) RequestImport ¶
func (s *Prover) RequestImport(ctx context.Context, header *token.Header, requestImport *token.ImportRequest) (*token.CommandResponse_TokenTransaction, error)
func (*Prover) RequestRedeem ¶
func (s *Prover) RequestRedeem(ctx context.Context, header *token.Header, request *token.RedeemRequest) (*token.CommandResponse_TokenTransaction, error)
func (*Prover) RequestTransfer ¶
func (s *Prover) RequestTransfer(ctx context.Context, header *token.Header, request *token.TransferRequest) (*token.CommandResponse_TokenTransaction, error)
func (*Prover) RequestTransferFrom ¶
func (s *Prover) RequestTransferFrom(ctx context.Context, header *token.Header, request *token.TransferRequest) (*token.CommandResponse_TokenTransaction, error)
type ResponseMarshaler ¶
responseMarshaler生成token.signedMandResponse
func NewResponseMarshaler ¶
func NewResponseMarshaler(signerID SignerIdentity) (*ResponseMarshaler, error)
func (*ResponseMarshaler) MarshalCommandResponse ¶
func (s *ResponseMarshaler) MarshalCommandResponse(command []byte, responsePayload interface{}) (*token.SignedCommandResponse, error)
type SignerIdentity ¶
type SignerIdentity interface { Signer //serialize返回用于验证的此标识的字节表示形式 //此SignerIdentity签名的邮件 Serialize() ([]byte, error) }
SignerIdentity对消息进行签名并将其公共标识序列化为字节
type TMSManager ¶
type TMSManager interface { //GetIssuer返回绑定到已传递通道的颁发者及其凭据 //是元组(privatecredential、publiccredential)。 GetIssuer(channel string, privateCredential, publicCredential []byte) (Issuer, error) //GetTransactor返回绑定到已传递通道的事务处理程序及其凭据 //是元组(privatecredential、publiccredential)。 GetTransactor(channel string, privateCredential, publicCredential []byte) (Transactor, error) }
type TokenCapabilityChecker ¶
type TokenCapabilityChecker struct {
PeerOps peer.Operations
}
TokenCapabilityChecker实现CapabilityChecker接口
type Transactor ¶
type Transactor interface { //RequestTransfer创建与令牌传输相关联的数据,假设 //应用程序级标识。Intokens字节是标识符 //在输出中,需要从分类帐中查找其详细信息。 RequestTransfer(request *token.TransferRequest) (*token.TokenTransaction, error) //RequestReduce允许赎回输入tokenids中的令牌 //它查询分类账以读取每个令牌ID的详细信息。 //它创建了一个令牌事务,并为兑换的令牌和 //可能是另一个输出,用于将剩余的令牌(如果有)传输给创建者 RequestRedeem(request *token.RedeemRequest) (*token.TokenTransaction, error) //listTokens返回此事务处理程序拥有的未使用令牌的一部分 ListTokens() (*token.UnspentTokens, error) //RequestApprove创建一个包含必要数据的令牌事务 //赞成 RequestApprove(request *token.ApproveRequest) (*token.TokenTransaction, error) //RequestTransferFrom创建一个包含必要数据的令牌事务 //转让先前委托转让的第三方的代币 //通过批准请求 RequestTransferFrom(request *token.TransferRequest) (*token.TokenTransaction, error) //请求期望允许基于期望进行间接传输。 //它创建一个具有预期中指定的输出的令牌事务。 RequestExpectation(request *token.ExpectationRequest) (*token.TokenTransaction, error) //完成释放此事务处理程序持有的任何资源 Done() }
交易人允许使用已发行的代币
Source Files ¶
Click to show internal directories.
Click to hide internal directories.