Documentation ¶
Index ¶
- Constants
- type Account
- type DigitalItem
- type DrmChaincode
- func (t *DrmChaincode) Check(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)
- func (t *DrmChaincode) Init(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error)
- func (t *DrmChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error)
- func (t *DrmChaincode) Publish(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)
- func (t *DrmChaincode) Query(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error)
- type PublishRequest
- type QueryResponse
- type SimpleChaincode
- func (t *SimpleChaincode) Delete(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)
- func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error)
- func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error)
- func (t *SimpleChaincode) Open(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)
- func (t *SimpleChaincode) Query(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error)
- func (t *SimpleChaincode) Transfer(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)
- type SmallbankChaincode
- func (t *SmallbankChaincode) Amalgamate(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)
- func (t *SmallbankChaincode) CreateAccount(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)
- func (t *SmallbankChaincode) DepositChecking(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)
- func (t *SmallbankChaincode) Init(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error)
- func (t *SmallbankChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error)
- func (t *SmallbankChaincode) Query(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error)
- func (t *SmallbankChaincode) SendPayment(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)
- func (t *SmallbankChaincode) TransactSavings(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)
- func (t *SmallbankChaincode) WriteCheck(stub shim.ChaincodeStubInterface, args []string) ([]byte, error)
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 DigitalItem ¶
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 QueryResponse ¶
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)
Click to show internal directories.
Click to hide internal directories.