Rome Docs
  • Getting Started
  • Overview of Rome
    • Rome Scales Bitcoin
      • How Rome Scales Bitcoin
    • Rome Scales Ethereum
      • How Rome Scales Ethereum
    • Rome Scales Rollups
      • How Rome Scales Rollups
    • Rome Provides Interop with Cosmos
      • How Rome Provides Interop with Cosmos
  • Rome L2 Setup
    • Setup your L2
      • Choose your Chain ID
      • Download Rome Repos
      • Register your L2
      • Initialize your L2
      • Setup OP Geth Node
      • Run Block Explorer
      • Run on Remote Server
        • Setup Remote Server
        • Setup Certificate
    • Test your L2
      • Setup Metamask
      • Fund your Wallet
      • Check Wallet Balance
      • Do Simple Transfer
      • Run Uniswap (Optional)
  • Rome Interop
    • Rome SDK
    • Rome SDK Setup
      • Prepare Environment
      • Set Configuration
      • Run Rhea Example
      • Run Remus Example
      • Run Romulus Example
    • Remus: Cross-Rollup Atomicity
    • Romulus: Cross-Chain Atomicity
  • Rome EVM
    • How to use Rome EVM
    • RPC Information
    • Tutorial to deploy a smart contract on Rome EVM
  • Nexus: Rome's Based Sequencer
    • How Nexus Works
    • Transaction Flow
  • Shared Sequencer
    • Atomicity
    • Rome Transactions
    • Rhea
    • Hercules
    • Data Availability
    • Settlement
Powered by GitBook
On this page
  • Methods Used
  • Main Methods
  • Helper Methods
  • Example Results
  • Solana Transaction
  • Rollup Transactions

Was this helpful?

  1. Rome Interop
  2. Rome SDK Setup

Run Romulus Example

Romulus transactions involve multiple Ethereum-like rollup transactions and Solana transactions bundled within a single Solana transaction. This structure allows for cross-chain atomic transactions.

Run Romulus example using:

cargo run --example romulus

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 Ethereum rollup 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)];

Example Results

cargo run --example romulus

INFO romulus: https://explorer.solana.com/tx/3EXFLyJ2ELQyR3Pax5F2JpRYtL4emSArfY5uco2kGuzaVB6zrB8ZrH6TWPrmyukjmUveBbM8RmY48Jm6t8HSJArp?cluster=devnet

Solana Transaction

  • Instruction 3 logs show transfer from wallet ae600d1f94680ef43ab12f8d618f8aafc208fe25 to wallet b94f5374fce5edbc8e2a8697c15331677e6ebf0b for chain 200003.

  • Instruction 4 logs show transfer from wallet ae600d1f94680ef43ab12f8d618f8aafc208fe25 to wallet b94f5374fce5edbc8e2a8697c15331677e6ebf0b for chain 200004.

  • Instruction 5 shows SOL transfer from one Solana wallet to another.

Rollup Transactions

The Rollup block explorers show these rollup transactions for chains 200003 and 200004 from wallet ae600d1f94680ef43ab12f8d618f8aafc208fe25 to b94f5374fce5edbc8e2a8697c15331677e6ebf0b.

PreviousRun Remus ExampleNextRemus: Cross-Rollup Atomicity

Last updated 2 months ago

Was this helpful?

The Solana block explorer shows the Solana transaction below (). This transaction contains three relevant instructions all executed atomically within this single Solana transaction.

link here