@@ -20,6 +20,7 @@ const DEBUG = process.env.DEBUG || process.env.npm_config_DEBUG || process.env.n
2020const SALT = process . env . SALT || process . env . npm_config_SALT || process . env . npm_package_config_SALT ;
2121const TOKEN_URL = process . env . TOKEN_URL || process . env . npm_config_TOKEN_URL || process . env . npm_package_config_TOKEN_URL ;
2222const ISPROD = process . env . ISPROD || process . env . npm_config_ISPROD || process . env . npm_package_config_ISPROD || false ;
23+ const INSIGHTS_KEY = process . env . INSIGHTS_KEY || process . env . npm_config_INSIGHTS_KEY || process . env . npm_package_config_INSIGHTS_KEY
2324const INTERNAL_TOKEN = process . env . INTERNAL_TOKEN || process . env . npm_config_INTERNAL_TOKEN || process . env . npm_package_config_INTERNAL_TOKEN ;
2425const WEB3_URI = process . env . WEB3_URI || process . env . npm_config_WEB3_URI || process . env . npm_package_config_WEB3_URI ;
2526const ETHERSCAN_KEY = process . env . ETHERSCAN_KEY || process . env . npm_config_ETHERSCAN_KEY || process . env . npm_package_config_ETHERSCAN_KEY ;
@@ -55,6 +56,7 @@ const ctx_config = {
5556 tokenUrl : TOKEN_URL ,
5657 isProd : ISPROD && / t r u e / i. test ( ISPROD ) ,
5758 isTest : ! ( ! ! ISPROD && / t r u e / i. test ( ISPROD ) ) ,
59+ insights_key : INSIGHTS_KEY ,
5860 etherscan_key : ETHERSCAN_KEY ,
5961 ethereum_network : NETWORK_TYPE ,
6062 web3_uri : WEB3_URI ,
@@ -80,6 +82,7 @@ const ctx_config = {
8082} ;
8183const log = require ( './lib/log.js' ) . init ( ctx_config ) . fn ( "app" ) ;
8284const debug = require ( './lib/log.js' ) . init ( ctx_config ) . debug_fn ( "app" ) ;
85+ const insights_key = require ( './lib/insights.js' ) . init ( ctx_config ) ;
8386const crypto = require ( './lib/crypto.js' ) . init ( ctx_config ) ;
8487const eth = require ( './lib/eth-chain.js' ) . init ( ctx_config ) ;
8588const etherscan = require ( './lib/etherscan.js' ) . init ( ctx_config ) ;
@@ -90,6 +93,7 @@ const throttle = require('./lib/throttle.js').init(ctx_config);
9093const normalizer = require ( './lib/normalizer.js' ) . init ( ctx_config ) ;
9194const tallyCache = require ( './lib/tally-cache.js' ) . init ( ctx_config ) ;
9295log ( "CONFIG:\n%O" , ( ( cfg ) => {
96+ cfg . insights_key = cfg . insights_key ? cfg . insights_key . replace ( / .(? = .{ 2 } ) / g, '*' ) : null ;
9397 cfg . web3_uri = cfg . web3_uri . replace ( / .(? = .{ 2 } ) / g, '*' ) ;
9498 cfg . etherscan_key = cfg . etherscan_key . replace ( / .(? = .{ 2 } ) / g, '*' ) ;
9599 cfg . pgpassword = cfg . pgpassword . replace ( / .(? = .{ 2 } ) / g, '*' ) ;
0 commit comments