Skip to main content
Version: 3.2.0

Remote Nonce Caching

This guide will walk you through successfully installing the API and initialising for Remote Nonce Caching.

The first thing we need to do is ensure that you have npm installed. You'll find instructions on how to do this here. You'll also find instructions on how to install the avn-api library.

Create an account The easiest way to create an account is to create it using a supported wallet. Supported wallets are: PolkadotJS, Subwallet, Nova, Talisman.

We Need VOW
VOW is the utility token of the Voucher Ledger. It's required to do the below:

  1. Access the Parachain network via the API. You need 1 VOW in your account to use the API. The VOW needs to be lifted (moved) to the Voucher Ledger, and there are also instructions for that too here.

  2. Transaction Fee: Note, all transactions on the VL must be paid for using VOW, so going forward it's important for you to have some VOW in your account. There are multiple ways to purchase VOW and this page provides instructions on how to get some.

Once you have some VOW in your account, of which you can check your account balance by typing your address into the explorer here, we can now configure the Remote Nonce Caching.

important

You can get the VL_GATEWAY_URL for both mainnet and public testnet here.
An example Remote Nonce Cache Provider can be found here. However this is test code, use it at your own risk.

First we install the prerequisites.

const { AvnApi, SetupMode, SigningMode } = require("avn-api");
const VL_GATEWAY_URL = "replace with VL_GATEWAY_URL";

Then we initialise the API

const TestNonceCacheProvider =
"import the example nonce cache provider, the link is above"; //require('./testRedisNonceCacheProvider');
const testCacheProvider = new TestNonceCacheProvider();

const options = {
setupMode: SetupMode.MultiUser,
signingMode: SigningMode.RemoteSigner,
hasPayer: false,
defaultLogLevel: "error",
signer,
nonceCacheType: NonceCacheType.Remote,
cacheProvider: testCacheProvider,
};

const avnSdk = new AvnApi(VL_GATEWAY_URL, options);
async function main() {
// initialise the api sdk and return
await avnSdk.init();
return avnSdk;
}