Compare commits

..

No commits in common. "7bee2a268793126920c7acf220bfdc46dd83f780" and "4868a8d4055e4adabf3913ff273b78b2ee8930f1" have entirely different histories.

7 changed files with 28 additions and 14 deletions

View File

@ -1,7 +0,0 @@
---
description: Generate a merge request summary
---
- fetch origin/main
- compare the current branch to origin/main
- generate a merge request summary as an untracked file called merge-${branch}.md

View File

@ -17,7 +17,7 @@ describe('Run', () => {
apps[0].config.seedPeers.push(apps[1].myRequestAddr); apps[0].config.seedPeers.push(apps[1].myRequestAddr);
apps[1].config.seedPeers.push(apps[0].myRequestAddr); apps[1].config.seedPeers.push(apps[0].myRequestAddr);
await Promise.all(apps.map((app) => app.start())); await Promise.all(apps.map((app) => app.start({ waitForReady: false })));
}); });
afterAll(async () => { afterAll(async () => {

View File

@ -0,0 +1,13 @@
import Docker from 'dockerode';
import { describe, it, beforeAll, afterAll, expect } from '@jest/globals';
import Debug from 'debug';
const debug = Debug('rz:test:docker-smoke');
// Simple test to verify Docker is working
describe('Docker Smoke Test', () => {
let docker: Docker;
let container: any;
});

View File

@ -83,13 +83,16 @@ export class RhizomeNode {
/** /**
* Start the node components * Start the node components
* @param options.startupOptions Options for node startup
* @param options.waitForReady Whether to wait for all components to be fully ready (default: false)
* @param options.syncOnStart Whether to sync with peers on startup (default: false) * @param options.syncOnStart Whether to sync with peers on startup (default: false)
* @returns Promise that resolves when the node is fully started and ready * @returns Promise that resolves when the node is started (and ready if waitForReady is true)
*/ */
async start({ async start({
waitForReady = false,
syncOnStart = false syncOnStart = false
}: { syncOnStart?: boolean } = {}): Promise<void> { }: { waitForReady?: boolean; syncOnStart?: boolean } = {}): Promise<void> {
debug(`[${this.config.peerId}]`, 'Starting node (waiting for ready)...'); debug(`[${this.config.peerId}]`, `Starting node${waitForReady ? ' (waiting for ready)' : ''}...`);
// Connect our lossless view to the delta stream // Connect our lossless view to the delta stream
this.deltaStream.subscribeDeltas(async (delta) => { this.deltaStream.subscribeDeltas(async (delta) => {
@ -112,7 +115,11 @@ export class RhizomeNode {
// Start HTTP server if enabled // Start HTTP server if enabled
if (this.config.httpEnable && this.httpServer) { if (this.config.httpEnable && this.httpServer) {
await this.httpServer.startAndWait(); if (waitForReady) {
await this.httpServer.startAndWait();
} else {
this.httpServer.start();
}
} }
// Initialize network components // Initialize network components
@ -125,7 +132,7 @@ export class RhizomeNode {
await new Promise((resolve) => setTimeout(resolve, 1000)); await new Promise((resolve) => setTimeout(resolve, 1000));
} }
debug(`[${this.config.peerId}]`, 'Node started and ready'); debug(`[${this.config.peerId}]`, `Node started${waitForReady ? ' and ready' : ''}`);
} }
async stop() { async stop() {

View File

@ -61,7 +61,7 @@ export class TestOrchestrator extends BaseOrchestrator {
// Start the node and wait for all components to be ready // Start the node and wait for all components to be ready
debug(`[${nodeId}] Starting node and waiting for it to be fully ready...`); debug(`[${nodeId}] Starting node and waiting for it to be fully ready...`);
try { try {
await node.start(); await node.start({ waitForReady: true });
debug(`[${nodeId}] Node is fully started and ready`); debug(`[${nodeId}] Node is fully started and ready`);
} catch (error) { } catch (error) {
debug(`[${nodeId}] Error starting node:`, error); debug(`[${nodeId}] Error starting node:`, error);

View File

@ -172,6 +172,7 @@ export class Lossless {
viewSpecific(entityId: DomainEntityID, deltaIds: DeltaID[], deltaFilter?: DeltaFilter): LosslessViewOne | undefined { viewSpecific(entityId: DomainEntityID, deltaIds: DeltaID[], deltaFilter?: DeltaFilter): LosslessViewOne | undefined {
const combinedFilter = (delta: Delta) => { const combinedFilter = (delta: Delta) => {
if (!deltaIds.includes(delta.id)) { if (!deltaIds.includes(delta.id)) {
debug(`[${this.rhizomeNode.config.peerId}]`, `Excluding delta ${delta.id} because it's not in the requested list of deltas`);
return false; return false;
} }
if (!deltaFilter) return true; if (!deltaFilter) return true;