rhizome/README.md

94 lines
1.9 KiB
Markdown
Raw Normal View History

2024-12-22 17:30:41 -06:00
## Setup
2024-12-19 23:16:45 -06:00
Install [`nvm`](https://nvm.sh)
2024-12-22 17:30:41 -06:00
Clone repo
```bash
git clone https://gitea.dgov.io/ladd/rhizome
```
2024-12-22 17:30:41 -06:00
Use `nvm` to install and activate the target nodejs version
2024-12-22 17:30:41 -06:00
```bash
nvm install
```
Install nodejs packages
```bash
2024-12-22 17:30:41 -06:00
npm install
```
## Build
Compile Typescript
2024-12-22 17:30:41 -06:00
```bash
npm run build
```
2024-12-22 17:30:41 -06:00
During development, it's useful to run the compiler in watch mode:
```bash
npm run build:watch
2024-12-22 17:30:41 -06:00
```
## Run
To demonstrate the example application, you can open multiple terminals, and in each terminal execute something like the following:
2024-12-22 17:30:41 -06:00
2024-12-22 17:33:22 -06:00
```bash
export DEBUG="*,-express"
2024-12-22 17:33:22 -06:00
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
2024-12-22 17:33:22 -06:00
```
2024-12-22 17:32:00 -06:00
2024-12-22 17:33:22 -06:00
```bash
export DEBUG="*,-express"
2024-12-22 17:33:22 -06:00
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
2024-12-22 17:33:22 -06:00
export RHIZOME_PEER_ID=peer2
npm run example-app
2024-12-22 17:33:22 -06:00
```
2024-12-22 17:32:19 -06:00
2024-12-22 17:33:22 -06:00
```bash
export DEBUG="*,-express"
2024-12-22 17:33:22 -06:00
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
2024-12-22 17:33:22 -06:00
export RHIZOME_PEER_ID=peer3
npm run example-app
2024-12-22 17:33:22 -06:00
```
2024-12-22 17:30:41 -06:00
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)
2024-12-22 17:33:22 -06:00
```bash
curl -s http://localhost:3000/peers/count | jq
```
Query the list of peers seen by a given node (including itself)
```bash
2024-12-22 17:33:22 -06:00
curl -s http://localhost:3000/peers | jq
```
Query the number of deltas ingested by this node
```bash
2024-12-22 17:33:22 -06:00
curl -s http://localhost:3000/deltas/count | jq
```
Query the list of deltas ingested by this node
```bash
2024-12-22 17:33:22 -06:00
curl -s http://localhost:3000/deltas | jq
```
2024-12-23 17:29:38 -06:00
# Project Management
- [] Item 1
- [] Item 2