# network_from_algod

> Derive the CAIP-2 network id from an algod client and register it.

```python
from ai_economy_sdk import network_from_algod
```

```python
def network_from_algod(algod_client: Any) -> str
```

Derive the CAIP-2 network id from an algod client and register it.

## Parameters

- `algod_client` (`Any`, required):
Active `algosdk.v2client.algod.AlgodClient` instance.

## Returns

- `returns` (`str`):
Registered canonical short CAIP-2 network identifier.

## Examples

```python
# Requires running Algod node:
from algosdk.v2client import algod
from ai_economy_sdk.network import network_from_algod

client = algod.AlgodClient("a" * 64, "http://localhost:4001")
caip = network_from_algod(client)
print(caip)
```

## See also

- `register_network`: Manually register network parameters.

Source: [ai_economy_sdk/network.py](https://github.com/x402-avm/ai-economy-sdk/blob/main/ai_economy_sdk/network.py#L300)

Source: https://x402-avm.github.io/reference/python/ai-economy-sdk/network-from-algod
