Announcement Publishing
On Frequency, Announcements are mapped to Schemas which in turn publish Frequency Messages. Frequency Messages are either direct Graph Changes from a particular user, or a Batch Publication with a multitude of possible users.
Announcement Type Enum | Announcement | Batched | Schema Id Mainnet | Schema Id Rococo | Frequency Model Type | Frequency Payload Location |
---|---|---|---|---|---|---|
0 | Tombstone | YES | TBD | 1 (v1.1.0+) | Parquet | IPFS |
1 | Graph Change | no | TBD | 7 (v1.1.0+) | AvroBinary | OnChain |
2 | Broadcast | YES | TBD | 2 (v1.1.0+) | Parquet | IPFS |
3 | Reply | YES | TBD | 3 (v1.1.0+) | Parquet | IPFS |
4 | Reaction | YES | TBD | 4 (v1.1.0+) | Parquet | IPFS |
5 | Profile | YES | TBD | 5 (v1.1.0+) | Parquet | IPFS |
6 | Update | YES | TBD | 6 (v1.2.0+) | Parquet | IPFS |
Source code for each schema is also located in the LibertyDSNP/schemas repository.
DSNP Non-Batched Announcements
Frequency uses an on-chain data structure for storage of GraphChange
Announcements.
Each individual announcement is submitted using the add_onchain_message
extrinsic.
DSNP Batched Announcements
Frequency uses DSNP Batch Publications for Announcements that are batched. The Parquet file is stored on IPFS, but it is discovered through the Frequency Message.
Frequency Messages maintain the metadata of where and when the Batch Publication was published and which Provider MSA published it. It is the publisher's responsibility to maintain the IPFS pin so that the batch file is continuously available.
DSNP Batch Publications MUST be validated upon fetching to ensure data and permission integrity.
Ordering
Frequency Messages are well ordered within a Schema.
- Frequency: Block number ascending
- Frequency: Block index ascending
- DSNP Standard: Order Announcements in a Batch Publication File by row appearance order.
Ordering Across Schemas
Frequency provides complete ordering metadata for Messages across Schemas. Block index is unique per Message within the same block.
Human Order
Due to the asynchronous nature of networks and batching, it is possible that the canonical ordering of Announcements is wrong from a human viewpoint. With dependent Announcements, where one Announcement refers to another Announcement, the order may be inferred differently than the canonical ordering. It is left to user interfaces to handle these situations.
Retrieval
Frequency nodes provide an RPC interface get_messages_by_schema
with paginated responses that differ based on the Schema.
Frequency nodes can provide a websocket interface that will emit an event for each block that has one or more messages of a given schema in that block.
The MessagesStored
event can be used to know when to call the RPC interface to retrieve the messages.
See the Frequency Documentation for more details on Message retrieval.