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.setPaymentAsset

Type

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.setSyloResolverMethod

Type

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.registerResolver

Type

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.updateResolver

Type

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.deregisterResolver

Type

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.createValidationRecord

Type

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.addValidationRecordEntry

Type

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.updateValidationRecord

Type

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.deleteValidationRecord

Type

function deleteValidationRecord(
  data_id: Bytes
)

Storage

SyloAssetId

The asset used to pay for sylo extrinsics.

Namespace

api.query.syloDataVerification.syloAssetId

Type

function syloAssetId(): Option<u32>

SyloResolverMethod

The string reserved for the method used by sylo resolvers.

Namespace

api.query.syloDataVerification.syloResolverMethod

Type

function syloResolverMethod(): Bytes

Resolvers

Map from resolver identifier to resolver information.

Namespace

api.query.syloDataVerification.resolvers

Type

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.validationRecords

Type

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.PaymentAssetSet

Type

type PaymentAssetSet = {
  asset_id: u32
}

SyloResolverMethodSet

The string reserved for the method used by sylo resolvers has been set.

Namespace

api.events.syloDataVerification.SyloResolverMethodSet

Type

type SyloResolverMethodSet = {
  method: Vec<u8>
}

ResolverRegistered

A new resolver has been registered and set in storage.

Namespace

api.events.syloDataVerification.ResolverRegistered

Type

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.ResolverUpdated

Type

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.ResolverDeregistered

Type

type ResolverDeregistered = {
  id: Vec<u8>
}

ValidationRecordCreated

A new validation record has been created and set in storage.

Namespace

api.events.syloDataVerification.ValidationRecordCreated

Type

type ValidationRecordCreated = {
  author: AccountId,
  id: Vec<u8>
}

ValidationEntryAdded

An entry of an existing validation record has been added.

Namespace

api.events.syloDataVerification.ValidationEntryAdded

Type

type ValidationEntryAdded = {
  author: AccountId,
  id: Vec<u8>,
  checksum: H256
}

ValidationRecordUpdated

An existing validation record has had its fields updated.

Namespace

api.events.syloDataVerification.ValidationRecordUpdated

Type

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.ValidationRecordDeleted

Type

type ValidationRecordDeleted = {
  author: AccountId,
  id: Vec<u8>
}

Errors

ResolverAlreadyRegistered

The Resolver identifier is already in use.

Namespace

api.errors.syloDataVerification.ResolverAlreadyRegistered

ResolverNotRegistered

The Resolver has not been registered.

Namespace

api.errors.syloDataVerification.ResolverNotRegistered

NotController

Account is not controller of resolver.

Namespace

api.errors.syloDataVerification.NotController

RecordAlreadyCreated

A validation record with the given data id has already been created.

Namespace

api.errors.syloDataVerification.RecordAlreadyCreated

NoValidationRecord

The validation record to be updated has not been created.

Namespace

api.errors.syloDataVerification.NoValidationRecord

Constants

MaxResolvers

The maximum number of resolvers in a validation record.

Namespace

api.consts.syloDataVerification.MaxResolvers

Type

type MaxResolvers = u32

MaxTags

The maximum number of tags in a validation record.

Namespace

api.consts.syloDataVerification.MaxTags

Type

type MaxTags = u32

MaxEntries

The maximum number of validation entries in a record.

Namespace

api.consts.syloDataVerification.MaxEntries

Type

type MaxEntries = u32

MaxServiceEndpoints

The maximum number of service endpoints for a registered resolver.

Namespace

api.consts.syloDataVerification.MaxServiceEndpoints

Type

type MaxServiceEndpoints = u32

StringLimit

The max length of strings used within the Sylo Pallet.

Namespace

api.consts.syloDataVerification.StringLimit

Type

type StringLimit = u32