API reference
Submit data to Avail DA

Submit data to Avail DA

LOOKING FOR INSTRUCTIONS ON HOW TO RUN YOUR OWN LIGHT CLIENT?
You can check out our docs here for instructions on how to run your own light client.

Submits application data to the avail network

In case of data transaction, data transaction is created, signed and submitted.
In case of extrinsic, externally created and signed transaction is submitted.

Only one field is allowed per request.
Both data and extrinsic has to be encoded using base64 encoding.

Params:

  • base64 encoded data or extrinsic

HOW TO SUBMIT DATA USING THE LIGHT CLIENT?

  1. To use this method you need to run your Light Client in the app-client mode. You can then submit data directly to the appID you configured while booting up the Light Client.

  2. You can only pass Base64 encoded data to be submitted via the Light Client. You can use this website (opens in a new tab) to encode & decode your data into the required formats.

Response:

  • block_number - block number where transaction is included
  • block_hash - block hash where transaction is included
  • hash - transaction hash
  • index - transaction index in the block
curl -XPOST 127.0.0.1:7007/v2/submit --header "Content-Type: application/json" --data '{"data":"dGVzdAo="}'
Sample Response:
{
  "block_number": {block-number},
  "block_hash": "{block-hash}",
  "hash": "{transaction-hash}",
  "index": {transaction-index}
}

If app mode is not active (or signing key is not configured and data is submitted) response is:

Not found