Skip to content

Add Dockerfile and environment setup for BSC cluster#1

Merged
IsaacTai13 merged 3 commits intomainfrom
feature/docker-cluster
Mar 27, 2026
Merged

Add Dockerfile and environment setup for BSC cluster#1
IsaacTai13 merged 3 commits intomainfrom
feature/docker-cluster

Conversation

@IsaacTai13
Copy link
Copy Markdown
Collaborator

@IsaacTai13 IsaacTai13 commented Mar 27, 2026

Summary by CodeRabbit

  • Documentation

    • Added comprehensive Docker setup guide to README with step-by-step instructions and monitoring commands.
    • Included recommendations for Docker-based installation as an alternative to manual setup.
  • New Features

    • Added Docker Compose configuration for containerized node deployment.
    • Introduced container initialization script for automated startup and setup.

- set useLatestBscClinet to true to compile geth with latest geth on
  github
- xargs -r to ignore error if no previous geth found
@IsaacTai13 IsaacTai13 merged commit 7e7374d into main Mar 27, 2026
1 check was pending
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 27, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This pull request introduces Docker containerization support for the BSC toolbox. A new docker-compose.yml file defines a bsc-node service that builds from a local Dockerfile, exposes RPC and metrics ports, and manages container lifecycle. An entrypoint.sh startup script executes on container initialization, setting up the environment and running bsc_cluster.sh reset. The bsc_cluster.sh script is updated to resolve create-validator from the system PATH and safely handle empty process lists during cleanup. README documentation is expanded with Docker setup instructions, port mappings, and in-container monitoring commands.

Sequence Diagram

sequenceDiagram
    participant User
    participant Docker as Docker Compose
    participant Container as Container Runtime
    participant Entrypoint as entrypoint.sh
    participant ClusterScript as bsc_cluster.sh
    participant App as BSC Application
    
    User->>Docker: docker compose up -d --build
    Docker->>Docker: Build image from Dockerfile
    Docker->>Container: Start bsc-node service
    Container->>Entrypoint: Execute entrypoint.sh
    Entrypoint->>Entrypoint: cd /node_deploy<br/>Create lock file
    Entrypoint->>ClusterScript: bash ./bsc_cluster.sh reset
    ClusterScript->>ClusterScript: Initialize validator<br/>Register stakehub<br/>Configure node
    ClusterScript->>Entrypoint: Initialization complete
    Entrypoint->>Entrypoint: Remove lock file
    Entrypoint->>App: exec bash (main container shell)
    App->>App: Ready for user interaction
    App->>User: RPC available at :8545<br/>Monitoring available
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 4

❌ Failed checks (4 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title does not follow the required format. It lacks the required (<domain/pkg>): prefix structure specified in the guidelines. Reformat the title to follow the exact pattern: (<domain/pkg>): . For example: 'feat(docker): add Dockerfile and BSC cluster environment setup'.
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.
Concurrency Safety ⚠️ Warning The PR contains critical concurrency safety violations including untracked background processes, missing trap handlers for graceful termination, orphaned lock files, fragile process detection patterns, and no PID tracking mechanism. Add trap handlers for EXIT and signal handling, implement wait synchronization for background processes, replace ps/grep with pgrep, and quote all variable expansions for proper signal propagation.
Security Considerations ⚠️ Warning Pull request introduces critical security vulnerabilities including exposed RPC ports without authentication, dangerous geth flags, hardcoded weak credentials, command injection risks in process termination, and missing input validation. Bind RPC endpoints to 127.0.0.1 only, remove dangerous flags, use environment variables for credentials, replace ps|grep with pgrep, add input validation for ValidatorIdx, implement trap cleanup handlers, and replace curl|bash patterns with verified package manager commands.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Go Build And Test Rationale ✅ Passed No Go source code, packages, or build configurations are modified; only shell scripts, Docker config, and documentation are changed.
Public Api Changes ✅ Passed PR adds Docker support and modifies internal bsc_cluster.sh implementation details; no breaking changes to public APIs or exported functions/types.
Rust Best Practices ✅ Passed PR contains only shell scripts, Go code, YAML, and documentation—no Rust files present, so Rust best practices check does not apply.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/docker-cluster

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

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