Skip to content

Commit

Permalink
Merge pull request #621 from oceanprotocol/readme-requirements-update
Browse files Browse the repository at this point in the history
Adding system minimum requirements
  • Loading branch information
jamiehewitt15 authored Aug 16, 2024
2 parents a568d65 + fb92c43 commit 21a098d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 47 deletions.
83 changes: 38 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,26 @@ This is a minimal guide to quickly start and run an Ocean Node. See the [docs](/

**Note: this repository is currently excluded from all bug bounty programs.**

## Running Ocean Nodes in Docker (recommended)
## System requirements

Build and run the node using Docker:
We recommend the following minimum requirements, although you may be be able to run a node with less (depending on your configuration).

- 1vcpu
- 2 GB ram
- 4 GB storage
- OS: we recommend using the latest LTS version of Ubuntu or the latest iOS. However, the nodes should also work on other operating systems including Windows.

## Option 1: Running Ocean Nodes in Docker (recommended)

1. **Build the Docker image:**
`docker build -t ocean-node:mybuild .`
Build and run the node using Docker:

2. **Run the Docker container:**
`docker run -e PRIVATE_KEY=your_private_key_here ocean-node:mybuild`
```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
```

## Running Ocean Nodes with PM2
## Option 2: Running Ocean Nodes with PM2

PM2 is a process manager that makes it easy to manage and monitor your Node.js applications.

Expand Down Expand Up @@ -44,38 +53,32 @@ pm2 stop ocean-node # Stop the node
pm2 delete ocean-node # Delete the process
```

## Running Ocean Nodes With NPM
## Option 3: Running Ocean Nodes With NPM

### Prerequisites

- **Node Version:** Install the node version specified in `.nvmrc`.
- **Docker**
- **Docker compose**
- **nvm** (recommended but not necessary)

### 1. Set Up Environment
### 1. Start the Typesense database

1. **Use the correct Node.js version:**
`nvm use`

2. **Install dependencies:**
`npm install`

### 2. Build the Project

`npm run build`

### 3. Start Required Services
```bash
docker-compose -f typesense-compose.yml up -d
```

In a separate terminal, clone and start the necessary services using Barge:
### 2. Install dependencies & build the project

```bash
git clone https://github.com/oceanprotocol/barge.git
cd barge
git checkout feature/nodes
./start_ocean.sh -with-c2d
nvm use # Use the correct Node.js version
npm install # Install dependencies
npm run build # Build the Project
```

### 4. Configure Environment Variables
### 3. Configure Environment Variables

**Option 1: Automatic Setup (Recommended)**
#### Option 1: Automatic Setup (Recommended)

Run the helper script to generate and set up the recommended environment variables:

Expand All @@ -84,34 +87,24 @@ Run the helper script to generate and set up the recommended environment variabl
source .env
```

**Option 2: Manual Setup**
#### Option 2: Manual Setup

Manually set the required environment variables:

`export PRIVATE_KEY="your_private_key_here"`

The `PRIVATE_KEY` is the only mandatory environmental variable. Additional configurations can be set as needed.
```bash
export PRIVATE_KEY="0x_your_private_key_here"
```

For all available configurations, refer to the [Environment Variables](docs/env.md) documentation.
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.

### 5. Start the Node

`npm run start`
```bash
npm run start
```

Your node is now running, the dashboard will be available at `http://localhost:8000/dashboard/`. To start additional nodes, repeat these steps in a new terminal.

## Testing

Run unit and integration tests to ensure everything is set up correctly:

- **Unit Tests:**
`npm run test:unit`

- **Integration Tests:**
`npm run test:integration`

For advanced testing scenarios, refer to the [Testing Guide](docs/testing.md).

## Additional Resources

- [Ocean Nodes Architecture](docs/Arhitecture.md)
Expand Down
14 changes: 12 additions & 2 deletions docs/testing.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
# Tests

### Unit tests
## Unit tests

```bash
npm run test:unit
```

## Integration tests

To run the integration tests, you should start barge locally. In a separate terminal, clone and start the necessary services using Barge:

````bash
git clone https://github.com/oceanprotocol/barge.git
cd barge
git checkout feature/nodes
./start_ocean.sh -with-c2d
'''
Now, back in your nodes terminal, you can run the tests
```bash
npm run test:integration
```
````
If you started barge without c2d components you can run a lighter version of integration tests that do not run the compute to data tests.
Expand Down

0 comments on commit 21a098d

Please sign in to comment.