Algod Client
Algorand node operations and queries using the AlgodClient.
Examples (19)
Section titled “Examples (19)”| Example | Description |
|---|---|
| Node Health and Status | This example demonstrates how to check node health and status using the AlgodClient methods: health_check(), ready(), status(), and status_after_block(). Prerequisites: |
| Version and Genesis Information | This example demonstrates how to retrieve node version information and genesis configuration using the AlgodClient methods: versions() and genesis(). Prerequisites: |
| Ledger Supply Information | This example demonstrates how to retrieve ledger supply information using the AlgodClient method: supply(). Prerequisites: |
| Account Information | This example demonstrates how to retrieve comprehensive account information using the AlgodClient methods: account_information(), account_application_information(), and account_asset_information(). Prerequisites: |
| Transaction Parameters | This example demonstrates how to get suggested transaction parameters using suggested_params(). These parameters are essential for constructing valid transactions on the Algorand network. Prerequisites: |
| Send and Confirm Transaction | This example demonstrates how to send transactions and wait for confirmation using send_raw_transaction() and pending_transaction_information(). It shows the complete lifecycle of submitting a transaction to the Algorand network. Prerequisites: |
| Pending Transactions | This example demonstrates how to query pending transactions in the transaction pool using pending_transactions() and pending_transactions_by_address(). Pending transactions are those that have been submitted but not yet confirmed in a block. Prerequisites: |
| Block Data | This example demonstrates how to retrieve block information using the AlgodClient methods: block(), block_hash(), and block_tx_ids(). Prerequisites: |
| Asset Information | This example demonstrates how to retrieve asset information using the AlgodClient method: asset_by_id() Prerequisites: |
| Application Information | This example demonstrates how to retrieve application information using the AlgodClient method: application_by_id() Prerequisites: |
| Application Boxes | This example demonstrates how to query application boxes using the AlgodClient methods: application_boxes() and application_box_by_name() API Patterns:
Prerequisites: |
| TEAL Compile and Disassemble | This example demonstrates how to compile TEAL source code to bytecode and disassemble bytecode back to TEAL using the AlgodClient methods:
Note: Python SDK takes bytes for teal_compile (use .encode()), while TypeScript takes string. CompileResponse uses attribute access with hash_ (underscore to avoid Python builtin). Prerequisites: |
| Transaction Simulation | This example demonstrates how to simulate transactions before submitting them to the Algorand network. Simulation allows you to:
Prerequisites: |
| Ledger State Deltas | This example demonstrates how to retrieve ledger state deltas using:
State deltas show what changed in the ledger (accounts, balances, apps, assets) between rounds. Note: These endpoints may require node configuration to enable (EnableDeveloperAPI=true). Prerequisites: |
| Transaction Proof | This example demonstrates how to get transaction proofs using:
Transaction proofs are cryptographic proofs that a transaction is included in a specific block. They are used for light client verification, allowing clients to verify transaction inclusion without downloading the entire blockchain. The proof uses a Merkle tree structure where:
Prerequisites: |
| Light Block Header Proof | This example demonstrates how to get light block header proofs using:
Light block header proofs are part of Algorand’s State Proof system, which allows light clients and other blockchains to verify Algorand’s blockchain state without needing to sync all blocks or trust intermediaries. Key concepts:
Prerequisites: Note: On LocalNet in dev mode, state proofs may not be generated, so this example demonstrates the API call and handles the expected errors gracefully. |
| State Proof | This example demonstrates how to get state proofs using:
State proofs are cryptographic proofs that attest to the state of the Algorand blockchain. They allow external systems (like bridges, light clients, and other blockchains) to verify Algorand’s blockchain state without trusting any intermediary. Key concepts:
Prerequisites: Note: On LocalNet in dev mode, state proofs are NOT generated because: 1. Dev mode doesn’t run real consensus 2. There are no real participation keys generating state proofs This example demonstrates the API call and handles the expected errors gracefully. |
| DevMode Timestamp Offset | This example demonstrates how to manage block timestamp offset in DevMode using:
In DevMode, you can control the timestamp of blocks by setting an offset. This is useful for testing time-dependent smart contracts without waiting for real time to pass. Key concepts:
Prerequisites: Note: These endpoints return HTTP 404 if not running on a DevMode node. |
| Sync Round Management | This example demonstrates how to manage the sync round using:
What is the sync round? The sync round is a configuration that controls the minimum round the node will keep data for. When set, the node will:
This is useful for:
Key concepts:
Prerequisites: Note: On some nodes, these endpoints may require admin privileges or return errors if the feature is not supported. |
Quick Start
Section titled “Quick Start”Run any example from the repository’s examples directory:
cd examplesuv run python algod_client/01_node_health_status.py