Sol.College

Structure lesson (licence does not allow quoting code)

Synapse

The Synapse of the Bolarity Network, the foundation of chain abstraction, responsible for the account interaction, message record, and execution

Original
BolarityNetwork/Synapse
SuperStack fork
Blockchains/Synapse @ 6a4725c
Stars
1
Last push (original)
2025-07-18
Languages
Rust, TypeScript, Solidity, JavaScript
Detected stack
AnchorMetaplexweb3.js
Categories
Other
Licence
none detected: code not quoted on Sol.College

Architecture

313 source files. By extension: .rs ×192, .ts ×96, .sol ×23, .js ×2.

Top-level directorySource files
contracts272
relayer39
relayer-metrics2

On-chain programs: contracts/solana/relayer-hub/programs/relayer-hub, contracts/solana/relayer_solana/programs/nft_verification, contracts/solana/relayer_solana/programs/proxy, contracts/solana/relayer_solana/programs/relayer_solana, contracts/solana/relayer_solana/programs/stake, contracts/solana/relayer_solana/programs/test, contracts/solana/relayer_solana/programs/token_bridge_relayer

How it works: instructions and accounts

Each instruction handler and the accounts struct it validates, found by reading the Rust source. Links go to the exact line at the pinned commit.

InstructionAccountsSource
InitializeConfignative instruction variantcontracts/solana/relayer-offchain/core/src/instruction.rs:18
initializeInitializecontracts/solana/relayer_solana/programs/stake/src/lib.rs:37
depositDepositcontracts/solana/relayer_solana/programs/stake/src/lib.rs:53
withdrawWithdrawcontracts/solana/relayer_solana/programs/stake/src/lib.rs:91
deregister_tokenDeregisterTokencontracts/solana/relayer_solana/programs/token_bridge_relayer/src/lib.rs:97
update_relayer_feeUpdateRelayerFeecontracts/solana/relayer_solana/programs/token_bridge_relayer/src/lib.rs:113
update_swap_rateUpdateSwapRatecontracts/solana/relayer_solana/programs/token_bridge_relayer/src/lib.rs:142
cancel_ownership_transfer_requestManageOwnershipcontracts/solana/relayer_solana/programs/token_bridge_relayer/src/lib.rs:210
update_assistantManageOwnershipcontracts/solana/relayer_solana/programs/token_bridge_relayer/src/lib.rs:223
confirm_ownership_transfer_requestConfirmOwnershipTransfercontracts/solana/relayer_solana/programs/token_bridge_relayer/src/processor/admin/ownership.rs:80
cancel_ownership_transfer_requestManageOwnershipcontracts/solana/relayer_solana/programs/token_bridge_relayer/src/processor/admin/ownership.rs:103
update_swap_rateUpdateSwapRatecontracts/solana/relayer_solana/programs/token_bridge_relayer/src/processor/admin/update_swap_rate.rs:36
update_relayer_feeUpdateRelayerFeecontracts/solana/relayer_solana/programs/token_bridge_relayer/src/processor/admin/update_relayer_fee.rs:41
set_pause_for_transfersPauseOutboundTransferscontracts/solana/relayer_solana/programs/token_bridge_relayer/src/processor/admin/set_pause_for_transfers.rs:20
initializeInitializecontracts/solana/relayer_solana/programs/proxy/src/lib.rs:33
proxy_callSplitSolcontracts/solana/relayer_solana/programs/proxy/src/lib.rs:61
testTestcontracts/solana/relayer_solana/programs/proxy/src/lib.rs:107
receive_messageReceiveMessagecontracts/solana/relayer_solana/programs/proxy/src/lib.rs:138
initializeInitializecontracts/solana/relayer_solana/programs/nft_verification/src/instructions.rs:11
initializeInitializecontracts/solana/relayer_solana/programs/nft_verification/src/lib.rs:18
initializeInitializecontracts/solana/relayer_solana/programs/relayer_solana/src/lib.rs:53
send_messageSendMessagecontracts/solana/relayer_solana/programs/relayer_solana/src/lib.rs:225
receive_messageReceiveMessagecontracts/solana/relayer_solana/programs/relayer_solana/src/lib.rs:308
receive_message2ReceiveMessage2contracts/solana/relayer_solana/programs/relayer_solana/src/lib.rs:423
receive_message3ReceiveMessage3contracts/solana/relayer_solana/programs/relayer_solana/src/lib.rs:556
initializeInitializecontracts/solana/relayer-hub/programs/relayer-hub/src/lib.rs:21
update_configUpdateConfigcontracts/solana/relayer-hub/programs/relayer-hub/src/lib.rs:25
register_relayerRegisterRelayercontracts/solana/relayer-hub/programs/relayer-hub/src/lib.rs:34
register_tx_poolRegisterTxPoolcontracts/solana/relayer-hub/programs/relayer-hub/src/lib.rs:44
init_execute_transactionInitExecTransactioncontracts/solana/relayer-hub/programs/relayer-hub/src/lib.rs:56

Where the Solana code lives

Source files that import a Solana SDK, ranked by how many Solana APIs they use, with the APIs each one calls. Read them in this order to see how the app talks to the chain.

FileSolana APIs used
contracts/solana/relayer_solana/tests/relayer_solana.tsPublicKey, Keypair, Program, seeds, findProgramAddressSync, SystemProgram
contracts/ethereum/scripts/deploy.tsPublicKey, transfer, findProgramAddressSync, Keypair, getAssociatedTokenAddressSync, SystemProgram
contracts/solana/relayer-offchain/core/src/epoch_snapshot.rsPubkey, seeds, AccountInfo
contracts/solana/relayer_solana/programs/relayer_solana/src/context.rsseeds, Program, Pubkey, AccountInfo, init_if_needed, has_one
relayer/src/controller.tsPublicKey, Transaction, ComputeBudgetProgram, Program, Keypair, sendAndConfirmTransaction
contracts/solana/relayer-offchain/core/src/vault_registry.rsPubkey, seeds, AccountInfo
contracts/solana/relayer_solana/migrations/deploy.tsPublicKey, sendAndConfirmTransaction, Transaction, findProgramAddressSync, getAssociatedTokenAddress, Program
contracts/solana/relayer-hub/programs/relayer-hub/src/instructions/transaction_pool.rsseeds, Transaction, Program, init_if_needed
contracts/solana/relayer_solana/programs/relayer_solana/src/lib.rsinvoke_signed, seeds, transfer, invoke, Pubkey, Program
relayer/src/relayer_hub.tsProgram, PublicKey, findProgramAddressSync, Transaction, sendAndConfirmTransaction, AnchorProvider
contracts/solana/relayer_solana/programs/nft_verification/src/state.rsPubkey, Program, seeds, init_if_needed
contracts/solana/relayer-offchain/relayer-ncn-operator-cli/src/relayer_ncn.rsPubkey, Keypair, Transaction

Dapp: devnet deploy pending

⏳ Devnet deploy pending — goes live when the devnet wallet is topped up. This fork's own dapp is not deployed yet, so there is no program address or transaction to show. It is queued in dapp-queue.txt; once devnet SOL is available it is deployed, exercised with real devnet transactions, and this section switches to the live dapp at /dapps/synapse/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.

How to run, build and test

These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.

DirectoryCommandRuns
relayernpm run start
relayernpm run build
relayer-metricsnpm run start
relayer-metricsnpm run test
contracts/solana/relayer_solanaanchor build
contracts/solana/relayer_solanaanchor test
contracts/solana/relayer_solanaanchor run test
contracts/solana/relayer-hubanchor build
contracts/solana/relayer-hubanchor test
contracts/solana/relayer-hubanchor run test

What you could build from it