peer

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

Connection represents a connection to a peer.

func Connect

func Connect(peer *Peer, mspID string, identity *identity.Identity) (*Connection, error)

Connect opens a connection to the peer.

func ConnectClient

func ConnectClient(peer *client.Peer, mspID string, identity *identity.Identity, tlsEnabled bool) (*Connection, error)

ConnectClient opens a connection to the peer using a client peer object.

func (*Connection) Close

func (c *Connection) Close() error

Close closes the connection to the peer.

func (*Connection) Deliver

func (c *Connection) Deliver(envelope *common.Envelope, callback blocks.DeliverCallback) error

Deliver requests one or more blocks from the peer.

func (*Connection) Identity

func (c *Connection) Identity() *identity.Identity

Identity gets the identity used for the connection.

func (*Connection) InstallChaincode

func (c *Connection) InstallChaincode(pkg []byte) (string, error)

InstallChaincode installs the specified chaincode package onto the peer.

func (*Connection) IsConnected

func (c *Connection) IsConnected() bool

IsConnected returns true if the connection is open to the peer.

func (*Connection) JoinChannel

func (c *Connection) JoinChannel(block *common.Block) error

JoinChannel asks the peer to join the specified channel.

func (*Connection) ListChannels

func (c *Connection) ListChannels() ([]string, error)

ListChannels asks the peer for the list of channels it has joined.

func (*Connection) MSPID

func (c *Connection) MSPID() string

MSPID gets the MSP ID used for the connection.

func (*Connection) ProcessProposal

func (c *Connection) ProcessProposal(signedProposal *peer.SignedProposal) (*peer.ProposalResponse, error)

ProcessProposal asks the peer to endorse the specified proposal.

type Peer

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

Peer represents a loaded peer definition.

func New

func New(organization *organization.Organization, directory string, microfabPort int32, apiPort int32, apiURL string, chaincodePort int32, chaincodeURL string, operationsPort int32, operationsURL string, couchDB bool, couchDBPort int32, gossipPort int32, gossipURL string) (*Peer, error)

New creates a new peer.

func (*Peer) APIHost

func (p *Peer) APIHost(internal bool) string

APIHost returns the host (hostname:port) of the peer.

func (*Peer) APIHostname

func (p *Peer) APIHostname(internal bool) string

APIHostname returns the hostname of the peer.

func (*Peer) APIPort

func (p *Peer) APIPort(internal bool) int32

APIPort returns the API port of the peer.

func (*Peer) APIURL

func (p *Peer) APIURL(internal bool) *url.URL

APIURL returns the API URL of the peer.

func (*Peer) ChaincodeHost

func (p *Peer) ChaincodeHost(internal bool) string

ChaincodeHost returns the host (hostname:port) of the peer.

func (*Peer) ChaincodeHostname

func (p *Peer) ChaincodeHostname(internal bool) string

ChaincodeHostname returns the hostname of the peer.

func (*Peer) ChaincodePort

func (p *Peer) ChaincodePort(internal bool) int32

ChaincodePort returns the chaincode port of the peer.

func (*Peer) ChaincodeURL

func (p *Peer) ChaincodeURL(internal bool) *url.URL

ChaincodeURL returns the chaincode URL of the peer.

func (*Peer) EnableTLS

func (p *Peer) EnableTLS(tls *identity.Identity)

EnableTLS enables TLS for this peer.

func (*Peer) GossipHost

func (p *Peer) GossipHost(internal bool) string

GossipHost returns the host of the gossip connection

func (*Peer) GossipHostname

func (p *Peer) GossipHostname(internal bool) string

GossipHostname returns just the host name used for the gossip connection

func (*Peer) GossipURL

func (p *Peer) GossipURL(internal bool) *url.URL

GossipURL returns the full URL used for the gossip connection

func (*Peer) MSPID

func (p *Peer) MSPID() string

MSPID returns the MSP ID of the peer.

func (*Peer) OperationsHost

func (p *Peer) OperationsHost(internal bool) string

OperationsHost returns the host (hostname:port) of the peer.

func (*Peer) OperationsHostname

func (p *Peer) OperationsHostname(internal bool) string

OperationsHostname returns the hostname of the peer.

func (*Peer) OperationsPort

func (p *Peer) OperationsPort(internal bool) int32

OperationsPort returns the operations port of the peer.

func (*Peer) OperationsURL

func (p *Peer) OperationsURL(internal bool) *url.URL

OperationsURL returns the operations URL of the peer.

func (*Peer) Organization

func (p *Peer) Organization() *organization.Organization

Organization returns the organization of the peer.

func (*Peer) Start

func (p *Peer) Start(timeout time.Duration) error

Start starts the peer.

func (*Peer) Stop

func (p *Peer) Stop() error

Stop stops the peer.

func (*Peer) TLS

func (p *Peer) TLS() *identity.Identity

TLS gets the TLS identity for this peer.

Jump to

Keyboard shortcuts

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