Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Fix restart #75

Merged
merged 3 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/).
Expand Down
2 changes: 1 addition & 1 deletion starknet_devnet/blueprints/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 1 addition & 2 deletions test/test_restart.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down