Announcement Publishing
On Frequency, Announcements are mapped to Schemas which in turn publish Frequency Messages. Frequency Messages are either individual Announcements from a particular user, or a Batch Publication with a multitude of possible users.
Enum | Announcement | Type | Deployed Schema Id | Frequency Model Type | Frequency Payload Location |
---|---|---|---|---|---|
0 | Tombstone | Batched | Mainnet: 16 Testnet (Paseo): 16 | ||
Parquet | |||||
IPFS | |||||
2 | Broadcast | Batched | Mainnet: 17 Testnet (Paseo): 17 | ||
Parquet | |||||
IPFS | |||||
3 | Reply | Batched | Mainnet: 18 Testnet (Paseo): 18 | ||
Parquet | |||||
IPFS | |||||
4 | Reaction | Batched | Mainnet: 4 Testnet (Paseo): 4 | ||
Parquet | |||||
IPFS | |||||
6 | Update | Batched | Mainnet: 19 Testnet (Paseo): 19 | ||
Parquet | |||||
IPFS | |||||
8 | User Attribute Set | Batched | Mainnet: 20 Testnet (Paseo): 20 | ||
Parquet | |||||
IPFS | |||||
9 | DSNP Content Attribute Set | Batched | Mainnet: 12 Testnet (Paseo): 12 | ||
Parquet | |||||
IPFS | |||||
10 | External Content Attribute Set | Batched | Mainnet: 13 Testnet (Paseo): 13 | ||
Parquet | |||||
IPFS |
Source code for each schema is located in the LibertyDSNP/schemas repository.
Batch Publications
Frequency uses DSNP Batch Publications for some types of Announcements. Parquet files are stored on IPFS, but are discovered through Frequency Messages.
DSNP Batch Publications MUST be validated upon fetching to ensure data and permission integrity.
Announcement Validation
DSNP Announcements are validated differently depending on the type of Announcement. Non-batched Announcements are on chain, are validated at write time, and do not need to be re-validated at read time. Batched Announcements are off chain and MUST be validated at read time (See: Validation).
Ordering Announcements
Frequency Messages are well ordered:
- Frequency: Block number ascending
- Frequency: Block index ascending (unique)
- DSNP Standard: Order Announcements in a Batch Publication File by row appearance order.
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
messages.getBySchemaId()
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
messages::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.