Documentation ¶
Index ¶
- Constants
- Variables
- func NewClientConnection(addr string, kopts *KeepaliveOptions, creds credentials.TransportCredentials, ...) (*grpc.ClientConn, error)
- func ParseConfig() error
- func Start(cc Chaincode) error
- type Chaincode
- type ChaincodeStub
- func (stub *ChaincodeStub) GetBalance(who string) (string, error)
- func (stub *ChaincodeStub) GetCcid() string
- func (stub *ChaincodeStub) GetCreator() string
- func (stub *ChaincodeStub) GetData() [][]byte
- func (stub *ChaincodeStub) GetFuncAndArgs() (string, []string)
- func (stub *ChaincodeStub) GetOwner() string
- func (stub *ChaincodeStub) GetState(key string) ([]byte, error)
- func (stub *ChaincodeStub) GetStates(keys ...string) (map[string][]byte, error)
- func (stub *ChaincodeStub) GetStringData() []string
- func (stub *ChaincodeStub) GetTxid() string
- func (stub *ChaincodeStub) PutState(key string, value []byte, ifNotExist bool) error
- func (stub *ChaincodeStub) PutStates(states map[string][]byte, keys ...string) error
- func (stub *ChaincodeStub) Transfer(to, coin string) error
- type ChaincodeStubInterface
- type Handler
- type KeepaliveOptions
- type NetConfig
- type PeerInfo
- type RespStatus
- type Stream
- type Token
Constants ¶
View Source
const ( MAX_RECV_MSG_SIZE = 100 * 1024 * 1024 // 100 Mbytes MAX_SEND_MSG_SIZE = 100 * 1024 * 1024 // 100 Mbytes DEFAULT_TIMEOUT = 3 * time.Second // 3 seconds )
Variables ¶
View Source
var DefaultKeepaliveOptions = &KeepaliveOptions{ ClientInterval: time.Duration(1) * time.Minute, ClientTimeout: time.Duration(20) * time.Second, }
Functions ¶
func NewClientConnection ¶
func NewClientConnection(addr string, kopts *KeepaliveOptions, creds credentials.TransportCredentials, block bool) (*grpc.ClientConn, error)
func ParseConfig ¶
func ParseConfig() error
Types ¶
type Chaincode ¶
type Chaincode interface { Init(stub ChaincodeStubInterface) error Invoke(stub ChaincodeStubInterface) error }
type ChaincodeStub ¶
type ChaincodeStub struct {
// contains filtered or unexported fields
}
func (*ChaincodeStub) GetBalance ¶
func (stub *ChaincodeStub) GetBalance(who string) (string, error)
func (*ChaincodeStub) GetCcid ¶
func (stub *ChaincodeStub) GetCcid() string
func (*ChaincodeStub) GetCreator ¶
func (stub *ChaincodeStub) GetCreator() string
func (*ChaincodeStub) GetData ¶
func (stub *ChaincodeStub) GetData() [][]byte
func (*ChaincodeStub) GetFuncAndArgs ¶
func (stub *ChaincodeStub) GetFuncAndArgs() (string, []string)
func (*ChaincodeStub) GetOwner ¶
func (stub *ChaincodeStub) GetOwner() string
func (*ChaincodeStub) GetStates ¶
func (stub *ChaincodeStub) GetStates(keys ...string) (map[string][]byte, error)
func (*ChaincodeStub) GetStringData ¶
func (stub *ChaincodeStub) GetStringData() []string
func (*ChaincodeStub) GetTxid ¶
func (stub *ChaincodeStub) GetTxid() string
func (*ChaincodeStub) PutState ¶
func (stub *ChaincodeStub) PutState(key string, value []byte, ifNotExist bool) error
func (*ChaincodeStub) PutStates ¶
func (stub *ChaincodeStub) PutStates(states map[string][]byte, keys ...string) error
func (*ChaincodeStub) Transfer ¶
func (stub *ChaincodeStub) Transfer(to, coin string) error
type ChaincodeStubInterface ¶
type ChaincodeStubInterface interface { GetCcid() string GetOwner() string GetTxid() string GetCreator() string GetData() [][]byte GetStringData() []string GetFuncAndArgs() (string, []string) GetState(key string) ([]byte, error) GetStates(keys ...string) (map[string][]byte, error) //GetStateByRange(startKey, endKey string) (map[string][]byte, error) PutState(key string, value []byte, ifNotExist bool) error PutStates(states map[string][]byte, keys ...string) error Transfer(to, coin string) error GetBalance(who string) (string, error) }
type KeepaliveOptions ¶
type NetConfig ¶
type NetConfig struct { //Clients []ClientInfo `json:"clients"` Peers []PeerInfo `json:"peers"` }
type RespStatus ¶
type RespStatus uint8
const ( RespStatusError RespStatus = iota RespStatusUpdate RespStatusQuery )
type Stream ¶
type Stream interface { Send(*pb.ChaincodeMessage) error Recv() (*pb.ChaincodeMessage, error) CloseSend() error }
type Token ¶
type Token interface { Transfer(stub ChaincodeStubInterface, to, amount string) error GetBalance(stub ChaincodeStubInterface, who string) error GetTotalSupply(stub ChaincodeStubInterface) error }
Click to show internal directories.
Click to hide internal directories.