This package is a convenient starting point for building a rollup using the Sovereign SDK:
crates/stf
: TheSTF
is derived from theRuntime
and is used in therollup
andprovers
crates.crates/provers
: This crate is responsible for creating proofs for theSTF
.crates/rollup
: This crate runs theSTF
and offers additional full-node functionalities.
(!) Note for using WIP repo. This repo utilizes private Sovereign SDK repo and default cargo needs this environment variable to use ssh key:
export CARGO_NET_GIT_FETCH_WITH_CLI=true
$ cd crates/rollup/
$ make clean-db
export SOV_PROVER_MODE=execute
This will compile and start the rollup node:
$ cargo run --bin node
$ make test-create-token
Your batch was submitted to the sequencer for publication. Response: "Submitted 1 transactions"
0: 633764b4ac1e0a6259d786e4a2b8b916f16c2c9690359d8b53995fd6d80747cd
$ make wait-ten-seconds
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"ledger_getEventsByTxnHash","params":["633764b4ac1e0a6259d786e4a2b8b916f16c2c9690359d8b53995fd6d80747cd"],"id":1}' http://127.0.0.1:12345
{"jsonrpc":"2.0","result":[{"event_value":{"TokenCreated":{"token_address":"sov1zdwj8thgev2u3yyrrlekmvtsz4av4tp3m7dm5mx5peejnesga27svq9m72"}},"module_name":"bank","module_address":"sov1r5glamudyy9ysysfjkwu3wf9cjqs98e47tzc6pxuqlp48phqk36sthwg6h"}],"id":1}
$ make test-bank-supply-of
$ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"bank_supplyOf","params":{"token_address":"sov1zdwj8thgev2u3yyrrlekmvtsz4av4tp3m7dm5mx5peejnesga27svq9m72"},"id":1}' http://127.0.0.1:12345
{"jsonrpc":"2.0","result":{"amount":10000000},"id":1}
$ cd crates/rollup/
$ make clean
$ make start
This will compile and start the rollup node:
$ cargo run --bin rollup --no-default-features --features celestia_da
Using CELESTIA=1
will enable the client to be built with Celestia support and submit the test token
$ CELESTIA=1 make test-create-token
Your batch was submitted to the sequencer for publication. Response: "Submitted 1 transactions"
0: 633764b4ac1e0a6259d786e4a2b8b916f16c2c9690359d8b53995fd6d80747cd
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"ledger_getEventsByTxnHash","params":["633764b4ac1e0a6259d786e4a2b8b916f16c2c9690359d8b53995fd6d80747cd"],"id":1}' http://127.0.0.1:12345
{"jsonrpc":"2.0","result":[{"event_value":{"TokenCreated":{"token_address":"sov1zdwj8thgev2u3yyrrlekmvtsz4av4tp3m7dm5mx5peejnesga27svq9m72"}},"module_name":"bank","module_address":"sov1r5glamudyy9ysysfjkwu3wf9cjqs98e47tzc6pxuqlp48phqk36sthwg6h"}],"id":1}
$ make test-bank-supply-of
$ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"bank_supplyOf","params":{"token_address":"sov1zdwj8thgev2u3yyrrlekmvtsz4av4tp3m7dm5mx5peejnesga27svq9m72"},"id":1}' http://127.0.0.1:12345
{"jsonrpc":"2.0","result":{"amount":10000000},"id":1}
By default, demo-rollup disables proving (i.e. the default behavior is. If we want to enable proving, several options are available:
export SOV_PROVER_MODE=skip
Skips verification logic.export SOV_PROVER_MODE=simulate
Run the rollup verification logic inside the current process.export SOV_PROVER_MODE=execute
Run the rollup verifier in a zkVM executor.export SOV_PROVER_MODE=prove
Run the rollup verifier and create a SNARK of execution.