Skip to content

Clusters & Program IDs

The program is deployed at a different address on each cluster. The gem exposes all three as constants under Solace::ZarTrustlessEscrow.

ClusterConstantProgram ID
MainnetMAINNET_PROGRAM_IDZARxRie8kHmJ3V3GSRFS6CUDjCMm5pEoZyhEddq6FSu
DevnetDEVNET_PROGRAM_IDZARTiAgmDYUcqbx35KF4cfJYudyQAeM4iagCXs5AR9V
LocalnetLOCALNET_PROGRAM_IDHKzzmBQk3uat5Vak8RyPyDe3f6Fi9boR1vDV6qMrSXmH

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.

Built on Solace