Documentation
¶
Index ¶
- Constants
- Variables
- func FromArgsWithAdmin(symbol string, args []string) (*proto.Config, error)
- func FromArgsWithIssuerAndAdmin(symbol string, args []string) (*proto.Config, error)
- func FromArgsWithIssuerAndFeeSetter(symbol string, args []string) (*proto.Config, error)
- func FromArgsWithIssuerFeeSetterAndFeeAddressSetter(symbol string, args []string) (*proto.Config, error)
- func FromBytes(cfgBytes []byte) (*proto.Config, error)
- func FromInitArgs(channel string, args []string) ([]byte, error)deprecated
- func IsJSON(args []string) bool
- func Load(stub shim.ChaincodeStubInterface) ([]byte, error)
- func Save(stub shim.ChaincodeStubInterface, cfgBytes []byte) error
Constants ¶
const BatchPrefix = "batchTransactions"
BatchPrefix is a prefix for batched transactions
Variables ¶
var ( ErrAdminEmpty = errors.New("'admin' address is empty") ErrIssuerEmpty = errors.New("'issuer' address is empty") ErrFeeSetterEmpty = errors.New("'fee-setter' address is empty") ErrFeeAddressSetterEmpty = errors.New("'fee-address-setter' address is empty") )
positional args specific errors
var ErrCfgBytesEmpty = errors.New("config bytes is empty")
Functions ¶
func FromArgsWithAdmin ¶
FromArgsWithAdmin configures the proto.Config with an admin address. Args: [platformSKI (deprecated), robotSKI, adminAddress]
func FromArgsWithIssuerAndAdmin ¶
FromArgsWithIssuerAndAdmin configures the proto.Config with an issuer and admin address. Args: [platformSKI (deprecated), robotSKI, issuerAddress, adminAddress]
func FromArgsWithIssuerAndFeeSetter ¶
FromArgsWithIssuerAndFeeSetter configures the proto.Config with an issuer and fee setter address. Args: [platformSKI (deprecated), robotSKI, issuerAddress, feeSetter]
func FromArgsWithIssuerFeeSetterAndFeeAddressSetter ¶
func FromArgsWithIssuerFeeSetterAndFeeAddressSetter(symbol string, args []string) (*proto.Config, error)
FromArgsWithIssuerFeeSetterAndFeeAddressSetter configures the proto.Config with an issuer, fee setter, and fee admin setter address. Args: [platformSKI (deprecated), robotSKI, issuerAddress, feeSetter, feeAddressSetter]
func FromBytes ¶
FromBytes parses the provided byte slice containing JSON-encoded configuration and returns a pointer to a proto.Config struct.
func FromInitArgs
deprecated
Deprecated: added only for backward compatibility. FromInitArgs parses positional initialization arguments and generates JSON-config of []byte type. Accepts the channel name (chaincode) and the list of positional initialization parameters. Only needed to maintain backward compatibility. Marked for deletion after all deploy tools will be switched to JSON-config initialization of chaincodes.
func IsJSON ¶
IsJSON checks if the provided arguments represent a valid JSON configuration.
The function returns true if there is exactly one argument in the initialization args slice, and if the content of that argument is a valid JSON.
func Load ¶
func Load(stub shim.ChaincodeStubInterface) ([]byte, error)
Load retrieves and returns the raw configuration data from the state using the provided State interface.
The function returns the configuration data as a byte slice and nil error if successful.
If there is an error while loading the data from the state, an error is returned with additional information about the error.
If the retrieved configuration data is empty, the function returns an ErrCfgBytesEmpty error.
func Save ¶
func Save(stub shim.ChaincodeStubInterface, cfgBytes []byte) error
Save saves configuration data to the state using the provided State interface.
If the provided cfgBytes slice is empty, the function returns an ErrCfgBytesEmpty error.
If there is an error while saving the data to the state, an error is returned with additional information about the error.
Types ¶
This section is empty.