This directory contains documentation and examples related to the opinionated SDK and additional functionalities provided by the avail-js-sdk
.
The following scripts have been tested with ts-node v10.9.2 node v20.11.1 (npm v10.2.4)
.
To run the examples provided in the docs/extrinsics
directory, follow these steps:
- Install
ts-node
globally if you haven't already:
npm i -g ts-node
- From the avail-js/docs folder, install all necessary dependencies:
npm install
- Ensure you're running a local Avail node. You can do this with the following command from the root directory:
cargo build --release
./target/release/avail-node --dev
You can also take the latest release from Github
- To run any example script from the docs/extrinsics folder, use the following command format, replacing NAME_OF_THE_FILE with the actual file name you want to run:
ts-node ./docs/extrinsics/NAME_OF_THE_FILE.ts
For example, to run the staking_nominate.ts script:
ts-node ./docs/extrinsics/staking_nominate.ts
This will execute the chosen example script, showcasing how to interact with the Avail network using the avail-js-sdk.