Skip to content

Commit

Permalink
made a few changes
Browse files Browse the repository at this point in the history
  • Loading branch information
EthWiz committed Oct 10, 2024
1 parent c4afd93 commit 98a41e0
Show file tree
Hide file tree
Showing 6 changed files with 309 additions and 3,037 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.next
node_modules
.DS_Store
.DS_Store
package-lock.json
11 changes: 7 additions & 4 deletions pages/_meta.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,20 @@
"pagination": false
}
},

"madara-overview": {
"title": "Overview"
},
"get-started": {
"title": "Get started"
},
"--- NODE OPERATORS": {
"title": "NODE OPERATORS",
"type": "separator"
},
"introduction": {
"title": "Overview"
},
"get-started": {
"title": "Get started"
},

"fundamentals": {
"title": "Fundamentals"
},
Expand Down
204 changes: 181 additions & 23 deletions pages/get-started/install.en.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,191 @@ In this section, we will guide you through the build and run process so that you

We want anyone to be able to launch a Madara full node, which is why we've divided this section into 3 difficulty levels:

- [**Low-level**](#low-level-installation-from-source) (from source directly building the rust binary locally)
- [**Mid-level**](#mid-level-installation) (from Docker **recommend** via the available docker images)
- [**High-level**](#high-level-installation-click-n-play) (from an high-level interactive menu)
- [**Mid-level**](#mid-level-installation) (from Docker **recommend** via the available docker images)
- [**Low-level**](#low-level-installation-from-source) (from source directly building the rust binary locally)

{/* prettier-ignore */}
<Tabs items={['Low-level', 'Mid-level', 'High-level']}>
<Tab>
<Tabs items={['High-level', 'Mid-level', 'Low-level']}>

<Tab>
This is the highest level way to install Madara with some custom features. For advanced configuration we recommend you to use the source or docker methods.

<Steps>
### Download script

You will need to download and run the installer script using the following command:

```bash
curl -sL https://raw.githubusercontent.com/madara-alliance/madara/refs/heads/main/scripts/launcher -o launcher && chmod +x launcher && ./launcher
```

### Follow instructions

video-goes-here

</Steps>

</Tab>
<Tab>
This is the recommend way to easily install and run Madara as it only requires a terminal access and Docker installed.

<Steps>

### Install Docker

{/* prettier-ignore */}

<Tabs items={["MacOS", "Linux", "Windows"]}>
<Tab>
**MacOS**: To install Docker on MacOS, follow these steps: 1. Visit the
[Docker
Hub](https://hub.docker.com/editions/community/docker-ce-desktop-mac/) and
download Docker Desktop for Mac. 2. Open the downloaded `.dmg` file and drag
the Docker icon to your Applications folder to begin the installation. 3.
Once installed, launch Docker from your Applications folder. Docker will
request your admin password to complete the setup. 4. After installation,
you can open a terminal and run `docker --version` to verify that Docker has
been installed successfully.
</Tab>
<Tab>
**Linux**: Docker installation on Linux varies by distribution, but here are
the general steps: 1. Update your package manager index by running `sudo
apt-get update` (This command is for distributions using `apt` like Ubuntu
or Debian). 2. Install prerequisite packages which allow `apt` to use
packages over HTTPS: `sudo apt-get install apt-transport-https
ca-certificates curl software-properties-common`. 3. Add Docker's official
GPG key: `curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo
apt-key add -`. 4. Verify that you now have the key with the fingerprint by
searching for the last 8 characters of the fingerprint. 5. Set up the Docker
repository by running `sudo add-apt-repository "deb [arch=amd64]
https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"`. 6.
Update the `apt` package index again: `sudo apt-get update`. 7. Install
Docker: `sudo apt-get install docker-ce`. 8. To verify Docker is installed
correctly, run `docker run hello-world`. Note: The above commands are
tailored for Ubuntu. Please adjust for your particular Linux distribution.
</Tab>
<Tab>
**Windows**: To install Docker on Windows, ensure you meet the following
requirements: - Windows 10 64-bit: Pro, Enterprise, or Education (Build
15063 or later). - Hyper-V and Containers Windows features must be enabled.
Here are the steps: 1. Visit the [Docker
Hub](https://hub.docker.com/editions/community/docker-ce-desktop-windows/)
to download Docker Desktop for Windows. 2. Run the downloaded Docker Desktop
installer. 3. Follow the installation instructions. You might be prompted to
logout and log back in, or reboot your computer before you can use Docker.
4. After installation, run Docker by searching for it in the Start menu and
selecting Docker Desktop. 5. To verify Docker has been installed, open a
command prompt and enter `docker --version`. Note: If your system does not
support Hyper-V or if you are running Windows 10 Home, you may need to
install Docker Toolbox instead.
</Tab>
</Tabs>

### Run docker image

Once you have successfully installed Docker, you can now run Madara using the images available here: [Madara-v0.1.0-nightly](https://link).
You can replace the `--rpc-port`, `--base-path` with your desired parameters.

<Callout type="info" emoji="ℹ️">
This is a default configuration. For more information on possible
configurations, please visit the
[Configuration](../fundamentals/configuration) section.
</Callout>

<Callout type="warning" emoji="⚠️">
Make sure to change the volume `-v` of your container if you change the
`--base-path`.
</Callout>

```bash
docker run -d \
--name Madara
-p 9944:9944 \
-v /var/lib/madara:/var/lib/madara \
madara:latest \
--base-path /var/lib/Madara \
--network main \
--l1-endpoint ${ETHEREUM_API_URL}
```

<Callout type="info" emoji="ℹ️">
If you don't have an L1 endpoint url we recommend you to head up to the
[Verification](/) section to get one
</Callout>

### Check logs

```bash
docker logs -f madara
```

<Callout type="info" emoji="ℹ️">
Now you can head up to the [Metrics](/) section to easily deploy a Grafana and
Prometheus dashboard
</Callout>

</Steps>

## Using Docker Compose

<Steps>

### Prerequisites

Ensure you have Docker and Docker Compose installed on your machine. You can follow the installation instructions for Docker in the previous section.

### Prepare the Environment

Ensure you have the necessary environment variable `ETHEREUM_API_URL` set. You can set this in your shell or in a `.env` file in the same directory as your `docker-compose.yml` file:

```bash
export ETHEREUM_API_URL="your-ethereum-api-url"
```

Or create a `.env` file:

```
ETHEREUM_API_URL=your-ethereum-api-url
```

<Callout type="warning" emoji="⚠️">
When running with `sudo`, environment variables set in the current session might not be carried over. You can pass the variable directly to sudo using the `-E` option to preserve the environment:
</Callout>

<Callout type="info" emoji="ℹ️">
If you don't have an L1 endpoint url we recommend you to head up to the
[Verification](/) section to get one
</Callout>

### Build and Run the Container

Navigate to the cloned Madara repository containing your `docker-compose.yml` file and run the following command to build and start the Madara client:

```bash
docker-compose up -d
```

This command will build the Docker image and start the container in detached mode.

### Check Logs

You can view the logs of the running Madara service using the following command:

```bash
docker-compose logs -f Madara
```

{" "}

<Callout type="info" emoji="ℹ️">
Now you can head up to the [Metrics](/) section to easily deploy a Grafana and
Prometheus dashboard
</Callout>

</Steps>
</Tab>
<Tab>
This installation process will help you build the binary directly from the source code locally on your machine.
<Steps>
### Install dependencies
Expand Down Expand Up @@ -88,25 +265,6 @@ We want anyone to be able to launch a Madara full node, which is why we've divid
--l1-endpoint ${ETHEREUM_API_URL}
```
</Tab>
<Tab>
```bash
cargo run --release -- \
--name Madara \
--sequencer
--base-path /var/lib/madara \
--preset test \
--l1-endpoint ${ETHEREUM_API_URL}
```
</Tab>
<Tab>
```bash
cargo run --release -- \
--name Madara \
--devnet
--base-path /var/lib/madara \
--preset test
```
</Tab>
</Tabs>

<Callout type="info" emoji="ℹ️">
Expand Down
Loading

0 comments on commit 98a41e0

Please sign in to comment.