From 7c73dde06c27912bb6b88c595f00233a6f8078d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Fri, 3 Feb 2023 01:09:41 +0100 Subject: [PATCH 1/9] update communities table for home-community entries --- .../Community.ts | 51 +++++++++++++++++++ database/entity/Community.ts | 2 +- .../0060-update_communities_table.ts | 32 ++++++++++++ 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 database/entity/0060-update_communities_table/Community.ts create mode 100644 database/migrations/0060-update_communities_table.ts diff --git a/database/entity/0060-update_communities_table/Community.ts b/database/entity/0060-update_communities_table/Community.ts new file mode 100644 index 000000000..5ded76cf9 --- /dev/null +++ b/database/entity/0060-update_communities_table/Community.ts @@ -0,0 +1,51 @@ +import { + BaseEntity, + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, +} from 'typeorm' + +@Entity('communities') +export class Community extends BaseEntity { + @PrimaryGeneratedColumn('increment', { unsigned: true }) + id: number + + @Column({ name: 'foreign', type: 'bool', nullable: false, default: true }) + foreign: boolean + + @Column({ name: 'public_key', type: 'binary', length: 64, default: null, nullable: true }) + publicKey: Buffer + + @Column({ name: 'api_version', length: 10, nullable: false }) + apiVersion: string + + @Column({ name: 'end_point', length: 255, nullable: false }) + endPoint: string + + @Column({ name: 'last_announced_at', type: 'datetime', nullable: true }) + lastAnnouncedAt: Date + + @Column({ name: 'verified_at', type: 'datetime', nullable: true }) + verifiedAt: Date + + @Column({ name: 'last_error_at', type: 'datetime', nullable: true }) + lastErrorAt: Date + + @CreateDateColumn({ + name: 'created_at', + type: 'datetime', + default: () => 'CURRENT_TIMESTAMP(3)', + nullable: false, + }) + createdAt: Date + + @UpdateDateColumn({ + name: 'updated_at', + type: 'datetime', + onUpdate: 'CURRENT_TIMESTAMP(3)', + nullable: true, + }) + updatedAt: Date | null +} diff --git a/database/entity/Community.ts b/database/entity/Community.ts index 457d03eae..80e5ace30 100644 --- a/database/entity/Community.ts +++ b/database/entity/Community.ts @@ -1 +1 @@ -export { Community } from './0058-add_communities_table/Community' +export { Community } from './0060-update_communities_table/Community' diff --git a/database/migrations/0060-update_communities_table.ts b/database/migrations/0060-update_communities_table.ts new file mode 100644 index 000000000..d99073846 --- /dev/null +++ b/database/migrations/0060-update_communities_table.ts @@ -0,0 +1,32 @@ +/* MIGRATION TO CREATE THE FEDERATION COMMUNITY TABLES + * + * This migration creates the `community` and 'communityfederation' tables in the `apollo` database (`gradido_community`). + */ + +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +/* eslint-disable @typescript-eslint/no-explicit-any */ + +export async function upgrade(queryFn: (query: string, values?: any[]) => Promise>) { + await queryFn( + 'ALTER TABLE `communities` MODIFY COLUMN `last_announced_at` datetime(3) AFTER `end_point`;', + ) + await queryFn( + 'ALTER TABLE `communities` ADD COLUMN `foreign` tinyint(4) NOT NULL DEFAULT 1 AFTER `id`;', + ) + await queryFn( + 'ALTER TABLE `communities` ADD COLUMN `verified_at` datetime(3) AFTER `last_announced_at`;', + ) + await queryFn( + 'ALTER TABLE `communities` ADD COLUMN `last_error_at` datetime(3) AFTER `verified_at`;', + ) +} + +export async function downgrade(queryFn: (query: string, values?: any[]) => Promise>) { + // write downgrade logic as parameter of queryFn + await queryFn( + 'ALTER TABLE `communities` MODIFY COLUMN `last_announced_at` datetime(3) NOT NULL AFTER `end_point`;', + ) + await queryFn('ALTER TABLE communities DROP COLUMN foreign;') + await queryFn('ALTER TABLE communities DROP COLUMN verified_at;') + await queryFn('ALTER TABLE communities DROP COLUMN last_error_at;') +} From c9cd73a66def9cb5d53b6d8cc9ac2095b444d853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Fri, 3 Feb 2023 01:10:56 +0100 Subject: [PATCH 2/9] use db-version 0060 in backend --- backend/src/config/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index d010b4ab0..3b8d0d1d6 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -10,7 +10,7 @@ Decimal.set({ }) const constants = { - DB_VERSION: '0059-add_hide_amount_to_users', + DB_VERSION: '0060-update_communities_table', DECAY_START_TIME: new Date('2021-05-13 17:46:31-0000'), // GMT+0 LOG4JS_CONFIG: 'log4js-config.json', // default log level on production should be info From c1cc4e7aa371046c4bb63c0e486d0df149ce9ac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Fri, 3 Feb 2023 01:12:17 +0100 Subject: [PATCH 3/9] change federation config properties for home-community entries --- dht-node/.env.dist | 4 +++- dht-node/.env.template | 1 + dht-node/src/config/index.ts | 7 ++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dht-node/.env.dist b/dht-node/.env.dist index c1641ea98..6c1743d91 100644 --- a/dht-node/.env.dist +++ b/dht-node/.env.dist @@ -1,4 +1,4 @@ -CONFIG_VERSION=v1.2023-01-01 +CONFIG_VERSION=v2.2023-02-03 # Database DB_HOST=localhost @@ -20,3 +20,5 @@ EVENT_PROTOCOL_DISABLED=false # on an hash created from this topic FEDERATION_DHT_TOPIC=GRADIDO_HUB # FEDERATION_DHT_SEED=64ebcb0e3ad547848fef4197c6e2332f +# FEDERATION_COMMUNITY_URL=http://localhost +# FEDERATION_COMMUNITY_API_PORT=5000 diff --git a/dht-node/.env.template b/dht-node/.env.template index eca7cb277..c96d938a5 100644 --- a/dht-node/.env.template +++ b/dht-node/.env.template @@ -15,3 +15,4 @@ EVENT_PROTOCOL_DISABLED=$EVENT_PROTOCOL_DISABLED FEDERATION_DHT_TOPIC=$FEDERATION_DHT_TOPIC FEDERATION_DHT_SEED=$FEDERATION_DHT_SEED FEDERATION_COMMUNITY_URL=$FEDERATION_COMMUNITY_URL +FEDERATION_COMMUNITY_API_PORT=FEDERATION_COMMUNITY_API_PORT diff --git a/dht-node/src/config/index.ts b/dht-node/src/config/index.ts index 02cbb20e9..3da771f92 100644 --- a/dht-node/src/config/index.ts +++ b/dht-node/src/config/index.ts @@ -3,13 +3,13 @@ import dotenv from 'dotenv' dotenv.config() const constants = { - DB_VERSION: '0059-add_hide_amount_to_users', + DB_VERSION: '0060-update_communities_table', LOG4JS_CONFIG: 'log4js-config.json', // default log level on production should be info LOG_LEVEL: process.env.LOG_LEVEL || 'info', CONFIG_VERSION: { DEFAULT: 'DEFAULT', - EXPECTED: 'v1.2023-01-01', + EXPECTED: 'v2.2023-02-03', CURRENT: '', }, } @@ -36,7 +36,8 @@ const eventProtocol = { const federation = { FEDERATION_DHT_TOPIC: process.env.FEDERATION_DHT_TOPIC || 'GRADIDO_HUB', FEDERATION_DHT_SEED: process.env.FEDERATION_DHT_SEED || null, - FEDERATION_COMMUNITY_URL: process.env.FEDERATION_COMMUNITY_URL || null, + FEDERATION_COMMUNITY_URL: process.env.FEDERATION_COMMUNITY_URL || 'http://localhost', + FEDERATION_COMMUNITY_API_PORT: process.env.FEDERATION_COMMUNITY_API_PORT || '5000', } // Check config version From 559016bf3c5d21e61408ae3c057ff2532db099c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Fri, 3 Feb 2023 01:13:33 +0100 Subject: [PATCH 4/9] writeHomeCommunity Entries with different ports per api-version --- dht-node/src/dht_node/index.ts | 47 +++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/dht-node/src/dht_node/index.ts b/dht-node/src/dht_node/index.ts index 51610e233..3dffcb1ac 100644 --- a/dht-node/src/dht_node/index.ts +++ b/dht-node/src/dht_node/index.ts @@ -15,9 +15,9 @@ const ERRORTIME = 240000 const ANNOUNCETIME = 30000 enum ApiVersionType { - V1_0 = 'v1_0', - V1_1 = 'v1_1', - V2_0 = 'v2_0', + V1_0 = '1_0', + V1_1 = '1_1', + V2_0 = '2_0', } type CommunityApi = { api: string @@ -31,13 +31,16 @@ export const startDHT = async (topic: string): Promise => { logger.info(`keyPairDHT: publicKey=${keyPair.publicKey.toString('hex')}`) logger.debug(`keyPairDHT: secretKey=${keyPair.secretKey.toString('hex')}`) + const ownApiVersions = writeHomeCommunityEnries(keyPair.publicKey) + /* const ownApiVersions = Object.values(ApiVersionType).map(function (apiEnum) { const comApi: CommunityApi = { api: apiEnum, - url: CONFIG.FEDERATION_COMMUNITY_URL + apiEnum, + url: CONFIG.FEDERATION_COMMUNITY_URL, } return comApi }) + */ logger.debug(`ApiList: ${JSON.stringify(ownApiVersions)}`) const node = new DHT({ keyPair }) @@ -184,3 +187,39 @@ export const startDHT = async (topic: string): Promise => { logger.error('DHT unexpected error:', err) } } + +async function writeHomeCommunityEnries(pubKey: any): Promise { + const homeApiVersions: CommunityApi[] = Object.values(ApiVersionType).map(function ( + apiEnum, + idx, + ) { + const port = Number.parseInt(CONFIG.FEDERATION_COMMUNITY_API_PORT) + idx + 1 + const comApi: CommunityApi = { + api: apiEnum, + url: CONFIG.FEDERATION_COMMUNITY_URL + ':' + port.toString() + '/api/', + } + return comApi + }) + + homeApiVersions.forEach(async function (homeApi) { + const variables = { + foreign: false, + apiVersion: homeApi.api, + endPoint: homeApi.url, + publicKey: pubKey.toString('hex'), + } + // this will NOT update the updatedAt column, to distingue between a normal update and the last announcement + await DbCommunity.createQueryBuilder() + .insert() + .into(DbCommunity) + .values(variables) + .orUpdate({ + conflict_target: ['id', 'foreign', 'publicKey', 'apiVersion'], + overwrite: ['foreign', 'api_version', 'end_point', 'public_key'], + }) + .execute() + logger.info(`federation home-community upserted successfully...`) + }) + + return homeApiVersions +} From 2ec903ce2f1f21c5cdc000a34da541aa300e4a9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Fri, 3 Feb 2023 17:31:23 +0100 Subject: [PATCH 5/9] insert HomeCommunity-Entries before starting dht-announcement --- dht-node/src/dht_node/index.ts | 39 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/dht-node/src/dht_node/index.ts b/dht-node/src/dht_node/index.ts index 3dffcb1ac..5ea373231 100644 --- a/dht-node/src/dht_node/index.ts +++ b/dht-node/src/dht_node/index.ts @@ -200,26 +200,27 @@ async function writeHomeCommunityEnries(pubKey: any): Promise { } return comApi }) - - homeApiVersions.forEach(async function (homeApi) { - const variables = { - foreign: false, - apiVersion: homeApi.api, - endPoint: homeApi.url, - publicKey: pubKey.toString('hex'), + try { + // first remove privious existing homeCommunity entries + const homeComs = await DbCommunity.find({ foreign: false }) + if (homeComs.length > 0) { + await DbCommunity.remove(homeComs) } - // this will NOT update the updatedAt column, to distingue between a normal update and the last announcement - await DbCommunity.createQueryBuilder() - .insert() - .into(DbCommunity) - .values(variables) - .orUpdate({ - conflict_target: ['id', 'foreign', 'publicKey', 'apiVersion'], - overwrite: ['foreign', 'api_version', 'end_point', 'public_key'], - }) - .execute() - logger.info(`federation home-community upserted successfully...`) - }) + + homeApiVersions.forEach(async function (homeApi) { + const homeCom = new DbCommunity() + homeCom.foreign = false + homeCom.apiVersion = homeApi.api + homeCom.endPoint = homeApi.url + homeCom.publicKey = pubKey.toString('hex') + + // this will NOT update the updatedAt column, to distingue between a normal update and the last announcement + await DbCommunity.insert(homeCom) + logger.info(`federation home-community inserted successfully: ${homeCom}`) + }) + } catch (err) { + throw new Error(`Federation: Error writing HomeCommunity-Entries: ${err}`) + } return homeApiVersions } From 7e5165072b3197ec7738e0b78313eefbf1d09cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Fri, 3 Feb 2023 17:50:59 +0100 Subject: [PATCH 6/9] correct SQL error on e2e-tests --- database/migrations/0060-update_communities_table.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/database/migrations/0060-update_communities_table.ts b/database/migrations/0060-update_communities_table.ts index d99073846..79180e587 100644 --- a/database/migrations/0060-update_communities_table.ts +++ b/database/migrations/0060-update_communities_table.ts @@ -26,7 +26,7 @@ export async function downgrade(queryFn: (query: string, values?: any[]) => Prom await queryFn( 'ALTER TABLE `communities` MODIFY COLUMN `last_announced_at` datetime(3) NOT NULL AFTER `end_point`;', ) - await queryFn('ALTER TABLE communities DROP COLUMN foreign;') - await queryFn('ALTER TABLE communities DROP COLUMN verified_at;') - await queryFn('ALTER TABLE communities DROP COLUMN last_error_at;') + await queryFn('ALTER TABLE `communities` DROP COLUMN `foreign`;') + await queryFn('ALTER TABLE `communities` DROP COLUMN `verified_at`;') + await queryFn('ALTER TABLE `communities` DROP COLUMN `last_error_at`;') } From 16bffa04361c37c6e7a5ade742fc67ad1e89256a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Fri, 3 Feb 2023 20:10:21 +0100 Subject: [PATCH 7/9] adapt unit-tests on changes --- dht-node/src/dht_node/index.test.ts | 74 ++++++++++++++++------------- 1 file changed, 42 insertions(+), 32 deletions(-) diff --git a/dht-node/src/dht_node/index.test.ts b/dht-node/src/dht_node/index.test.ts index 343fe7ec7..c6d2c358c 100644 --- a/dht-node/src/dht_node/index.test.ts +++ b/dht-node/src/dht_node/index.test.ts @@ -44,10 +44,11 @@ const lookupResultMock = { token: Buffer.from(TEST_TOPIC), from: { id: Buffer.from('somone'), + foreign: true, host: '188.95.53.5', port: 63561, }, - to: { id: null, host: '83.53.31.27', port: 55723 }, + to: { id: null, foreign: true, host: '83.53.31.27', port: 55723 }, peers: [ { publicKey: Buffer.from('some-public-key'), @@ -234,18 +235,18 @@ describe('federation', () => { beforeEach(async () => { jest.clearAllMocks() jsonArray = [ - { api: 'v1_0', url: 'too much versions at the same time test' }, - { api: 'v1_0', url: 'url2' }, - { api: 'v1_0', url: 'url3' }, - { api: 'v1_0', url: 'url4' }, - { api: 'v1_0', url: 'url5' }, + { api: '1_0', url: 'too much versions at the same time test' }, + { api: '1_0', url: 'url2' }, + { api: '1_0', url: 'url3' }, + { api: '1_0', url: 'url4' }, + { api: '1_0', url: 'url5' }, ] await socketEventMocks.data(Buffer.from(JSON.stringify(jsonArray))) }) it('logs the received data', () => { expect(logger.info).toBeCalledWith( - 'data: [{"api":"v1_0","url":"too much versions at the same time test"},{"api":"v1_0","url":"url2"},{"api":"v1_0","url":"url3"},{"api":"v1_0","url":"url4"},{"api":"v1_0","url":"url5"}]', + 'data: [{"api":"1_0","url":"too much versions at the same time test"},{"api":"1_0","url":"url2"},{"api":"1_0","url":"url3"},{"api":"1_0","url":"url4"},{"api":"1_0","url":"url5"}]', ) }) @@ -266,17 +267,17 @@ describe('federation', () => { jsonArray = [ { wrong: 'wrong but tolerated property test', - api: 'v1_0', + api: '1_0', url: 'url1', }, { - api: 'v2_0', + api: '2_0', url: 'url2', wrong: 'wrong but tolerated property test', }, ] await socketEventMocks.data(Buffer.from(JSON.stringify(jsonArray))) - result = await DbCommunity.find() + result = await DbCommunity.find({ foreign: true }) }) afterAll(async () => { @@ -287,13 +288,14 @@ describe('federation', () => { expect(result).toHaveLength(2) }) - it('has an entry for api version v1_0', () => { + it('has an entry for api version 1_0', () => { expect(result).toEqual( expect.arrayContaining([ expect.objectContaining({ id: expect.any(Number), + foreign: true, publicKey: expect.any(Buffer), - apiVersion: 'v1_0', + apiVersion: '1_0', endPoint: 'url1', lastAnnouncedAt: expect.any(Date), createdAt: expect.any(Date), @@ -303,13 +305,14 @@ describe('federation', () => { ) }) - it('has an entry for api version v2_0', () => { + it('has an entry for api version 2_0', () => { expect(result).toEqual( expect.arrayContaining([ expect.objectContaining({ id: expect.any(Number), + foreign: true, publicKey: expect.any(Buffer), - apiVersion: 'v2_0', + apiVersion: '2_0', endPoint: 'url2', lastAnnouncedAt: expect.any(Date), createdAt: expect.any(Date), @@ -535,7 +538,7 @@ describe('federation', () => { { api: 'toolong api', url: 'some valid url' }, ] await socketEventMocks.data(Buffer.from(JSON.stringify(jsonArray))) - result = await DbCommunity.find() + result = await DbCommunity.find({ foreign: true }) }) afterAll(async () => { @@ -551,6 +554,7 @@ describe('federation', () => { expect.arrayContaining([ expect.objectContaining({ id: expect.any(Number), + foreign: true, publicKey: expect.any(Buffer), apiVersion: 'valid api', endPoint: @@ -588,7 +592,7 @@ describe('federation', () => { }, ] await socketEventMocks.data(Buffer.from(JSON.stringify(jsonArray))) - result = await DbCommunity.find() + result = await DbCommunity.find({ foreign: true }) }) afterAll(async () => { @@ -604,6 +608,7 @@ describe('federation', () => { expect.arrayContaining([ expect.objectContaining({ id: expect.any(Number), + foreign: true, publicKey: expect.any(Buffer), apiVersion: 'valid api1', endPoint: @@ -621,6 +626,7 @@ describe('federation', () => { expect.arrayContaining([ expect.objectContaining({ id: expect.any(Number), + foreign: true, publicKey: expect.any(Buffer), apiVersion: 'valid api2', endPoint: @@ -638,6 +644,7 @@ describe('federation', () => { expect.arrayContaining([ expect.objectContaining({ id: expect.any(Number), + foreign: true, publicKey: expect.any(Buffer), apiVersion: 'valid api3', endPoint: @@ -655,6 +662,7 @@ describe('federation', () => { expect.arrayContaining([ expect.objectContaining({ id: expect.any(Number), + foreign: true, publicKey: expect.any(Buffer), apiVersion: 'valid api4', endPoint: @@ -710,17 +718,17 @@ describe('federation', () => { Buffer.from( JSON.stringify([ { - api: 'v1_0', - url: 'http://localhost:4000/api/v1_0', + api: '1_0', + url: 'http://localhost:5001/api/', }, { - api: 'v2_0', - url: 'http://localhost:4000/api/v2_0', + api: '2_0', + url: 'http://localhost:5002/api/', }, ]), ), ) - result = await DbCommunity.find() + result = await DbCommunity.find({ foreign: true }) }) afterAll(async () => { @@ -736,9 +744,10 @@ describe('federation', () => { expect.arrayContaining([ expect.objectContaining({ id: expect.any(Number), + foreign: true, publicKey: expect.any(Buffer), - apiVersion: 'v1_0', - endPoint: 'http://localhost:4000/api/v1_0', + apiVersion: '1_0', + endPoint: 'http://localhost:5001/api/', lastAnnouncedAt: expect.any(Date), createdAt: expect.any(Date), updatedAt: null, @@ -747,14 +756,15 @@ describe('federation', () => { ) }) - it('has an entry for api version v2_0', () => { + it('has an entry for api version 2_0', () => { expect(result).toEqual( expect.arrayContaining([ expect.objectContaining({ id: expect.any(Number), + foreign: true, publicKey: expect.any(Buffer), - apiVersion: 'v2_0', - endPoint: 'http://localhost:4000/api/v2_0', + apiVersion: '2_0', + endPoint: 'http://localhost:5002/api/', lastAnnouncedAt: expect.any(Date), createdAt: expect.any(Date), updatedAt: null, @@ -775,16 +785,16 @@ describe('federation', () => { Buffer.from( JSON.stringify([ { - api: 'v1_0', - url: 'http://localhost:4000/api/v1_0', + api: '1_0', + url: 'http://localhost:5001/api/', }, { - api: 'v1_1', - url: 'http://localhost:4000/api/v1_1', + api: '1_1', + url: 'http://localhost:5002/api/', }, { - api: 'v2_0', - url: 'http://localhost:4000/api/v2_0', + api: '2_0', + url: 'http://localhost:5003/api/', }, ]), ), From a07888004e32b161e367fec01d2961de9ecf87a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Fri, 3 Feb 2023 20:28:57 +0100 Subject: [PATCH 8/9] unit-test: clearDB before startDHT --- dht-node/src/dht_node/index.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/dht-node/src/dht_node/index.test.ts b/dht-node/src/dht_node/index.test.ts index c6d2c358c..59e52149a 100644 --- a/dht-node/src/dht_node/index.test.ts +++ b/dht-node/src/dht_node/index.test.ts @@ -117,6 +117,7 @@ describe('federation', () => { beforeEach(async () => { DHT.mockClear() jest.clearAllMocks() + await cleanDB() await startDHT(TEST_TOPIC) }) From 44c59c3d297372c63bce7cd393a15064ce9bcb07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Fri, 3 Feb 2023 20:52:21 +0100 Subject: [PATCH 9/9] improve logoutput --- dht-node/src/dht_node/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dht-node/src/dht_node/index.ts b/dht-node/src/dht_node/index.ts index 5ea373231..ab81792df 100644 --- a/dht-node/src/dht_node/index.ts +++ b/dht-node/src/dht_node/index.ts @@ -216,7 +216,7 @@ async function writeHomeCommunityEnries(pubKey: any): Promise { // this will NOT update the updatedAt column, to distingue between a normal update and the last announcement await DbCommunity.insert(homeCom) - logger.info(`federation home-community inserted successfully: ${homeCom}`) + logger.info(`federation home-community inserted successfully: ${JSON.stringify(homeCom)}`) }) } catch (err) { throw new Error(`Federation: Error writing HomeCommunity-Entries: ${err}`)