Skip to content

Commit

Permalink
Merge pull request #27 from oceanprotocol/alex_play_p2p_direct
Browse files Browse the repository at this point in the history
Nodes POC
  • Loading branch information
alexcos20 authored Oct 12, 2023
2 parents ce69c9e + 30b99df commit 9940f42
Show file tree
Hide file tree
Showing 28 changed files with 42,170 additions and 1 deletion.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.20.2
48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,47 @@
# ocean-node
# ocean-node


WIP, may not compile.


## 1. Make sure to use nvm
```bash
nvm use
```

## 2. Install deps
```bash
npm i
```

## 3. Build
```bash
npm run build
```

## 4. Open terminal 1 and run a node
```bash
npm run start
```

## 4. Open a 2nd terminal and run another node
```bash
export PORT=8000
npm run start
```

Now, you should see the nodes discovery/connecting/disconnecting

Load postman collection from docs and play




## Structure:
- Everything hovers around components:
- database: will have connection to typesense/es and will implement basic operations. This is used by all other components
- indexer: upcoming indexer feature
- provider: will have core provider functionality
- httpRoutes: exposes http endpoints
- P2P: has P2P functionality. will have to extend handleBroadcasts and handleProtocolCommands, rest is pretty much done

105 changes: 105 additions & 0 deletions docs/Ocean Node.postman_collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"info": {
"_postman_id": "ff8f2614-8d77-40e4-9031-9ca2ed9f7973",
"name": "Ocean Node",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "8000 - getP2pPeers",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "8001 - getP2pPeers",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "8000 - getOceanPeers",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "8001 - getOceanPeers",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "8000 - advertiseDid",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "8001 - advertiseDid",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "8000 - getProvidersForDid",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "8001 - getProvidersForDid",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "8000 - broadcastCommand",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "8001 - broadcastCommand",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "8000 - directCommand",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "8001 - directCommand",
"request": {
"method": "GET",
"header": []
},
"response": []
}
]
}
Loading

0 comments on commit 9940f42

Please sign in to comment.