v 3.x.x
Search
K
Links
Comment on page

Message types

The Aleph network supports various types of message that all have their

Message structure

All the messages follow this based structure:
// BaseMessage structure
type: string | The type of the message, can be Post, Aggregate, Store, ...
channel: string | Channel of the message, ideally one application has one channel.
time: float | When the message was created.
size: number | The size of the messages.
// Sender info
sender: string | The address of the account that signed and sent the transaction.
chain: string | The chain used by the sender: AVAX, ETH, DOT, SOL, ...
signature: string | The sender's signature that authenticates his ownership.
// Content
item_hash: string | The sha256 of the item_content field.
item_content: JSON string | The stringified content of the message according to its type.
content: Object | The content of the message according to its type.
item_type: string | Where to store item_content: inline, IPFS, storage.
hash_type: string | The algorithm used for the item_hash.

content example

Each message has a different content. You can find their definition on their dedicated pages.
Item_content for a Post
content:
type: // Type of the Post: blog, comment, ...
address: // The account address associated with the post.
content: // An object containing the content of the post.
time: // When the object where created.
ref: // A text that is linked to this post, another post for example.
Item_content for an Aggregate
content:
key: // The indexed key under the content is stored.
address: // The account address associated with the post.
content: // An object containing the value associated with the key.
time: // When the object where created.

Item_type and storage

You can choose several ways to store your data on the Aleph network.
When you are uploading a message on Aleph you can use the inlineRequested boolean to ask the network to store the content of your message into a JSON string inside the item_content field.
If your data could fall under GDPR or you want to store them in a different file. set inlineRequested to false and use set the storageEngine field to storage or ifps.
  • Storage - A non SQL database solution
  • IPFS - The famous file storage decentralised protocol.