Go to file
Ladd Hoffman e242df5c7a markdown table formatting 2024-12-24 14:02:21 -06:00
__tests__ fixup 2024-12-23 23:36:38 -06:00
markdown converted logging to use debug library. added markdown watch and reread 2024-12-24 13:41:31 -06:00
src added concept status info to README 2024-12-24 13:58:02 -06:00
.gitignore peers are able to sync 2024-12-22 09:13:44 -06:00
.nvmrc pretty neat 2024-12-21 21:16:18 -06:00
LICENSE Initial commit 2024-12-19 23:16:45 -06:00
README.md markdown table formatting 2024-12-24 14:02:21 -06:00
eslint.config.js keeping track of peers from whom deltas are received 2024-12-22 14:00:51 -06:00
package-lock.json added lossless view 2024-12-23 17:29:38 -06:00
package.json converted logging to use debug library. added markdown watch and reread 2024-12-24 13:41:31 -06:00
tsconfig.json pretty neat 2024-12-21 21:16:18 -06:00

README.md

Concepts

Implemented Notes
Peering Yes Currently using RHIZOME_SEED_PEERS, no gossip / discovery
Schemas Not really Currently very thin layer allowing TypedCollections
Relationships No Supporting relational algebra among domain entities
Views Yes Currently using functions rather than JSON-Logic expressions
Functions No Arbitrary subscribers to delta stream (that can also emit deltas?)
Tests Minimal So far we have a few ts-jest tests. Need a plan for multi-node tests.
Identity No Probably a public key / private key system
Contexts No Each context may involve different lossy functions and delta filters
HTTP API Yes Basic peering info and entity CRUD

Development / Demo

Setup

Install nvm

Clone repo

git clone https://gitea.dgov.io/ladd/rhizome

Use nvm to install and activate the target nodejs version

nvm install

Install nodejs packages

npm install

Build

Compile Typescript

npm run build

During development, it's useful to run the compiler in watch mode:

npm run build:watch

Run

To demonstrate the example application, you can open multiple terminals, and in each terminal execute something like the following:

export DEBUG="*,-express"
export RHIZOME_REQUEST_BIND_PORT=4000
export RHIZOME_PUBLISH_BIND_PORT=4001
export RHIZOME_SEED_PEERS='127.0.0.1:4002, 127.0.0.1:4004'
export RHIZOME_HTTP_API_PORT=3000
export RHIZOME_PEER_ID=peer1
npm run example-app
export DEBUG="*,-express"
export RHIZOME_REQUEST_BIND_PORT=4002
export RHIZOME_PUBLISH_BIND_PORT=4003
export RHIZOME_SEED_PEERS='127.0.0.1:4000, 127.0.0.1:4004'
export RHIZOME_HTTP_API_PORT=3001
export RHIZOME_PEER_ID=peer2
npm run example-app
export DEBUG="*,-express"
export RHIZOME_REQUEST_BIND_PORT=4004
export RHIZOME_PUBLISH_BIND_PORT=4005
export RHIZOME_SEED_PEERS='127.0.0.1:4000, 127.0.0.1:4002'
export RHIZOME_HTTP_API_PORT=3002
export RHIZOME_PEER_ID=peer3
npm run example-app

In a separate terminal, you can use curl to interact with an instance.

jq is helpful for formatting the json responses.

Query the number of peers seen by a given node (including itself)

curl -s  http://localhost:3000/peers/count | jq

Query the list of peers seen by a given node (including itself)

curl -s  http://localhost:3000/peers | jq

Query the number of deltas ingested by this node

curl -s  http://localhost:3000/deltas/count | jq

Query the list of deltas ingested by this node

curl -s  http://localhost:3000/deltas | jq