Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@krrish-sehgal
Copy link
Contributor

@krrish-sehgal krrish-sehgal commented Apr 14, 2025

As per the discussion this is the scripts encompassing the commands , used by me to deploy ordinals and mainnet.

References : https://medium.com/coinmonks/ultimate-guide-to-bitcoin-testnet-fullnode-setup-b83da1bb22e

Summary by CodeRabbit

  • New Features
    • Introduced an automated setup for Bitcoin Core on Linux, simplifying installation, configuration, and service management.
    • Added an automated process to install and verify ord software, streamlining dependency updates, toolchain setup, and software deployment.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 14, 2025

Walkthrough

The pull request introduces two new shell scripts within the BACON directory. The first script automates the setup of Bitcoin Core on a Linux system by installing dependencies, downloading and verifying binaries, configuring application files, and establishing a systemd service. The second script automates the installation and build process for the ord software, including package updates, dependency installations, Rust setup, source download from GitHub, building with Cargo, and performing optional index file processing.

Changes

File Path Change Summary
BACON/setup-mainnet.sh New script to automate Bitcoin Core setup on Linux: sets strict error handling; initializes environment variables; creates bitcoin user/group; installs dependencies; downloads, verifies, and extracts binaries; generates bitcoin.conf; creates and starts a systemd service; updates PATH.
BACON/setup-ord.sh New script to automate ord software setup on Linux: updates packages; installs dependencies (including Rust via its installer); verifies Rust and Cargo installations; downloads and builds ord source from GitHub using Cargo; moves binary to /usr/local/bin; optionally processes an index file.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant S as setup-mainnet.sh
    participant P as Package Manager
    participant D as Download Server
    participant Sys as Systemd
    U->>S: Execute script
    S->>Sys: Check/create bitcoin user/group
    S->>P: Update package list and install dependencies
    S->>D: Download Bitcoin Core binaries and checksums
    D-->>S: Return binaries and checksum
    S->>S: Verify checksum and extract binaries
    S->>S: Generate bitcoin.conf configuration file
    S->>Sys: Create systemd service configuration for Bitcoin Core
    S->>Sys: Enable and start Bitcoin Core service
    U->>S: Check Bitcoin Core service status/logs
Loading
sequenceDiagram
    participant U as User
    participant S as setup-ord.sh
    participant P as Package Manager
    participant R as Rust Installer
    participant G as GitHub
    U->>S: Execute script
    S->>P: Update system packages and install dependencies
    S->>R: Download and install Rust
    R-->>S: Provide Rust and Cargo installation
    S->>G: Download ord source code (version 0.22.2)
    G-->>S: Return ord source files
    S->>S: Extract and build ord using Cargo
    S->>S: Move built binary to /usr/local/bin and verify installation
    S->>S: Optionally download and decompress index file
    S->>U: Output "setup complete" message
Loading

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@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: 2

🧹 Nitpick comments (3)
BACON/setup-ord.sh (2)

23-24: Suggestion: Handle Directory Change Failures
When changing directories with cd ord-0.22.2, it’s safer to append || exit to ensure that the script terminates if the directory change fails. For example:

cd ord-0.22.2 || exit

This aligns with recommendations from Shellcheck (SC2164).

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 24-24: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)


5-5: Optional Improvement: Consolidate Package Updates
The script calls sudo apt update twice (once at line 5 and again at line 28). While this may be intentional to guarantee fresh indexes before different installations, consolidating them could streamline the process.

Also applies to: 28-28

BACON/setup-mainnet.sh (1)

90-92: Suggestion: Ensure Idempotence in PATH Update
Appending to the bitcoin user’s PATH using sudo su - bitcoin -c 'echo "export PATH=\$PATH:/opt/bitcoin/current/bin" >> ~/.profile' may lead to duplicate entries upon multiple executions. Consider checking for an existing entry before appending to avoid redundancy.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 30a52a6 and 57ca02e.

📒 Files selected for processing (2)
  • BACON/setup-mainnet.sh (1 hunks)
  • BACON/setup-ord.sh (1 hunks)
🧰 Additional context used
🪛 Shellcheck (0.10.0)
BACON/setup-ord.sh

[warning] 24-24: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Run Tests
  • GitHub Check: docker-test
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
BACON/setup-mainnet.sh (1)

1-3: Good Use of Robust Error Handling
The inclusion of set -euo pipefail right after the shebang ensures that the script will exit on errors or unset variables. This practice improves the overall reliability of the deployment process.

@DonnieBLT DonnieBLT merged commit 9912722 into OWASP-BLT:main Apr 14, 2025
11 of 14 checks passed
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.

2 participants