Documentation ¶
Overview ¶
tape.go is utils copied from tape project
Index ¶
- Variables
- func CommitterFrom(connect *grpc.ClientConn) orderer.AtomicBroadcastClient
- func CreateProposal(creator []byte, channel, ccname, version string, ...) (proposal *peer.Proposal, txid string, err error)
- func DERToPrivateKey(der []byte) (key interface{}, err error)
- func EndorserFrom(connect *grpc.ClientConn) peer.EndorserClient
- func FindKeyFilesOrPanic(dirname string) []string
- func GetCertificate(f string) (*x509.Certificate, []byte, error)
- func GetChaincodeHeaderExtension(hdr *common.Header) (*peer.ChaincodeHeaderExtension, error)
- func GetPrivateKey(f string) (*ecdsa.PrivateKey, error)
- func GetRandomNonce() []byte
- func IsLowS(k *ecdsa.PublicKey, s *big.Int) (bool, error)
- func PEMtoPrivateKey(raw []byte, pwd []byte) (interface{}, error)
- func Ping(target string, params Params) (connect *grpc.ClientConn, err error)
- func ToAddress(url string) string
- func ToLowS(k *ecdsa.PublicKey, s *big.Int) (*big.Int, bool, error)
- type Committer
- type Crypto
- type CryptoConfig
- type ECDSASignature
- type Endorser
- type Eventer
- type Node
- type SeekInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // CurveHalfOrders contains the precomputed curve group orders halved. // It is used to ensure that signature' S value is lower or equal to the // curve group order halved. We accept only low-S signatures. // They are precomputed for efficiency reasons. CurveHalfOrders = map[elliptic.Curve]*big.Int{ elliptic.P224(): new(big.Int).Rsh(elliptic.P224().Params().N, 1), elliptic.P256(): new(big.Int).Rsh(elliptic.P256().Params().N, 1), elliptic.P384(): new(big.Int).Rsh(elliptic.P384().Params().N, 1), elliptic.P521(): new(big.Int).Rsh(elliptic.P521().Params().N, 1), } )
View Source
var SeekMax = &orderer.SeekPosition{ Type: &orderer.SeekPosition_Specified{ Specified: &orderer.SeekSpecified{ Number: math.MaxUint64, }, }, }
View Source
var SeekNewest = &orderer.SeekPosition{ Type: &orderer.SeekPosition_Newest{ Newest: &orderer.SeekNewest{}, }, }
Functions ¶
func CommitterFrom ¶
func CommitterFrom(connect *grpc.ClientConn) orderer.AtomicBroadcastClient
func CreateProposal ¶
func DERToPrivateKey ¶
DERToPrivateKey unmarshals a der to private key
func EndorserFrom ¶
func EndorserFrom(connect *grpc.ClientConn) peer.EndorserClient
func FindKeyFilesOrPanic ¶
func GetCertificate ¶
func GetCertificate(f string) (*x509.Certificate, []byte, error)
func GetChaincodeHeaderExtension ¶ added in v0.0.1
func GetChaincodeHeaderExtension(hdr *common.Header) (*peer.ChaincodeHeaderExtension, error)
func GetPrivateKey ¶
func GetPrivateKey(f string) (*ecdsa.PrivateKey, error)
func GetRandomNonce ¶
func GetRandomNonce() []byte
func PEMtoPrivateKey ¶
PEMtoPrivateKey unmarshals a pem to private key
Types ¶
type Committer ¶
type Committer struct { orderer.AtomicBroadcastClient orderer.AtomicBroadcast_BroadcastClient // not intrinsic context.Context }
type Crypto ¶
type Crypto struct { Creator []byte PrivKey *ecdsa.PrivateKey SignCert *x509.Certificate Digest func([]byte) []byte }
func LoadCryptoFrom ¶
func LoadCryptoFrom(config CryptoConfig) (*Crypto, error)
func (*Crypto) NewSignatureHeader ¶
func (s *Crypto) NewSignatureHeader() (*common.SignatureHeader, error)
func (*Crypto) SetDefaultDigest ¶
func (s *Crypto) SetDefaultDigest()
type CryptoConfig ¶
type ECDSASignature ¶
type Endorser ¶
type Endorser struct { peer.EndorserClient context.Context }
func (*Endorser) ProcessProposal ¶
func (endorser *Endorser) ProcessProposal(in *peer.SignedProposal) (*peer.ProposalResponse, error)
type Eventer ¶
type Eventer struct { peer.DeliverClient context.Context peer.Deliver_DeliverWithPrivateDataClient Continue func(currentDeliverResponse *peer.DeliverResponse, currentError error, deliverResponses []*peer.DeliverResponse, errors []error) bool ErrorReducer func(errors []error) error ReceiptData interface{} }
func EventerFrom ¶
func EventerFrom(ctx context.Context, connect *grpc.ClientConn) Eventer
func (*Eventer) AsTransactionListener ¶
AsTransactionListener return a proper SeekInfo
type Node ¶
type Node struct { Addr string `yaml:"addr"` TLSCACert string `yaml:"tls_ca_cert"` TLSCAKey string `yaml:"tls_ca_key"` TLSCARoot string `yaml:"tls_ca_root"` TLSCACertByte []byte TLSCAKeyByte []byte TLSCARootByte []byte SslTargetNameOverride string `json:"ssl-target-name-override"` }
func (Node) AsGRPCClient ¶
func (node Node) AsGRPCClient() (connect *grpc.ClientConn, err error)
type SeekInfo ¶
func SeekInfoFrom ¶
func SeekInfoFrom(start, stop *orderer.SeekPosition) SeekInfo
func (SeekInfo) Fetch ¶
Fetch will only get current existing blocks. Commonly used for: get genesis block, query block content
func (SeekInfo) WaitUtilReady ¶
WaitUtilReady will wait for future block Commonly used for: Wait for next block, confirming tx finality
Click to show internal directories.
Click to hide internal directories.