Crate sov_sequencer

source ·
Expand description

Sov-Sequencer

Simple implementation of based sequencer generic over batch builder and DA service.

Exposes 2 RPC methods:

  1. sequencer_acceptTx where input is supposed to be signed and serialized transaction. This transaction is stored in mempool
  2. sequencer_publishBatch without any input, which builds the batch using batch builder and publishes it on DA layer.

How to use it with sov-cli

sov-cli from demo-stf crate has support for interacting with sov-sequencer.

Make sure that this tool is build

cd examples/demo-stf
cargo build --bin sov-cli

Submit transactions

This command is similar to serialize call from demo-rollup README, with one last parameter, RPC endpoint for sov-sequencer.

When demo-rollup with enabled sequencer starts, it prints on which endpoint it listens:

2023-07-07T14:53:02.280562Z  INFO sov_demo_rollup: Starting RPC server at 127.0.0.1:12345

Let’s submit 3 transactions: create token, mint and transfer:

# create token
./target/debug/sov-cli submit-transaction examples/demo-stf/src/sov-cli/test_data/token_deployer_private_key.json Bank examples/demo-stf/src/sov-cli/test_data/create_token.json 0 http://127.0.0.1:12345

# mint
./target/debug/sov-cli submit-transaction examples/demo-stf/src/sov-cli/test_data/minter_private_key.json Bank examples/demo-stf/src/sov-cli/test_data/mint.json 0 http://127.0.0.1:12345

# transfer
./target/debug/sov-cli submit-transaction examples/demo-stf/src/sov-cli/test_data/minter_private_key.json Bank examples/demo-stf/src/sov-cli/test_data/transfer.json 1 http://127.0.0.1:12345

Now these transactions are in the mempool

Publish blob

In order to submit transactions to DA layer, sequencer needs to publish them. This can be done by triggering publishBatch endpooint:

./target/debug/sov-cli publish-batch http://127.0.0.1:12345

After some time, processed transaction should appear in logs of running rollup

Modules

  • Utilities for the sequencer rpc

Structs

  • Single data structure that manages mempool and batch producing.
  • A transaction to be submitted to the rollup

Enums

Functions