> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Solana Agave 2.0 upgrade reference

> Quick reference for the Solana node client transition from Solana Labs to Agave, covering deprecated methods, renamed endpoints, and migration steps.

**TLDR:**

* Agave v2.0, with an October 21, 2024 upgrade deadline for nodes, removed several outdated RPC methods. Solana nodes on Chainstack return `-32601 Method not found` for them.
* Each removed method has a replacement, such as `getSignatureStatuses`. See [Methods: deprecated and replaced](#methods-deprecated-and-replaced).
* The code examples illustrate how to switch from `confirmTransaction` to `getSignatureStatuses` in both JavaScript and Python.

## In brief

[Agave](https://github.com/anza-xyz/agave) is the Rust-based Solana node client that is also a fork of the original Solana Labs client.

The primary purpose of Agave replacing the original Solana Labs client is to make the network multi-client. The multi-client part mostly means the introduction of another node client — the C-based Firedancer.

The Agave v2.0 release schedule set **October 21, 2024** as the upgrade deadline for nodes.

Agave v2.0 removed the methods listed in [Methods: deprecated and replaced](#methods-deprecated-and-replaced), and later Agave releases don't serve them either. Solana nodes on Chainstack return `-32601 Method not found` for each of them.

See:

> [card] [Agave v2.0 release schedule](https://github.com/anza-xyz/agave/wiki/v2.0-Release-Schedule)

> [card] [Agave v2.0 transition guide](https://github.com/anza-xyz/agave/wiki/Agave-v2.0-Transition-Guide)

## Methods: deprecated and replaced

| Deprecated call | Replacement call |
| - | - |
| confirmTransaction | [getSignatureStatuses](https://docs.chainstack.com/reference/solana-getsignaturestatuses.md) |
| getSignatureStatus | [getSignatureStatuses](https://docs.chainstack.com/reference/solana-getsignaturestatuses.md) |
| getSignatureConfirmation | [getSignatureStatuses](https://docs.chainstack.com/reference/solana-getsignaturestatuses.md) |
| getConfirmedSignaturesForAddress | [getSignaturesForAddress](https://docs.chainstack.com/reference/solana-getsignaturesforaddress.md) |
| getConfirmedBlock | [getBlock](https://docs.chainstack.com/reference/solana-getblock.md) |
| getConfirmedBlocks | [getBlocks](https://docs.chainstack.com/reference/solana-getblocks.md) |
| getConfirmedBlocksWithLimit | [getBlocksWithLimit](https://docs.chainstack.com/reference/getblockswithlimit.md) |
| getConfirmedTransaction | [getTransaction](https://docs.chainstack.com/reference/gettransaction.md) |
| getConfirmedSignaturesForAddress2 | [getSignaturesForAddress](https://docs.chainstack.com/reference/solana-getsignaturesforaddress.md) |
| getRecentBlockhash | [getLatestBlockhash](https://docs.chainstack.com/reference/solana-getlatestblockhash.md) |
| getFees | [getFeeForMessage](https://docs.chainstack.com/reference/solana-getfeeformessage.md) |
| getFeeCalculatorForBlockhash | [isBlockhashValid](https://docs.chainstack.com/reference/isblockhashvalid.md) or [getFeeForMessage](https://docs.chainstack.com/reference/solana-getfeeformessage.md) |
| getFeeRateGovernor | [getFeeForMessage](https://docs.chainstack.com/reference/solana-getfeeformessage.md) |
| getSnapshotSlot | [getHighestSnapshotSlot](https://docs.chainstack.com/reference/solana-gethighestsnapshotslot.md) |
| getStakeActivation | [getAccountInfo \| Solana](https://docs.chainstack.com/reference/solana-getaccountinfo.md) ([alternative approach](https://solana.stackexchange.com/questions/15710/the-alternative-method-to-get-the-stake-account-status-since-getstakeactivation)) |

## Replacing `confirmTransaction` with `getSignatureStatuses`

```javascript @solana/web3.js theme={"system"}
import { Connection, Transaction, SendOptions } from '@solana/web3.js';

async function sendAndConfirmTransaction(
  connection: Connection,
  transaction: Transaction,
  timeout: number = 30000, // 30 seconds default timeout
  options?: SendOptions
): Promise<string> {
  // Send the transaction
  const signature = await connection.sendTransaction(transaction, options?.signers || [], {
    ...options,
    skipPreflight: options?.skipPreflight || false
  });

  // Create a promise that will reject after the timeout
  const timeoutPromise = new Promise((_, reject) => {
    setTimeout(() => {
      reject(new Error(`Transaction confirmation timeout after ${timeout}ms`));
    }, timeout);
  });

  // Create the confirmation promise
  const confirmationPromise = (async () => {
    let done = false;
    while (!done) {
      // Get the status of the transaction
      const response = await connection.getSignatureStatuses([signature]);
      const status = response.value[0];

      if (status) {
        if (status.err) {
          throw new Error(`Transaction failed: ${status.err.toString()}`);
        }

        // Check if we have enough confirmations
        if (status.confirmationStatus === 'finalized') {
          done = true;
          return signature;
        }
      }

      // Wait a bit before checking again
      await new Promise(resolve => setTimeout(resolve, 1000));
    }
  })();

  // Race between timeout and confirmation
  try {
    return await Promise.race([confirmationPromise, timeoutPromise]);
  } catch (error) {
    // If it's a timeout error, we should still return the signature
    if (error.message.includes('timeout')) {
      return signature;
    }
    throw error;
  }
}

// Example usage
async function example() {
  const connection = new Connection('CHAINSTACK_NODE');
  const transaction = new Transaction();
  // ... add your transaction instructions here ...

  try {
    const signature = await sendAndConfirmTransaction(connection, transaction, 60000, {
      skipPreflight: false,
      // ... other options
    });
    console.log('Transaction confirmed:', signature);
  } catch (error) {
    console.error('Transaction failed:', error);
  }
}
```

```python solana.py theme={"system"}
from solana.rpc.async_api import AsyncClient
from solana.rpc.commitment import Commitment
from solana.rpc.models import TxOpts
from solders.transaction import VersionedTransaction
from solders.transaction_status import TransactionConfirmationStatus
from typing import Optional, List, Union
import time
import asyncio
from concurrent.futures import TimeoutError

class TransactionConfirmationError(Exception):
    """Custom exception for transaction confirmation errors"""
    pass

async def send_and_confirm_transaction(
    client: AsyncClient,
    transaction: VersionedTransaction,
    signers: List,
    timeout: int = 30,  # timeout in seconds
    commitment: Union[str, Commitment] = "finalized"
) -> str:
    """
    Send and confirm a transaction using getSignatureStatuses

    Args:
        client: Solana client instance
        transaction: Signed transaction to send
        signers: List of signers for the transaction
        timeout: Maximum time to wait for confirmation in seconds
        commitment: Commitment level to use

    Returns:
        Transaction signature

    Raises:
        TransactionConfirmationError: If transaction fails or times out
    """

    # Send the transaction
    try:
        response = await client.send_transaction(
            transaction,
            opts=TxOpts(
                skip_preflight=False,
                preflight_commitment=commitment
            )
        )
        signature = response.value
    except Exception as e:
        raise TransactionConfirmationError(f"Failed to send transaction: {str(e)}")

    # Start time for timeout tracking
    start_time = time.time()

    async def confirm_transaction() -> str:
        while True:
            try:
                # Check if we've exceeded timeout
                if time.time() - start_time > timeout:
                    raise TimeoutError(f"Transaction confirmation timeout after {timeout} seconds")

                # Get transaction status
                response = await client.get_signature_statuses([signature])

                if response.value[0] is None:
                    # Transaction not yet processed, wait and retry
                    await asyncio.sleep(1)
                    continue

                status = response.value[0]

                # Check if transaction failed
                if status.err:
                    raise TransactionConfirmationError(
                        f"Transaction failed: {status.err}"
                    )

                # Check confirmation status
                conf_status = status.confirmation_status
                if conf_status == TransactionConfirmationStatus.Finalized:
                    return str(signature)

                # Wait before checking again
                await asyncio.sleep(1)

            except TimeoutError:
                # Return signature even on timeout
                return str(signature)
            except Exception as e:
                if not isinstance(e, TimeoutError):
                    raise TransactionConfirmationError(f"Confirmation failed: {str(e)}")

    try:
        return await confirm_transaction()
    except Exception as e:
        raise TransactionConfirmationError(str(e))

# Example usage
async def example():
    # Initialize client
    async with AsyncClient("CHAINSTACK_NODE") as client:
        # Build and sign your transaction
        transaction = ...  # a VersionedTransaction with your instructions and signers

        try:
            signature = await send_and_confirm_transaction(
                client=client,
                transaction=transaction,
                signers=[],  # Add your signers here
                timeout=60,  # 60 seconds timeout
                commitment="finalized"
            )
            print(f"Transaction confirmed: {signature}")
        except TransactionConfirmationError as e:
            print(f"Transaction failed: {str(e)}")

# Run the example
if __name__ == "__main__":
    asyncio.run(example())
```
