From ffba99c402c79c07d4fbf2e2858780c27a8ddb46 Mon Sep 17 00:00:00 2001 From: "matej.vukosav" Date: Mon, 21 Oct 2024 11:47:38 +0200 Subject: [PATCH 1/9] chore: update readme --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8139011..e79ccf1 100644 --- a/README.md +++ b/README.md @@ -10,21 +10,22 @@ This is a [Tauri](https://tauri.app/) desktop application created using Node.js ## Getting Started 1. Clone the repository: +2. ```bash git clone https://github.com/calimero-network/node-multiplatform-tauri.git ``` -2. Navigate to the project directory: +3. Navigate to the project directory: ```bash cd node-multiplatform-tauri ``` -3. Install the dependencies: +4. Install the dependencies: ```bash npm install ``` -4. Run the development environment: +5. Run the development environment: ```bash npm run tauri dev ``` From edd1b4bcb05af6e8e29bd71af9cd0ce781d663d1 Mon Sep 17 00:00:00 2001 From: "matej.vukosav" Date: Mon, 21 Oct 2024 11:48:00 +0200 Subject: [PATCH 2/9] chore: update lines --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e79ccf1..31dbe3f 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,13 @@ This is a [Tauri](https://tauri.app/) desktop application created using Node.js ## Getting Started 1. Clone the repository: -2. + ```bash git clone https://github.com/calimero-network/node-multiplatform-tauri.git ``` 3. Navigate to the project directory: + ```bash cd node-multiplatform-tauri ``` From 97a936edee3f06770ff9fbdc0702e5e56455505d Mon Sep 17 00:00:00 2001 From: alenmestrov Date: Mon, 21 Oct 2024 11:49:17 +0200 Subject: [PATCH 3/9] updated readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 31dbe3f..5ec023b 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ This is a [Tauri](https://tauri.app/) desktop application created using Node.js ```bash npm run tauri dev ``` - + ## Build To create a production build of the application, run: From 08c2216520616c54e3bf58c11c5a4f36915bf8c3 Mon Sep 17 00:00:00 2001 From: alenmestrov Date: Tue, 22 Oct 2024 11:15:31 +0200 Subject: [PATCH 4/9] chore: updated readme.md file to reflect latest features --- README.md | 47 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 5ec023b..54b2c65 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ # Node Multiplatform Wrapper with Tauri -This is a [Tauri](https://tauri.app/) desktop application created using Node.js and Rust. +This is a [Tauri](https://tauri.app/) desktop application created using Node.js and Rust. The app serves as a GUI for interacting with the Calimero node. ## Prerequisites - [Node.js](https://nodejs.org/) (v16 or higher) - [Rust](https://www.rust-lang.org/) +- [pnpm](https://pnpm.js.org/) (as the package manager) ## Getting Started @@ -15,26 +16,54 @@ This is a [Tauri](https://tauri.app/) desktop application created using Node.js git clone https://github.com/calimero-network/node-multiplatform-tauri.git ``` -3. Navigate to the project directory: +2. Navigate to the project directory: ```bash cd node-multiplatform-tauri ``` -4. Install the dependencies: +3. Install the dependencies using pnpm: ```bash - npm install + pnpm install ``` -5. Run the development environment: +4. Run the development environment: ```bash - npm run tauri dev + pnpm run tauri dev ``` - + + - In development mode, the Calimero node binary is stored in the `src-tauri/bin` folder. + - Depending on the `--target` flag during the build or the user's operating system, the app automatically downloads the Calimero node binary directly from the github release page. + ## Build To create a production build of the application, run: ```bash -npm run tauri build -``` \ No newline at end of file +pnpm run tauri build +``` + +- In production mode, the Calimero node binary is stored in the `resources` folder. + +## Features + +- The application has commands defined in `src-tauri/src/commands/mod.rs` for interacting with the Calimero node: + - **Initialize Node**: Create and initialize a new node with specified parameters. + - **Update Node**: Modify the configuration of an existing node. + - **Start Node**: Start a specified node. + - **Stop Node**: Stop a running node. + - **Get Node Log**: Retrieve the log file for a specified node. + - **Delete Node**: Remove a specified node from the application. + - **Open Dashboard**: Open the admin dashboard for a specified node. + +- The frontend of the application is built using **TypeScript** and **React**, providing a modern and responsive user interface. +- It includes options to run nodes on application startup and to run the application on OS startup. +- The application features an interactive CLI to interact with started nodes. +- There are checks in place to ensure that ports are not already in use and to prevent starting a node with the same name as an already running instance outside of the application. + +## CI/CD + +The project includes a GitHub workflow file that automates the build process for the application on multiple platforms. It builds the application for: + +- **macOS** (both aarch64 and x86 architectures) +- **Linux** (both aarch64 and x86 architectures) From 2346e1c4de47d357e1a2844b7abe5bdf285a7da9 Mon Sep 17 00:00:00 2001 From: alenmestrov Date: Sun, 27 Oct 2024 07:49:42 +0100 Subject: [PATCH 5/9] fix: fixed missing dir --- src-tauri/src/main.rs | 5 ++++- src-tauri/src/utils/setup.rs | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 150cf3f..0634365 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -6,7 +6,7 @@ use node_multiplatform_tauri::tray::menu::{create_menu, handle_menu_click}; use node_multiplatform_tauri::tray::{handle_tray_click, update_tray_menu}; use node_multiplatform_tauri::types::AppState; use node_multiplatform_tauri::utils::setup::{ - run_nodes_on_startup, setup_app_state, setup_auto_launch, setup_store, + run_nodes_on_startup, setup_app_folders, setup_app_state, setup_auto_launch, setup_store }; use tauri::{Manager, SystemTray, SystemTrayEvent, SystemTrayMenu, WindowEvent}; @@ -22,6 +22,9 @@ fn main() -> eyre::Result<()> { // Initialize store let store = setup_store(app)?; + // Initialize app folders + setup_app_folders(&app_handle)?; + // Get the run_app_on_startup value from the store let run_app_on_startup = store .get("run_app_on_startup") diff --git a/src-tauri/src/utils/setup.rs b/src-tauri/src/utils/setup.rs index bade1e7..12a51b5 100644 --- a/src-tauri/src/utils/setup.rs +++ b/src-tauri/src/utils/setup.rs @@ -51,6 +51,14 @@ pub fn setup_app_state(app_handle: AppHandle, store: Store) -> Result Result<()> { + let nodes_dir = get_nodes_dir(app_handle); + if !nodes_dir.exists() { + fs::create_dir_all(nodes_dir).map_err(|e| eyre!("Failed to create nodes directory: {}", e))?; + } + Ok(()) +} + // Run start_nodes_on_startup pub fn run_nodes_on_startup(state: &State<'_, AppState>) -> Result<(), Box> { let app_handle_clone = state.app_handle.clone(); From 8c11667fae5ce47248007a0f23f5bd6c5ddaec99 Mon Sep 17 00:00:00 2001 From: alenmestrov Date: Sun, 27 Oct 2024 07:52:40 +0100 Subject: [PATCH 6/9] fix: added options for --target flag --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 54b2c65..4cad9e0 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,12 @@ This is a [Tauri](https://tauri.app/) desktop application created using Node.js - In development mode, the Calimero node binary is stored in the `src-tauri/bin` folder. - Depending on the `--target` flag during the build or the user's operating system, the app automatically downloads the Calimero node binary directly from the github release page. + The following `--target` flags are supported for different architectures: + - `--target aarch64-apple-darwin`: For ARM-based macOS (M1 and above) + - `--target x86_64-apple-darwin`: For Intel-based macOS + - `--target x86_64-unknown-linux-gnu`: For x86_64 Linux systems + - `--target aarch64-unknown-linux-gnu`: For ARM-based Linux systems + ## Build To create a production build of the application, run: From d8a5e24577a543df51c048a71109c96837d094c3 Mon Sep 17 00:00:00 2001 From: alenmestrov Date: Sun, 27 Oct 2024 08:44:39 +0100 Subject: [PATCH 7/9] feat: additional explanation of pnpm run tauri build command --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 4cad9e0..541420e 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,10 @@ To create a production build of the application, run: pnpm run tauri build ``` +- The build process automatically downloads the Calimero node binary directly from the github release page based on the target architecture, if target architecture is not explicitly specified, Tauri will use the host architecture. - In production mode, the Calimero node binary is stored in the `resources` folder. +- The build process will fail if the target architecture is not supported by the Calimero node binary release page. +- After building process is complete, the Calimero node binary will be stored in the `src-tauri/target` folder, exact path will be displayed in the terminal after build process is complete. ## Features From aa5004bfc597a8332867dd8f9977f2d6fae3c51d Mon Sep 17 00:00:00 2001 From: alenmestrov Date: Sun, 27 Oct 2024 08:45:16 +0100 Subject: [PATCH 8/9] fix: increased size of default application window --- src-tauri/tauri.conf.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index e86f31d..82eefc1 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -37,8 +37,8 @@ "windows": [ { "title": "Calimero Node Manager", - "width": 800, - "height": 600 + "width": 1200, + "height": 800 } ], "security": { From aed5d3fb4679f12fe1b57975b5cfb2532ad019ad Mon Sep 17 00:00:00 2001 From: alenmestrov Date: Sun, 27 Oct 2024 08:49:11 +0100 Subject: [PATCH 9/9] feat: added better placeholders for node init form inputs --- src/components/node/nodeInitPopup/index.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/node/nodeInitPopup/index.tsx b/src/components/node/nodeInitPopup/index.tsx index b6f4740..e8b1734 100644 --- a/src/components/node/nodeInitPopup/index.tsx +++ b/src/components/node/nodeInitPopup/index.tsx @@ -62,11 +62,11 @@ const NodeInitializationPopup: React.FC = ({...pro

Initialize Node

= ({...pro type="number" value={serverPort} onChange={(e) => setServerPort(e.target.value)} - placeholder="Enter server port" + placeholder="e.g. 2428" + min="1024" + max="65535" required /> = ({...pro type="number" value={swarmPort} onChange={(e) => setSwarmPort(e.target.value)} - placeholder="Enter swarm port" + placeholder="e.g.2528" + min="1024" + max="65535" required />