Skip to content

one click deprecated, snapshot added in readme and updated scripts#241

Open
anunay-xin wants to merge 6 commits intoXinFinOrg:masterfrom
anunay-xin:snapshot-readme
Open

one click deprecated, snapshot added in readme and updated scripts#241
anunay-xin wants to merge 6 commits intoXinFinOrg:masterfrom
anunay-xin:snapshot-readme

Conversation

@anunay-xin
Copy link

@anunay-xin anunay-xin commented Jan 28, 2026

Summary by CodeRabbit

  • Documentation

    • Made Docker the primary deployment path, reorganized setup methods, added a snapshot-based setup, and marked the one‑click installer as deprecated
    • Streamlined environment variable guidance and clarified RPC namespace availability
  • Chores

    • Prefer Docker Compose v2 with a fallback to legacy compose across scripts
    • Migrated remote API flags to modern HTTP/WebSocket names and removed default mining activation
  • Bug Fixes

    • Fixed startup message typo

@coderabbitai
Copy link

coderabbitai bot commented Jan 28, 2026

📝 Walkthrough

Walkthrough

README reworked to a Docker-first guide, adding a snapshot-based Method 4 and marking the one‑click installer as deprecated. Multiple start/up/down scripts now prefer Docker Compose v2 (CLI) and node startup flags migrated from legacy RPC options to HTTP/WS flag names; minor env and bootstrap updates applied.

Changes

Cohort / File(s) Summary
Documentation / README
README.md
Converted primary workflow to Docker/Docker Compose, added Method 4 (Snapshot), deprecated legacy one‑click installer (Method 3), reorganized wallet/RPC guidance and updated examples.
Compose CLI detection (up/down)
devnet/docker-up.sh, devnet/docker-down.sh, mainnet/docker-up.sh, mainnet/docker-down.sh, testnet/docker-up.sh, testnet/docker-down.sh
Replaced legacy docker-compose existence/alias logic with feature detection preferring docker compose (v2 plugin); set COMPOSE variable and invoke compose via $COMPOSE; emit deprecation/migration notices on fallback.
Node startup scripts
devnet/start.sh, mainnet/start-node.sh, testnet/start-apothem.sh
Migrated deprecated --rpc* flags to --http* equivalents and renamed WebSocket flags to --ws-...; removed --mine and XDCx datadir flags; fixed Genesis message typo.
Bootstrap / helper scripts
setup/bootstrap.sh, devnet/..., mainnet/..., testnet/...
Switched direct docker-compose invocation to Docker Compose CLI namespace (docker compose) in bootstrap; other helper scripts updated to use COMPOSE where applicable.
Environment files
mainnet/.env, mainnet/env.example
Removed db from RPC_API and WS_API lists, narrowing exposed RPC/WS namespaces (db removed).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 I swapped my keys for a Docker shell,
Watched compose v2 ring its bell,
Snapshots tucked in cozy rows,
HTTP whispers where RPC flows,
Hopping on — the node now dwells 🌿

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: deprecating the one-click installer method and adding a snapshot-based setup method, plus updating related scripts.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@anunay-xin anunay-xin marked this pull request as ready for review February 11, 2026 04:56
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Fix all issues with AI agents
In `@mainnet/start-node.sh`:
- Around line 78-91: The script is using unrecognized hyphenated flags (e.g.,
--http-addr, --http-port, --http-api, --ws-addr, etc.) when ENABLE_RPC is true;
update the args assembly in mainnet/start-node.sh (the args array and the
ENABLE_RPC branch) to use the correct flag style supported by the XDC binary and
apply the same changes to the testnet and devnet start-node.sh scripts: either
convert the hyphenated flags to legacy RPC flags (e.g., --rpc, --rpcaddr,
--rpcport, --rpcapi, --ws, --wsaddr/--wsport as supported) or to modern
dot-notation (e.g., --http.addr, --http.port, --http.api, --ws.addr, --ws.port),
and verify by checking the XDC binary help before choosing which form to use.

In `@README.md`:
- Line 142: Update the README line that currently reads "**Step 1: Download
[XinFin One-Click Installer]... for Windows, Linux, and Mac OS and Install on
your local machine.**" by replacing "Mac OS" with the correct Apple branding
"macOS" (i.e., "Windows, Linux, and macOS"); ensure the exact phrase in the
README is updated and preserve surrounding formatting and links.
- Line 259: Remove the confusing placeholder by replacing the note text that
contains "/your/xdcchain/directory" so it only shows the concrete path
"XinFin-Node/mainnet/xdcchain" (i.e., delete the placeholder and parentheses or
reword to "Make sure to use the actual path, e.g. XinFin-Node/mainnet/xdcchain")
to avoid duplication and confusion.
- Line 6: Replace the incomplete fragment "should be facing internet directly"
in README.md with a complete sentence that includes a clear subject and
articles; for example, change it to "The servers should be facing the internet
directly" or, if more specific, "The application servers should face the
internet directly" so the sentence reads grammatically complete and unambiguous.
- Around line 138-140: Replace the "Apple Mac" entry in the README list with the
correct OS name "macOS" (update the list item that currently reads "Apple Mac"
to "macOS") so the entries read: "macOS", "Windows", "Linux - Ubuntu" for
consistency and accuracy.
🧹 Nitpick comments (8)
README.md (6)

14-21: Add language specifiers to code blocks.

The code blocks are missing language specifiers, which helps with syntax highlighting and improves readability.

✨ Proposed improvement
-```
+```bash
 git clone https://github.com/XinFinOrg/XinFin-Node.git

Enter XinFin-Node directory
- +bash
cd XinFin-Node


34-38: Add language specifier to code block.

The code block is missing a language specifier for better syntax highlighting.

✨ Proposed improvement
-```
+```bash
 cd mainnet # testnet
 cp env.example .env
 nano .env
</details>

---

`45-47`: **Add language specifiers to shell command blocks.**

Multiple code blocks containing shell commands are missing language specifiers, which would improve syntax highlighting and readability.

<details>
<summary>✨ Proposed improvement for all shell command blocks</summary>

Add `bash` or `shell` language identifier to all code blocks containing shell commands:

```diff
-```
+```bash
 sudo docker-compose -f docker-compose.yml up -d

Apply the same change to code blocks at lines 55-57, 59-62, 68-71, and 79-82.
</details>


Also applies to: 55-57, 59-62, 68-71, 79-82

---

`200-202`: **Add language specifiers to code blocks in Method 4.**

Multiple code blocks in the new snapshot method are missing language specifiers, which would improve syntax highlighting and documentation quality.

<details>
<summary>✨ Proposed improvement</summary>

Add `bash` language identifier to all code blocks:

```diff
-```
+```bash
 sudo su -c "bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)" root

Apply this change to all code blocks at lines 200-202, 205-211, 215-217, 220-222, 225-234, 238-241, 250-252, and 255-257. For the `.env` configuration block at lines 245-247, use `bash` or `env` as the language specifier.
</details>


Also applies to: 205-211, 215-217, 220-222, 225-234, 238-241, 245-247, 250-252, 255-257

---

`3-3`: **Consider removing closing hashes from headings for consistency.**

The markdown linter flags that these headings use closing hashes (`### Title ###`), which is the "atx_closed" style. The more common and recommended style is "atx" (without closing hashes: `### Title`). While both are valid, consistency improves maintainability.

<details>
<summary>✨ Proposed improvement</summary>

```diff
-### Method 1:- Setup XinFin Masternode Docker ###
+### Method 1:- Setup XinFin Masternode Docker

-### Method 3:- Setup XinFin's XDC Masternode One-click Installer(Deprecated) ###
+### Method 3:- Setup XinFin's XDC Masternode One-click Installer(Deprecated)

-### Method 4:- Setup XinFin Masternode Using Snapshot ###
+### Method 4:- Setup XinFin Masternode Using Snapshot

Also applies to: 131-131, 193-193


230-230: Endpoint is valid and operational; consider adding a brief security reminder.

The endpoint https://rpc.xdc.network/download is accessible and returns valid bash script content (HTTP 200, 26KB). The bootstrap pattern is reasonable and matches the documented workflow.

Consider adding a brief note encouraging users to review the script content before piping to bash, especially for users unfamiliar with this pattern. Even though the current documentation contextualizes this within a tmux session (suggesting user review), an explicit security reminder would be helpful for clarity and good practice.

mainnet/docker-up.sh (1)

3-12: Good approach for Docker Compose v2 detection with a minor robustness gap.

The v2 plugin detection logic is sound. One observation: the else branch assumes docker-compose (standalone) is installed, but doesn't verify it. If neither docker compose (v2) nor docker-compose (standalone) is available, line 12 will fail with an unhelpful "command not found" error.

Consider adding a guard in the fallback:

Suggested improvement
 if command -v docker >/dev/null 2>&1 && docker compose version >/dev/null 2>&1; then
     COMPOSE="docker compose"
 else
-    COMPOSE="docker-compose"
-    echo "Using legacy docker-compose. Upgrade to docker compose is recommended."
+    if command -v docker-compose >/dev/null 2>&1; then
+        COMPOSE="docker-compose"
+        echo "Using legacy docker-compose. Upgrade to docker compose is recommended."
+    else
+        echo "Error: Neither 'docker compose' (v2 plugin) nor 'docker-compose' (standalone) found. Please install Docker Compose." >&2
+        exit 1
+    fi
 fi

This pattern applies equally to all six docker-up/docker-down scripts in this PR (mainnet, testnet, devnet).

mainnet/start-node.sh (1)

78-91: Unset environment variables will pass empty strings to flags.

If ENABLE_RPC is true but variables like RPC_ADDR, RPC_PORT, RPC_API, etc. are not set, they expand to empty strings (e.g., --http-addr ""), which may cause unexpected behavior. Consider providing sensible defaults (e.g., 0.0.0.0, 8545, eth,net,web3).

This is pre-existing behavior, but since you're already updating these flags, it would be a good time to add defaults.

Example: adding defaults for RPC env vars
 # if ENABLE_RPC is true, add RPC related parameters
 if echo "${ENABLE_RPC}" | grep -iq "true"; then
+    RPC_ADDR="${RPC_ADDR:-0.0.0.0}"
+    RPC_PORT="${RPC_PORT:-8545}"
+    RPC_API="${RPC_API:-eth,net,web3}"
+    RPC_CORS_DOMAIN="${RPC_CORS_DOMAIN:-*}"
+    RPC_VHOSTS="${RPC_VHOSTS:-*}"
+    WS_ADDR="${WS_ADDR:-0.0.0.0}"
+    WS_PORT="${WS_PORT:-8555}"
+    WS_API="${WS_API:-eth,net,web3}"
+    WS_ORIGINS="${WS_ORIGINS:-*}"
     args+=(
         --http

@anunay-xin anunay-xin changed the title one click deprecated and snapshot added in readme one click deprecated, snapshot added in readme and updated scripts Feb 11, 2026
…avoid ERROR: client version 1.30 is too old.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
setup/bootstrap.sh (1)

49-69: ⚠️ Potential issue | 🔴 Critical

docker compose (v2 plugin) is used but never installed — only standalone v1 is installed.

Line 51 downloads the standalone docker-compose v1.25.0 binary, which provides the docker-compose command. Line 69 now invokes docker compose (the v2 plugin subcommand), which requires the docker-compose-plugin package — never installed by this script. On a fresh machine this will fail.

Either install the v2 plugin and use docker compose, or keep the standalone binary and use docker-compose. The v2 plugin approach is recommended since standalone v1 is deprecated:

Proposed fix: install v2 plugin instead of standalone v1
-    echo "Installing Docker-Compose"
-    
-    curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
-        
-    chmod +x /usr/local/bin/docker-compose
-    sleep 5
-    echo "Docker Compose Installed successfully"
+    echo "Installing Docker Compose Plugin"
+
+    sudo apt-get install docker-compose-plugin -y
+    echo "Docker Compose Plugin installed successfully"

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
mainnet/env.example (1)

9-9: ⚠️ Potential issue | 🟡 Minor

db was not removed from RPC_API in this example file.

WS_API (line 16) had db removed, but RPC_API still includes it. This is inconsistent with mainnet/.env where db was removed from both. Since the db namespace is being dropped, this should be updated too.

📝 Proposed fix
-RPC_API=db,eth,net,txpool,web3,XDPoS
+RPC_API=eth,net,txpool,web3,XDPoS
🤖 Fix all issues with AI agents
In `@mainnet/.env`:
- Line 11: Update the RPC_API setting in env.example to match the actual mainnet
.env by removing the "db" token so RPC_API is "eth,net,txpool,web3,XDPoS";
locate the RPC_API entry (identifier RPC_API) in env.example and replace the
value that currently includes "db,eth,net,txpool,web3,XDPoS" with the value used
in mainnet .env to keep the files consistent for cp env.example .env users.

In `@README.md`:
- Around line 239-241: The README currently uses "rm -rf" for removing files
"XDC/nodekey" and "XDC/transactions.rlp"; change those commands to use "rm -f"
instead (or keep "rm -rf" only for directory removals) so single files are
removed safely and errors aren't masked—update the instances referencing
XDC/nodekey and XDC/transactions.rlp accordingly.
- Around line 291-312: The README's "Removed Namespaces" section is missing the
`db` namespace which this PR removes from the `RPC_API` and `WS_API` defaults;
update the "Removed Namespaces" list to include `db` alongside `personal`, e.g.,
add a short entry like "`db` - database storage access methods (removed from
RPC_API and WS_API defaults)", and ensure the term `db` matches the exact
namespace string used in the .env changes so readers can correlate the removal
with the `RPC_API` and `WS_API` updates.
- Around line 224-234: Replace the insecure "curl | bash" pattern with explicit
download-and-verify steps: instruct users to first download the installer to a
local file (e.g., using curl or wget), verify the file integrity/signature
(e.g., provide guidance to check a published SHA256 checksum or use GPG
signature verification), inspect the script before running, then execute it
locally (e.g., with bash or by making it executable). Update the README example
block that currently shows "curl -fsSL https://rpc.xdc.network/download | bash"
to the safer sequence and add a note recommending verification for masternode
operators handling funds.
🧹 Nitpick comments (2)
README.md (2)

3-3: Heading style inconsistency: closed ATX headings.

Lines 3, 131, and 193 use closed ATX headings (### ... ###) while other headings in the file don't. Markdownlint flags this (MD003). Consider using open ATX style consistently.

📝 Proposed fix
-### Method 1:- Setup XinFin Masternode Docker ###
+### Method 1: Setup XinFin Masternode Docker

-### Method 3:- Setup XinFin's XDC Masternode One-click Installer(Deprecated) ###
+### Method 3: Setup XinFin's XDC Masternode One-click Installer (Deprecated)

-### Method 4:- Setup XinFin Masternode Using Snapshot ###
+### Method 4: Setup XinFin Masternode Using Snapshot

Also applies to: 131-131, 193-193


46-46: Update docker-compose commands to Docker Compose v2 syntax.

Docker Compose v1 (docker-compose) was deprecated when v2 reached GA (April 2022) and support ended after June 2023. Update the following instances to use the v2 CLI plugin syntax:

Lines 46, 56, 70, 81
-sudo docker-compose -f docker-compose.yml up -d
+sudo docker compose -f docker-compose.yml up -d
-sudo docker-compose -f docker-compose.yml down
+sudo docker compose -f docker-compose.yml down


# RPC API setting
RPC_API=db,eth,net,txpool,web3,XDPoS
RPC_API=eth,net,txpool,web3,XDPoS
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistency: db removed from RPC_API here but still present in env.example.

mainnet/env.example line 9 still has RPC_API=db,eth,net,txpool,web3,XDPoS while this file has db removed. The example file should match to avoid confusion when users run cp env.example .env.

🤖 Prompt for AI Agents
In `@mainnet/.env` at line 11, Update the RPC_API setting in env.example to match
the actual mainnet .env by removing the "db" token so RPC_API is
"eth,net,txpool,web3,XDPoS"; locate the RPC_API entry (identifier RPC_API) in
env.example and replace the value that currently includes
"db,eth,net,txpool,web3,XDPoS" with the value used in mainnet .env to keep the
files consistent for cp env.example .env users.

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.

1 participant