Documentation
¶
Index ¶
- Variables
- func CheckSpec(spec *pb.ChaincodeSpec) error
- type Devops
- func (d *Devops) Build(context context.Context, spec *pb.ChaincodeSpec) (*pb.ChaincodeDeploymentSpec, error)
- func (d *Devops) Deploy(ctx context.Context, spec *pb.ChaincodeSpec) (*pb.ChaincodeDeploymentSpec, error)
- func (d *Devops) Invoke(ctx context.Context, chaincodeInvocationSpec *pb.ChaincodeInvocationSpec) (*pb.Response, error)
- func (*Devops) Login(ctx context.Context, secret *pb.Secret) (*pb.Response, error)
- func (d *Devops) Query(ctx context.Context, chaincodeInvocationSpec *pb.ChaincodeInvocationSpec) (*pb.Response, error)
- type PeerInfo
- type ServerAdmin
- type ServerOpenchain
- func (s *ServerOpenchain) GetBlockByNumber(ctx context.Context, num *pb.BlockNumber) (*pb.Block, error)
- func (s *ServerOpenchain) GetBlockCount(ctx context.Context, e *empty.Empty) (*pb.BlockCount, error)
- func (s *ServerOpenchain) GetBlockchainInfo(ctx context.Context, e *empty.Empty) (*pb.BlockchainInfo, error)
- func (s *ServerOpenchain) GetPeerEndpoint(ctx context.Context, e *empty.Empty) (*pb.PeersMessage, error)
- func (s *ServerOpenchain) GetPeers(ctx context.Context, e *empty.Empty) (*pb.PeersMessage, error)
- func (s *ServerOpenchain) GetState(ctx context.Context, chaincodeID, key string) ([]byte, error)
- func (s *ServerOpenchain) GetTransactionByID(ctx context.Context, txID *wrappers.StringValue) (*pb.Transaction, error)
Constants ¶
This section is empty.
Variables ¶
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 ¶
func (d *Devops) Deploy(ctx context.Context, spec *pb.ChaincodeSpec) (*pb.ChaincodeDeploymentSpec, error)
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
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 ¶
func (*ServerAdmin) GetStatus(context.Context, *empty.Empty) (*pb.ServerStatus, error)
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 ¶
func (*ServerAdmin) StopServer(context.Context, *empty.Empty) (*pb.ServerStatus, error)
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) GetTransactionByID ¶
func (s *ServerOpenchain) GetTransactionByID(ctx context.Context, txID *wrappers.StringValue) (*pb.Transaction, error)
GetTransactionByID returns a transaction matching the specified ID