Phase 1 of Avail's unification drop has ended. Phase 2 now begins, ๐Ÿ‘‰๐Ÿ‘‰ check out this page ๐Ÿ‘ˆ๐Ÿ‘ˆ for more information.

Docs
Quickstart

Get Started with Avail

Start Operating

To run an Avail light client, simply install the Avail CLI npm package:

npm i -g @availproject/cli

Then, run:

avail lc up

That's it!

If you're seeking more control over the configuration or are interested in running a full node, check out the deployment guides below.

ActionTokens NeededStakingTechnical Skill RequiredClient Binary
Run a Light ClientNoNoBasicv1.7.6 (opens in a new tab)
Run a Full Node / ValidatorNoNoModeratev1.10.0.0 (opens in a new tab)

Start Building

The Avail API offers a robust set of features that enable application developers to interact seamlessly with the Avail network. This guide provides a curated list of example code snippets in JavaScript/TypeScript, Rust, and Go. These examples cover essential tasks such as establishing a connection to a local node, querying data from the network, and executing transactions on the blockchain.

Before diving into the examples, ensure you have a local Avail node running or configure your settings to align with an existing network.

Detailed instructions on how to execute these examples are available in the Avail GitHub repository:

Sample Workflow

Follow these steps to understand a sample end-to-end flow of data availability in Avail. Examples are provided for JavaScript, Go, and Rust.

Step 1: Establishing Connection

Before you can interact with the Avail network, you need to establish a connection to a node.

LanguageExample Link
JavaScriptEstablishing Connection (opens in a new tab)
GoEstablishing Connection (opens in a new tab)
RustHeaders (opens in a new tab)

Step 2: Submitting Data

Once connected, the next step is to submit data to the network. This could be any blob of data that you want to make available.

LanguageExample Link
JavaScriptSubmitting Blob Data (opens in a new tab)
GoSubmitting Blob Data (opens in a new tab)
RustSubmitting Blob Data (opens in a new tab)

Step 3: Dispatching Data Root (Optional)

If you need to dispatch the data root, you can do so at this stage. This is optional and depends on your use case.

LanguageExample Link
JavaScriptDispatching Data Root (opens in a new tab)
RustSubmit Data and Dispatch Data Root (opens in a new tab)

Step 4: Querying Data and Proofs

After submitting your data, you might want to query it to ensure it's been properly stored and is retrievable.

LanguageExample Link
JavaScriptQuerying Data Proof (opens in a new tab)
GoQuerying Data Proof (opens in a new tab)
RustDemocracy External (opens in a new tab)

Step 5: Monitoring and Metrics

Finally, you can monitor the network and your data by listening for new blocks and other metrics.

LanguageExample Link
JavaScriptListening for New Blocks (opens in a new tab)
GoListening for New Blocks (opens in a new tab)

API Examples

The following table lists various code examples for interacting with the Avail network. These examples are organized by functionality and the supported programming languages.

FunctionalitySupported Languages
Data SubmissionTypeScript (opens in a new tab), Go (opens in a new tab), Rust (opens in a new tab)
Dispatching Data RootTypeScript (opens in a new tab)
Creating Application KeyTypeScript (opens in a new tab), Rust (opens in a new tab)
Asset TransferTypeScript (opens in a new tab), Go (opens in a new tab)
Querying Proof/Data ProofTypeScript (opens in a new tab), Go (opens in a new tab)
Querying Application DataTypeScript (opens in a new tab)
Event Monitoring (Blocks/Data Submission)TypeScript (opens in a new tab), Go (opens in a new tab), Go (opens in a new tab)
Network Connection & InfoTypeScript (opens in a new tab), Go (opens in a new tab)
Internal OperationsGo (opens in a new tab)
Rust + & Substrate ExamplesVarious Rust (opens in a new tab) examples like Data Availability Bridge Actor, Democracy External, etc.