revert test fixes for invites
This commit is contained in:
2025-12-17 21:09:01 -05:00
parent 7469c84692
commit 4f450e804d
2 changed files with 6 additions and 16 deletions
+4 -12
View File
@@ -220,12 +220,9 @@ async function main() {
const topic = crypto.createHash('sha256').update(process.env.TOPIC_SEED || 'p2ns-dns').digest();
state.topic = topic; // Store topic in state for keep-alive and cleanup
logDebug('Main', `Generated topic: ${topic.toString('hex')}`);
// Initialize corestore with a stable primaryKey derived from our persistent keypair
// This ensures core keys are deterministic and persistent across restarts
const primaryKey = crypto.createHash('sha256').update(keypair.secretKey).digest();
const store = new Corestore(process.env.STORAGE_DIR || './my-storage', { primaryKey });
logInfo('Main', `Corestore initialized with stable primaryKey and storage: ${process.env.STORAGE_DIR || 'my-storage'}`);
// Initialize corestore and hyperswarm
const store = new Corestore(process.env.STORAGE_DIR || './my-storage');
logInfo('Main', `Corestore initialized with storage: ${process.env.STORAGE_DIR || 'my-storage'}`);
// Use the persistent keypair that was loaded earlier (already in state.keypair)
// Configure Hyperswarm for better local network peer discovery
const swarmOptions = {
@@ -970,12 +967,7 @@ async function main() {
logInfo('Main', 'Autopass ready');
state.dnsPass = dnsPass;
core = dnsPass.base;
// Ensure the core is fully ready and updated from disk
await core.ready();
await core.update();
logInfo('Main', `Core retrieved. Writable: ${core.writable}, Key: ${core.key.toString('hex')}`);
logInfo('Main', `Core retrieved. Writable: ${core.writable}`);
// Setup domains watcher for master
setupDomainsWatcher();
setupListeners();
+2 -4
View File
@@ -711,11 +711,9 @@ async function setupP2NS() {
state.keypair = keypair;
logInfo('Main', 'Persistent keypair loaded');
// Initialize corestore with a stable primaryKey derived from our persistent keypair
const primaryKey = crypto.createHash('sha256').update(keypair.secretKey).digest();
const store = new Corestore(config.STORAGE_DIR, { primaryKey });
const store = new Corestore(config.STORAGE_DIR);
state.store = store;
logInfo('Main', `Corestore initialized with stable primaryKey`, { storageDir: config.STORAGE_DIR });
logInfo('Main', `Corestore initialized`, { storageDir: config.STORAGE_DIR });
// Use the persistent keypair from state
// Configure Hyperswarm for better local network peer discovery