/** * A helper function that checks the metadata version / runtime version in intervals. * If a change is detected, an appropriate callback is executed. * * @param opts.metadata Options to restart upon metadata version change. * @param opts.runtime Options to restart upon runtime hash change. * @param opts.log Optional function to log the output. * @param opts.checkIntervalSeconds How often to check for changes. 10 minutes by default. * @returns A function to stop and cleanup the restarter. * * @example * runtimeRestarter({ * metadata: { * getMetadataVersion: async () => (await api.rpc.state.getMetadata()).version.toString(), * onMetadataChange: () => process.exit(1), * }, * runtime: { * getRuntimeVersionHash: async () => (await api.rpc.state.getRuntimeVersion()).hash.toString(), * onRuntimeChange: () => process.exit(1), * } * log: (msg) => console.log(msg) * }) */ export declare function runtimeRestarter(opts: { metadata?: { getMetadataVersion: () => Promise; onMetadataChange: () => void | Promise; }; runtime?: { getRuntimeVersionHash: () => Promise; onRuntimeChange: () => void | Promise; }; log?: (msg: string) => void; checkIntervalSeconds?: number; }): () => void;