undefined

Digital Twins

Imagine having a complicated device or system which has several modules to maintain and requires a few accounts to use. To keep all of them in one place or to encode some functionality with separate accounts or, for example, to set different datalog sources for different information flows, Digital Twin module is to be used.


Dev Node
Please pay attention that this and following tutorials are demonstrated on a local instance of Robonomics Node. Set up yours with these instructions.

Theory overview

Any account can create and manage a Digital Twin. The Twin may be imagined as some sort of table with the following contents:

DT idTopic NameSource
00x00…0004Gz…hQJ
10x00…0014GVi…Bn
0x00…0024Hm…vLS
0x00…4HQ…RQY
n0xFF…FFF4Hw…CyK

Where:

  • DT id is unsigned integer unique Digital Twin index.

  • Topic name is a hex H256 or ASCII data of 32 bytes length, same as Launch extrinsic parameter.
    For example: 0x1234....FF or hello.parachain.robonomics.world.

  • Source - is some Account address.

    Topics
    As have been discussed previously in Launch extrinsic overview, the H256 may be represented as an encoded IPFS CID (see Python tool for that).
    Therefore, topics may be used as some data storage as well, say, a Twin’s module description.

Create Digital Twin

1. Navigate to Developer -> Extrinsics

extrinsics

2. Choose digitalTwin -> create from the dropdown list of possible extrinsics

twin-create

Submit the transaction. Here, no parameters needed to create a Twin. It will be granted an index and only the Digital Twin owner is able to add/modify topics of the Twin from now on.

Twin ID may be found on the Explorer overview page.

create-log

Add Topic

Choose digitalTwin -> setSource from the dropdown list of possible extrinsics

set-topic
  • id - Digital Twin ID, which has been obtained on the Explorer page.

  • topic - previously discussed H256 topic name. In this picture it’s a string of 32 symbols.

  • source - account address to be associated with the topic.

    Overwrite
    Pay attention that the topic may be overwritten with another source address if needed.

Sign and submit the extrinsic.

Explore

You can find all information about existing Digital Twins in Developer -> Chain state storage module digitalTwin.

  • Total number of Twins - total();
  • Digital Twin owner - owner(u32);
  • Information about topics of a Digital Twin - digitalTwin(u32).
chain-state

Couldn't complete

Thanks,
we'll keep in touch!

It was hard

Thanks,
we'll keep in touch!

It was ok

Thanks,
we'll keep in touch!

It was easy

Thanks,
we'll keep in touch!
Main contributors: @nakata5321 , @PaTara43
Make a contribution

Robonomics wiki is open source. See something that's wrong or unclear? Submit a pull request.

? Ask your question