-
-
Notifications
You must be signed in to change notification settings - Fork 313
add setup scrips for mainnet and ordinals server #4136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe 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
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
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
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 withcd ord-0.22.2, it’s safer to append|| exitto ensure that the script terminates if the directory change fails. For example:cd ord-0.22.2 || exitThis 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 callssudo apt updatetwice (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 usingsudo 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
📒 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 ofset -euo pipefailright after the shebang ensures that the script will exit on errors or unset variables. This practice improves the overall reliability of the deployment process.
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