diff --git a/docs/mumbai/smart_rollups.rst b/docs/mumbai/smart_rollups.rst index 556034db96b981284e24c0f67834d139ff028a29..cdd1821ca36a8e28922559bbc9cf0114d8d6e28b 100644 --- a/docs/mumbai/smart_rollups.rst +++ b/docs/mumbai/smart_rollups.rst @@ -493,6 +493,15 @@ Second, the configured rollup node can be run: The log should show that the rollup node follows the layer-1 chain and processes the inbox of each level. +Rollup node in a sandbox +"""""""""""""""""""""""" + +The node can also be tested locally with a sandbox environment. (See :doc:`sandbox documentation <../user/sandbox>`.) + +Once you initialized the "sandboxed" client data with ``./src/bin_client/octez-init-sandboxed-client.sh``, you can run a sandboxed rollup node with ``octez-smart-rollup'node-alpha run``. + +A temporary directory ``/tmp/tezos-smart-rollup-node.xxxxxxxx`` will be used. However, a specific data directory can be set with the environment variable ``SCORU_DATA_DIR``. + .. _sending_external_inbox_message_mumbai: Sending an external inbox message diff --git a/src/bin_client/octez-init-sandboxed-client.sh b/src/bin_client/octez-init-sandboxed-client.sh index 98b9032653236edb47aeab1bffd4fe02290f5c9c..225e142f30ae9d3a045559538211975fd8bdd7b6 100755 --- a/src/bin_client/octez-init-sandboxed-client.sh +++ b/src/bin_client/octez-init-sandboxed-client.sh @@ -13,6 +13,11 @@ init_sandboxed_client() { rpc=$((18730 + id)) client_dir="$(mktemp -d -t tezos-tmp-client.XXXXXXXX)" client_dirs+=("$client_dir") + if [ -n "$SCORU_DATA_DIR" ]; then + rollup_node_dir="$SCORU_DATA_DIR" + else + rollup_node_dir="$(mktemp -d -t tezos-smart-rollup-node.XXXXXXXX)" + fi signer="$local_signer -d $client_dir" if [ -n "$USE_TLS" ]; then client="$local_client -base-dir $client_dir -endpoint https://$host:$rpc" @@ -184,8 +189,9 @@ main () { echo "exec $baker \"\$@\"" >> $client_dir/bin/octez-baker-$protocol_without_number chmod +x $client_dir/bin/octez-baker-$protocol_without_number + echo '#!/bin/sh' > $client_dir/bin/octez-smart-rollup-node-$protocol_without_number - echo "exec $sc_rollup_node \"\$@\"" >> $client_dir/bin/octez-smart-rollup-node-$protocol_without_number + echo "exec $sc_rollup_node \"\$@\" -data-dir $rollup_node_dir" >> $client_dir/bin/octez-smart-rollup-node-$protocol_without_number chmod +x $client_dir/bin/octez-smart-rollup-node-$protocol_without_number echo '#!/bin/sh' > $client_dir/bin/octez-smart-rollup-client-$protocol_without_number