Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(faucet): resume after restart #517

Merged
merged 33 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fcb66c7
feat: improve node errors
polydez Oct 18, 2024
40a42f1
docs: update `CHANGELOG.md`
polydez Oct 18, 2024
8873ba5
feat: save/restore faucet state and keypair to/from files
polydez Oct 11, 2024
9053f12
feat: make faucet account public, request account state on submission…
polydez Oct 17, 2024
f984e67
feat: introduce `ClientError`
polydez Oct 18, 2024
8e12b04
fix: update config
polydez Oct 18, 2024
4fc851f
fix: save new faucet state to in-memory store after getting from the …
polydez Oct 18, 2024
cebc372
fix: remove `macros` feature from axum dependency
polydez Oct 18, 2024
be90b6b
docs: update `CHANGELOG.md`
polydez Oct 18, 2024
b808a80
docs: add comment for `seed` field
polydez Oct 21, 2024
dafc01b
fix: log message
polydez Oct 21, 2024
50fd73e
refactor: address review comments
polydez Oct 21, 2024
011002a
Merge branch 'next' into polydez-faucet-restore
polydez Oct 22, 2024
8db4ae9
refactor: initial changes
Fumuran Oct 24, 2024
a78828f
refactor: impl Send and Sync for FaucetDataStore
Fumuran Oct 24, 2024
af6a0f3
chore: update changelog
Fumuran Oct 24, 2024
bf9bdc2
refactor: remove unnecessary async, add warning ignore to makefile
Fumuran Oct 24, 2024
349c43b
refactor: update genesis generation, read faucet account from `faucet…
polydez Oct 25, 2024
bf0e97d
feat: faucet account creation
polydez Oct 25, 2024
c9f7fdd
fix: handling of account not found error
polydez Oct 25, 2024
9e5d91d
refactor: use Arc and Mutex
bobbinth Oct 25, 2024
738eae0
chore: removed unneeded cast
bobbinth Oct 25, 2024
df3a19b
fix: lint
bobbinth Oct 25, 2024
915edf2
docs: update CHANGELOG.md
polydez Oct 28, 2024
573f5c3
Merge branch 'refs/heads/andrew-migrate-to-miden-vm-0.11' into polyde…
polydez Oct 28, 2024
4384a76
fix: compilation errors
polydez Oct 28, 2024
ea5d59c
docs: add `TODO` for incorrect and unsafe `Send` implementation
polydez Oct 28, 2024
f111115
refactor: small refactoring
polydez Oct 28, 2024
a6c37d0
Merge branch 'next' into polydez-faucet-restore
polydez Oct 28, 2024
0a9f068
refactor: address review comments
polydez Oct 29, 2024
112fcb6
docs: update `README.md` for faucet
polydez Oct 29, 2024
d0b8b5c
docs: improve instructions and clarifications in faucet's `README.md`
polydez Oct 30, 2024
96d406d
Merge branch 'next' into polydez-faucet-restore
polydez Oct 30, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/deploy_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
sudo chown -R miden /opt/miden; \
sudo /usr/bin/miden-node init -c /etc/miden/miden-node.toml -g /opt/miden/miden-node/genesis.toml; \
sudo /usr/bin/miden-node make-genesis -i /opt/miden/miden-node/genesis.toml -o /opt/miden/miden-node/genesis.dat --force; \
sudo /usr/bin/miden-faucet init -c /opt/miden/miden-faucet/miden-faucet.toml
sudo /usr/bin/miden-faucet init -c /opt/miden/miden-faucet/miden-faucet.toml -f /opt/miden/miden-node/accounts/faucet.mac

- name: Start miden node service
uses: ./.github/actions/ssm_execute
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Changed the `BlockWitness` to pass the inputs to the VM using only advice provider (#516).
- [BREAKING] Improved store API errors (return "not found" instead of "internal error" status if requested account(s) not found) (#518).
- [BREAKING] Migrated to v0.11 version of Miden VM (#528).
- [BREAKING] Changed faucet storage type in the genesis to public. Using faucet from the genesis for faucet web app. Added support for faucet restarting without blockchain restarting (#517).

## 0.5.1 (2024-09-12)

Expand Down
3 changes: 3 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ miden-processor = { git = "https://github.com/0xPolygonMiden/miden-vm.git", bran
miden-stdlib = { git = "https://github.com/0xPolygonMiden/miden-vm.git", branch = "next", default-features = false }
miden-tx = { git = "https://github.com/0xPolygonMiden/miden-base.git", branch = "next" }
prost = { version = "0.13" }
rand = { version = "0.8" }
thiserror = { version = "1.0" }
tokio = { version = "1.40", features = ["rt-multi-thread"] }
tokio-stream = { version = "0.1" }
Expand Down
5 changes: 3 additions & 2 deletions bin/faucet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ repository.workspace = true
testing = ["miden-objects/testing", "miden-lib/testing"]

[dependencies]
anyhow = "1.0"
axum = { version = "0.7", features = ["tokio"] }
clap = { version = "4.5", features = ["derive", "string"] }
figment = { version = "0.10", features = ["toml", "env"] }
Expand All @@ -28,12 +29,12 @@ miden-node-utils = { workspace = true }
miden-objects = { workspace = true , features = ["concurrent"] }
miden-tx = { workspace = true, features = ["concurrent"] }
mime = "0.3"
rand = { version = "0.8" }
rand = { workspace = true }
rand_chacha = "0.3"
serde = { version = "1.0", features = ["derive"] }
static-files = "0.2"
thiserror = { workspace = true }
tokio = { workspace = true }
tokio = { workspace = true, features = ["fs"] }
toml = { version = "0.8" }
tonic = { workspace = true }
tower = "0.5"
Expand Down
17 changes: 14 additions & 3 deletions bin/faucet/README.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we update step 1 in this file as well? I'm actually not sure if docker images work any more.

Also, is there some disconnect between step 1 and step 2? That is, if we run faucet in the testing mode, we should run node in the testing mode as well (maybe that's what's happening already, but I'd make it more explicit).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes both should be in the same mode. I do wish we could make the difficulty configurable and not gated behind a compile time feature. Then we could decouple things by having an rpc endpoint to fetch the current difficulty of the node for example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bobbinth,

Should we update step 1 in this file as well? I'm actually not sure if docker images work any more.

I've checked, it works.

Also, is there some disconnect between step 1 and step 2? That is, if we run faucet in the testing mode, we should run node in the testing mode as well (maybe that's what's happening already, but I'd make it more explicit).

If we run node by using Docker, it's created in "testing" mode. All instructions in faucet's readme build node and faucet in "testing" mode. I've improved documentation in order to make it more descriptive about that.

Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,23 @@ make docker-run-node
make install-faucet-testing
```

3. Create the default faucet configuration file:
3. [Optional] Create faucet account. Skip this step if you want to use an account from the genesis. This will generate authentication keypair and generate and write public faucet account data with its keypair into the file specified in `output-path`. This account will not be created on chain yet, this will happen on the first minting transaction:

```bash
miden-faucet create-faucet-account \
--output-path <path to faucet.mac> \
--token-symbol POL \
--decimals 9 \
--max-supply 1000000000
```


4. Create the default faucet configuration file. Specify the path to the faucet account file created on the previous step in the `-f` flag (if you want to use an account from the genesis, specify the path to the `faucet.mac` file generated by the [make-genesis](../../README.md#setup) command of the Miden node):
```bash
miden-faucet init
miden-faucet init -f <path to faucet.mac>
```

4. Start the faucet server:
5. Start the faucet server:
```bash
miden-faucet start
```
Expand Down
Loading
Loading