aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.devcontainer/Dockerfile6
-rw-r--r--.devcontainer/devcontainer.json6
-rw-r--r--.github/dependabot.yml7
-rw-r--r--.github/workflows/release.yml27
-rw-r--r--.github/workflows/rust.yml32
-rw-r--r--Makefile20
-rw-r--r--README.md15
7 files changed, 30 insertions, 83 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
deleted file mode 100644
index 70e0380..0000000
--- a/.devcontainer/Dockerfile
+++ /dev/null
@@ -1,6 +0,0 @@
-FROM mcr.microsoft.com/devcontainers/rust:1-1-bookworm
-
-RUN apt-get update &&\
- DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends binaryen &&\
- rustup target add wasm32-wasi &&\
- curl https://wasmtime.dev/install.sh -sSf | bash
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
deleted file mode 100644
index e162517..0000000
--- a/.devcontainer/devcontainer.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "name": "Rust",
- "build": {
- "dockerfile": "Dockerfile"
- }
-}
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
deleted file mode 100644
index eb3541b..0000000
--- a/.github/dependabot.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-version: 2
-
-updates:
-- package-ecosystem: cargo
- directory: "/"
- schedule:
- interval: monthly
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
deleted file mode 100644
index 9024e47..0000000
--- a/.github/workflows/release.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-name: Release
-
-on:
- push:
- tags:
- - "v*"
-
-jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Build
- run: |
- rustup target add wasm32-wasi
- cargo build --release --target wasm32-wasi
- - name: Optimize
- run: |
- sudo apt-get update && sudo apt-get install binaryen
- wasm-opt target/wasm32-wasi/release/hdwallet.wasm -O4 -o target/hdwallet.wasm --strip-debug --strip-producers
-
- - name: Release
- env:
- GH_TOKEN: ${{ github.token }}
- run: |
- gh release create ${GITHUB_REF#refs/*/} -t ${GITHUB_REF#refs/*/} --generate-notes target/hdwallet.wasm
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
deleted file mode 100644
index 2ad8a78..0000000
--- a/.github/workflows/rust.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-name: Rust
-
-on:
- push:
- branches: [ main ]
- pull_request:
- branches: [ main ]
-
-env:
- CARGO_TERM_COLOR: always
-
-jobs:
- check:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - name: Lint
- run: |
- cargo fmt -- --check
- cargo clippy --locked --all-targets -- -D warnings
- - name: Test
- run: |
- cargo test
-
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - name: Build
- run: |
- rustup target add wasm32-wasi
- cargo build --target wasm32-wasi
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..8c9a8f2
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,20 @@
+.POSIX:
+.SUFFIXES:
+
+CARGO = cargo
+WASMOPT = wasm-opt
+
+.PHONY: all
+all: check build
+
+.PHONY: check
+check:
+ $(CARGO) fmt -- --check
+ $(CARGO) clippy --locked --all-targets -- -D warnings
+ $(CARGO) test
+
+.PHONY: build
+build:
+ $(CARGO) build --release
+ $(CARGO) build --release --target wasm32-wasi
+ $(WASMOPT) target/wasm32-wasi/release/hdwallet.wasm -O4 -o target/hdwallet.wasm --strip-debug --strip-producers
diff --git a/README.md b/README.md
index 272ee05..b073d25 100644
--- a/README.md
+++ b/README.md
@@ -3,12 +3,17 @@
Command line tool for generating and using BIP-0032 hierarchical deterministic
wallets for Ethereum.
+## Dependencies
+
+- Rust (`cargo` is used for building)
+- Binaryen (`wasm-opt` for optimizing the WebAssembly binary)
+
## Building and Running
-This crate can be built from source with Cargo:
+This project can be built with `make`:
```
-cargo build
+make
```
Additional help is provided on the commandline:
@@ -17,10 +22,10 @@ Additional help is provided on the commandline:
hdwallet --help
```
-## Releases
+## WebAssembly
-Additionally, `hdwallet` is also released as a WASI Wasm application. This
-ensures that if malicious code were ever to make its way into the released
+Additionally, `hdwallet` is also released as a WASI WebAssembly application.
+This ensures that if malicious code were ever to make its way into the released
binary by sneaking in through dependencies or at distribution time, it would
have very limited impact thanks to the strong security gurantees of sandboxing
Wasm modules.