@sentio/runtime 1.40.0-rc.2 → 1.40.1-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/processor-runner.js
CHANGED
@@ -71,7 +71,7 @@ if (options['log-format'] === 'json') {
|
|
71
71
|
},
|
72
72
|
};
|
73
73
|
const logger = (0, winston_1.createLogger)({
|
74
|
-
format: winston_1.format.combine(winston_1.format.timestamp({ format: 'YYYY-MM-DDTHH:mm:
|
74
|
+
format: winston_1.format.combine(winston_1.format.timestamp({ format: 'YYYY-MM-DDTHH:mm:ss.SSSZ' }), utilFormatter, winston_1.format.errors({ stack: true }), winston_1.format.json()),
|
75
75
|
transports: [new winston_1.transports.Console()],
|
76
76
|
});
|
77
77
|
console.log = (...args) => logger.info.call(logger, ...args);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"processor-runner.js","sourceRoot":"","sources":["../src/processor-runner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,gDAAuB;AACvB,wDAAyB;AACzB,2CAA4B;AAE5B,0EAA+C;AAC/C,yCAAwC;AACxC,qCAA0D;AAC1D,2FAAsF;AAEtF,2CAAoD;AACpD,uCAAgD;AAChD,yCAAwC;AACxC,mCAA+B;AAC/B,2CAAuC;AAEvC,qCAA+B;AAC/B,iDAAyD;AAEzD,aAAK,CAAC,KAAK,EAAE,CAAA;AACb,qBAAS,CAAC,KAAK,EAAE,CAAA;AAEjB,MAAM,iBAAiB,GAAG;IACxB,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE;IACrD,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE;IAChE,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,EAAE;IAC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AAO,GAAG,IAAI,uCAAwB,CAAC,WAAW,CAAC,CAAA;AAEzD,MAAM,CAAC,GAAG,CAAC,4BAAmB,EAAE,OAAO,CAAC,CAAA;AAExC,MAAM,CAAC,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAExC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA","sourcesContent":["#!/usr/bin/env node\n\nimport path from 'path'\nimport fs from 'fs-extra'\nimport * as util from 'util'\n\nimport commandLineArgs from 'command-line-args'\nimport { createServer } from 'nice-grpc'\nimport { createLogger, transports, format } from 'winston'\nimport { CompressionAlgorithms } from '@grpc/grpc-js/build/src/compression-algorithms'\n\nimport { ProcessorDefinition } from '@sentio/protos'\nimport { ProcessorServiceImpl } from './service'\nimport { setProvider } from './provider'\nimport { State } from './state'\nimport { Endpoints } from './endpoints'\n\nimport { load } from './loader'\nimport { FullProcessorServiceImpl } from './full-service'\n\nState.reset()\nEndpoints.reset()\n\nconst optionDefinitions = [\n { name: 'target', type: String, defaultOption: true },\n { name: 'port', alias: 'p', type: String, defaultValue: '4000' },\n { name: 'concurrency', type: Number, defaultValue: 4 },\n { name: 'use-chainserver', type: Boolean, defaultValue: false },\n {\n name: 'chains-config',\n alias: 'c',\n type: String,\n defaultValue: 'chains-config.json',\n },\n { name: 'chainquery-server', type: String, defaultValue: '' },\n { name: 'pricefeed-server', type: String, defaultValue: '' },\n { name: 'log-format', type: String, defaultValue: 'console' },\n { name: 'debug', type: Boolean, defaultValue: false },\n]\n\nconst options = commandLineArgs(optionDefinitions, { partial: true })\n\nif (options['log-format'] === 'json') {\n const utilFormatter = {\n transform: (info: any) => {\n const args = info[Symbol.for('splat')]\n if (args) {\n info.message = util.format(info.message, ...args)\n }\n return info\n },\n }\n const logger = createLogger({\n format: format.combine(\n format.timestamp({ format: 'YYYY-MM-DDTHH:mm:ss.SSSZ' }),\n utilFormatter,\n format.errors({ stack: true }),\n format.json()\n ),\n transports: [new transports.Console()],\n })\n\n console.log = (...args) => logger.info.call(logger, ...args)\n console.info = (...args) => logger.info.call(logger, ...args)\n console.warn = (...args) => logger.warn.call(logger, ...args)\n console.error = (...args) => logger.error.call(logger, ...args)\n console.debug = (...args) => logger.debug.call(logger, ...args)\n}\nif (options.debug) {\n console.log('Starting with', options.target)\n}\n\nconst fullPath = path.resolve(options['chains-config'])\nconst chainsConfig = fs.readJsonSync(fullPath)\n\nsetProvider(chainsConfig, options.concurrency, options['use-chainserver'])\nEndpoints.INSTANCE.chainQueryAPI = options['chainquery-server']\nEndpoints.INSTANCE.priceFeedAPI = options['pricefeed-server']\n\nif (options.debug) {\n console.log('Starting Server', options)\n}\n\nconst server = createServer({\n 'grpc.max_send_message_length': 128 * 1024 * 1024,\n 'grpc.max_receive_message_length': 128 * 1024 * 1024,\n 'grpc.default_compression_algorithm': CompressionAlgorithms.gzip,\n})\n\nconst baseService = new ProcessorServiceImpl(() => load(options.target), server.shutdown)\nconst service = new FullProcessorServiceImpl(baseService)\n\nserver.add(ProcessorDefinition, service)\n\nserver.listen('0.0.0.0:' + options.port)\n\nconsole.log('Processor Server Started')\n"]}
|
package/package.json
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sentio/runtime",
|
3
3
|
"license": "Apache-2.0",
|
4
|
-
"version": "1.40.
|
4
|
+
"version": "1.40.1-rc.1",
|
5
5
|
"scripts": {
|
6
6
|
"compile": "tsc -p .",
|
7
7
|
"build": "yarn compile",
|
8
8
|
"build_all": "yarn lerna run --scope=@sentio/runtime build --include-dependencies",
|
9
|
-
"test": "jest"
|
9
|
+
"test": "jest",
|
10
|
+
"run": "ts-node --files src/processor-runner.ts --log-format=json"
|
10
11
|
},
|
11
12
|
"dependencies": {
|
12
13
|
"@ethersproject/providers": "~5.7.0",
|
13
|
-
"@sentio/protos": "^1.40.
|
14
|
+
"@sentio/protos": "^1.40.1-rc.1",
|
14
15
|
"bignumber.js": "^9.1.0",
|
15
16
|
"command-line-args": "^5.2.1",
|
16
17
|
"command-line-usage": "^6.1.3",
|
@@ -46,5 +47,5 @@
|
|
46
47
|
"!{lib,src}/tests",
|
47
48
|
"!**/*.test.{js,ts}"
|
48
49
|
],
|
49
|
-
"gitHead": "
|
50
|
+
"gitHead": "d7dd959aaa2e6a0f4fe42b262e9e07133d59005b"
|
50
51
|
}
|
package/src/processor-runner.ts
CHANGED
@@ -52,7 +52,7 @@ if (options['log-format'] === 'json') {
|
|
52
52
|
}
|
53
53
|
const logger = createLogger({
|
54
54
|
format: format.combine(
|
55
|
-
format.timestamp({ format: 'YYYY-MM-DDTHH:mm:
|
55
|
+
format.timestamp({ format: 'YYYY-MM-DDTHH:mm:ss.SSSZ' }),
|
56
56
|
utilFormatter,
|
57
57
|
format.errors({ stack: true }),
|
58
58
|
format.json()
|