Giter Club home page Giter Club logo

node-installer's Introduction

Node Installer

This repository contains an easy to use installer to run a Dusk node for our Nocturne testnet. For more information on how to participate, see the node running guide on our wiki.

Prerequisites

  • Ubuntu 22.04 LTS x64
  • OpenSSL 3

This installer is specifically built for Ubuntu 22.04 x64. It might work on older or newer versions.

Packages

The installer comes with the following packages:

Folder layout

The configuration files, binaries, services and scripts can be found in /opt/dusk/.

The log files can be found in /var/log/rusk.log and /var/log/rusk-recovery.log.

Installation

ℹ️ To run the latest release of the Node Installer execute the following command:

curl --proto '=https' --tlsv1.2 -sSfL https://github.com/dusk-network/node-installer/releases/download/v0.2.0/node-installer.sh | sudo sh

⚠️ CAUTION To run the not release yet unstable version of the Node Installer execute the following command:

curl --proto '=https' --tlsv1.2 -sSfL https://raw.githubusercontent.com/dusk-network/node-installer/main/node-installer.sh | sudo sh

Configuration

The installer comes with sane defaults, only requiring minimal configuration. Before the Rusk service can be started, the CONSENSUS_KEYS and DUSK_CONSENSUS_KEYS_PASS need to be provided.

The CONSENSUS_KEYS can be either moved to /opt/dusk/conf/ from another system or generated on the node itself and moved there.

Set consensus keys

To generate the provisioner keys locally, run rusk-wallet and either create a new wallet or use a recovery phrase with rusk-wallet restore.

To generate and export the provisioner key-pair and put the .keys file in the right directory with the right name, copy the following command:

rusk-wallet export -d /opt/dusk/conf -n consensus.keys

Set consensus password

Run the following command and it will prompt you to enter the password for the consensus keys file:

sh /opt/dusk/bin/setup_consensus_pwd.sh

Reset Rusk state

To remove old Rusk state and the old wallet cache, simply run:

ruskreset

Start Rusk

Everything should be configured now and the node is ready to run. Use the following commands:

service rusk start

Check the status of the Rusk service by running:

service rusk status

Check the installer version

To check your installer version, run:

ruskquery version

If you're running an outdated version of the installer, it will warn you and ask you to upgrade.

Fast Syncing with Archival State Download

To significantly reduce the time required to sync your node to the latest published state, you can use the download_state command. This command stops your node and replaces its current state with the latest published state from one of Dusk's archival nodes.

To see the available published states, run:

download_state --list

Using the Fast Sync Command

  1. Stop your node (if it's running):

    service rusk stop
  2. Execute the fast sync command.

    download_state

    If you want to sync up with a specific state instead of the default one, you need to pass the block height of the state you want to syncup with.

    download_state 369876

    Follow the prompts to confirm the operation.

  3. Restart your node:

    service rusk restart

This process will ensure your node is up-to-date with the latest blockchain state, allowing you to sync faster and get back to participating in the network in less time.

Note

If you are experiencing errors in downloading the state, it might be due to some remnants of previous state syncing. Try to clean up with sudo rm /tmp/state.tar.gz

Diagnostics

Check if your node is syncing, processing and accepting new blocks:

tail -F /var/log/rusk.log | grep "block accepted"

To check the latest block height:

ruskquery block-height

node-installer's People

Contributors

autholykos avatar bobotig avatar duccas avatar hdauven avatar herr-seppia avatar justmvg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

node-installer's Issues

ifconfig is outdated

Summary

ifconfig is outdated and no longer available on newer versions of Ubuntu.

Possible solution design or implementation

Make use of a different tool available on (future) LTS releases of Debian and Ubuntu, like ip.

Remove sync to 86k blocks

Summary

If people upgrade with the current installer, their state would be reset.

Since we assume everyone is already synced up, for now we'll just get rid of the state reset.

Issue running 'service rusk start' on local setup

Describe the bug
Issue running service rusk start on a local setup.

To Reproduce

  1. first installed latest stable ITN release through curl
  2. configured rusk-wallet and exported consensus keys (had to manually open permissions to /opt through sudo chmod 775 /opt and sudo chown -R $USER:$USER /opt/dusk
  3. set consensus pw successfully through /opt/dusk/bin/setup_consensus_pwd.sh
  4. start rusk through service rusk start

Expected behaviour
expected node to start syncing after starting rusk service.

Logs/Screenshot
the logs of rusk (through tail -F /var/log/rusk.log) shows repeatedly:

Using CONSENSUS_KEYS in /opt/dusk/conf/consensus.keys
2024-02-16T15:32:51.206596Z  INFO rusk: Using state from "/opt/dusk/rusk/state"
2024-02-16T15:32:51.208971Z  INFO rusk: Rusk VM loaded
2024-02-16T15:32:51.209073Z  INFO node::databroker: DataBrokerSrv::new with conf: max_inv_entries: 100, max_ongoing_requests: 1000
2024-02-16T15:32:51.209113Z  INFO node::database::rocksdb: Opening database in "/opt/dusk/rusk/chain.db"

error logs through cat /var/log/rusk.err:

thread 'main' panicked at /home/docker/actions-runner/_work/rusk/ruskthread 'main' panicked at /home/docker/actions-runner/_work/rusk/ruskthread 'main' panicked at /home/docker/actions-runner/_work/rusk/rusk/node/src/database/rocksdb.rs:164:18:
should be a valid database in {path}: Error { message: "Failed to create RocksDB directory: `Os { code: 13, kind: PermissionDenied, message: \"Permission denied\" }`." }

Platform

  • Architecture: ARM
  • OS: Ubuntu 22.04.3 LTS
  • ITN installer: both v0.1.0 and latest version show similar issue

Additional context
Add any other context about the problem here.

Auto-configure

Summary

To make the node setup more straightforward and user-friendly, allow users to fetch configuration parameters from other nodes or endpoints.

Sane default endpoints should be provided for known networks.

Possible solution design or implementation

Nodes provide an info endpoint that provides parameters like network-id, bootstrapping addresses and genesis state.

Update installer

Summary

The current installer is based on the old Golang node, combined with Rusk. To prepare the ITN installer for ITN2, we need to update the scripts.

Possible solution design or implementation

The installer no longer needs to use the dusk and rusk-recovery-state binary. We should remove these and replace the rusk binary with the latest version.

Given the blockchain is encapsulated into a single binary, the way services are structure in the installer also needs to change.

CLI update clears config.toml

Describe the bug
Upgarded my node following the steps as described: https://docs.dusk.network/itn/node-upgrade/

To Reproduce
Upgrade node follwoing this steps

My Discord comment:

Just upgraded my node to the latest version. Followed the steps by the book, and see that my node is producing blocks again. Only when I want to open my wallet I get this error: Network not found, check config.toml, specify network with -n flag

Investigation shows that the config.toml file was empty so I added the data and node is running again.

Seems that this update clears this file.

Test with Ubuntu LTS 24.04

Summary

With the upcoming release of Ubuntu LTS 24.04, and the upcoming mainnet release, we should test whether the installer works with the upcoming Ubuntu LTS.

Update rusk wallet to 0.13

Summary

Update the Rusk wallet CLI from v0.12 to v0.13 to incorporate some of the UX improvements we've made as of late.

Possible solution design or implementation

Simply update the WALLET_URL to point to the latest Rusk wallet release.

Node launch prerequisites

Summary

Currently, if the node software is installed, it gives you commands to run the node and view the logs. If you run the node, it'll always fail by default and tell you what steps to take next.

From a user experience point of view, it would be nice to give a number of pre-launch steps that need to be take before a node can be ran.

Possible solution design or implementation

Inform the user to place the CONSENSUS_KEYS file in /opt/dusk/conf/consensus.keys close to the launch the node instructions.

Also inform the user what command to run to set the CONSENSUS_KEYS password. Alternatively, they can also be told where to put the password OR be prompted for it during installation.

Add script to query the node in an easy way

Summary

Instead of providing users with commands to query their node, it would be helpful to provide a script/bin that executes the commands for them.

Possible solution design or implementation

Provide a script/bin that can query the node for information like the current block height.

Release v0.1.0

Summary

Release version 0.1.0 with the latest Rusk binary

This change requires an update to the Rusk binary in the bin folder and an update to the installer URL.

Add state/cache reset utility

Summary

Provide a tool for users to easily reset the node state, chain DB and wallet cache. This is useful for users who want to start with a clean state on their nodes, and for us to provide both fresh network updates and multiple networks support.

Possible solution

Provide an executable script called ruskreset that prompts the user for confirmation if executed.

The script will stop Rusk, remove the rusk state and chain.db folders. It will also remove the wallet cache and logs.

Prepare installer for Nocturne

Summary

To support the installer for Nocturne, we need at least the following:

  • Change network ID
  • Remove migration height setting
  • set generation_timeout
  • Provide a state reset utility

Cant start rusk service / node

rusk.service: Main process exited, code=exited, status=101/n/a
rusk.service: Failed with result 'exit-code'.
rusk.service: Scheduled restart job, restart counter is at 159.

Rusk service cant start...

Need guide

Cant start rusk service

when i use the cmd "service rusk start", it returns "Job for rusk.service failed because the control process exited with error code.
See "systemctl status rusk.service" and "journalctl -xeu rusk.service" for details."

then i use the cmd "journalctl -xe", it returns the below message, why ?

Support: http://www.ubuntu.com/support
░░
░░ A start job for unit rusk.service has begun execution.
░░
░░ The job identifier is 30808.
Mar 11 21:53:43 VM-4-11-ubuntu sshd[393249]: pam_unix(sshd:auth): check pass; user unknown
Mar 11 21:53:43 VM-4-11-ubuntu sshd[393249]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=170.64.195.73
Mar 11 21:53:43 VM-4-11-ubuntu systemd[1]: rusk.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ An ExecStartPre= process belonging to unit rusk.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Mar 11 21:53:43 VM-4-11-ubuntu systemd[1]: rusk.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit rusk.service has entered the 'failed' state with result 'exit-code'.
Mar 11 21:53:43 VM-4-11-ubuntu systemd[1]: Failed to start DUSK Rusk.
░░ Subject: A start job for unit rusk.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit rusk.service has finished with a failure.
░░
░░ The job identifier is 30808 and the job result is failed.
Mar 11 21:53:46 VM-4-11-ubuntu sshd[393249]: Failed password for invalid user awsgui from 170.64.195.73 port 52764 ssh2
Mar 11 21:53:48 VM-4-11-ubuntu sshd[393249]: Connection closed by invalid user awsgui 170.64.195.73 port 52764 [preauth]
Mar 11 21:53:49 VM-4-11-ubuntu sshd[393289]: Invalid user tom from 170.64.195.73 port 48060

Add version history

Summary

Add a way for users to query the installer version, and retrieve what the latest version is, and if so, allow them to download the new version.

Possible solution design or implementation

On installation, place a version file on the system.

This version file can then be checked by the script, and by a ruskquery command, to check against any upstream new releases.

Expand State Download tool

Summary

The state download tool currently only allows for a given state and no state.

It should provide the following extra functionality:

  1. Download the latest state by default
  2. Have a command to list all possible states
  3. Return a proper error if the state is not available

Network selection

Summary

Currently, the installer only allows for the installation of a single network.

It would be nice if the installer allowed you to pick between testnet, devnet and in the future mainnet.

Possible solution design or implementation

By default target testnet, but through a flag allow for the setting of a different target network.

Recovery-at-start

Summary

Recovery-at-start should take over from what previously was rusk-recovery-keys and recovery-state. The node should not start if no valid state is available.

Possible solution design or implementation

Update the startup routine scripts to no longer use rusk-recovery-keys and recovery-state, but use Rusk directly.

Stuck and cannot resync after upgrade to v0.1.5

Describe the bug
A clear and concise description of what the bug is.
Chain will not resync or connect once wallet upgraded to v0.1.5
Also wallet keys and consensus keys gone, won't load, have to reinitiate

To Reproduce
if applicable add a minimum reproducible example
Install v0.1.5
Can't run the node with service rusk start

// Be exhaustive
// 
Doesn't load```

But that being said, running this upgrade script on a node already on v0.1.5 doesn't seem to induce this error. I cannot confirm as none of my nodes is at the earlier version now

**Expected behaviour**
A clear and concise description of what you expected to happen.
I expected all my wallet and consensus keys to be intact and the service to run without issues like last upgrades

**Logs/Screenshot**
If applicable, add damning logs
Job for rusk.service failed because of unavailable resources or another system error. 

**Platform**
Fill as appropriate
 - Architecture: [ARM, 8086]
 - OS: [e.g. iOS, Linux]
 - Browser [e.g. chrome, safari]
AMD
Linux ubuntu 22.04
CLI

**Additional context**
Add any other context about the problem here.
Concerned chain is stuck and that we will not be able to proceed with 75% uptime with this issue.

Suggestions @HDauven for ITN node setup guide

Improvement ease-of-use of node setup guide

  1. Create subcategories. So in the explanation for step 1, create point 1.1, 1.2, 1.3 etc for every separate step. This makes it much easier to follow each step, is easy for your own use while creating the guide and helps for users to backtrack and ask questions about a (then numbered) subject. Also it helps for receiving feedback and improves readability.

  2. Implement pauses between some of the steps to make people wait. I noticed during setup that sometimes things were not updated on the server yet, which made me think I did something wrong or I did not follow the guide well and then I already started looking for errors or wanting to correct things, while all was actually done correctly and in good order after waiting a minute or so for the server to update.

Additions:

  • At step 1.1 (unpacking tar) for me, using 7-zip, it was necessary to unpack the download and then unpacking the .tar file. So actually, with windows, it is necessary to unpack twice.

  • At step 1.5 (creating .cpk and .key) it might be handy already renaming the .key file into consensus.keys? In that case, people don't have to backtrack to that step and the consensus.keys file is already there.

  • At step 2.7 (or so, the one where Filezilla is used). It is easier to start with the download, install and running of Filezilla and after that, give the instructions. The way it is now it's kind of confusing. Also, if my second tip is good to implement, the consensus.keys file is already there so that would make it a very easy step.

One last suggestion: in the final edit, I would advise not using the fatprinted word every new alinea. It serves no purpose when using subcategories (1.1, 1.2 etc); multiple alineas can fall under under category which makes it way more uncluttered

Not much, just some small suggestions. Very well done guide @HDauven, very clear!

Update binary and installer config to reduce bandwidth

Summary

The current installer increases bandwidth for the node significantly.

Possible solution design or implementation

To reduce the bandwidth consumed by the nodes, we need to tune settings like autopropagate and the amount of repair blocks.

We also need to update the Rusk binary with the following fix included: dusk-network/rusk#1456

Update README

Summary

The scripts have changed by a decent amount. These changes have not been properly reflected in the current README.

Solution

Update the README with all the proper and up-to-date information.

Documentation

Summary

The repository currently makes no mention of how to use the installer.

Possible solution design or implementation

Provide concise documentation on how to run and operate the ITN installer.

Update Apt on install

Summary

Update packages pre-installation of the installer to ensure the availability of all packages.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.