How to Use Madara with Avail
Introduction
Embark on setting up your own Madara-based Validium, leveraging Avail as the data availability layer. This guide is tailored for deploying on Ethereum's Sepolia testnet and integrating with the Avail Goldberg testnet. To gain a comprehensive understanding of Madara Starknet, review the Madara documentation (opens in a new tab).
In this guide, you will conduct the following:
Prerequisites
Ensure you have installed the following software.
Installation commands are based on Ubuntu 20.04 LTS:
|
|
Hardware Requirements
The Madara stack, being a StarkNet sequencer, has specific hardware requirements for efficient operation. These requirements are particularly important when integrating Avail as the DA Layer.
Component | Minimum Requirements | Recommended Setup | Suggested AWS Instance |
---|---|---|---|
Sequencer Node | 4-core CPU, 16GB RAM, 100 GB SSD | 8-core CPU, 32GB RAM, 200 GB SSD | m5a.xlarge |
Avail Node | 4-core CPU, 8GB RAM, 50 GB SSD | 8-core CPU, 16GB RAM, 100 GB SSD | m5a.large |
The storage requirements can vary based on the volume of transactions and the length of the chain history you intend to maintain. For high-traffic networks, consider scaling your storage capacity accordingly.
Launch an Avail-Powered Madara Validium
-
Clone the Madara repository:
git clone git@github.com:keep-starknet-strange/madara.git cd madara
-
Build the chain in release mode:
cargo build --release
Running a Single-Node Development Chain
-
Start the development chain:
./target/release/madara --dev
-
Purge the chain's state:
./target/release/madara purge-chain --dev
-
Start with detailed logging:
RUST_BACKTRACE=1 ./target/release/madara -ldebug --dev
-
Create a plain chain spec:
./target/release/madara build-spec > ./infra/chain-sepcs/chain-spec-plain.json
Setting Up Avail as the DA Layer
-
Configure Avail for Madara:
# Configuration for local Avail node cat > da-config.json <<EOF { "ws_provider": "ws://127.0.0.1:9945", "app_id": 0, "validate_codegen": false, "seed": "//Alice" } EOF
-
Start Avail Node (in another terminal):
./data-avail --dev --rpc-port 9945 --port 30334
-
Setup Madara for Avail:
./madara setup --chain=dev --from-remote --base-path=../.madara
-
Launch Madara with Avail:
./madara --chain=dev --base-path=../.madara --da-layer=avail --force-authoring --alice
Deploying an Account on Your Chain
- After setting up your chain, you can deploy your own account and start making transactions.
Using Avail in Madara
- Specify
--da-layer avail
when launching a Madara node to use Avail for publishing the state_diff.
Remember to adjust the da-config.json
file based on your setup, whether it's a local node or using the Avail network.