|
| 1 | +# Codono Bitcoin Prune Node Setup Script |
| 2 | + |
| 3 | +This script automates the setup of a Bitcoin prune node. It checks for existing configurations, installs necessary software, and sets up the node with resume protection using `screen`. |
| 4 | + |
| 5 | +## Features |
| 6 | +- **Resume-Supported**: Can be run multiple times without overwriting existing configurations. |
| 7 | +- **RPC Configuration**: Generates and saves RPC credentials in `/opt/btc_rpc.yml`. |
| 8 | +- **Screen Session**: Runs the Bitcoin node in a `screen` session for resume protection. |
| 9 | +- **Supervisor Setup**: Configures `supervisor` to manage the Bitcoin node service. |
| 10 | +- **Wallet Creation**: Creates a default wallet and an additional wallet named `my_wallet`. |
| 11 | + |
| 12 | +## Instructions to Use the Script |
| 13 | + |
| 14 | +### Prerequisites |
| 15 | +- **Root Access**: This script requires root privileges to install software and configure system settings. |
| 16 | +- **Internet Access**: The script downloads Bitcoin Core and other dependencies. |
| 17 | + |
| 18 | +### Steps |
| 19 | + |
| 20 | +1. **Save the Script**: |
| 21 | + - Download the script to your server. For example, save it as `setup_bitcoin_node.sh`. |
| 22 | + |
| 23 | +2. **Make the Script Executable**: |
| 24 | + ```bash |
| 25 | + chmod +x setup_bitcoin_node.sh |
| 26 | + |
| 27 | +Run the Script with Root Privileges: |
| 28 | + |
| 29 | +```bash |
| 30 | +sudo ./setup_bitcoin_node.sh |
| 31 | +``` |
| 32 | +### What the Script Does |
| 33 | +- **Welcome Message**: Provides an overview of what the script will do. |
| 34 | +- **User Confirmation**: Asks for user confirmation before proceeding. |
| 35 | +- **Check for Existing RPC Configuration**: Reuses existing RPC information from /opt/btc_rpc.yml if it exists. |
| 36 | +- **Install Necessary Software**: Installs screen and Bitcoin Core if they are not already installed. |
| 37 | +- **Configure Bitcoin Core**: Sets up bitcoin.conf with random RPC credentials and a specified port. |
| 38 | +- **Start Bitcoin Node**: Runs the Bitcoin node in a screen session for resume protection. |
| 39 | +- **Supervisor Configuration**: Sets up supervisor to manage the Bitcoin node service. |
| 40 | +- **Wallet Creation**: Creates a default wallet and an additional wallet named my_wallet. |
| 41 | +- **Connection Test**: Tests the connection to the Bitcoin node.** |
| 42 | +### Notes |
| 43 | +- **Existing Configurations**: The script checks for existing configurations and reuses them to avoid overwriting. |
| 44 | +- **Screen Session**: The Bitcoin node runs in a screen session. You can resume the session with screen -r bitcoin_node. |
| 45 | +- **Supervisor**: The script configures supervisor to manage the Bitcoin node service, ensuring it restarts automatically if it crashes. |
| 46 | +- **Wallets**: The script creates a default wallet and an additional wallet named my_wallet if they do not already exist. |
| 47 | +- **Resume-Supported**: The script is designed to be run multiple times without overwriting existing configurations or reinstalling software. |
| 48 | +- **Review Script**: Always review and understand the script before running it, especially when running with root privileges. |
| 49 | + |
| 50 | +### Troubleshooting |
| 51 | +- **Screen Session**: If the script stops unexpectedly, you can resume the session with screen -r bitcoin_node. |
| 52 | +- **Logs**: Check the supervisor logs for any issues: |
| 53 | + |
| 54 | +```bash |
| 55 | +supervisorctl tail -f bitcoin |
| 56 | +``` |
| 57 | + |
| 58 | +### Connection Issues |
| 59 | +Use the curl command provided in the script to test the connection to the Bitcoin node. |
| 60 | + |
| 61 | +### Support |
| 62 | +For any issues or further assistance, please contact **https://t.me/@ctoninja** |
| 63 | +Thank you for using the Codono Bitcoin Prune Node Setup Script! |
0 commit comments