1 unstable release
Uses new Rust 2024
new 0.1.4 | Apr 25, 2025 |
---|
#15 in Magic Beans
315KB
7K
SLoC
Nitro Da CLI
This crate allows users to interact with the blober
program in order to register new blober
PDA accounts, upload
blobs and retrieve data from the indexer.
The mandatory parameters for this tool are the address of the blober
program (--program-id
or -p
) and the
namespace of the blober
PDA to interact with (--namespace
or -n
).
Optional global parameters are:
- payer (
-s
,--payer
): The payer account to use for transactions - output (
-o
,--output
): The output format to use [default: text] [possible values: text, json, json-pretty, csv] - falls back to text output if a format is not supported for a command - indexer url (
-i
,--indexer-url
): The URL of the indexer to use - config file (
-c
,--config-file
): The path to the SolanaConfig
file [default: ~/.config/solana/cli/config.yml]
The CLI has a help
command (available for each subcommand as well) which you can use to check the usage.
Here is a high level overview of the available commands.
nitro-da-cli blober
or nitro-da-cli br
This subcommand allows you to initialize and close blober
PDA accounts with the followign commands:
nitro-da-cli br initialize
ornitro-da-cli br i
to initialize a newblober
PDA account
# Initialize a new namespace with the seed "some-namespace"
nitro-da-cli -p "<program-id-of-blober>" -n "some-namespace" br i
nitro-da-cli br close
ornitro-da-cli br c
to close an existingblober
PDA account
# Close a existing namespace with the seed "some-namespace"
nitro-da-cli -p "<program-id-of-blober>" -n "some-namespace" br c
nitro-da-cli blob
or nitro-da-cli b
This subcommand allows you to upload and discard blobs of data with the following commands:
nitro-da-cli b upload
ornitro-da-cli b u
to upload data read from a file at the given--data-path
(or-d
)
# Upload a blob of data read from a file
nitro-da-cli -p "<program-id-of-blober>" -n "some-namespace" b u -d "./data.txt"
nitro-da-cli b discard
ornitro-da-cli b d
to discard a blob upload with the givenblob
PDA (--blob
or-b
) before it is finalized
# Discard a failed or stale blob upload with the given PDA ID
nitro-da-cli -p "<program-id-of-blober>" -n "some-namespace" b d -b "<some-blob-pda-id>"
nitro-da-cli b fetch
ornitro-da-cli b f
to fetch blob data from the ledger given a list of transaction signatures
# Fetch blob data from the ledger given a list of transactions
nitro-da-cli -p "<program-id-of-blober>" -n "some-namespace" b f "<some-tx-signature>" "<some-other-tx-signature>"
nitro-da-cli b get
ornitro-da-cli b g
to retrieve all blobs finalized at a given slot
# Get all blobs which were finalized at the given slot
nitro-da-cli -p "<program-id-of-blober>" -n "some-namespace" b g 54321
nitro-da-cli indexer
or nitro-da-cli i
This subcommand allows you to fetch blobs and proofs for a given blober
PDA and slot
using the following commands:
nitro-da-cli i blobs
ornitro-da-cli i b
to fetch blobs
# Retrieve all blobs finalized at the given slot
nitro-da-cli -p "<program-id-of-blober>" -n "some-namespace" i b 54321
nitro-da-cli i proofs
ornitro-da-cli i p
to fetch proofs
# Fetch a compound proof (inclusion or completness) for a given slot
nitro-da-cli -p "<program-id-of-blober>" -n "some-namespace" i p 54321
nitro-da-cli measure
or nitro-da-cli m
This subcommand allow you to generate data files and upload them to capture some measurements using the following commands:
nitro-da-cli m generate
ornitro-da-cli m g
to generate data files to a given directorynitro-da-cli m measure
ornitro-da-cli m m
to upload data from a given directory and capture measurementsnitro-da-cli m automate
ornitro-da-cli m a
to run automated benchmarks with combinations of different data generation and measurement scenarios
Dependencies
~84MB
~1.5M SLoC