Home/Docs/Reference/Clusters & Config

Configuration files and cluster settings.

Clusters & Config

Global config

Location: ~/.bake/config.json

json
{
  "activeCluster": "cookie",
  "walletPath": "~/.config/solana/id.json"
}

Fields

FieldTypeDescription
activeClusterstringCurrent cluster name or RPC URL
walletPathstringPath to local keypair

Config locking

bake uses atomic file locking (~/.bake/config.lock) to prevent concurrent processes from clobbering config writes. Locks are:

  • Acquired via O_CREAT | O_EXCL (atomic OS-level check)
  • Retried 10 times at 50ms intervals
  • Treated as abandoned after 5 seconds
  • Released in finally blocks

Project config

Location: bake.config.json in project root (created by bake init)

json
{
  "programId": "56Vj61zFW4hHV6wdjnisrHtVwWDqyjixjpBgnoRJvzxL"
}

Built-in clusters

NameRPC
cookiehttps://rpc.cookiescan.io
mainnethttps://api.mainnet-beta.solana.com
devnethttps://api.devnet.solana.com

Custom clusters

Any valid Solana RPC URL works:

bash
bake use https://my-rpc.example.com

Anchor.toml

bake reads Anchor.toml for project detection and program ID resolution. The [provider] section must stay populated:

toml
[provider]
cluster = "localnet"
wallet = "~/.config/solana/id.json"
Sourced from local MDX in docs/content/docs