service

package
v0.0.0-...-667e438 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned if a requested resource does not exist
	ErrNotFound = errors.New("openchain: resource not found")
)

Functions

func CheckSpec

func CheckSpec(spec *pb.ChaincodeSpec) error

CheckSpec to see if chaincode resides within current package capture for language.

Types

type Devops

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

Devops implementation of Devops services

func NewDevopsServer

func NewDevopsServer(p *node.NodeEngine) *Devops

NewDevopsServer creates and returns a new Devops server instance.

func (*Devops) Build

func (d *Devops) Build(context context.Context, spec *pb.ChaincodeSpec) (*pb.ChaincodeDeploymentSpec, error)

Build builds the supplied chaincode image

func (*Devops) Deploy

Deploy deploys the supplied chaincode image to the validators through a transaction

func (*Devops) Invoke

func (d *Devops) Invoke(ctx context.Context, chaincodeInvocationSpec *pb.ChaincodeInvocationSpec) (*pb.Response, error)

Invoke performs the supplied invocation on the specified chaincode through a transaction

func (*Devops) Login

func (*Devops) Login(ctx context.Context, secret *pb.Secret) (*pb.Response, error)

TODO: login should become part of the cred

func (*Devops) Query

func (d *Devops) Query(ctx context.Context, chaincodeInvocationSpec *pb.ChaincodeInvocationSpec) (*pb.Response, error)

Current query only do query in local and do not really gen a query tx

type PeerInfo

type PeerInfo interface {
	GetPeers() (*pb.PeersMessage, error)
	GetPeerEndpoint() (*pb.PeerEndpoint, error)
}

PeerInfo defines API to peer info data

type ServerAdmin

type ServerAdmin struct {
}

ServerAdmin implementation of the Admin service for the Peer

func NewAdminServer

func NewAdminServer() *ServerAdmin

NewAdminServer creates and returns a Admin service instance.

func (*ServerAdmin) GetStatus

GetStatus reports the status of the server

func (*ServerAdmin) StartServer

func (*ServerAdmin) StartServer(context.Context, *empty.Empty) (*pb.ServerStatus, error)

StartServer starts the server

func (*ServerAdmin) StopServer

StopServer stops the server

type ServerOpenchain

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

ServerOpenchain defines the Openchain server object, which holds the Ledger data structure and the pointer to the peerServer.

func NewOpenchainServer

func NewOpenchainServer() (*ServerOpenchain, error)

NewOpenchainServer creates a new instance of the ServerOpenchain.

func NewOpenchainServerWithPeerInfo

func NewOpenchainServerWithPeerInfo(peerServer PeerInfo) (*ServerOpenchain, error)

NewOpenchainServerWithPeerInfo creates a new instance of the ServerOpenchain. TODO: we should be albe to support mutiple ledgers

func (*ServerOpenchain) GetBlockByNumber

func (s *ServerOpenchain) GetBlockByNumber(ctx context.Context, num *pb.BlockNumber) (*pb.Block, error)

GetBlockByNumber returns the data contained within a specific block in the blockchain. The genesis block is block zero.

func (*ServerOpenchain) GetBlockCount

func (s *ServerOpenchain) GetBlockCount(ctx context.Context, e *empty.Empty) (*pb.BlockCount, error)

GetBlockCount returns the current number of blocks in the blockchain data structure.

func (*ServerOpenchain) GetBlockchainInfo

func (s *ServerOpenchain) GetBlockchainInfo(ctx context.Context, e *empty.Empty) (*pb.BlockchainInfo, error)

GetBlockchainInfo returns information about the blockchain ledger such as height, current block hash, and previous block hash.

func (*ServerOpenchain) GetPeerEndpoint

func (s *ServerOpenchain) GetPeerEndpoint(ctx context.Context, e *empty.Empty) (*pb.PeersMessage, error)

GetPeerEndpoint returns PeerEndpoint info of target peer.

func (*ServerOpenchain) GetPeers

func (s *ServerOpenchain) GetPeers(ctx context.Context, e *empty.Empty) (*pb.PeersMessage, error)

GetPeers returns a list of all peer nodes currently connected to the target peer.

func (*ServerOpenchain) GetState

func (s *ServerOpenchain) GetState(ctx context.Context, chaincodeID, key string) ([]byte, error)

GetState returns the value for a particular chaincode ID and key

func (*ServerOpenchain) GetTransactionByID

func (s *ServerOpenchain) GetTransactionByID(ctx context.Context, txID *wrappers.StringValue) (*pb.Transaction, error)

GetTransactionByID returns a transaction matching the specified ID

Jump to

Keyboard shortcuts

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