Run a Node
Note: Thanks to your contributions, cycle I of our TestNet Phase 3 journey has officially wrapped up! Now we're one step closer to onboarding the world to Bitcoin. Stay tuned for the next steps!
This step allows you to quickly start a light node on the Nubit DA Alpha Testnet. We support Mac, Linux, and Windows systems. If you want to explore more options, such as running a validator, bridge node, and a full node on the Nubit DA Alpha Testnet, please refer to Run a Node (For Developers). If you encounter any issues, please feel free to contact the Nubit team.
Run a Light Node with One Command
Note: Our Alpha Testnet Campaign "Phase 2: Light Node Quest" has officially ended. You can still run and start the light node, but no further verification and points will be given.
To start your light node, simply run the following command:
Whether you are launching the light node for the first time or are an existing user, this single command will automatically upgrade to the latest version of nubit-node and initiate the light node, regardless of the directory you are in. You will immediately benefit from a more resource-efficient way to participate in the Bitcoin network while maintaining a high level of security and decentralization.
After running a light node, you will have access to a wider range of operations on the Nubit DA Alpha Testnet. For detailed instructions, please refer to Integrate with Nubit DA.
Process of Running nubit.sh
(The First Time)
nubit.sh
(The First Time)Here is the entire process of what the nubit.sh
script does when first executed.
Start the Script:
The script begins with a message "Starting Nubit node..." to indicate that the process has started.
Determine the Architecture:
The script uses the
uname
command to determine the system's architecture and operating system and sets theARCH_STRING
variable based on the detected architecture:darwin-arm64
for ARM-based macOSdarwin-x86_64
for Intel-based macOSlinux-arm64
for ARM-based Linuxlinux-x86_64
for 64-bit Linuxlinux-x86
for 32-bit Linux
If the
ARCH_STRING
is not set (indicating an unsupported architecture), the script prints an error message and exits.
Download and Extract Nubit Node Package:
The script checks if the
nubit-node
directory already exists:If it does not exist, it constructs the URL for the appropriate Nubit node package based on the
ARCH_STRING
and prints the URL.It then downloads the package using either
curl
orwget
, whichever is available.After downloading, it extracts the package using
tar
, renames the extracted directory tonubit-node
, and deletes the tar file.
Make Necessary Installation:
Once the package is extracted, the following files and directories will be present in the
nubit-node-linux-x86_64
directory:bin/
: Contains executable files for the node.nubit
: The main executable file for the Nubit node.nkey
: A utility for key management.
Update and Validate Nubit Node:
The script includes MD5 checksums for verifying the downloaded files.
If the checksums do not match, the script will download the latest version of the Nubit node to ensure optimal performance and access to new features.
The script constructs the URL for the appropriate Nubit node package based on the
ARCH_STRING
, downloads, and extracts it.
Download and Extract Light Node Data:
The script downloads the light node data from the URL
https://nubit.sh/nubit-data/lightnode_data.tgz
.It then extracts the data, ensuring the node has the necessary data to start. For specific environment variables, please refer to set environment.
Start the Nubit Light Node:
The script navigates into the
$HOME/nubit-node
directory and runs thenubit
executable to start the Nubit node with the appropriate parameters for a light node.
Initialize the Nubit Light Node:
The output includes several initialization messages:
The light node store is initialized.
A new Nubit address named
my_nubit_key
is generated, along with its mnemonic phrase (which is displayed once and must be saved securely).The node joins the Nubit Alpha Testnet and starts syncing headers.
The script prints various status messages about the initialization process, including accessing the keyring, generating new keys, and starting the node.
Configure Node Settings:
The
config.toml
file, which is used by the Nubit node, includes various configurations such as startup timeout, shutdown timeout, P2P settings, RPC settings, and other node-specific configurations. This file ensures the Nubit node operates with the specified settings and parameters.Example configurations in
config.toml
include:[Node]
: Startup and shutdown timeouts.[Core]
: IP, RPC port, and GRPC port.[State]
: Keyring account name and backend.[P2P]
: Listen to addresses, announce addresses, peer settings, etc.[RPC]
: Address and port.[Share]
,[Header]
,[DASer]
,[Pruner]
: Additional settings for data availability sampling, header synchronization, pruning, etc.
Output and Save PUBKEY and AUTHKEY:
The script outputs the generated
PUBKEY
andAUTHKEY
, which are essential for node operations and security.Ensure these keys are saved securely.
Node Information:
The script prints the following information about the node:
Report Metrics and Print Head Information:
The script starts the Nubit node with metrics reporting enabled, sending metrics data to the endpoint
otel.nubit-alphatestnet-1.com:4318
.The script prints information about the network headers and the syncing process, ensuring the node is up-to-date with the latest network state.
Process of Running nubit.sh
(Subsequent Runs)
nubit.sh
(Subsequent Runs)Notes:
Save Keys Securely: Always ensure that the
PUBKEY
andAUTHKEY
are saved securely as they are crucial for node operations.No Reinstallation Needed: Since the binaries are already verified, the script skips the reinstallation process, making subsequent runs faster.
Continued Operation: The node will continue from its previous state, ensuring seamless operation and synchronization with the network.
When you execute the nubit.sh
script for the second time or any subsequent times, the process will differ slightly from the initial run. Here is a detailed guide for users executing the script after the first run:
Start the Script:
The script begins with a message "Starting Nubit node..." to indicate that the process has started.
Verify Installation:
The script checks the MD5 checksums of the existing
nubit
andnkey
binaries to ensure they are correct.If the checksums pass, the script prints "MD5 checking passed. Start directly" and proceeds without re-downloading the binaries.
Output Existing Keys:
The script confirms the presence of existing keys generated during the initial run.
Reminder: Ensure that the Nubit address,
PUBKEY
, andAUTHKEY
are saved securely as they are crucial for node operations.
Initialize Node:
The script accesses the keyring to use the existing keys for node operations and constructs the keyring signer using the stored key information.
It initializes and opens the necessary databases using the Badger database, ensuring the node can access its stored data and continue from where it left off.
The script loads peers from disk, reconnecting the node with its known peers, joins the appropriate network topics, and starts the P2P client and server.
The node begins syncing headers from the network to stay up-to-date.
The script starts the DASer (Data Availability Sampler) from the last checkpoint and initializes the RPC server for communication.
Node Information:
The script also prints the node information as usual:
Report Metrics and Print Head Information:
The script starts the Nubit node with metrics reporting enabled, sending metrics data to the endpoint
otel.nubit-alphatestnet-1.com:4318
.The script prints information about the network headers and the syncing process, ensuring the node is up-to-date with the latest network state.
Last updated