cc

package
v0.0.0-...-12180a1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL struct {
	// contains filtered or unexported fields
}

func New

func New() *ACL

func (*ACL) AddAdditionalKey

func (c *ACL) AddAdditionalKey(
	stub shim.ChaincodeStubInterface,
	args []string,
) peer.Response

AddAdditionalKey adds a new additional public key to the user account. Associates the new key with the "parent" address of the user in the ACL.

Call Arguments:

  • arg[0] - user address for linking the additional key
  • arg[1] - additional key in base58 format to add to your account
  • arg[2] - JSON array of tag strings to the key
  • arg[3] - nonce value in string format
  • arg[4:] - public keys and validator signatures

func (*ACL) AddMultisig

func (c *ACL) AddMultisig(stub shim.ChaincodeStubInterface, args []string) peer.Response

AddMultisig creates multi-signature address which operates when N of M signatures is present arg[0] N number of signature policy (number of sufficient signatures), M part is derived from number of public keys arg[1] nonce args[2:] are the public keys and signatures hex of all participants in the multi-wallet and signatures confirming the agreement of all participants with the signature policy

func (*ACL) AddMultisigWithBase58Signature

func (c *ACL) AddMultisigWithBase58Signature(stub shim.ChaincodeStubInterface, args []string) peer.Response

AddMultisigWithBase58Signature creates multi-signature address which operates when N of M signatures is present args[0] request id args[1] chaincodeName acl args[2] channelID acl args[3] N number of signature policy (number of sufficient signatures), M part is derived from number of public keys args[4] nonce args[5:] are the public keys and signatures base58 of all participants in the multi-wallet and signatures confirming the agreement of all participants with the signature policy

func (*ACL) AddRights

func (c *ACL) AddRights(stub shim.ChaincodeStubInterface, args []string) peer.Response

AddRights adds rights to the access matrix args[0] -> channelName args[1] -GetOperationAllRights> chaincodeName args[2] -> roleName args[3] -> operationName args[4] -> addressEncoded

func (*ACL) AddToList

func (c *ACL) AddToList(stub shim.ChaincodeStubInterface, args []string) peer.Response

AddToList sets address to 'gray list' or 'black list' arg[0] - address arg[1] - "gray" of "black"

func (*ACL) AddUser

func (c *ACL) AddUser(stub shim.ChaincodeStubInterface, args []string) peer.Response

AddUser adds user by public key to the ACL args is slice of parameters: args[0] - encoded base58 user publicKey args[1] - Know Your Client (KYC) hash args[2] - user identifier args[3] - user can do industrial operation or not (boolean)

func (*ACL) ChangeMultisigPublicKey

func (c *ACL) ChangeMultisigPublicKey(stub shim.ChaincodeStubInterface, args []string) peer.Response

ChangeMultisigPublicKey changes public key of multisig member arg[0] - multisig address (base58check) arg[1] - old key (base58) arg[2] - new key (base58) arg[3] - reason (string) arg[4] - reason ID (string) arg[5] - nonce arg[6:] - public keys and signatures of validators

func (*ACL) ChangePublicKey

func (c *ACL) ChangePublicKey(stub shim.ChaincodeStubInterface, args []string) peer.Response

ChangePublicKey changes public key of user arg[0] - user's address (base58check) arg[1] - reason (string) arg[2] - reason ID (string) arg[3] - new key (base58) arg[4] - nonce arg[5:] - public keys and signatures of validators

func (*ACL) ChangePublicKeyWithBase58Signature

func (c *ACL) ChangePublicKeyWithBase58Signature(stub shim.ChaincodeStubInterface, args []string) peer.Response

ChangePublicKeyWithBase58Signature changes the public key of a user with base58 encoding. It expects the following arguments: - 0: Request ID - 1: Chaincode name - 2: Channel ID - 3: User's address (base58check) - 4: Reason (string) - 5: Reason ID (string) - 6: New key (base58) - 7: Nonce - 8 and onwards: List of validators' public keys and their corresponding signatures

func (*ACL) CheckAddress

func (c *ACL) CheckAddress(stub shim.ChaincodeStubInterface, args []string) peer.Response

CheckAddress checks if the address is grayListed returns an error if the address is grayListed or returns pb.Address if not args[0] - base58-encoded address

func (*ACL) CheckKeys

func (c *ACL) CheckKeys(stub shim.ChaincodeStubInterface, args []string) peer.Response

CheckKeys returns AclResponse with account indo fetched by public keys

func (*ACL) DelFromList

func (c *ACL) DelFromList(stub shim.ChaincodeStubInterface, args []string) peer.Response

DelFromList removes address from gray list or black list arg[0] - address arg[1] - "gray" of "black"

func (*ACL) GetAccountAllRights

func (c *ACL) GetAccountAllRights(stub shim.ChaincodeStubInterface, args []string) peer.Response

GetAccountAllRights returns all operations specified account have right to execute args[0] -> addressEncoded

func (*ACL) GetAccountInfo

func (c *ACL) GetAccountInfo(stub shim.ChaincodeStubInterface, args []string) peer.Response

GetAccountInfo returns json-serialized account info (KYC hash, grayList and blacklist attributes) for address. arg[0] - address

func (*ACL) GetAccountOperationRight

func (c *ACL) GetAccountOperationRight(stub shim.ChaincodeStubInterface, args []string) peer.Response

GetAccountOperationRight checks address have rights for the operation args[0] -> channelName args[1] -GetOperationAllRights> chaincodeName args[2] -> roleName args[3] -> operationName args[4] -> addressEncoded

func (*ACL) GetAddresses

func (c *ACL) GetAddresses(stub shim.ChaincodeStubInterface, args []string) peer.Response

func (*ACL) GetOperationAllRights

func (c *ACL) GetOperationAllRights(stub shim.ChaincodeStubInterface, args []string) peer.Response

GetOperationAllRights returns all accounts having right to execute specified operation args[0] -> channelName args[1] -GetOperationAllRights> chaincodeName args[2] -> roleName args[3] -> operationName

func (*ACL) GetUser

func (c *ACL) GetUser(stub shim.ChaincodeStubInterface, args []string) peer.Response

GetUser returns user by address args is slice of parameters: args[0] - encoded base58 user address

func (*ACL) Init

Init - method for initialize chaincode args: adminSKI, validatorsCount, validatorBase58Ed25519PublicKey1, ..., validatorBase58Ed25519PublicKeyN

func (*ACL) Invoke

func (c *ACL) Invoke(stub shim.ChaincodeStubInterface) peer.Response

func (*ACL) RemoveAdditionalKey

func (c *ACL) RemoveAdditionalKey(stub shim.ChaincodeStubInterface, args []string) peer.Response

RemoveAdditionalKey removes the optional key from the user account. For cases, when the key is no longer needed or has been compromised.

Call Arguments:

  • arg[0] - user address for "linking" the additional key
  • arg[1] - additional key in base58 format for deletion from the account
  • arg[2] - nonce value in string format
  • arg[3:] - public keys and validator signatures

func (*ACL) RemoveRights

func (c *ACL) RemoveRights(stub shim.ChaincodeStubInterface, args []string) peer.Response

RemoveRights removes rights from the access matrix args[0] -> channelName args[1] -GetOperationAllRights> chaincodeName args[2] -> roleName args[3] -> operationName args[4] -> addressEncoded

func (*ACL) SetAccountInfo

func (c *ACL) SetAccountInfo(stub shim.ChaincodeStubInterface, args []string) peer.Response

SetAccountInfo sets account info (KYC hash, grayList and blacklist attributes) for address. arg[0] - address arg[1] - KYC hash arg[2] - is address gray listed? ("true" or "false") arg[3] - is address black listed? ("true" or "false")

func (*ACL) Setkyc

func (c *ACL) Setkyc(stub shim.ChaincodeStubInterface, args []string) peer.Response

Setkyc updates KYC for address arg[0] - address arg[1] - KYC hash arg[2] - nonce arg[3:] - public keys and signatures of validators

type Account

type Account struct {
	Address string   `json:"address"`
	Balance *big.Int `json:"balance"`
}

type AddrsWithPagination

type AddrsWithPagination struct {
	Addrs    []string
	Bookmark string
}

type ListType

type ListType string
const (
	BlackList ListType = "black"
	GrayList  ListType = "gray"
)

func (ListType) String

func (lt ListType) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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