-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli-wrapper): added Node CLI wrapper with initial commands and c…
…onfig parsing • Implemented wrapper with commands to start coordinator and nodes. • Added default node configuration file and logic to create node home directory if missing. • Introduced child process handling with temporary resolution for termination issues. • Defined node configuration struct with methods for reading and parsing config data. • Updated README.md with usage instructions.
- Loading branch information
1 parent
43782e3
commit 2b18893
Showing
7 changed files
with
370 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[package] | ||
name = "merow" | ||
version = "0.1.0" | ||
authors.workspace = true | ||
edition.workspace = true | ||
repository.workspace = true | ||
license.workspace = true | ||
|
||
[dependencies] | ||
clap = { workspace = true, features = ["env", "derive"] } | ||
const_format.workspace = true | ||
eyre.workspace = true | ||
|
||
tokio = { workspace = true, features = ["full"] } | ||
toml = "0.5.2" | ||
serde = { workspace = true, features = ["derive"] } | ||
|
||
[lints] | ||
workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# Core Cli Wrapper (crate::merow) | ||
|
||
A CLI wrapper for the Calimero Node that provides a default node configuration file for initializing a node, and quickly running a development environment for testing P2P Calimero Apps. | ||
|
||
## Features | ||
|
||
- Custom Node Configuration File | ||
- Simple Commands to Initialize and Run a Calimero Node | ||
- Creates a Node Home Directory (if it doesn't already exist) | ||
|
||
## Prerequisites | ||
- Rust: [Official Rust Installation](https://www.rust-lang.org/tools/install) | ||
|
||
## Setting up | ||
Clone the project | ||
|
||
```bash | ||
git clone https://github.com/kevinjaypatel/core.git | ||
``` | ||
|
||
Change to repo | ||
|
||
```bash | ||
cd core | ||
``` | ||
|
||
Check out cli-wrapper | ||
```bash | ||
git branch cli-wrapper | ||
``` | ||
|
||
## Usage | ||
|
||
Setup the Default Configuration: `./crates/merow/config/default.toml` | ||
|
||
```javascript | ||
[coordinator] | ||
name = "coordinator" | ||
server_port = 2427 | ||
swarm_port = 2527 | ||
home = "data" | ||
|
||
[admin] | ||
name = "node1" | ||
server_port = 2428 | ||
swarm_port = 2528 | ||
home = "data" | ||
``` | ||
|
||
Initialize a coordinator | ||
`$ merow -- init-coordinator` | ||
|
||
Initialize a node | ||
`$ merow -- init-node` | ||
|
||
Start a running coordinator | ||
`$ merow -- start-coordinator` | ||
|
||
Start a running node | ||
`$ merow -- start-node` | ||
|
||
|
||
## How to Run (from project root) | ||
|
||
### Build the Rust Package | ||
```bash | ||
cargo build | ||
``` | ||
|
||
### Starting up a Coordinator (same steps apply for Node Configuration) | ||
E.g. Initializes Coordinator (with defaults) | ||
```bash | ||
cargo run -p merow -- init-coordinator | ||
``` | ||
|
||
Start a running coordinator | ||
```bash | ||
cargo run -p merow -- start-coordinator | ||
``` | ||
|
||
### Accessing the coordinator via Admin Dashboard | ||
```bash | ||
http://localhost:<coordinator.server_port>/admin-dashboard/ | ||
``` | ||
|
||
## Roadmap | ||
|
||
- Additional commands for `Dev Context` creation and `Peer Invitation` | ||
- Add a boolean flag to the Configuration File for Deploying the Admin Dashboard | ||
- Multi-node deployment (e.g. node1, node2, ... nodeN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[coordinator] | ||
name = "coordinator" | ||
server_port = 2427 | ||
swarm_port = 2527 | ||
home = "data" | ||
|
||
[admin] | ||
name = "node1" | ||
server_port = 2428 | ||
swarm_port = 2528 | ||
home = "data" |
Oops, something went wrong.