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

Commit

Permalink
Fix restart (#75)
Browse files Browse the repository at this point in the history
* Change restart to post

* Update README with restart information
  • Loading branch information
badurinantun authored Apr 12, 2022
1 parent c770c80 commit a58a62e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
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/) and all the dependency packages.
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

0 comments on commit a58a62e

Please sign in to comment.