FluffyLabs / FluffyLabs/typeberry

Separate CLI from main functionality in RPC server

Open
#490 0 comments 0 reactions 0 assignees View on GitHub
M-node P-chores
Dominant language
TypeScript
Stars
10
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Description

There is a TODO comment in `bin/rpc/index.ts` suggesting that the RPC server should be refactored to start similar to `bin/jam` by:
- Accepting a config file to the `main` function
- Separating CLI parsing from main functionality

## Current State
The RPC server currently handles CLI argument parsing directly in the `main` function, which couples the CLI interface with the core functionality.

## Proposed Changes
- Refactor the `main` function to accept a config object instead of raw CLI arguments
- Move CLI argument parsing to a separate layer
- Align the architecture with how `bin/jam` is structured

## Context
- **File**: `bin/rpc/index.ts`
- **PR**: https://github.com/FluffyLabs/typeberry/pull/459
- **Comment**: https://github.com/FluffyLabs/typeberry/pull/459#discussion_r2213173018
- **Reported by**: @tomusdrw

## TODO Comment
```
// TODO: [MaSo] Could be starting like `bin/jam`
// from giving a config file to `main` function
// and separating cli from main funcionality
```

This appears to be an architectural improvement to improve code organization and consistency across the codebase.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.