From 279b58f808a49426a20df40b41ac6421f5e1bb30 Mon Sep 17 00:00:00 2001 From: Ermal Kaleci Date: Fri, 27 Jan 2023 13:58:26 +0100 Subject: [PATCH] add rpc to make sidecard happy (#169) --- src/rpc/dev.ts | 2 +- src/rpc/substrate/system.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rpc/dev.ts b/src/rpc/dev.ts index ca2cca8f..7d0e86f5 100644 --- a/src/rpc/dev.ts +++ b/src/rpc/dev.ts @@ -20,7 +20,7 @@ const handlers: Handlers = { let finalHash: string | undefined for (let i = 0; i < finalCount; i++) { - const block = await context.chain.newBlock({ inherent: { horizontalMessages: hrmp } }).catch((error) => { + const block = await context.chain.newBlock({ inherent: { horizontalMessages: hrmp || [] } }).catch((error) => { throw new ResponseError(1, error.toString()) }) logger.debug({ hash: block.hash }, 'dev_newBlock') diff --git a/src/rpc/substrate/system.ts b/src/rpc/substrate/system.ts index 5cbac218..fd35e04f 100644 --- a/src/rpc/substrate/system.ts +++ b/src/rpc/substrate/system.ts @@ -6,6 +6,9 @@ import path from 'node:path' import { Handlers } from '../shared' const handlers: Handlers = { + system_localPeerId: async () => '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY', + system_nodeRoles: async () => ['Full'], + system_localListenAddresses: async () => [], system_chain: async (context) => { return context.chain.api.getSystemChain() },