Documentation ¶
Index ¶
- func CopyAndSumCode(r io.Reader) ([]byte, *bytes.Buffer, error)
- func DownloadCode(url string, retry int) (*http.Response, error)
- func StoreCode(codeDir string, r io.Reader) ([]byte, error)
- func WriteCodeFile(codeDir string, codeID []byte, r io.Reader) error
- type CallContext
- type Chaincode
- type CodeDriver
- type CodeInfo
- type DeploymentInput
- type DriverType
- type MockCallContext
- type MockState
- type QueryData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CallContext ¶
type Chaincode ¶
type Chaincode interface { // Init is called when chaincode is deployed Init(ctx CallContext) error Invoke(ctx CallContext) error Query(ctx CallContext) ([]byte, error) }
Chaincode all chaincodes implements this interface
type CodeDriver ¶
type CodeDriver interface { // Install is called when code deployment transaction is received // Example data field - download url for code binary // After successful Install, getInstance should give a Chaincode instance without error Install(codeID, data []byte) error GetInstance(codeID []byte) (Chaincode, error) }
type CodeInfo ¶
type CodeInfo struct { DriverType DriverType `json:"driverType"` CodeID []byte `json:"codeID"` }
type DeploymentInput ¶
type DriverType ¶
type DriverType uint8
const ( DriverTypeNative DriverType = iota + 1 DriverTypeBincc DriverTypeEVM )
type MockCallContext ¶
type MockCallContext struct { MockSender []byte MockBlockHeight uint64 MockBlockHash []byte MockInput []byte *MockState }
func (*MockCallContext) BlockHash ¶
func (wc *MockCallContext) BlockHash() []byte
func (*MockCallContext) BlockHeight ¶
func (wc *MockCallContext) BlockHeight() uint64
func (*MockCallContext) Input ¶
func (wc *MockCallContext) Input() []byte
func (*MockCallContext) Sender ¶
func (wc *MockCallContext) Sender() []byte
type MockState ¶
func NewMockState ¶
func NewMockState() *MockState
Click to show internal directories.
Click to hide internal directories.