Run Romulus Example
How to run the Romulus transaction example, including helper methods and expected output.
Romulus transactions involve multiple EVM L2 transactions and Solana transactions bundled within a single Solana transaction.
This functionality enables atomic transactions between L2s and Solana.
Fund Necessary Wallets
Ensure the from address (0xae600d1f94680ef43ab12f8d618f8aafc208fe25
) has sufficient funds on both Rome Devnet Esquiline (Chain ID 121212
) and Rome Devnet Subura (Chain ID 121213
).
Otherwise, use the instructions linked here to fund this wallet on both networks.
Run Romulus Example
RUST_LOG=info cargo run --example romulus
Example Output
INFO romulus: https://explorer.solana.com/tx/2Ra62pkEjufrzDtwrNjTgmUBGZffRNv1uaw7rzBcVdJZzKAUViJigJsP1UdzQNPQJMRbBTbooLxme8pWwvGAmJ7y?cluster=devnet
The results show two L2 transactions and one Solana balance transfer executed atomically within a single Solana transaction.
Solana Transaction
The Solana Devnet block explorer shows the Romulus Solana transaction below. It contains three relevant instructions executed atomically within a single Solana transaction.
Instruction 3 logs show transfer from wallet
ae600d1f94680ef43ab12f8d618f8aafc208fe25
to walletb94f5374fce5edbc8e2a8697c15331677e6ebf0b
on the Rome Esquiline chain.Instruction 4 logs show transfer from wallet
ae600d1f94680ef43ab12f8d618f8aafc208fe25
to walletb94f5374fce5edbc8e2a8697c15331677e6ebf0b
on the Rome Subura chain.Instruction 5 shows SOL transfer from one Solana wallet to another on the Solana Devnet.

L2 Transactions
Rome Esquiline block explorer shows the corresponding L2 transaction below between the same wallets from ae600d1f94680ef43ab12f8d618f8aafc208fe25
to b94f5374fce5edbc8e2a8697c15331677e6ebf0b
.

Rome Subura block explorer shows the corresponding L2 transaction below between the same wallets from ae600d1f94680ef43ab12f8d618f8aafc208fe25
to b94f5374fce5edbc8e2a8697c15331677e6ebf0b
.

Explanation of Methods Used
We explain the methods used in rome-sdk/examples/romulus.rs below.
Main Methods
The Rome struct will be used to compose transactions. Initialize it with your configuration:
let config = RomeConfig::load_json(common::CONFIG_PATH.parse()?).await?;
let rome = Rome::new_with_config(config).await?;
Create a Romulus transaction and then compose it using the Rome transaction structure. Specify the EVM L2 transactions, Solana instructions, and signers needed for the Solana instructions:
let romulus_tx = RomulusTx::new(eth_txs, sol_ixs);
let mut rome_tx = rome.compose_cross_chain_tx(romulus_tx, signers).await?;
Send the transaction to the Solana network:
let signature = rome.send_and_confirm(&mut *rome_tx).await?;
Helper Methods
Create Solana wallet using:
let sender = common::create_solana_payer();
Create Solana transfer instruction using
let sol_ixs = vec![common::construct_solana_transfer_ix(&sender)];
Create Solana transaction signers using
let signers = vec![Arc::new(sender)];
Last updated
Was this helpful?