peer

package
v0.0.0-...-e171dc0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PeersToTxnProcessors

func PeersToTxnProcessors(peers []fab.Peer) []apitxn.ProposalProcessor

PeersToTxnProcessors converts a slice of Peers to a slice of TxnProposalProcessors

Types

type Peer

type Peer struct {
	// contains filtered or unexported fields
}

Peer represents a node in the target blockchain network to which HFC sends endorsement proposals, transaction ordering or query requests.

func NewPeer

func NewPeer(url string, config apiconfig.Config) (*Peer, error)

NewPeer constructs a Peer given its endpoint configuration settings. url is the URL with format of "host:port".

func NewPeerFromProcessor

func NewPeerFromProcessor(url string, processor apitxn.ProposalProcessor, config apiconfig.Config) (*Peer, error)

NewPeerFromProcessor constructs a Peer with a ProposalProcessor to simulate transactions.

func NewPeerTLSFromCert

func NewPeerTLSFromCert(url string, certificate string, serverHostOverride string, config apiconfig.Config) (*Peer, error)

NewPeerTLSFromCert constructs a Peer given its endpoint configuration settings. url is the URL with format of "host:port". certificate is ... serverNameOverride is passed to NewClientTLSFromCert in grpc/credentials.

func (*Peer) EnrollmentCertificate

func (p *Peer) EnrollmentCertificate() *pem.Block

EnrollmentCertificate returns the Peer's enrollment certificate. It returns the certificate in PEM format signed by the trusted CA.

func (*Peer) MSPID

func (p *Peer) MSPID() string

MSPID gets the Peer mspID.

func (*Peer) Name

func (p *Peer) Name() string

Name gets the Peer name.

func (*Peer) ProcessTransactionProposal

func (p *Peer) ProcessTransactionProposal(proposal apitxn.TransactionProposal) (apitxn.TransactionProposalResult, error)

ProcessTransactionProposal sends the created proposal to peer for endorsement.

func (*Peer) Roles

func (p *Peer) Roles() []string

Roles gets the user’s roles the Peer participates in. It’s an array of possible values in “client”, and “auditor”. The member service defines two more roles reserved for peer membership: “peer” and “validator”, which are not exposed to the applications. It returns the roles for this user.

func (*Peer) SetEnrollmentCertificate

func (p *Peer) SetEnrollmentCertificate(pem *pem.Block)

SetEnrollmentCertificate set the Peer’s enrollment certificate. pem is the enrollment Certificate in PEM format signed by the trusted CA.

func (*Peer) SetMSPID

func (p *Peer) SetMSPID(mspID string)

SetMSPID sets the Peer mspID.

func (*Peer) SetName

func (p *Peer) SetName(name string)

SetName sets the Peer name / id.

func (*Peer) SetRoles

func (p *Peer) SetRoles(roles []string)

SetRoles sets the user’s roles the Peer participates in. See getRoles() for legitimate values. roles is the list of roles for the user.

func (*Peer) URL

func (p *Peer) URL() string

URL gets the Peer URL. Required property for the instance objects. It returns the address of the Peer.

type TransactionProposalError

type TransactionProposalError struct {
	Endorser string
	Proposal apitxn.TransactionProposal
	Err      error
}

TransactionProposalError represents an error condition that prevented proposal processing.

func (TransactionProposalError) Error

func (tpe TransactionProposalError) Error() string

Jump to

Keyboard shortcuts

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