Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ jobs:
run: |
npm ci
npm run build
npm run start &
npm run start > ocean-node.log 2>&1 &
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
IPFS_GATEWAY: http://172.15.0.16:8080/
Expand Down Expand Up @@ -287,6 +287,21 @@ jobs:
run: npm run test:system
env:
AVOID_LOOP_RUN: true
- name: Show Ocean Node logs on failure
if: failure()
working-directory: ${{ github.workspace }}/ocean-node
run: |
echo "=== Ocean Node Logs ==="
if [ -f ocean-node.log ]; then
cat ocean-node.log
else
echo "No ocean-node.log file found"
fi
echo "=== Docker Logs ==="
docker logs ocean-contracts-1 || echo "No ocean-contracts-1 container"
docker logs ocean-typesense-1 || echo "No ocean-typesense-1 container"
echo "=== System Processes ==="
ps aux | grep -E "(node|ocean)" || echo "No node/ocean processes found"

control_panel_build:
runs-on: ubuntu-latest
Expand Down
148 changes: 148 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
{
"authorizedDecrypters": [],
"authorizedDecryptersList": [],
"allowedValidators": [],
"allowedValidatorsList": [],
"authorizedPublishers": [],
"authorizedPublishersList": [],
"keys": {},
"hasIndexer": true,
"hasHttp": true,
"hasP2P": true,
"p2pConfig": {
"bootstrapNodes": [],
"bootstrapTimeout": 20000,
"bootstrapTagName": "bootstrap",
"bootstrapTagValue": 50,
"bootstrapTTL": 0,
"enableIPV4": true,
"enableIPV6": true,
"ipV4BindAddress": "0.0.0.0",
"ipV4BindTcpPort": 9000,
"ipV4BindWsPort": 0,
"ipV6BindAddress": "::1",
"ipV6BindTcpPort": 0,
"ipV6BindWsPort": 0,
"announceAddresses": [],
"pubsubPeerDiscoveryInterval": 10000,
"dhtMaxInboundStreams": 500,
"dhtMaxOutboundStreams": 500,
"dhtFilter": null,
"mDNSInterval": 20000,
"connectionsMaxParallelDials": 15,
"connectionsDialTimeout": 30000,
"upnp": true,
"autoNat": true,
"enableCircuitRelayServer": false,
"enableCircuitRelayClient": false,
"circuitRelays": 0,
"announcePrivateIp": false,
"filterAnnouncedAddresses": [
"127.0.0.0/8",
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16",
"100.64.0.0/10",
"169.254.0.0/16",
"192.0.0.0/24",
"192.0.2.0/24",
"198.51.100.0/24",
"203.0.113.0/24",
"224.0.0.0/4",
"240.0.0.0/4"
],
"minConnections": 1,
"maxConnections": 300,
"autoDialPeerRetryThreshold": 7200000,
"autoDialConcurrency": 5,
"maxPeerAddrsToDial": 5,
"autoDialInterval": 5000,
"enableNetworkStats": false
},
"hasControlPanel": true,
"httpPort": 8001,
"dbConfig": {
"url": "http://localhost:8108/?apiKey=xyz",
"username": "",
"password": "",
"dbType": "typesense"
},
"supportedNetworks": {
"8996": {
"rpc": "http://127.0.0.1:8545",
"chainId": 8996,
"network": "development",
"chunkSize": 100
}
},
"feeStrategy": {},
"c2dClusters": [],
"ipfsGateway": "https://ipfs.io/",
"arweaveGateway": "https://arweave.net/",
"accountPurgatoryUrl": null,
"assetPurgatoryUrl": null,
"allowedAdmins": [],
"allowedAdminsList": [],
"rateLimit": 30,
"maxConnections": 30,
"denyList": {
"peers": [],
"ips": []
},
"unsafeURLs": [],
"isBootstrap": false,
"claimDurationTimeout": 600,
"validateUnsignedDDO": true,
"jwtSecret": "ocean-node-secret",
"dockerComputeEnvironments": [
{
"socketPath": "/var/run/docker.sock",
"resources": [
{
"id": "disk",
"total": 1
}
],
"storageExpiry": 604800,
"maxJobDuration": 3600,
"access": {
"addresses": [],
"accessLists": []
},
"fees": {
"8996": [
{
"prices": [
{
"id": "cpu",
"price": 1
}
]
}
]
},
"free": {
"maxJobDuration": 3600,
"maxJobs": 3,
"access": {
"addresses": [],
"accessLists": []
},
"resources": [
{
"id": "cpu",
"max": 1
},
{
"id": "ram",
"max": 1
},
{
"id": "disk",
"max": 1
}
]
}
}
]
}
85 changes: 85 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,91 @@ Forwards request to PolicyServer (if any)
}
```

---

## Fetch Config

### `HTTP` GET /api/admin/config

#### Description

returns current node configuration with sensitive data hidden (admin only)

#### Parameters

| name | type | required | description |
| --------------- | ------ | -------- | -------------------------------------------- |
| expiryTimestamp | number | v | expiry timestamp for the request |
| signature | string | v | signed message to authenticate admin request |

#### Request

```json
{
"expiryTimestamp": 1234567890,
"signature": "0x123"
}
```

#### Response

```json
{
"keys": {
"privateKey": "[*** HIDDEN CONTENT ***]"
},
"chainIds": [1],
"rpcs": { "1": "https://eth-mainnet.g.alchemy.com/v2/..." },
"...": "..."
}
```

---

## Update Config

### `HTTP` POST /api/admin/config/update

#### Description

updates node configuration and reloads it gracefully (admin only)

#### Parameters

| name | type | required | description |
| --------------- | ------ | -------- | -------------------------------------------------- |
| expiryTimestamp | number | v | expiry timestamp for the request |
| signature | string | v | signed message to authenticate admin request |
| config | object | v | partial configuration object with fields to update |

#### Request

```json
{
"expiryTimestamp": 1234567890,
"signature": "0x123",
"config": {
"chainIds": [1],
"rpcs": { "1": "https://eth-mainnet.g.alchemy.com/v2/..." }
}
}
```

#### Response

```json
{
"keys": {
"privateKey": "[*** HIDDEN CONTENT ***]"
},
"chainIds": [1],
"rpcs": { "1": "https://eth-mainnet.g.alchemy.com/v2/..." },
"...": "..."
}
```

---

# Compute

For starters, you can find a list of algorithms in the [Ocean Algorithms repository](https://github.com/oceanprotocol/algo_dockers) and the docker images in the [Algo Dockerhub](https://hub.docker.com/r/oceanprotocol/algo_dockers/tags).
Expand Down
14 changes: 14 additions & 0 deletions docs/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ The `DOCKER_COMPUTE_ENVIRONMENTS` environment variable should be a JSON array of
],
"storageExpiry": 604800,
"maxJobDuration": 3600,
"access": {
"addresses": ["0x123", "0x456"],
"accessLists": []
},
"fees": {
"1": [
{
Expand All @@ -154,6 +158,10 @@ The `DOCKER_COMPUTE_ENVIRONMENTS` environment variable should be a JSON array of
"free": {
"maxJobDuration": 60,
"maxJobs": 3,
"access": {
"addresses": [],
"accessLists": ["0x789"]
},
"resources": [
{
"id": "cpu",
Expand All @@ -178,6 +186,9 @@ The `DOCKER_COMPUTE_ENVIRONMENTS` environment variable should be a JSON array of
- **socketPath**: Path to the Docker socket (e.g., docker.sock).
- **storageExpiry**: Amount of seconds for storage expiry.(Mandatory)
- **maxJobDuration**: Maximum duration in seconds for a job.(Mandatory)
- **access**: Access control configuration for paid compute jobs. If both `addresses` and `accessLists` are empty, all addresses are allowed.
- **addresses**: Array of Ethereum addresses allowed to run compute jobs. If empty and no access lists are configured, all addresses are allowed.
- **accessLists**: Array of AccessList contract addresses. Users holding NFTs from these contracts can run compute jobs. Checked across all supported networks.
- **fees**: Fee structure for the compute environment.
- **feeToken**: Token address for the fee.
- **prices**: Array of resource pricing information.
Expand All @@ -192,6 +203,9 @@ The `DOCKER_COMPUTE_ENVIRONMENTS` environment variable should be a JSON array of
- **storageExpiry**: Amount of seconds for storage expiry for free jobs.
- **maxJobDuration**: Maximum duration in seconds for a free job.
- **maxJobs**: Maximum number of simultaneous free jobs.
- **access**: Access control configuration for free compute jobs. Works the same as the main `access` field.
- **addresses**: Array of Ethereum addresses allowed to run free compute jobs.
- **accessLists**: Array of AccessList contract addresses for free compute access control.
- **resources**: Array of resources available for free jobs.
- **id**: Resource type (e.g., `cpu`, `ram`, `disk`).
- **total**: Total number of the resource available.
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@oceanprotocol/contracts": "^2.4.0",
"@oceanprotocol/ddo-js": "^0.1.4",
"@types/lodash.clonedeep": "^4.5.7",
"aws-sdk": "^2.1591.0",
"aws-sdk": "^2.1692.0",
"axios": "^1.12.0",
"base58-js": "^2.0.0",
"cors": "^2.8.5",
Expand Down
10 changes: 10 additions & 0 deletions src/@types/C2D/C2D.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,18 @@ export interface RunningPlatform {
os?: string
}

export interface ComputeAccessList {
addresses: string[]
accessLists: string[]
}

export interface ComputeEnvironmentFreeOptions {
// only if a compute env exposes free jobs
storageExpiry?: number
maxJobDuration?: number
maxJobs?: number // maximum number of simultaneous free jobs
resources?: ComputeResource[]
access: ComputeAccessList
}
export interface ComputeEnvironmentBaseConfig {
description?: string // v1
Expand All @@ -95,6 +101,7 @@ export interface ComputeEnvironmentBaseConfig {
maxJobs?: number // maximum number of simultaneous paid jobs
fees: ComputeEnvFeesStructure
resources?: ComputeResource[]
access: ComputeAccessList
free?: ComputeEnvironmentFreeOptions
platform: RunningPlatform
}
Expand Down Expand Up @@ -126,6 +133,7 @@ export interface C2DDockerConfig {
fees: ComputeEnvFeesStructure
resources?: ComputeResource[] // optional, owner can overwrite
free?: ComputeEnvironmentFreeOptions
access: ComputeAccessList
}

export type ComputeResultType =
Expand Down Expand Up @@ -221,6 +229,7 @@ export interface DBComputeJobPayment {
token: string
lockTx: string
claimTx: string
cost: number
}

// this is the internal structure
Expand All @@ -243,6 +252,7 @@ export interface DBComputeJob extends ComputeJob {
payment?: DBComputeJobPayment
metadata?: DBComputeJobMetadata
additionalViewers?: string[] // addresses of additional addresses that can get results
algoDuration: number // duration of the job in seconds
}

// make sure we keep them both in sync
Expand Down
Loading
Loading