Skip to content

Commit

Permalink
feat: Justfile Migration (#224)
Browse files Browse the repository at this point in the history
* feat: migrate to justfile over makefile

* fix: doc cleaning

* fix: doc cleaning

* fix: consistently use spaces
  • Loading branch information
refcell authored May 22, 2024
1 parent 412051c commit 13e124c
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 28 deletions.
76 changes: 76 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
set positional-arguments
set dotenv-load := true

alias t := test
alias b := build-all
alias l := lint
alias f := fmt

# default recipe to display help information
default:
@just --list

# Builds all docker images
build-all:
docker buildx build --platform linux/arm64,linux/amd64 -t a16zcrypto/magi --push .

# Builds local magi docker images
build-local:
docker buildx build -t noah7545/magi --load .

# Pulls all docker images
pull:
cd docker && docker compose pull

# Cleans all docker images
clean:
cd docker && docker compose down -v --remove-orphans

# Composes docker
run:
cd docker && docker compose up

# Composes docker with local images
run-local:
just build-local && cd docker && docker compose up

# Runs op-geth with docker
run-geth:
cd docker && COMPOSE_PROFILES=op-geth docker compose up

# Runs op-erigon with docker
run-erigon:
cd docker && COMPOSE_PROFILES=op-erigon docker compose up

# Run all tests
tests: test test-docs

# Test for the native target with all features
test *args='':
cargo nextest run --all --all-features $@

# Lint for all available targets
lint: lint-native lint-docs

# Fixes and checks the formatting
fmt: fmt-native-fix fmt-native-check

# Fixes the formatting
fmt-native-fix:
cargo +nightly fmt --all

# Check the formatting
fmt-native-check:
cargo +nightly fmt --all -- --check

# Lints
lint-native: fmt-native-check
cargo +nightly clippy --all --all-features --all-targets -- -D warnings

# Lint the Rust documentation
lint-docs:
RUSTDOCFLAGS="-D warnings" cargo doc --all --no-deps --document-private-items

# Test the Rust documentation
test-docs:
cargo test --doc --all --locked
25 changes: 0 additions & 25 deletions Makefile

This file was deleted.

4 changes: 3 additions & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ This contains a simple docker setup for running magi and op-geth.

## Running

Begin by copying `.env.default` to `.env`. You can set the network to sync to by changing the `NETWORK` value (supported options are optimism-goerli and base-goerli). Make sure to set the `L1_RPC_URL` value to a valid RPC URL for the L1 being used by the given network. If you are running in production, you may also want to set a secure `JWT_SECRET` value. You can create a new secret by running `openssl rand -hex 32`.
Begin by copying `.env.default` to `.env`. You can set the network to sync to by changing the `NETWORK` value (supported options are optimism-goerli and base-goerli).
Make sure to set the `L1_RPC_URL` value to a valid RPC URL for the L1 being used by the given network. If you are running in production, you may also want to set a secure `JWT_SECRET` value.
You can create a new secret by running `openssl rand -hex 32`.

To run both magi and op-geth together, run `docker compose up`. To run just op-geth without magi for local development, run `COMPOSE_PROFILES=no-magi docker compose up`

Expand Down
7 changes: 5 additions & 2 deletions docs/devnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ To launch the OP devnet, ensure you have [Docker](https://www.docker.com/):

cd optimism
git submodule update --init --recursive
make devnet-up
just devnet-up

For troubleshooting, please refer to the official [documentation](https://community.optimism.io/docs/developers/build/dev-node/#).

Expand Down Expand Up @@ -130,6 +130,9 @@ To test withdrawal from your account refer to this [tutorial](https://stack.opti

## Trouble shooting

If the Magi node stops syncing, you can reset the devnet. To do this, navigate to the Optimism root directory and run the following command: make devnet-clean. Afterward, start again both the devnet and Magi.
If the Magi node stops syncing, you can reset the devnet.
To do this, navigate to the root of the Optimism monorepo directory
and run the following command: `make devnet-clean`.
Afterward, start again both the devnet and Magi.

If the issue continues, please create a new issue on GitHub providing detailed information about the problem.

0 comments on commit 13e124c

Please sign in to comment.