From 32569685bc844113791b78f362aa383f64170322 Mon Sep 17 00:00:00 2001 From: directcuteo <37619567+directcuteo@users.noreply.github.com> Date: Fri, 1 Mar 2024 11:15:37 +0200 Subject: [PATCH 1/2] Frontend Readme (#249) --- README.md | 73 +++++++++++++++++++--------------------------- frontend/README.md | 39 ++++++++++++------------- 2 files changed, 48 insertions(+), 64 deletions(-) diff --git a/README.md b/README.md index cbe254f56..d053ca6e8 100644 --- a/README.md +++ b/README.md @@ -74,61 +74,48 @@ cargo run --release -p cli node ## How to launch the UI: -### Prerequisites +## Prerequisites -The following tools are required to launch the UI: +### 1. Node.js v20.11.1 -- Node.js -- npm -- Angular CLI - -Here are the steps to install these tools: - -#### 1. Node.js - -Download and install [Node.js](https://nodejs.org/) for your OS, which includes Node Package Manager (npm). - -- After installing Node.js, verify your installation: - - ```bash - node -v - ``` - This command should print the version number of your Node.js installation. - -#### 2. npm -- Verify that you are running a version of npm that is at least 6.x.x or higher: +#### MacOS +```bash +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +brew install node@20.11.1 +``` - ```bash - npm -v - ``` - This command should print the version number of your npm installation. +#### Linux +```bash +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash +source ~/.bashrc +nvm install 20.11.1 +``` -#### 3. Angular CLI -- Install the Angular CLI globally: +#### Windows +Download [Node.js v20.11.1](https://nodejs.org/) from the official website, open the installer and follow the prompts to complete the installation. - ```bash - npm install -g @angular/cli - ``` - This command installs the Angular CLI globally on your system. -- Verify your Angular CLI installation: +### 2. Angular CLI v16.2.0 +```bash +npm install -g @angular/cli@16.2.0 +``` - ```bash - ng version - ``` - This command should print the version number of your Angular CLI installation. +### 3. Installation +Open a terminal and navigate to this project's root directory -### Steps (for any OS) +```bash +cd PROJECT_LOCATION/openmina/frontend +``` +Install the dependencies +```bash +npm install +``` -Open the command line, navigate to the openmina directory and then run +## Run the application -``` sh -cd frontend -npm install +```bash npm start ``` -Open your browser and navigate to [http://localhost:4200](http://localhost:4200). - ## Repository Structure - [core/](core) - Provides basic types needed to be shared across different diff --git a/frontend/README.md b/frontend/README.md index 8cc1446f3..70f0a9ac5 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -4,9 +4,7 @@ This is a simple Angular application that will help you to see the behaviour of ## Prerequisites -### 1. Node.js - -Install Node.js v20.11.1: +### 1. Node.js v20.11.1 #### MacOS ```bash @@ -24,25 +22,24 @@ nvm install 20.11.1 #### Windows Download [Node.js v20.11.1](https://nodejs.org/) from the official website, open the installer and follow the prompts to complete the installation. -### 2. Angular CLI -Install the Angular CLI v16.2.0 globally: - - ```bash - npm install -g @angular/cli@16.2.0 - ``` - -## Installation +### 2. Angular CLI v16.2.0 +```bash +npm install -g @angular/cli@16.2.0 +``` -1. Open a terminal and navigate to this project's root directory. -2. Install project dependencies: +### 3. Installation +Open a terminal and navigate to this project's root directory - ```bash - npm install - ``` -3. Run the application: +```bash +cd PROJECT_LOCATION/openmina/frontend +``` +Install the dependencies +```bash +npm install +``` - ```bash - npm start - ``` +## Run the application -Next time you want to run the application, just run `npm start` again. +```bash +npm start +``` From 02cf062c493ef58262a3d7eabbc16ab85ada2a10 Mon Sep 17 00:00:00 2001 From: Bruno Deferrari Date: Fri, 1 Mar 2024 08:28:55 -0300 Subject: [PATCH 2/2] docs(readme): Update setup and build instructions --- README.md | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d053ca6e8..05679ba63 100644 --- a/README.md +++ b/README.md @@ -51,24 +51,35 @@ This installation guide has been tested on Debian and Ubuntu and should work on **Pre-requisites:** -Ubuntu or Debian-based Linux distribution. +Ubuntu or Debian-based Linux distribution with the following packages installed: + +- `curl` +- `git` +- `libssl-dev` +- `pkg-config` + +Example: + +``` sh +# Either using "sudo" or as the "root" user +sudo apt install curl git libssl-dev pkg-config +``` **Steps (for Debian-based Linux distros):** Open up the command line and enter the following: +And then: -``` sh -apt install curl git - +```sh +# Install rustup and set the default Rust toolchain to 1.75 (newer versions work too) curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.75 - +# Setup the current shell with rustup source "$HOME/.cargo/env" - +# Clone the openmina repository git clone https://github.com/openmina/openmina.git - cd openmina/ - +# Build and run the node cargo run --release -p cli node ```