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

Nodes POC #27

Merged
merged 6 commits into from
Oct 12, 2023
Merged
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
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