peer

package
v0.0.0-...-85e540a Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Peer

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

Peer represents a loaded peer definition.

func FromBytes

func FromBytes(data []byte) (*Peer, error)

FromBytes creates a new connection to a peer from JSON data.

func FromFile

func FromFile(file string) (*Peer, error)

FromFile creates a new connection to a peer from a JSON file.

func New

func New(organization *organization.Organization, directory string, apiPort int32, apiURL string, chaincodePort int32, chaincodeURL string, operationsPort int32, operationsURL string) (*Peer, error)

New creates a new peer.

func (*Peer) APIPort

func (p *Peer) APIPort() int32

APIPort returns the API port of the peer.

func (*Peer) APIURL

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

APIURL returns the API URL of the peer.

func (*Peer) ChaincodePort

func (p *Peer) ChaincodePort() int32

ChaincodePort returns the chaincode port of the peer.

func (*Peer) ChaincodeURL

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

ChaincodeURL returns the chaincode URL of the peer.

func (*Peer) Close

func (p *Peer) Close() error

Close closes any open connection to the peer.

func (*Peer) Connect

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

Connect opens a connection to the peer.

func (*Peer) Connected

func (p *Peer) Connected() bool

Connected determines if a connection is open to the peer.

func (*Peer) ConnectionIdentity

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

ConnectionIdentity returns the identity used to connect to the peer.

func (*Peer) ConnectionMSPID

func (p *Peer) ConnectionMSPID() string

ConnectionMSPID returns the MSP ID used to connect to the peer.

func (*Peer) Deliver

func (p *Peer) Deliver(envelope *common.Envelope, callback blocks.DeliverCallback) error

Deliver requests one or more blocks from the peer.

func (*Peer) DeliverFiltered

func (p *Peer) DeliverFiltered(envelope *common.Envelope, callback blocks.DeliverFilteredCallback) error

DeliverFiltered requests one or more filtered blocks from the peer.

func (*Peer) Host

func (p *Peer) Host() string

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

func (*Peer) Hostname

func (p *Peer) Hostname() string

Hostname returns the hostname of the peer.

func (*Peer) InstallChaincode

func (p *Peer) InstallChaincode(scds []byte) error

InstallChaincode installs the specified chaincode package onto the peer.

func (*Peer) JoinChannel

func (p *Peer) JoinChannel(block *common.Block) error

JoinChannel asks the peer to join the specified channel.

func (*Peer) ListChannels

func (p *Peer) ListChannels() ([]string, error)

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

func (*Peer) MSPID

func (p *Peer) MSPID() string

MSPID returns the MSP ID of the peer.

func (*Peer) OperationsPort

func (p *Peer) OperationsPort() int32

OperationsPort returns the operations port of the peer.

func (*Peer) OperationsURL

func (p *Peer) OperationsURL() *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) Port

func (p *Peer) Port() int32

Port returns the port of the peer.

func (*Peer) ProcessProposal

func (p *Peer) ProcessProposal(signedProposal *peer.SignedProposal) (*peer.ProposalResponse, error)

ProcessProposal asks the peer to endorse the specified proposal.

func (*Peer) Start

func (p *Peer) Start() error

Start starts the peer.

func (*Peer) Stop

func (p *Peer) Stop() error

Stop stops the peer.

func (*Peer) ToBytes

func (p *Peer) ToBytes() ([]byte, error)

ToBytes saves the peer to JSON data.

func (*Peer) ToFile

func (p *Peer) ToFile(file string) error

ToFile saves the peer to a JSON file.

Jump to

Keyboard shortcuts

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