SyloDataVerification
The Sylo Data Verification pallet provides functionality for registering resolvers and verifying data through validation records. It allows users to create, update, and delete validation records that can be used to verify the authenticity and integrity of data.
Calls
setPaymentAsset
Set the asset used to pay for sylo extrinsics.
This operation requires root access.
Namespace
api.tx.syloDataVerification.setPaymentAssetType
function setPaymentAsset(
payment_asset: u32
)setSyloResolverMethod
Set the string used as the reserved sylo resolver method.
This operation requires root access.
Namespace
api.tx.syloDataVerification.setSyloResolverMethodType
function setSyloResolverMethod(
resolver_method: Bytes
)registerResolver
Register a new resolver.
The caller will be set as the controller of the resolver.
Namespace
api.tx.syloDataVerification.registerResolverType
function registerResolver(
identifier: Bytes,
service_endpoints: Vec<Bytes>
)updateResolver
Update the service endpoints of an existing resolver.
Caller must be the controller of the resolver.
Namespace
api.tx.syloDataVerification.updateResolverType
function updateResolver(
identifier: Bytes,
service_endpoints: Vec<Bytes>
)deregisterResolver
Deregister an existing resolver.
Caller must be the controller of the resolver.
Namespace
api.tx.syloDataVerification.deregisterResolverType
function deregisterResolver(
identifier: Bytes
)createValidationRecord
Create a new validation record.
The caller will be set as the record's author.
For any specified resolvers which use the reserved sylo resolver method, those resolvers must already be registered and exist in storage.
The initial record entry will use the current system block for the block value.
Namespace
api.tx.syloDataVerification.createValidationRecordType
function createValidationRecord(
data_id: Bytes,
resolvers: Vec<{method: Bytes, identifier: Bytes}>,
data_type: Bytes,
tags: Vec<Bytes>,
checksum: H256
)addValidationRecordEntry
Add a new entry to an existing validation record.
The current block will be used as the entry's block number.
Caller must be the author of the record.
Namespace
api.tx.syloDataVerification.addValidationRecordEntryType
function addValidationRecordEntry(
data_id: Bytes,
checksum: H256
)updateValidationRecord
Update a validation record's fields. The call takes in an Option value for the fields: resolvers, data_type, and tags.
Setting those fields to Some value will update the field in storage, whilst setting to None will be a no-op.
Caller must be the author of the record.
Namespace
api.tx.syloDataVerification.updateValidationRecordType
function updateValidationRecord(
data_id: Bytes,
resolvers: Option<Vec<{method: Bytes, identifier: Bytes}>>,
data_type: Option<Bytes>,
tags: Option<Vec<Bytes>>
)deleteValidationRecord
Delete an existing validation record.
Caller must be the author of the record.
Namespace
api.tx.syloDataVerification.deleteValidationRecordType
function deleteValidationRecord(
data_id: Bytes
)Storage
SyloAssetId
The asset used to pay for sylo extrinsics.
Namespace
api.query.syloDataVerification.syloAssetIdType
function syloAssetId(): Option<u32>SyloResolverMethod
The string reserved for the method used by sylo resolvers.
Namespace
api.query.syloDataVerification.syloResolverMethodType
function syloResolverMethod(): BytesResolvers
Map from resolver identifier to resolver information.
Namespace
api.query.syloDataVerification.resolversType
function resolvers(
Bytes
): Option<{
controller: AccountId,
service_endpoints: Vec<Bytes>
}>ValidationRecords
Map from account and data identifier to validation record information.
Namespace
api.query.syloDataVerification.validationRecordsType
function validationRecords(
AccountId,
Bytes
): Option<{
author: AccountId,
resolvers: Vec<{method: Bytes, identifier: Bytes}>,
data_type: Bytes,
tags: Vec<Bytes>,
entries: Vec<{checksum: H256, block: BlockNumber}>
}>Events
PaymentAssetSet
The asset used for extrinsics has been set.
Namespace
api.events.syloDataVerification.PaymentAssetSetType
type PaymentAssetSet = {
asset_id: u32
}SyloResolverMethodSet
The string reserved for the method used by sylo resolvers has been set.
Namespace
api.events.syloDataVerification.SyloResolverMethodSetType
type SyloResolverMethodSet = {
method: Vec<u8>
}ResolverRegistered
A new resolver has been registered and set in storage.
Namespace
api.events.syloDataVerification.ResolverRegisteredType
type ResolverRegistered = {
id: Vec<u8>,
controller: AccountId,
service_endpoints: Vec<Vec<u8>>
}ResolverUpdated
An existing resolver has had its service endpoints updated.
Namespace
api.events.syloDataVerification.ResolverUpdatedType
type ResolverUpdated = {
id: Vec<u8>,
controller: AccountId,
service_endpoints: Vec<Vec<u8>>
}ResolverDeregistered
An existing resolver has been deregistered and removed from storage.
Namespace
api.events.syloDataVerification.ResolverDeregisteredType
type ResolverDeregistered = {
id: Vec<u8>
}ValidationRecordCreated
A new validation record has been created and set in storage.
Namespace
api.events.syloDataVerification.ValidationRecordCreatedType
type ValidationRecordCreated = {
author: AccountId,
id: Vec<u8>
}ValidationEntryAdded
An entry of an existing validation record has been added.
Namespace
api.events.syloDataVerification.ValidationEntryAddedType
type ValidationEntryAdded = {
author: AccountId,
id: Vec<u8>,
checksum: H256
}ValidationRecordUpdated
An existing validation record has had its fields updated.
Namespace
api.events.syloDataVerification.ValidationRecordUpdatedType
type ValidationRecordUpdated = {
author: AccountId,
id: Vec<u8>,
resolvers: Option<Vec<Vec<u8>>>,
data_type: Option<Vec<u8>>,
tags: Option<Vec<Vec<u8>>>
}ValidationRecordDeleted
An existing validation record has been deleted and removed from storage.
Namespace
api.events.syloDataVerification.ValidationRecordDeletedType
type ValidationRecordDeleted = {
author: AccountId,
id: Vec<u8>
}Errors
ResolverAlreadyRegistered
The Resolver identifier is already in use.
Namespace
api.errors.syloDataVerification.ResolverAlreadyRegisteredResolverNotRegistered
The Resolver has not been registered.
Namespace
api.errors.syloDataVerification.ResolverNotRegisteredNotController
Account is not controller of resolver.
Namespace
api.errors.syloDataVerification.NotControllerRecordAlreadyCreated
A validation record with the given data id has already been created.
Namespace
api.errors.syloDataVerification.RecordAlreadyCreatedNoValidationRecord
The validation record to be updated has not been created.
Namespace
api.errors.syloDataVerification.NoValidationRecordConstants
MaxResolvers
The maximum number of resolvers in a validation record.
Namespace
api.consts.syloDataVerification.MaxResolversType
type MaxResolvers = u32MaxTags
The maximum number of tags in a validation record.
Namespace
api.consts.syloDataVerification.MaxTagsType
type MaxTags = u32MaxEntries
The maximum number of validation entries in a record.
Namespace
api.consts.syloDataVerification.MaxEntriesType
type MaxEntries = u32MaxServiceEndpoints
The maximum number of service endpoints for a registered resolver.
Namespace
api.consts.syloDataVerification.MaxServiceEndpointsType
type MaxServiceEndpoints = u32StringLimit
The max length of strings used within the Sylo Pallet.
Namespace
api.consts.syloDataVerification.StringLimitType
type StringLimit = u32