Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating README.md to show new docker setup flow & Fixing the PM2 setup instructions #635

Merged
merged 11 commits into from
Aug 27, 2024
30 changes: 24 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ The other options are more recommended towards deleveopers that want to tinker.

## Option 2: Running local build of Ocean Nodes in Docker

Build and run the node using Docker:
Run the following script to deploy node:

```bash
docker build -t ocean-node:mybuild . # Build the Docker image
# Make sure you include 0x at the start of the private key
docker run -e PRIVATE_KEY=0x_your_private_key_here ocean-node:mybuild # Start container
scripts/ocean-node-quickstart.sh
# OR
npm run quickstart
```
This command will run you through the process of setting up the environmental variables for your node.

## Option 3: Running Ocean Nodes with PM2

Expand All @@ -40,13 +41,29 @@ PM2 is a process manager that makes it easy to manage and monitor your Node.js a
npm install -g pm2
```

2. Start the Ocean Node with PM2
2. Setup the environmental variables

Either use the script:

```
npm run envSetup
```

or setup the required environment variables manually:

```bash
export PRIVATE_KEY="0x_your_private_key_here"
```

The `PRIVATE_KEY` is the only mandatory environmental variable, you must include the `0x` at the front of your private key. Additional configurations can be set as needed. For all available configurations, refer to the [Environment Variables](docs/env.md) documentation.

3. Quick start the Ocean Node with PM2

```bash
pm2 start npm --name "ocean-node" -- run start
```

3. Monitor and Manage the Node
4. Monitor and Manage the Node

You can use the following PM2 commands to manage your Ocean Node:

Expand Down Expand Up @@ -119,3 +136,4 @@ Your node is now running, the dashboard will be available at `http://localhost:8
- [Network Configuration](docs/networking.md)
- [Logging & accessing logs](docs/networking.md)
- [Dashboard: Local development](dashboard/README.md)
- [Docker Deployment Guide](docs/dockerDeployment.md)
4 changes: 3 additions & 1 deletion deployment/README.md → docs/dockerDeployment.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Docker Deployment Guide

This guide is intended to provide quick steps for starting an **Ocean Node** using Docker Engine and Docker Compose plugin.

Note: For installing each of these prerequisites, a good starting point is the official documentation: [Install Docker Engine](https://docs.docker.com/engine/install/) and [Overview of installing Docker Compose](https://docs.docker.com/compose/install/)
Expand All @@ -9,7 +11,7 @@ a) download the script `ocean-node-quickstart.sh` from the current directory
b) run the script

```shell
bash ocean-node-quickstart.sh
bash scripts/ocean-node-quickstart.sh
```

c) provide the necessary information interactively (example)
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"build": "npm run clean && npm run check-changes && npm run build:tsc",
"build:no-dashboard": "npm run clean && npm run build:tsc",
"build:tsc": "tsc --sourceMap",
"quickstart": "bash scripts/ocean-node-quickstart.sh",
"setupEnv": "bash -c './src/helpers/scripts/setupNodeEnv.sh && source .env'",
"build-tests:tsc": "tsc --sourceMap --sourceRoot ./src/test && cp ./src/test/.env.test ./dist/test",
"build:dashboard": "cd dashboard && npm install --maxsockets 1 && NODE_ENV=production npx next build",
"check-changes": "node scripts/dashboardChanges.js",
Expand Down
2 changes: 1 addition & 1 deletion scripts/dashboard.hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c870a78421b1c4c5c9870fa7bec7947f64cb8574f166211814487c34be6cce34
c870a78421b1c4c5c9870fa7bec7947f64cb8574f166211814487c34be6cce34
Loading