Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0e614ba
feat: implement mint command
Keinberger Dec 9, 2025
f5ce756
chore: update changelog
Keinberger Dec 10, 2025
c72de74
feat: implement new miden-faucet-operator binary
Keinberger Dec 11, 2025
ede1df1
chore(Makefile): update Makefile to include miden-faucet-operator bin…
Keinberger Dec 12, 2025
06f1dd9
docs: update README to include correct client start command
Keinberger Dec 12, 2025
b26a008
feat: rename faucet to faucet-operator and faucet-operator to faucet-…
Keinberger Dec 12, 2025
5324f7c
chore(CHANGELOG): amend statement
Keinberger Dec 15, 2025
8b0a2c4
chore: rename miden-faucet.service file
Keinberger Dec 15, 2025
735310e
fix(docs): correct naming for miden-faucet binaries
Keinberger Dec 15, 2025
9d81d0d
docs: use correct api bind flag
Keinberger Dec 16, 2025
c04b641
feat: implement common response types across operator and client bina…
Keinberger Dec 16, 2025
799ce95
docs: add README for miden-faucet-client binary
Keinberger Dec 16, 2025
6213ac8
chore: linting
Keinberger Dec 16, 2025
f5029ac
fix: prevent tests from being run on miden-faucet binary alias
Keinberger Dec 16, 2025
94e7328
chore: export raw request parameters from miden-faucet-operator
Keinberger Dec 17, 2025
4a8c51c
chore: implement native miden_pow_rate_limiter package in faucet-client
Keinberger Dec 17, 2025
c7352b9
chore(faucet-client): rename account flag to target, quantity to amount
Keinberger Dec 18, 2025
49e14b3
chore(action.yml): amend action workflow according to binary separation
Keinberger Dec 18, 2025
04487c5
chore(publish-debian.yml): amend workflow for binary separation
Keinberger Dec 22, 2025
4fee953
chore(faucet): revert binary rename from miden-faucet-operator to mid…
Keinberger Jan 16, 2026
3874b6e
Update CHANGELOG.md
Keinberger Jan 16, 2026
b5b483c
Update bin/faucet-client/src/main.rs
Keinberger Jan 16, 2026
2c1c2bd
Update docs/src/getting-started/installation.md
Keinberger Jan 16, 2026
d65d61d
Merge pull request #196 from 0xMiden/kbg/feat/mint-command
Keinberger Jan 16, 2026
114bd40
Merge branch 'main' into next
Keinberger Jan 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Updated faucet optional deployment to use an empty transaction (#[182](https://github.com/0xMiden/miden-faucet/pull/182)).
- Added a feature `tokio` for the `miden-pow-rate-limiter` crate ([#188](https://github.com/0xMiden/miden-faucet/pull/188).)
- Added integration to import mint private notes directly to the wallet ([#189](https://github.com/0xMiden/miden-faucet/pull/189)).
- Added a new `miden-faucet-client` binary with the `mint` command ([#196](https://github.com/0xMiden/miden-faucet/pull/196)).

## 0.12.4 (2025-12-04)

Expand Down Expand Up @@ -87,7 +88,7 @@
- Redesigned the home frontend ([#20](https://github.com/0xMiden/miden-faucet/pull/20)).
- Redesigned the tokens request flows ([#25](https://github.com/0xMiden/miden-faucet/pull/25)).
- Added faucet supply amounts to the metadata ([#30](https://github.com/0xMiden/miden-faucet/pull/30)).
- Added supply exceeded check ([#31](https://github.com/0xMiden/miden-faucet/pull/31)).
- Added supply exceeded check ([#31](https://github.com/0xMiden/miden-faucet/pull/31)).
- Use HTTP 429 status code for rate limited error ([#51](https://github.com/0xMiden/miden-faucet/pull/51)).
- Replace amount options validation for maximum claimable amount ([#52](https://github.com/0xMiden/miden-faucet/pull/52)).
- Added `mdbook` documentation ([#61](https://github.com/0xMiden/miden-faucet/pull/61)).
Expand Down
142 changes: 142 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["bin/faucet", "crates/faucet"]
members = ["bin/faucet", "bin/faucet-client", "crates/faucet"]

resolver = "2"

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ check: ## Check all targets and features for errors without code generation
.PHONY: install-faucet
install-faucet: ## Installs faucet
${BUILD_PROTO} cargo install --path bin/faucet --locked
${BUILD_PROTO} cargo install --path bin/faucet-client --locked

.PHONY: check-tools
check-tools: ## Checks if development tools are installed
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ For comprehensive guides, API reference, and examples, see the [Miden Faucet Doc

## Running the faucet

1. Install the faucet:
The faucet comes with two CLI tools:
- **miden-faucet**: Runs the faucet, used for initializing and starting the faucet.
- **miden-faucet-client**: Used for interacting with a live faucet, i.e. for requesting tokens from a running faucet.

1. Install both faucet binaries:
```bash
make install-faucet
```

2. Initialize the faucet. This will generate a new account with the specified token configuration and save the account data to a local SQLite store:
2. Initialize the faucet server. This will generate a new account with the specified token configuration and save the account data to a local SQLite store:

```bash
miden-faucet init \
Expand All @@ -32,6 +36,13 @@ miden-faucet start \
--network testnet
```

## Requesting tokens from a live faucet

You can use the `miden-faucet-client` binary to request tokens from any running faucet instance, whether it's your local faucet or the remote testnet faucet:
```bash
miden-faucet-client mint --url <FAUCET_API_URL> --target-account <ACCOUNT_ID> --amount <BASE_UNITS>
```

After a few seconds you may go to `http://localhost:8080` and see the faucet UI.

## Faucet security features:
Expand Down
33 changes: 33 additions & 0 deletions bin/faucet-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[package]
authors.workspace = true
description = "Client CLI to request tokens from a remote Miden faucet (PoW mint)"
edition.workspace = true
homepage.workspace = true
license.workspace = true
name = "miden-faucet-client"
readme = "README.md"
repository.workspace = true
rust-version.workspace = true
version.workspace = true

[lints]
workspace = true

[dependencies]
anyhow = { workspace = true }
clap = { features = ["derive", "env", "string"], version = "4.5" }
hex = { version = "0.4" }
miden-client = { workspace = true }
miden-faucet-lib = { workspace = true }
miden-pow-rate-limiter = { workspace = true }
rand = { features = ["thread_rng"], workspace = true }
reqwest = { default-features = false, features = ["json", "rustls-tls"], version = "0.12" }
serde_json = { workspace = true }
thiserror = { workspace = true }
tokio = { features = ["macros", "net", "rt-multi-thread", "sync", "time"], workspace = true }
url = { workspace = true }

[dev-dependencies]
axum = { features = ["tokio"], version = "0.8" }
serde = { workspace = true }
tokio = { features = ["macros", "net", "rt-multi-thread", "time"], workspace = true }
13 changes: 13 additions & 0 deletions bin/faucet-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# miden-faucet-client

Command-line tool for interacting with a live Miden faucet.

## Commands

### `mint`

Requests tokens from a faucet by solving its PoW challenge and minting a public P2ID note.

```bash
miden-faucet-client mint --url <FAUCET_API_URL> --target-account <ACCOUNT_ID> --amount <AMOUNT>
```
1 change: 1 addition & 0 deletions bin/faucet-client/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod mint;
29 changes: 29 additions & 0 deletions bin/faucet-client/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
use clap::{Parser, Subcommand};
use miden_faucet_client::mint;

/// Client CLI for interacting with a live faucet.
#[derive(Parser)]
#[command(version, about, long_about = None)]
struct Cli {
#[command(subcommand)]
command: Command,
}

#[derive(Subcommand)]
enum Command {
/// Request tokens from a remote faucet (does not consume the resulting note).
Mint(mint::MintCmd),
}

#[tokio::main]
async fn main() -> anyhow::Result<()> {
let cli = Cli::parse();

match cli.command {
Command::Mint(cmd) => {
cmd.execute().await.map_err(anyhow::Error::from)?;
},
}

Ok(())
}
Loading