benchmark

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: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ERROR_ACCOUNT_EXISTING = "{\"code\":302, \"reason\": \"account already exists\"}"
View Source
const ERROR_ACCOUT_ABNORMAL = "{\"code\":303, \"reason\": \"abnormal account\"}"
View Source
const ERROR_MONEY_NOT_ENOUGH = "{\"code\":304, \"reason\": \"account's money is not enough\"}"
View Source
const ERROR_PUT_STATE = "Failed to put state"
View Source
const ERROR_SYSTEM = "{\"code\":300, \"reason\": \"system error: %s\"}"
View Source
const ERROR_SYSTEM_EXCEPTION = "System exception"
View Source
const ERROR_UNKNOWN_FUNC = "Unknown function"
View Source
const ERROR_WRONG_ARGS = "Wrong arguments of function"
View Source
const ERROR_WRONG_FORMAT = "{\"code\":301, \"reason\": \"command format is wrong\"}"
View Source
const ERR_NOT_FOUND = "Could not find specified account"

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	CustomId        string
	CustomName      string
	SavingsBalance  int
	CheckingBalance int
}

type DigitalItem

type DigitalItem struct {
	Author     string
	CreateTime string
	Info       string
	Identity   string
}

type DrmChaincode

type DrmChaincode struct {
}

func (*DrmChaincode) Check

func (t *DrmChaincode) Check(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)

check if a digital item is already published

func (*DrmChaincode) Init

func (t *DrmChaincode) Init(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error)

func (*DrmChaincode) Invoke

func (t *DrmChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error)

func (*DrmChaincode) Publish

func (t *DrmChaincode) Publish(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)

publish a digital item, store the hash and drm information into ledger

func (*DrmChaincode) Query

func (t *DrmChaincode) Query(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error)

query the drm info by item's identity

type PublishRequest

type PublishRequest struct {
	Author     string
	CreateTime string
	Info       string
	Item       string
}

type QueryResponse

type QueryResponse struct {
	Result     string // "Published" or "Unknown"
	Author     string
	CreateTime string
	Info       string
}

type SimpleChaincode

type SimpleChaincode struct {
}

SimpleChaincode example simple Chaincode implementation

func (*SimpleChaincode) Delete

func (t *SimpleChaincode) Delete(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)

delete an account, should be [delete account]

func (*SimpleChaincode) Init

func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error)

func (*SimpleChaincode) Invoke

func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error)

Transaction makes payment of X units from A to B

func (*SimpleChaincode) Open

func (t *SimpleChaincode) Open(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)

open an account, should be [open account money]

func (*SimpleChaincode) Query

func (t *SimpleChaincode) Query(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error)

query current money of the account,should be [query accout]

func (*SimpleChaincode) Transfer

func (t *SimpleChaincode) Transfer(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)

transfer money from account1 to account2, should be [transfer accout1 accout2 money]

type SmallbankChaincode

type SmallbankChaincode struct {
}

func (*SmallbankChaincode) Amalgamate

func (t *SmallbankChaincode) Amalgamate(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)

func (*SmallbankChaincode) CreateAccount

func (t *SmallbankChaincode) CreateAccount(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)

func (*SmallbankChaincode) DepositChecking

func (t *SmallbankChaincode) DepositChecking(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)

func (*SmallbankChaincode) Init

func (t *SmallbankChaincode) Init(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error)

func (*SmallbankChaincode) Invoke

func (t *SmallbankChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error)

func (*SmallbankChaincode) Query

func (t *SmallbankChaincode) Query(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error)

func (*SmallbankChaincode) SendPayment

func (t *SmallbankChaincode) SendPayment(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)

func (*SmallbankChaincode) TransactSavings

func (t *SmallbankChaincode) TransactSavings(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)

func (*SmallbankChaincode) WriteCheck

func (t *SmallbankChaincode) WriteCheck(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)

Jump to

Keyboard shortcuts

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