From 67d4ea3ba67e6004605a9e1e9f5b4353edf0732a Mon Sep 17 00:00:00 2001 From: Jesse Snyder Date: Wed, 17 Jan 2024 19:47:46 -0700 Subject: [PATCH] update README. just commands for docker stuff. --- README.md | 48 ++++-------------------------------------------- justfile | 11 +++++++++++ 2 files changed, 15 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 1d3b5bf..e0f6f46 100644 --- a/README.md +++ b/README.md @@ -47,39 +47,8 @@ Run front end dev server and Go binary together with `mprocs` just run-all-dev ``` -**Use private key to fund users** - -```bash -./eth-faucet -httpport 8080 -wallet.provider http://localhost:8545 -wallet.privkey privkey -``` - -**Use keystore to fund users** - -```bash -./eth-faucet -httpport 8080 -wallet.provider http://localhost:8545 -wallet.keyjson keystore -wallet.keypass password.txt -``` - ### Configuration -You can configure the funder by using environment variables instead of command-line flags as follows: -```bash -export WEB3_PROVIDER=https://some.rpc.endpoint -export PRIVATE_KEY=0x... -``` - -or - -```bash -export WEB3_PROVIDER=https://some.rpc.endpoint -export KEYSTORE=path/to/keystore -echo "your keystore password" > `pwd`/password.txt -``` - -Then run the faucet application without the wallet command-line flags: -```bash -./eth-faucet -httpport 8080 -``` - **Optional Flags** The following are the available command-line flags(excluding above wallet flags): @@ -96,19 +65,10 @@ The following are the available command-line flags(excluding above wallet flags) ### Docker deployment ```bash -docker run -d -p 8080:8080 -e WEB3_PROVIDER=https://some.rpc.endpoint -e PRIVATE_KEY=0x... chainflag/eth-faucet:1.1.0 -``` - -or - -```bash -docker run -d -p 8080:8080 -e WEB3_PROVIDER=https://some.rpc.endpoint -e KEYSTORE=path/to/keystore -v `pwd`/keystore:/app/keystore -v `pwd`/password.txt:/app/password.txt chainflag/eth-faucet:1.1.0 -``` - -#### Build the Docker image - -```bash -docker buildx build -t ghcr.io/astriaorg/astria-faucet:0.0.1-local . +# might need to build image first +just docker-build +# run via Docker image +just docker-run ``` ## License diff --git a/justfile b/justfile index 6ae3104..49f86b4 100644 --- a/justfile +++ b/justfile @@ -1,6 +1,9 @@ default: @just --list +image_name := 'ghcr.io/astriaorg/eth-faucet' +default_docker_tag := 'local' + # installs developer dependencies for MacOS users with `brew` brew-install-dev-deps: brew install just @@ -13,6 +16,14 @@ build-all: go generate -x go build -v +# builds docker image w/ `local` tag by default +docker-build tag=default_docker_tag: + docker buildx build -f ./Dockerfile -t {{image_name}}:{{tag}} . + +# runs faucet via docker +docker-run tag=default_docker_tag: + docker run --rm -p 8080:8080 {{image_name}}:{{tag}} + # lints the go code go-lint: golangci-lint run ./...