Skip to content
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

Implement Single-Binary Visor Using libsui #1294

Open
karlem opened this issue Feb 19, 2025 · 2 comments
Open

Implement Single-Binary Visor Using libsui #1294

karlem opened this issue Feb 19, 2025 · 2 comments

Comments

@karlem
Copy link
Contributor

karlem commented Feb 19, 2025

Rationale
A single-binary Visor that embeds CometBFT, Fendermint, and optional relayer/EVM services simplifies distribution and eliminates the need to manage multiple executables. This approach allows signature checks during unpacking, consolidates node configuration (in visor.toml), and provides a unified CLI for starting, stopping, and logging processes.

Actions

  1. Embed Dependencies with libsui
  • Bundle CometBFT, Fendermint, and relayer/eth inside the Visor binary.
  • Unpack them to a secure or temporary location at runtime, performing signature checks.
  1. Implement Initialization
  • Add visor init to create ~/.mychain/ and generate default configs (visor.toml, CometBFT, Fendermint, Relayer).
  • Provide key generation if necessary.
  1. Start/Stop & Logging
  • Add visor start to spawn all embedded binaries (CometBFT, Fendermint, Relayer).
  • Add visor stop to gracefully terminate processes.
  • Direct logs to console or ~/.mychain/logs.
  1. Global Configuration
  • Store global settings (chain ID, run_relayer, etc.) in visor.toml.
  • Pass relevant config to unpacked binaries (e.g., genesis file path, ports).
  1. Subcommands
  • Provide commands like visor cometbft version or visor fendermint init by proxying to the unpacked binaries for advanced usage.
  1. Documentation
  • Include a brief guide covering visor init, visor start, visor stop, and any specialized subcommands.
Copy link

linear bot commented Feb 19, 2025

@raulk
Copy link
Contributor

raulk commented Feb 20, 2025

I disagree with introducing yet another new thing/layer of complexity here. We need to simplify, not introduce more indirection! Would propose the following approach:

  • Consolidate everything into a single ipc process, except for the CLI. ipc-cli can be renamed to ipcctl (following the kube and kubectl convention).
  • Repurpose the existing Fendermint config.toml and turn it into an ipc.toml. Extend it to define consensus engine choice (only one choice available today: cometbft) and the consensus engine parameters.
  • This ipc.toml is a single configuration that can be used to start any service: consensus, node, eth-api, relayer. So you'd do: ipc run --config=ipc.toml [service_name...].
  • We can have predefined profiles, e.g. the default profile could be to start everything within a single process. So if you simply do ipc run --config=ipc.toml, it would start all of the above services. And we can define other profiles going forward, and select with --profile.
  • To manage CometBFT, we will want to use Docker. We can repurpose quite a bit of code from the Materializer to do just that.

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

No branches or pull requests

2 participants