-
Notifications
You must be signed in to change notification settings - Fork 8
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
Feat installer #123
Feat installer #123
Conversation
0d54b35
to
dd711b9
Compare
3549330
to
ef7d83d
Compare
e5a5243
to
6c9db3d
Compare
6c9db3d
to
30f5707
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I scrolled briefly through it but I still haven't tested it. Can you add some documentation on how to start it, what it does etc?
30f5707
to
3a27560
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: PolicyCompilation(PolicyError(DuplicatePubKeys))', src/installer/step/stakeholder.rs:113:42
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[1] 21753 segmentation fault (core dumped) ../revault-gui/target/debug/revault-gui --datadir /tmp/fakedatadir
:(
Overall, it looks really nice! But, either here or in a following PR, we should add some checks on the user inputs. Some issues I found:
- you can add only one stakeholder, even tho the minimum is two
- the manager threshold can be higher than the number of the managers, so you can create a super secure 8of1 (I saw a check for this in the code though 🤔 I think you allow the user to go on even if there are warnings, maybe somewhere else as well)
- we accept whatever in the field cosigner keys, even aaaaaa
- same for all the fields
host
andnoise key
(watchtowers, coordinator, cosigners...), and for thecookie
in bitcoind, we should check that the input is valid - I think we should ask for the
revaultd_path
as well, otherwise the installer won't start correctly the gui :( - As I was saying in ui: Give a fixed width to the buttons #141, I think all the buttons should have fixed width - for example, it would be nice to have the "stakeholder", "stakeholder & manager", "manager" buttons with the same widths, or the "save" and "install"
- As I was saying in Avoid putting the whole view in a Scrollable #125, some elements of the Ui should stay outside the scroll - like the "previous" or "save" buttons
src/installer/step/manager.rs
Outdated
} | ||
message::Action::Decrement => { | ||
self.treshold_warning = false; | ||
if self.managers_treshold > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe the threshold should start from 1?
src/installer/step/manager.rs
Outdated
} | ||
message::Action::Decrement => { | ||
self.spending_delay_warning = false; | ||
if self.spending_delay > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, should be at least 1
src/installer/view.rs
Outdated
.push(col_address) | ||
.push(col_cookie) | ||
.push( | ||
button::primary(&mut self.save_button, button::button_content(None, "Save")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably write "Install" in this button, no need to click install in the next view
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean: you write "Install" here in this button, and you actually install clicking that button, and the next view is only a "everything went good"
src/installer/view.rs
Outdated
warning: Option<&String>, | ||
) -> Element<Message> { | ||
let mut col = Column::new() | ||
.push(text::bold(text::simple("You reached the end")).size(50)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put here "RevaultGUI is installed!" (or a better name, or a better phrasing) and the button for starting
#[derive(Debug, Clone)] | ||
pub enum Message { | ||
Install(installer::Message), | ||
Run(app::Message), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cargo clippy is sad :(
warning: large size difference between variants
--> src/main.rs:69:5
|
69 | Run(app::Message),
| ^^^^^^^^^^^^^^^^^ this variant is 552 bytes
|
note: and the second-largest variant is 48 bytes:
--> src/main.rs:68:5
|
68 | Install(installer::Message),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
help: consider boxing the large fields to reduce the total size of the enum
|
69 | Run(Box<app::Message>),
| ^^^^^^^^^^^^^^^^^
a7c9f4a
to
2b3fef9
Compare
2b3fef9
to
48b0836
Compare
ef835e0
to
424e6b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fill private noise key
-> Would be nice to have here a "your",Fill your private noise key
. It would also be nice to have the validation while you write and not only when you click next, but I'm ok with merging even without this.
As we were saying in private chat, I think we should clarify how the secret is encoded? I think (but I'm not sure) at the moment the gui is treating it as utf-8 encoded (it uses as_bytes)- We should validate that the emergency address is on the same network as bitcoind, otherwise revaultd won't start :(
For doing this I think we should ask the emergency address after asking the bitcoind params
Again, I have no idea if the installation is correct as I can't start it, as the revaultd_path
is not set in the revault_gui.toml
install revaultd in your .cargo/bin with |
I would prefer avoiding installing revaultd on my machine actually 😅 We'll come up with something, I guess :) ACK 4e54d3b - I didn't review the code in deep, but I tested extensively |
I agree.
I think that's the main argument for his idea of starting `revaultd`'s `main` in a thread. The REVAULTD_PATH would be great to have for us but not end users.
…-------- Original Message --------
On Jul 5, 2021, 10:39, Daniela Brozzoni wrote:
I would prefer avoiding installing revaultd on my machine actually 😅 We'll come up with something, I guess :)
ACK [4e54d3b](4e54d3b) - I didn't review the code in deep, but I tested extensively
—
You are receiving this because your review was requested.
Reply to this email directly, [view it on GitHub](#123 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AFLK3F4MQGY4R5U7AXKBL53TWFVVVANCNFSM45C6ZISQ).
|
ACK 4e54d3b |
Add installer
Different use case:
--conf is present, the app tries to run and returns error if failure.
--datadir is present, the app tries to run and starts installer if config is
not fund in datadir or datadir does not exist.
no flags, the app tries to run with default datadir path, starts installer
if config is not fund in default datadir or default datadir does not exist.
close Build the setup wizard #106