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

Feat: auto start node before launch #945

Merged
merged 4 commits into from
Aug 26, 2022

Conversation

maparr
Copy link
Contributor

@maparr maparr commented Jul 26, 2022

It closes #906

@maparr maparr changed the title Feat/auto start node before launch Feat: auto start node before launch Jul 26, 2022
@spacemeshos spacemeshos deleted a comment from github-actions bot Jul 30, 2022
@spacemeshos spacemeshos deleted a comment from github-actions bot Jul 30, 2022
desktop/main/sources/currentNetwork.ts Outdated Show resolved Hide resolved
desktop/main.dev.ts Outdated Show resolved Hide resolved
desktop/main.dev.ts Outdated Show resolved Hide resolved
desktop/main/startApp.ts Outdated Show resolved Hide resolved
@maparr maparr force-pushed the feat/auto_start_node_before_launch branch from ed3372d to 4da3497 Compare July 31, 2022 18:40
@spacemeshos spacemeshos deleted a comment from github-actions bot Jul 31, 2022
@spacemeshos spacemeshos deleted a comment from github-actions bot Jul 31, 2022
@spacemeshos spacemeshos deleted a comment from github-actions bot Jul 31, 2022
@spacemeshos spacemeshos deleted a comment from github-actions bot Jul 31, 2022
@spacemeshos spacemeshos deleted a comment from github-actions bot Jul 31, 2022
@maparr maparr requested a review from brusherru July 31, 2022 18:42
@maparr maparr self-assigned this Aug 6, 2022
desktop/main/sources/currentNetwork.ts Outdated Show resolved Hide resolved
desktop/main/startApp.ts Outdated Show resolved Hide resolved
@maparr maparr requested a review from brusherru August 14, 2022 10:15
@brusherru
Copy link
Member

brusherru commented Aug 15, 2022

Are you sure that $currentNetwork works as expected?
Seems it will always have undefined instead of wallet meta, since the input argument is a Tuple [Network[], bool, WalletMeta|undefined]...
Am I miss something?

@maparr
Copy link
Contributor Author

maparr commented Aug 15, 2022

Are you sure that $currentNetwork works as expected? Seems it will always have undefined instead of wallet meta, since the input argument is a Tuple [Network[], bool, WalletMeta|undefined]... Am I miss something?

yes, tested changes. the current network will be or default network if the start node is on the auto-start step. of when wallet will be unlocked, iif statement waiting wallet unlock. So
combineLatestWith($wallet.pipe(map((w) => w?.meta.netId))) will hit the goal , when wallet will be available. Remote API/ unlock wallet / new wallet working as expected, checked with auto-start and without.

brusherru
brusherru previously approved these changes Aug 25, 2022
Copy link
Member

@brusherru brusherru left a comment

Choose a reason for hiding this comment

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

LGTM

p.s.
But I started thinking, do we really need to run it only on autostart, or on any app start? ;)
It might be a bit confusing. E.G. User uses auto-start and knows that Smapp smeshes for him. But then something went wrong (he closed the app / it crashed / etc) — the User restarts it and, I assume, he will expect the same behavior — just run and forget (no need to unlock).
What do you think?
cc: @oriya @pigmej

@pigmej
Copy link
Member

pigmej commented Aug 25, 2022

if I'd be the user I'd expect:

  1. when I close -> full unlock
  2. when app crashes -> to be discussed
  3. when I want it to autostart should autostart WITHOUT ulock with big warning about the security problems that it can lead to.

@pigmej
Copy link
Member

pigmej commented Aug 25, 2022

We can also put it past genesis ;)

@brusherru
Copy link
Member

@pigmej

big warning about the security problems that it can lead to

Do you know any? :)

@pigmej
Copy link
Member

pigmej commented Aug 26, 2022

Permanently unlocked wallet?

@brusherru
Copy link
Member

brusherru commented Aug 26, 2022

Permanently unlocked wallet?

No-no. The wallet is locked all the time until you type the password.
But you don't need to unlock the wallet just to start the Node and start smeshing — Smesher's coinbase is stored in the node config next to other required settings.
You'll need to unlock the wallet only when you want to send some transactions.

brusherru
brusherru previously approved these changes Aug 26, 2022
Copy link
Member

@brusherru brusherru left a comment

Choose a reason for hiding this comment

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

👍

@pigmej
Copy link
Member

pigmej commented Aug 26, 2022

OK, then clear to me :) sorry for the confusion ;)

@maparr maparr merged commit f26ae53 into develop Aug 26, 2022
@maparr maparr deleted the feat/auto_start_node_before_launch branch August 26, 2022 11:06
@oriya
Copy link

oriya commented Aug 26, 2022

Makes sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The password request upon wallet opening (Windows/Linux/MacOS)
4 participants