openchain

package
Version: v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2016 License: Apache-2.0 Imports: 22 Imported by: 40

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.

func GetRootNode

func GetRootNode() (string, error)

GetRootNode place holder function for providing a boostrap address for a Validating Peer.

func LoggingInit

func LoggingInit(command string)

LoggingInit is a 'hook' called at the beginning of command processing to parse logging-related options specified either on the command-line or in config files. Command-line options take precedence over config file options, and can also be passed as suitably-named environment variables. To change module logging levels at runtime call `logging.SetLevel(level, module)`. To debug this routine include logging=debug as the first term of the logging specification.

func SetupTestConfig

func SetupTestConfig()

SetupTestConfig setup the config during test execution

func SetupTestLogging

func SetupTestLogging()

SetupTestLogging setup the logging during test execution

Types

type Config

type Config struct {
}

Config the config wrapper structure

type Devops

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

Devops implementation of Devops services

func NewDevopsServer

func NewDevopsServer(coord peer.MessageHandlerCoordinator) *Devops

NewDevopsServer creates and returns a new Devops server instance.

func (*Devops) Build

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 (d *Devops) Login(ctx context.Context, secret *pb.Secret) (*pb.Response, error)

Login establishes the security context with the Devops service

func (*Devops) Query

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

Query performs the supplied query on the specified chaincode through a transaction

type PeerConnectionFSM

type PeerConnectionFSM struct {
	To  string
	FSM *fsm.FSM
}

PeerConnectionFSM example FSM for demonstration purposes.

func NewPeerConnectionFSM

func NewPeerConnectionFSM(to string) *PeerConnectionFSM

NewPeerConnectionFSM creates and returns a PeerConnectionFSM

type PeerInfo

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

PeerInfo

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

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.

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 *google_protobuf1.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 *google_protobuf1.Empty) (*pb.BlockchainInfo, error)

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

func (*ServerOpenchain) GetPeers

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) GetTransactionByUUID

func (s *ServerOpenchain) GetTransactionByUUID(ctx context.Context, txUUID string) (*pb.Transaction, error)

GetTransactionByUUID returns a transaction matching the specified UUID

Directories

Path Synopsis
obcpbft
Package obcpbft is a generated protocol buffer package.
Package obcpbft is a generated protocol buffer package.
example
chaincode/chaincode_example03
This program is an erroneous chaincode program that attempts to put state in query context - query should return error
This program is an erroneous chaincode program that attempts to put state in query context - query should return error
system_chaincode

Jump to

Keyboard shortcuts

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