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

Commit

Permalink
Bump version to v0.2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
FabijanC committed Aug 8, 2022
1 parent 812a98a commit 1b604e6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 25 deletions.
32 changes: 10 additions & 22 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.
- [Hardhat Integration](#hardhat-integration)
- [L1-L2 Postman Communication](#postman-integration)
- [Block Explorer](#block-explorer)
- [Blocks](#blocks)
- [Lite Mode](#lite-mode)
- [Restart](#restart)
- [Advancing time](#advancing-time)
Expand Down Expand Up @@ -114,15 +115,15 @@ docker pull shardlabs/starknet-devnet:<TAG>

Image tags correspond to Devnet versions as on PyPI and GitHub, with the `latest` tag used for the latest image. These images are built for linux/amd64. To use the arm64 versions, since `0.1.23` you can append `-arm` to the tag. E.g.:

- `shardlabs/starknet-devnet:0.2.8` - image for the amd64 architecture
- `shardlabs/starknet-devnet:0.2.8-arm` - image for the arm64 architecture
- `shardlabs/starknet-devnet:0.2.9` - image for the amd64 architecture
- `shardlabs/starknet-devnet:0.2.9-arm` - image for the arm64 architecture
- `shardlabs/starknet-devnet:latest-arm`

By appending the `-seed0` suffix, you can access images which [predeploy funded accounts](#predeployed-accounts) with `--seed 0`, thus always deploying the same set of accounts. E.g.:

- `shardlabs/starknet-devnet:0.2.8-seed0`
- `shardlabs/starknet-devnet:0.2.9-seed0`
- `shardlabs/starknet-devnet:latest-seed0`
- `shardlabs/starknet-devnet:0.2.8-arm-seed0`
- `shardlabs/starknet-devnet:0.2.9-arm-seed0`

The server inside the container listens to the port 5050, which you need to publish to a desired `<PORT>` on your host machine:

Expand Down Expand Up @@ -315,15 +316,13 @@ docker run \

A local block explorer (Voyager), as noted [here](https://voyager.online/local-version/), apparently cannot be set up to work with Devnet. Read more in [this issue](https://github.com/Shard-Labs/starknet-devnet/issues/60).

## Block
## Blocks

Devnet start with a genesis block.
Devnet starts with a genesis block (with block number equal to `0` and block hash equal to `"0x0"`).

GENESIS_BLOCK_NUMBER = 0
A new block is generated with each new transaction. There is no pending block.

GENESIS_BLOCK_HASH = "0x0"

You can create empty block without transaction.
To create an empty block without transactions, `POST` a request to `/create_block`:

```
POST /create_block
Expand Down Expand Up @@ -578,25 +577,14 @@ poetry run starknet-devnet
./scripts/lint.sh
```

### Development - Test in parallel
```bash
./scripts/test.sh
#optional you can pass <TEST_DIR>/
```
or manually you can set -s -v for verbose and replace 'auto' with number of workers (recommended same as CPU cores)
```bash
poetry run pytest -n auto --dist loadscope test/
# parallel testing using auto detect number of CPU cores and spawn same amount of workers
```

### Development - Test

When running tests locally, do it from the project root:

```bash
./scripts/compile_contracts.sh # first generate the artifacts

poetry run pytest test/
./scripts/test.sh [TEST_CASE] # parallelized testing - using auto detected number of CPU cores

poetry run pytest -s -v test/ # for more verbose output

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "starknet_devnet"
version = "0.2.8"
version = "0.2.9"
description = "A local testnet for Starknet"
authors = ["FabijanC <[email protected]>"]
license = "ISC"
Expand Down
2 changes: 1 addition & 1 deletion starknet_devnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from crypto_cpp_py.cpp_bindings import cpp_hash


__version__ = "0.2.8"
__version__ = "0.2.9"


def patched_pedersen_hash(left: int, right: int) -> int:
Expand Down
2 changes: 1 addition & 1 deletion test/test_block_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def test_block_number_incremented():
base_workflow()

@devnet_in_background("--lite-mode")
def test_block_number__incremented_in_lite_mode():
def test_block_number_incremented_in_lite_mode():
"""Tests compatibility with lite mode"""
base_workflow()

Expand Down

0 comments on commit 1b604e6

Please sign in to comment.