Skip to main content

Get Started with Avail

Start Operating

To run an Avail light client, simply run the following command:

curl -sL1 | sh

or, with wget:

wget --https-only --secure-protocol=TLSv1_2 --quiet -O - | sh

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.4
Run a Full NodeNoNoModeratev1.8.0.2
Become a ValidatorYesYesAdvancedv1.8.0.2

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
GoEstablishing Connection

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
GoSubmitting Blob Data
RustSubmitting Blob Data

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
RustSubmit Data and Dispatch Data Root

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
GoQuerying Data Proof
RustDemocracy External

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
GoListening for New Blocks

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, Go, Rust
Dispatching Data RootTypeScript
Creating Application KeyTypeScript, Rust
Asset TransferTypeScript, Go
Querying Proof/Data ProofTypeScript, Go
Querying Application DataTypeScript
Event Monitoring (Blocks/Data Submission)TypeScript, Go, Go
Network Connection & InfoTypeScript, Go
Internal OperationsGo
Rust + & Substrate ExamplesVarious Rust examples like Data Availability Bridge Actor, Democracy External, etc.