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 wallet b94f5374fce5edbc8e2a8697c15331677e6ebf0b on the Rome Esquiline chain.

  • Instruction 4 logs show transfer from wallet ae600d1f94680ef43ab12f8d618f8aafc208fe25 to wallet b94f5374fce5edbc8e2a8697c15331677e6ebf0b 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:

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:

Send the transaction to the Solana network:

Helper Methods

Create Solana wallet using:

Create Solana transfer instruction using

Create Solana transaction signers using

Last updated

Was this helpful?