Comment on page
Chainlets are billed at a pre-determined interval depending on the type of chainlet it is and the duration of each epoch. Typically, a chainlet would be billed each day for the resources it consumes.
As each billing cycle is processed, the funds available to the chainlet inside the escrow account get depleted. Make sure you keep your escrow account funded to prevent your chainlet from being shutdown.
As an example, if your chainlet type is
SagaOS, you can view the billing details by using
$ sagacli chainlet list-types
DisplayName Description Creator Version SetupCost EpochCost
----------- ----------- ------- ------- --------- ---------
SagaOS SagaOS Chainlet Stack saga1yuvju0cztlahsf6f37z9j83vwyzgj6pzhx090f 0.5.2 10000000upsaga 10000000upsaga/day
As you can see (slide to the right of the above code block), we have two separate costs associated with this chainlet type: a setup cost and an epoch cost.
A chainlet setup cost is a 1-time fee charged when the chainlet is initially launched.
An epoch cost is the amount billed at the end of each epoch. For SagaOS, the epoch is set to 1 day
As can be seen in our example listing above, we have a SetupCost of 10
upsaga) which is charged when the chainlet is launched.
We also have an EpochCost of 10
psagawhich is the amount billed to the chainlet each day.
All chainlets launched are charged a setup fee and a 30-day deposit of the epoch cost, which is then decremented as the chainlet gets billed each epoch.
For our example above, our chainlet launch cost would be
psaga)+ (30 days * EpochCost 10
psaga/day) = 310
This amount of 310
psagais charged to the chainlet launcher's wallet at chainlet launch, and deposited into the escrow account associated with the chainlet.
As a user, you can view the billing history associated with any chainlet you have launched or contributed funds toward. To view the billing history of a chainlet, simply type:
sagacli account get-billing-history <chain-id>
For example, to view the billing history of a chainlet with a
$ sagacli account get-billing-history magicwarriors_1698795593524888-1
ChainletId ChainletName ChainletOwner BilledAmount EpochIdentifier EpochNumber EpochStartTime
---------- ------------ ------------- ------------ --------------- ----------- --------------
magicwarriors_1698795593524888-1 magicwarriors saga1yuvju0cztlahsf6f37z9j83vwyzgj6pzhx090f 20000000upsaga day 1 2023-10-31T23:22:01Z
This output shows you the chainlet information along with the amount billed and the time the chainlet was billed.
This is a paginated query. Then, if you need to navigate through the chainlet billing history you have to change the value of
If for some reason you need to export all chainlet billing history in a single step, you can da that as well, just specifying the
$ sagacli account get-billing-history magicwarriors_1698795593524888-1 --csv-file /tmp/billing_history.csv
The csv file specified now contains all the billing history of
magicwarriors_1679599719-1chainlet recorded so far.
To get further details and options associated with getting billing history, please refer to
sagacli account get-billing-history --help