Skip to content

Commit

Permalink
Merge pull request #640 from oceanprotocol/fix/quickstart
Browse files Browse the repository at this point in the history
Update quickstart script
  • Loading branch information
mihaisc authored Aug 22, 2024
2 parents bb00a17 + 5ff643f commit e0d2e0c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 61 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ We recommend the following minimum requirements, although you may be be able to

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

[This readme](deployment/Readme.md) is the recommended way to host a node and be eligible for incentives.
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:

```bash
Expand All @@ -25,7 +30,7 @@ docker build -t ocean-node:mybuild . # Build the Docker image
docker run -e PRIVATE_KEY=0x_your_private_key_here ocean-node:mybuild # Start container
```

## Option 2: Running Ocean Nodes with PM2
## Option 3: 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 @@ -80,7 +85,7 @@ npm run build # Build the Project

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

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

```bash
./src/helpers/scripts/setupNodeEnv.sh
Expand All @@ -97,7 +102,7 @@ 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.

### 5. Start the Node
### 4. Start the Node

```bash
npm run start
Expand Down
64 changes: 32 additions & 32 deletions deployment/ocean-node-quickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,46 +141,46 @@ services:
DB_URL: 'http://typesense:8108/?apiKey=xyz'
IPFS_GATEWAY: 'https://ipfs.io/'
ARWEAVE_GATEWAY: 'https://arweave.net/'
LOAD_INITIAL_DDOS: ''
FEE_TOKENS: ''
FEE_AMOUNT: ''
ADDRESS_FILE: ''
NODE_ENV: ''
AUTHORIZED_DECRYPTERS: ''
OPERATOR_SERVICE_URL: ''
INTERFACES: ''
ALLOWED_VALIDATORS: ''
INDEXER_NETWORKS: '[]'
# LOAD_INITIAL_DDOS: ''
# FEE_TOKENS: ''
# FEE_AMOUNT: ''
# ADDRESS_FILE: ''
# NODE_ENV: ''
# AUTHORIZED_DECRYPTERS: ''
# OPERATOR_SERVICE_URL: ''
INTERFACES: '["HTTP","P2P"]'
# ALLOWED_VALIDATORS: ''
# INDEXER_NETWORKS: '[]'
ALLOWED_ADMINS: '["$ALLOWED_ADMINS"]'
INDEXER_INTERVAL: ''
# INDEXER_INTERVAL: ''
DASHBOARD: 'true'
RATE_DENY_LIST: ''
MAX_REQ_PER_SECOND: ''
MAX_CHECKSUM_LENGTH: ''
LOG_LEVEL: ''
# RATE_DENY_LIST: ''
# MAX_REQ_PER_SECOND: ''
# MAX_CHECKSUM_LENGTH: ''
# LOG_LEVEL: ''
HTTP_API_PORT: '$HTTP_API_PORT'
P2P_ENABLE_IPV4: ''
P2P_ENABLE_IPV6: ''
P2P_ipV4BindAddress: ''
P2P_ENABLE_IPV4: 'true'
P2P_ENABLE_IPV6: 'false'
P2P_ipV4BindAddress: '0.0.0.0'
P2P_ipV4BindTcpPort: '$P2P_ipV4BindTcpPort'
P2P_ipV4BindWsPort: '$P2P_ipV4BindWsPort'
P2P_ipV6BindAddress: ''
P2P_ipV6BindAddress: '::'
P2P_ipV6BindTcpPort: '$P2P_ipV6BindTcpPort'
P2P_ipV6BindWsPort: '$P2P_ipV6BindWsPort'
P2P_ANNOUNCE_ADDRESSES: '$P2P_ANNOUNCE_ADDRESSES'
P2P_ANNOUNCE_PRIVATE: ''
P2P_pubsubPeerDiscoveryInterval: ''
P2P_dhtMaxInboundStreams: ''
P2P_dhtMaxOutboundStreams: ''
P2P_mDNSInterval: ''
P2P_connectionsMaxParallelDials: ''
P2P_connectionsDialTimeout: ''
P2P_ENABLE_UPNP: ''
P2P_ENABLE_AUTONAT: ''
P2P_ENABLE_CIRCUIT_RELAY_SERVER: ''
P2P_ENABLE_CIRCUIT_RELAY_CLIENT: ''
P2P_BOOTSTRAP_NODES: ''
P2P_FILTER_ANNOUNCED_ADDRESSES: ''
# P2P_ANNOUNCE_PRIVATE: ''
# P2P_pubsubPeerDiscoveryInterval: ''
# P2P_dhtMaxInboundStreams: ''
# P2P_dhtMaxOutboundStreams: ''
# P2P_mDNSInterval: ''
# P2P_connectionsMaxParallelDials: ''
# P2P_connectionsDialTimeout: ''
# P2P_ENABLE_UPNP: ''
# P2P_ENABLE_AUTONAT: ''
# P2P_ENABLE_CIRCUIT_RELAY_SERVER: ''
# P2P_ENABLE_CIRCUIT_RELAY_CLIENT: ''
# P2P_BOOTSTRAP_NODES: ''
# P2P_FILTER_ANNOUNCED_ADDRESSES: ''
networks:
- ocean_network
depends_on:
Expand Down
31 changes: 5 additions & 26 deletions src/helpers/scripts/setupNodeEnv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,6 @@ setup_node_admin_wallet() {
fi
}

ask_for_same_admin_wallet() {

wallet_file_path=$wallet_file
if [ -f $wallet_file_path ]; then
read -p "Do you want to use the wallet associated with this key ( $wallet_file ) as a node admin account? [ y/n ]: " use_admin_wallet
use_admin_wallet=${use_admin_wallet:-y}
if [ "$use_admin_wallet" == 'y' ]; then
ADMIN_WALLET=`cat $wallet_file_path`
setup_node_admin_wallet
fi
fi
}

#check if the private key file exists
if ! [ -f $pk_file_path ]; then
echo "Private Key File does not exist."
Expand Down Expand Up @@ -224,20 +211,12 @@ if [ $exists_env_file -eq 0 ]; then
#configure the pk key on the .env file
setup_private_key
#Use wallet address from file? only if we just created it
if [ $created_pk_file -eq 1 ]; then
ask_for_same_admin_wallet
else
#we entered a pk ourselves
read -p "Do you want setup the wallet associated with this key, as a node admin account? [ y/n ]: " set_admin_wallet
set_admin_wallet=${set_admin_wallet:-y}
if [ "$set_admin_wallet" == 'y' ]; then
read -p "Enter your admin wallet address: " ADMIN_WALLET
check_wallet $ADMIN_WALLET
setup_node_admin_wallet
fi
fi
read -p "Enter your admin wallet address: " ADMIN_WALLET
check_wallet $ADMIN_WALLET
setup_node_admin_wallet

fi
else
else ``
echo "Creating .env file aborted!"
created_env_file=0
exit 1
Expand Down

0 comments on commit e0d2e0c

Please sign in to comment.