moved all scripts to ./scripts and added some arg shorthands
This commit is contained in:
parent
b557031358
commit
7f26c600dc
10
README.md
10
README.md
@ -18,9 +18,9 @@ Install dependencies through poetry
|
|||||||
poetry install
|
poetry install
|
||||||
```
|
```
|
||||||
|
|
||||||
Start the services (optionally as background processes)
|
Start the services (optionally as daemon
|
||||||
```
|
```
|
||||||
poetry run start [-b]
|
poetry run start [-d]
|
||||||
```
|
```
|
||||||
|
|
||||||
Apply the latest migrations against the local DB:
|
Apply the latest migrations against the local DB:
|
||||||
@ -30,7 +30,7 @@ poetry run exec alembic upgrade head
|
|||||||
|
|
||||||
Run inspect on a block
|
Run inspect on a block
|
||||||
```
|
```
|
||||||
poetry run inspect --block-number 11931270 --rpc 'http://111.11.11.111:8545/'
|
poetry run inspect -b/--block-number 11931270 -r/--rpc 'http://111.11.11.111:8545/'
|
||||||
```
|
```
|
||||||
|
|
||||||
To stop the services (if running in the background, otherwise just ctrl+c)
|
To stop the services (if running in the background, otherwise just ctrl+c)
|
||||||
@ -67,12 +67,12 @@ poetry run mypy # type checking
|
|||||||
poetry run black # style guide
|
poetry run black # style guide
|
||||||
poetry run pre-commit run --all-files # runs Black, PyLint and MyPy
|
poetry run pre-commit run --all-files # runs Black, PyLint and MyPy
|
||||||
# docker management
|
# docker management
|
||||||
poetry run start [-b] # starts all services, optionally in the background
|
poetry run start [-d] # starts all services, optionally as a daemon
|
||||||
poetry run stop # shutsdown all services or just ctrl + c if foreground
|
poetry run stop # shutsdown all services or just ctrl + c if foreground
|
||||||
poetry run build # rebuilds containers
|
poetry run build # rebuilds containers
|
||||||
poetry run attach # enters the mev-inspect container in interactive mode
|
poetry run attach # enters the mev-inspect container in interactive mode
|
||||||
# launches inspection script
|
# launches inspection script
|
||||||
poetry run inspect --block-number 11931270 --rpc 'http://111.11.11.111:8545/'
|
poetry run inspect -b/--block-number 11931270 -r/--rpc 'http://111.11.11.111:8545/'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,18 +29,18 @@ requires = ["poetry-core>=1.0.0"]
|
|||||||
build-backend = "poetry.core.masonry.api"
|
build-backend = "poetry.core.masonry.api"
|
||||||
|
|
||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
lint = 'scripts.dev_tools:lint'
|
lint = 'scripts.poetry.dev_tools:lint'
|
||||||
test = 'scripts.dev_tools:test'
|
test = 'scripts.poetry.dev_tools:test'
|
||||||
isort = 'scripts.dev_tools:isort'
|
isort = 'scripts.poetry.dev_tools:isort'
|
||||||
mypy = 'scripts.dev_tools:mypy'
|
mypy = 'scripts.poetry.dev_tools:mypy'
|
||||||
black = 'scripts.dev_tools:black'
|
black = 'scripts.poetry.dev_tools:black'
|
||||||
pre_commit = 'scripts.dev_tools:pre_commit'
|
pre_commit = 'scripts.poetry.dev_tools:pre_commit'
|
||||||
start = 'scripts.docker:start'
|
start = 'scripts.poetry.docker:start'
|
||||||
stop = 'scripts.docker:stop'
|
stop = 'scripts.poetry.docker:stop'
|
||||||
build = 'scripts.docker:build'
|
build = 'scripts.poetry.docker:build'
|
||||||
attach = 'scripts.docker:attach'
|
attach = 'scripts.poetry.docker:attach'
|
||||||
exec = 'scripts.docker:exec'
|
exec = 'scripts.poetry.docker:exec'
|
||||||
inspect = 'scripts.inspect:inspect'
|
inspect = 'scripts.poetry.inspect:inspect'
|
||||||
|
|
||||||
[tool.black]
|
[tool.black]
|
||||||
exclude = '''
|
exclude = '''
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
from subprocess import check_call
|
|
||||||
|
|
||||||
import click
|
|
||||||
|
|
||||||
|
|
||||||
@click.command()
|
|
||||||
@click.option("--block-number", type=int, help="the block number you are targetting")
|
|
||||||
@click.option("--rpc", help="rpc endpoint, this needs to have parity style traces")
|
|
||||||
def inspect(block_number: int, rpc: str):
|
|
||||||
check_call(
|
|
||||||
[
|
|
||||||
"docker",
|
|
||||||
"compose",
|
|
||||||
"exec",
|
|
||||||
"mev-inspect",
|
|
||||||
"python",
|
|
||||||
"inspect_block.py",
|
|
||||||
str(block_number),
|
|
||||||
rpc,
|
|
||||||
]
|
|
||||||
)
|
|
@ -5,10 +5,10 @@ import click
|
|||||||
|
|
||||||
|
|
||||||
@click.command()
|
@click.command()
|
||||||
@click.option("-b", required=False, is_flag=True)
|
@click.option("-d", required=False, is_flag=True)
|
||||||
def start(b: str):
|
def start(d: str):
|
||||||
"""if d is present background compose"""
|
"""if d is present, run docker compose as daemon"""
|
||||||
if b:
|
if d:
|
||||||
check_call(["docker", "compose", "up", "-d"])
|
check_call(["docker", "compose", "up", "-d"])
|
||||||
click.echo("docker running in the background...")
|
click.echo("docker running in the background...")
|
||||||
else:
|
else:
|
25
scripts/poetry/inspect.py
Normal file
25
scripts/poetry/inspect.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
from subprocess import check_call
|
||||||
|
|
||||||
|
import click
|
||||||
|
|
||||||
|
|
||||||
|
@click.command()
|
||||||
|
@click.option(
|
||||||
|
"-b", "--block-number", type=str, help="the block number you are targetting"
|
||||||
|
)
|
||||||
|
@click.option(
|
||||||
|
"-r", "--rpc", help="rpc endpoint, this needs to have parity style traces"
|
||||||
|
)
|
||||||
|
def inspect(block_number: str, rpc: str):
|
||||||
|
check_call(
|
||||||
|
[
|
||||||
|
"docker",
|
||||||
|
"compose",
|
||||||
|
"exec",
|
||||||
|
"mev-inspect",
|
||||||
|
"python",
|
||||||
|
"./scripts/inspect_block.py",
|
||||||
|
block_number,
|
||||||
|
rpc,
|
||||||
|
]
|
||||||
|
)
|
Loading…
x
Reference in New Issue
Block a user