-
Notifications
You must be signed in to change notification settings - Fork 4
Testing Milestone 1
First, run Fennel Protocol as a dev node:
$ ./scripts/setup.sh
$ ./scripts/build-run.shExtrinsics are available by navigating to Polkadot.js and entering the Developer > Extrinsics menu.
The following represent the features outlined as the deliverables outlined for Milestone 1:
Given all required input, the Identity Creation extrinsic will create a Storage entry adding a new Identity ID number to the account's list of active identities.
Query the IdentityList storage object by account ID to retrieve all active identities for an account.
Identities can be "mutated" by associating "traits" with them. These "traits" are nothing more than a key/value pair of strings. For instance, if I wanted to add a "name" trait to an identity I own, I'd pass in the identity id I want to mutate, the key "name" and the value "Husky".
Also in view for this function is the ability to add a hash which points to a content hosted on IPFS.
The arguments for the add_or_update_identity_trait extrinsic are the AccountID which owns the identity to be mutated, the identity index to be mutated, a string for the trait key, and a string for the trait value. This extrinsic will alter the IdentityTraitList storage. It will also emit IdentityUpdated which will contain the AccountID and the identity index which was updated.
The arguments for the remove_identity_trait extrinsic are the AccountID which owns the identity to be altered, the identity index to be altered, and the trait key string which is the trait to be removed. This will alter the IdentityTraitList storage by removing the identity index and trait key pair from the StorageDoubleMap.
The IdentityTraitList storage can be queried with an Identity index and a trait key to retrieve the trait value.
An identity can be revoked by calling the revoke_identity extrinsic with the following arguments: AccountID, identity index. This will alter the IdentityList by removing the given identity index from the list, and it will alter RevokedIdentityNumber incrementing it by one.
The RevokedIdentityNumber can be queried to see how many identities have been revoked.
A signal can be issued by calling the sign_for_identity extrinsic and passing in the following arguments: AccountID, identity index, and a string which is the signal content. This method will generate a unique identifier for the signal by using the current SignalCount value and placing that, along with the given identity index and the signal string content into FennelSignal. This method will also increment the SignalCount by one to be used for the next signal.
SignalCount can be queried to get both a count of all signals issued and to see the next available signal id. FennelSignal can be queried by passing in an identity index and a signal index to get the content of the signal.
Given an account ID, this extrinsic will create a new trust path between the caller's account ID and the address provided as input.
Query the TrustIssuance storage object with two account IDs to determine whether a path exists from one to the next. In the event that the first account trusts the second, storage will return an integer. Otherwise, it will return <none>.
This grant of trust may be rescinded through the trust removal extrinsic called with the same account ID.
Given an account ID, calling this extrinsic will notify the receiver that the have been asked to execute a trust issuance to the caller. Applications should then present the receiver with the option to issue a Trust Issuance or Trust Revocation. Querying the TrustRequestList storage item will return <none> if the request has not been placed, and an integer if the request has been placed.
The cancel_trust_request extrinsic will reverse requests placed through this extrinsic.
Use this to explicitly declare non-trust for an identity represented by the Account ID passed to the extrinsic.
Query the TrustRevocation storage object with two account IDs to determine whether a path exists from one to the next. In the event that the first account trusts the second, storage will return an integer. Otherwise, it will return <none>.
This revocation may be rescinded through the remove_revoked_trust extrinsic, similarly to cancelation of Trust Issuances and Trust Requests.