8000 `install.sh` script which makes the installation processes easier by qlrd · Pull Request #364 · vinteumorg/Floresta · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

install.sh script which makes the installation processes easier #364

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 8000 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

qlrd
Copy link
Contributor
@qlrd qlrd commented Jan 31, 2025

What is this PR for?

Fix #362

What is the purpose of this pull request?

  • Bug fix;
  • New feature;
  • Docs update;
  • Test;
  • Other: .

Which aspect of floresta its being addresed?

  • Blockchain;
  • Nodes communication;
  • User consumption;
  • Utreexo accumulator;
  • Other: installation script.

Checklists

  • I've signed all my commits;
  • I ran just lint;
  • I ran cargo test;
  • I checked the integration tests;
  • I'm linking the issue being fixed by this PR (if any).

Description

Added and install.sh script which makes the installation processes
easier (only for debian-like systems for now).

It installs apt-get dependencies, install rustup, build
florestad/floresta_cli and configure a proper systemd service in a
semi-customizable way.

It was also necessary to add some configurations to florestad.service so
that the service could run properly.

Notes to the reviewers

It was inspired by @Davidson-Souza that already made scripts for Archlinux and with some DMs, a desire about make possible a procedure like wget https://vinteum.org/floresta/install.sh | bash.

Copy link
Collaborator
@Davidson-Souza Davidson-Souza left a comment

Choose a reason for hiding this comment

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

ConceptACK

Some preliminary comments.

@qlrd qlrd force-pushed the contrib-install-debian-script branch 6 times, most recently from 5dd1b66 to 9091551 Compare March 6, 2025 14:38
@Davidson-Souza
Copy link
Collaborator

Trying this on Ubuntu 24 LTS. If I already have dialog it works fine. If don't have dialog it shows Checking if dialog is installed, the terminal blinks and I get my prompt back (the script terminates and cleans my terminal). It does show an error, but for a fraction of a second.

If I already have dialog it doesn't happen

@qlrd qlrd force-pushed the contrib-install-debian-script branch 3 times, most recently from daccc97 to ab69224 Compare March 11, 2025 12:59
@qlrd
Copy link
Contributor Author
qlrd commented Mar 12, 2025

@lucad70 suggested, in person, to add on initial screen:

If you want to disclose a security vulnerability,
please email Davidson Souza at me AT dlsouza DOT lol,
using the PGP key [2C8E0F 836FD7D BBBB9E 9B2EF899 64EC3AB 22B2E3](https://blog.dlsouza.lol/assets/gpg.asc).

Copy link
Collaborator
@Davidson-Souza Davidson-Souza left a comment

Choose a reason for hiding this comment

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

I've tested all options and with/without some requirements installed. It seems to work fine.

Leaving some comments, mostly related to the docs.

Some of those options seems "Advanced". Is it hard to make an "Advanced Configuration" sub-menu? This should cause less confusion for newbies.

8000

@qlrd qlrd force-pushed the contrib-install-debian-script branch 8 times, most recently from bea7463 to fc3ca7b Compare March 20, 2025 15:02
@qlrd qlrd requested a review from Davidson-Souza March 21, 2025 14:18
@qlrd qlrd force-pushed the contrib-install-debian-script branch from fc3ca7b to fa70662 Compare March 24, 2025 13:27
@qlrd
Copy link
Contributor Author
qlrd commented Mar 24, 2025

Added an advanced menu and simplified the main menu.

Should i squash to one commit or keep 2 commits?

@qlrd qlrd requested a review from Davidson-Souza March 24, 2025 13:29
@Davidson-Souza
Copy link
Collaborator

If I go to some option like Wallet -> Add xpub and then select cancel, it shows me an error, but then just starts the installation process without letting me configure anything else

Copy link
Collaborator
@Davidson-Souza Davidson-Souza left a comment

Choose a reason for hiding this comment

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

One extra round of review (hopefully one the last). Mostly about the setup, the interactive windows looks good.

florestaUserPath="/usr/lib/sysusers.d/florestad.conf"
florestaService="/usr/lib/systemd/system/florestad.service"
distribution=$(lsb_release -sc)
architecture=$(dpkg --print-architecture)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thinking about a future compatibility with non-dpkg distros, maybe using uname -m instead?

# Function to be printed on console when user need some
# assistance on usage, cli options, etc.
show_usage() {
echo "Install or uninstall Florestad and floresta_cli in your system."
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the binary name shouldn't be capitalized.

echo " -x, --xpub <XPUB> Define an xpub to be loaded onto config.toml."
echo " -d, --desc <DESC> Define a descriptor to be loaded onto config.toml."
echo " -a, --address <ADDR> Define am bitcoin address to be loaded onto config.toml"
echo " -n, --network <NETWORK> Pass --network onto built service with valid networks:"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This option is only relevant for the systemd file, right? I think it's nice to make this clear.

-v | --assume-valid)
check_interactive_mode
assume_valid="$2"
shift 2 # Corrected from shift to shift 2
Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment probably shouldn't be here

# func: download_floresta
#
# Download floresta from releases and check integrity
# TODO: add signature verification when possible
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just as an FYI: Until 0.7.0 I did not sign the source code. This file is created by github and I didn't really care for it.

From 0.8.0 onward I will sign it as well


sha256res=$(sha256sum $tarDest | awk -F" " '{ print $1 }')
sha256exp="733b1e2bcecfdf5ab552b81db428b125e6f8154cccfda69b5e746da7a4a0a322"
if [ ! "$sha256res" == "$sha256exp" ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

Something that could be done in a follow-up: even on error, we should call the clean-up methods. Even better would be to remove what was already copied over, so we don't leave garbage back from an unsuccessful install.

fi

if [ -f "$florestaUserPath" ]; then
echo "🧹 Removing sysusers config: $florestaUserPath"
Copy link
Collaborator

Choose a reason for hiding this comment

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

You have to call systemd-users after this, no?

@qlrd qlrd force-pushed the contrib-install-debian-script branch from fa70662 to 91a0ede Compare April 8, 2025 14:13
@qlrd
Copy link
Contributor Author
qlrd commented Apr 8, 2025

If I go to some option like Wallet -> Add xpub and then select cancel, it shows me an error, but then just starts the installation process without letting me configure anything else

fixed

@qlrd qlrd requested a review from Davidson-Souza April 8, 2025 14:25
@Davidson-Souza
Copy link
Collaborator

On a fresh ubuntu install I've ran on the same thing using 91a0ede. If I go into wallet > add xpub > cancel it shows invalid xpub, then invalid config and starts installing without asking me anything.

@qlrd qlrd force-pushed the contrib-install-debian-script branch from 91a0ede to a60fbfe Compare April 16, 2025 14:08
@qlrd
Copy link
Contributor Author
qlrd commented Apr 16, 2025

On a fresh ubuntu install I've ran on the same thing using 91a0ede. If I go into wallet > add xpub > cancel it shows invalid xpub, then invalid config and starts installing without asking me anything.

Reproduced and verified that the same behavior applies to the steps of adding descriptors and addresses.

Fixed.

I believe i should rebase it too, or no need?

@Davidson-Souza
Copy link
Collaborator

I believe i should rebase it too, or no need?

I don't think it's needed, it's up to you

When I select review and "yes", I'm being thrown back to the wallet configuration

@qlrd qlrd force-pushed the contrib-install-debian-script branch from a60fbfe to bc90121 Compare April 17, 2025 13:14
@qlrd
Copy link
Contributor Author
qlrd commented Apr 17, 2025

I believe i should rebase it too, or no need?

I don't think it's needed, it's up to you

When I select review and "yes", I'm being thrown back to the wallet configuration

Fixed (i believe), but now introduced another issue 😓. Can't go out of script when typing many ESCs.

…easier:

* only for debian for now;
* user have option to run interactively or wit CLI arguments;
* it installs apt-get/rust dependencies, build florestad/floresta_cli
and make a proper configuration of systemd service in a
semi-customizable way.

User can select:
 * the type of network (bitcoin, sigtest, testnet, regtest);
 * wallet;
 * advanced setup
 * review box.
 * xpub, ypub, zpub or tpub;
 * descriptor;
 * specific address.
 * a node to connect to (ip:port);
 * proxy (socks5 only);
 * a zeromq server to listen to (ip:port);
 * enable cfilters and filters-start-height;
 * assume-valid (with a blockheight to choose) and assume-utreexo;
 * ssl (check if openssl exists, install it if necessary and generate
PKCS#8  key and certificate paths and electrum ip/port);

.
@qlrd
Copy link
Contributor Author
qlrd commented Apr 18, 2025

I believe i should rebase it too, or no need?

I don't think it's needed, it's up to you
When I select review and "yes", I'm being thrown back to the wallet configuration

Fixed (i believe), but now introduced another issue 😓. Can't go out of script when typing many ESCs.

fixed

@qlrd qlrd force-pushed the contrib-install-debian-script branch from bc90121 to d139cb9 Compare April 18, 2025 12:58
interactive_add_xpub() {
local xpub_regex="^(xpub|ypub|zpub|tpub)[A-Za-z0-9]{107}$" # (X/Y/Z/T)PUBS are 111 chars

while true; do
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I select Cancel, it shows "Invalid Descriptor" and open the xpub input again

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.

[Enhancement] install.sh script for easy installation of a floresta node
2 participants
0