Hey there 👋 Welcome to Ajuna Network, the ecosystem for gamers and creators. This site is the entry point for all creators building or integrating on top of Ajuna Network!
The best resources in Substrate development are the official docs:
Follow the convention mentioned in Rust Development with exception for runtime modules (or pallets).
For pallets, prefixing with ajuna-pallet-* is appropriate.
Recommended is to peg our upstream dependencies at monthly snapshot releases with a dedicated time slot each month for upgrading.
Versioned released are infrequent in Substrate which often leads to a simple upgrade task requiring lots of effort. Other options include:
master branch, which means
master branch, which means
A nice trade-off between maintainability vs. latest tech is provided via monthly snapshot releases, where we can dedicate a time slot for upgrading every month. A changelog for each monthly release is also provided to help us understand its associated changes.
Our nodes can be thought of as distributed state machines with shared resources. These resources are tied to knowing how busy our network is and contribute to increasing or decreasing transaction fees. Hence pallets must be developed with optimization in mind towards:
Generally we aim to minimize the amount of storage a pallet uses by storing consensus critical information only. If we don’t have logic to read a particular data, it probably means we don’t need to store it on chain.
Substrate is coupled with a variant of Merkle Patricia tree and key-value DB (e.g, RocksDB), which means we don’t have to optimize the underlying storage operations.
We suggest the following to optimize storage items:
struct, rather than dispersing them across multiple storage items
O(log N) lowread and writexxHash over BLAKE2 hashing algorithm for its hashing speed
frame_support::BoundedVec to ensure we don’t run into iterating over a massive listSee Storage for more info.
Related to Disk I/O, we should consider using the smallest data types required for the job.
See microbenchmarks for measuring a piece of code.