get_foundry_network_name
Documentation for eth_defi.chain.get_foundry_network_name function.
- get_foundry_network_name(chain_id)
Return Foundry’s fork-cache network directory name for a chain id.
Anvil stores its fork RPC cache under
~/.foundry/cache/rpc/<network>/<block>/keyed by Foundry’s own chain name (e.g.mainnetfor Ethereum,bscfor BNB Smart Chain), not ourCHAIN_NAMESdisplay name. Use this to locate or seed a chain’s fork cache directory (seeeth_defi.testing.rpc_cache).- Parameters
chain_id (int) – EVM chain id.
- Returns
The Foundry network directory name, or
Nonewhen not recorded inFOUNDRY_NETWORK_NAMES(Foundry then falls back to the numeric chain id as the directory name).- Return type