Skip to content

Commit

Permalink
docs: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jcstein committed Mar 28, 2024
1 parent 593a0bf commit f1dd9e7
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 33 deletions.
4 changes: 4 additions & 0 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,10 @@ function sidebarHome() {
text: "Transaction resubmission guidelines",
link: "/developers/transaction-resubmission",
},
{
text: "FeeGrant module for blobs submission",
link: "/developers/feegrant-for-blobs",
},
{
text: "Node API",
link: "/developers/node-api",
Expand Down
78 changes: 45 additions & 33 deletions developers/feegrant-for-blobs.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# FeeGrant Module for Blobs submission
# FeeGrant module for blobs submission

## Overview

This guide provides developers with the knowledge to use the FeeGrant module on the Celestia's mocha testnet chain for
granting a data availability node's account to submit blobs without constantly funding it, enabling a third-party
account to cover the transaction fees.
This guide provides developers with the knowledge to use the FeeGrant
module on the Celestia's mocha testnet chain for granting a data
availability node's account to submit blobs without constantly
funding it, enabling a third-party account to cover the transaction fees.

## Pre-requisites

Expand All @@ -16,16 +17,19 @@ account to cover the transaction fees.

## Introduction

Each DA node contains a celestia account that is used to pay for blobs submissions. In order to unify the fee payment
process, the FeeGrant module allows a third-party account to pay for the fees incurred by the DA node's account.
This module is useful for projects that require a third-party to cover the fees for the DA node's account. You will need
one account that will contain the funds and another account that will be in the DA node. You will see the DA node's
account once you initialise the node.
Each DA node contains a celestia account that is used to pay for blobs
submissions. In order to unify the fee payment process, the FeeGrant module
allows a third-party account to pay for the fees incurred by the DA node's
account. This module is useful for projects that require a third-party to
cover the fees for the DA node's account. You will need one account that will
contain the funds and another account that will be in the DA node. You will
see the DA node's account once you initialise the node.

## Granting Fee Allowances
## Granting fee allowances

To grant fee allowances, allowing a third-party (granter) account to pay for the fees incurred by a Celestia data
availability node (grantee) account, use the following command:
To grant fee allowances, allowing a third-party (granter) account to pay
for the fees incurred by a Celestia data availability node (grantee)
account, use the following command:

```shell
celestia-appd tx feegrant grant \
Expand All @@ -41,24 +45,27 @@ celestia-appd tx feegrant grant \
--yes
```

Example
transaction: [Fee Grant Transaction on Mocha](https://mocha.celenium.io/tx/802a17777fbeab416f6fa2c25f0c56dd9cc8a92afc2a96293d114ac7c22efb5c)
Example transaction:
[Fee Grant Transaction on Mocha](https://mocha.celenium.io/tx/802a17777fbeab416f6fa2c25f0c56dd9cc8a92afc2a96293d114ac7c22efb5c)

## Verifying Balances and Transactions
## Verifying balances and transactions

Before diving into the specifics of verifying balances and transactions, it's important to note that currently, it's
necessary to fund the light node in order for its transactions to be included in the state. We recognize this step as an
extra layer of complexity and are actively working on improving the user experience. Future updates to the
nodes implementations will aim to make this step non-mandatory for the FeeGrant module to function effectively,
Before diving into the specifics of verifying balances and transactions,
it's important to note that currently, it's necessary to fund the light node
in order for its transactions to be included in the state. We recognize
this step as a extra layer of complexity and are actively working on improving
the user experience. Future updates to the nodes implementations will aim to
make this step non-mandatory for the FeeGrant module to function effectively,
streamlining the process for developers and users alike.

### Check Balance of the New DA Light Node
### Check balance of the new DA light node

To check the balance of a new light node, use the following command:

<!-- markdownlint-disable MD013 -->
```shell
celestia state balance --token $CEL_AUTH_TOKEN --node.store ~/.celestia-light-mocha-4/
```
<!-- markdownlint-enable MD013 -->

Example response when the account balance does not exist:

Expand All @@ -73,10 +80,11 @@ Example response when the account balance does not exist:

This indicates that the light node currently does not have any funds.

### Funding the Light Node
### Funding the light node

As of now, to ensure the light node's transactions are included in the state, you must initially fund the light node
with the least amount of funds using the following command:
As of now, to ensure the light node's transactions are included in the
state, you must initially fund the light node with the least amount
of funds using the following command:

```shell
celestia-appd tx bank send [granter_address] [grantee_address] 10000utia \
Expand All @@ -89,22 +97,25 @@ celestia-appd tx bank send [granter_address] [grantee_address] 10000utia \
--home ~/.celestia-app-devops/
```

### Submitting a Blob
### Submitting a blob

To submit a blob, utilize the following command:

<!-- markdownlint-disable MD013 -->
```shell
celestia blob submit --input-file blob.json --token $CEL_AUTH_TOKEN --node.store ~/.celestia-light-mocha-4/
```
<!-- markdownlint-enable MD013 -->

### Checking Account Balances After Submission
### Checking account balances after submission

Light Node Account:
After submitting a blob, you can check the light node account's balance to verify that the fees have been deducted:

After submitting a blob, you can check the light node account's balance
to verify that the fees have been deducted:
<!-- markdownlint-disable MD013 -->
```shell
celestia state balance --token $CEL_AUTH_TOKEN --node.store ~/.celestia-light-mocha-4/
```
<!-- markdownlint-enable MD013 -->

Example output showing fees are not deducted:

Expand All @@ -117,14 +128,15 @@ Example output showing fees are not deducted:
}
```

### Third-Party Account:
### Third-party account:

To confirm that the fees have been deducted from the third-party account that granted the fee allowance, run:
To confirm that the fees have been deducted from the third-party account that
granted the fee allowance, run:

```shell
celestia-appd query bank balances [granter_address] \
--node https://rpc.celestia-mocha.com:443 --denom utia
```

This output will show the remaining balance after fees have been deducted, confirming that the FeeGrant module is
working as intended.
This output will show the remaining balance after fees have been deducted,
confirming that the FeeGrant module is working as intended.

0 comments on commit f1dd9e7

Please sign in to comment.