From 467439de8f5d221176dd6aea9e28e21e5c8a26a0 Mon Sep 17 00:00:00 2001 From: Antun Badurina Date: Mon, 11 Apr 2022 18:47:42 +0200 Subject: [PATCH 1/3] Change restart to post --- starknet_devnet/blueprints/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/starknet_devnet/blueprints/base.py b/starknet_devnet/blueprints/base.py index 482755655..c854a949b 100644 --- a/starknet_devnet/blueprints/base.py +++ b/starknet_devnet/blueprints/base.py @@ -12,7 +12,7 @@ def is_alive(): """Health check endpoint.""" return "Alive!!!" -@base.route("/restart", methods=["GET"]) +@base.route("/restart", methods=["POST"]) def restart(): """Restart the starknet_wrapper""" state.reset() From c94852e8eb7fbc9c384c014d50313886c6cd4f27 Mon Sep 17 00:00:00 2001 From: Antun Badurina Date: Mon, 11 Apr 2022 18:47:50 +0200 Subject: [PATCH 2/3] Update restart tests --- test/test_restart.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/test_restart.py b/test/test_restart.py index c16b328c9..c4235c1c4 100644 --- a/test/test_restart.py +++ b/test/test_restart.py @@ -22,8 +22,7 @@ def run_before_and_after_test(): def restart(): """Get restart response""" - print(f"{APP_URL}/restart") - return requests.get(f"{APP_URL}/restart") + return requests.post(f"{APP_URL}/restart") def get_state_update(): """Get state update""" From 39d735d64933a4a376ac39957a115af4f6d874c7 Mon Sep 17 00:00:00 2001 From: Antun Badurina Date: Tue, 12 Apr 2022 09:19:59 +0200 Subject: [PATCH 3/3] Update README with restart information [skip ci] --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index ff0f88a0f..5a7e5c525 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Aims to mimic Starknet's Alpha testnet, but with simplified functionality. - [L1-L2 Postman Communication](#postman-integration) - [Block Explorer](#block-explorer) - [Lite Mode](#lite-mode) +- [Restart](#restart) - [Development](#development) ## Install @@ -222,6 +223,10 @@ To improve Devnet performance, consider passing these CLI flags on Devnet startu - `--lite-mode-deploy-hash` disables the calculation of the transaction hash for deploy transactions. It will instead be a simple sequence of numbers; - `--lite-mode-block-hash` disables the calculation of the block hash. It will instead be a simple sequence of numbers; +## Restart + +Devnet can be restarted by making a `POST /restart` request. All of the deployed contracts, blocks and storage updates will be restarted to the empty state. + ## Development If you're a developer willing to contribute, be sure to have installed [Poetry](https://pypi.org/project/poetry/).