Clusters & Program IDs
The program is deployed at a different address on each cluster. The gem exposes all three as constants under Solace::ZarTrustlessEscrow.
| Cluster | Constant | Program ID |
|---|---|---|
| Mainnet | MAINNET_PROGRAM_ID | ZARxRie8kHmJ3V3GSRFS6CUDjCMm5pEoZyhEddq6FSu |
| Devnet | DEVNET_PROGRAM_ID | ZARTiAgmDYUcqbx35KF4cfJYudyQAeM4iagCXs5AR9V |
| Localnet | LOCALNET_PROGRAM_ID | HKzzmBQk3uat5Vak8RyPyDe3f6Fi9boR1vDV6qMrSXmH |
Solace::ZarTrustlessEscrow::PROGRAM_ID is an alias for MAINNET_PROGRAM_ID and is the default the client and composers use when no program_id is given.
Selecting a cluster
Pass the matching program id when constructing the client (and point the connection at the same cluster's RPC):
ruby
program = Solace::Programs::ZarTrustlessEscrow.new(
connection:,
program_id: Solace::ZarTrustlessEscrow::DEVNET_PROGRAM_ID
)A helper resolves a cluster symbol to its id:
ruby
Solace::ZarTrustlessEscrow.program_id_for(:devnet)
# => "ZARTiAgmDYUcqbx35KF4cfJYudyQAeM4iagCXs5AR9V"It accepts :mainnet, :devnet, or :localnet, and raises ArgumentError for anything else.