Skip to content

Commit

Permalink
feat: remove insight API (dashevo#351)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Werner <alex@werner.fr>
Co-authored-by: Anton Suprunchuk <antouhou@gmail.com>
Co-authored-by: Ivan Shumkov <ivan@shumkov.ru>
  • Loading branch information
4 people committed Apr 21, 2021
1 parent 20d8ea9 commit 132f4d3
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 1,010 deletions.
3 changes: 0 additions & 3 deletions lib/config/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const OPTIONS = {
INSIGHT_URI: 'INSIGHT_URI',
LIVENET: 'LIVENET',
API_JSON_RPC_PORT: 'API_JSON_RPC_PORT',
API_GRPC_PORT: 'API_GRPC_PORT',
Expand All @@ -22,7 +21,6 @@ const OPTIONS = {

const DEFAULT_CONFIG = {};

DEFAULT_CONFIG[OPTIONS.INSIGHT_URI] = 'http://127.0.0.1:3001/insight-api';
DEFAULT_CONFIG[OPTIONS.LIVENET] = false;
DEFAULT_CONFIG[OPTIONS.API_JSON_RPC_PORT] = 2501;
DEFAULT_CONFIG[OPTIONS.API_GRPC_PORT] = 2500;
Expand Down Expand Up @@ -54,7 +52,6 @@ Object
const config = Object.assign({}, DEFAULT_CONFIG, envConfig);

module.exports = {
insightUri: config[OPTIONS.INSIGHT_URI],
livenet: Boolean(config[OPTIONS.LIVENET]),
rpcServer: {
port: parseInt(config[OPTIONS.API_JSON_RPC_PORT], 10),
Expand Down
1 change: 0 additions & 1 deletion lib/config/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ function validatePort(port, parameterName) {
*/
function validateConfig(config) {
const validationResults = [];
validationResults.push(validateHost(config.insightUri, 'INSIGHT_URI'));
validationResults.push(validateHost(config.dashcore.p2p.host, 'DASHCORE_P2P_HOST'));
validationResults.push(validatePort(config.dashcore.p2p.port, 'DASHCORE_P2P_PORT'));
validationResults.push(validateHost(config.dashcore.rpc.host, 'DASHCORE_RPC_HOST'));
Expand Down
207 changes: 0 additions & 207 deletions lib/externalApis/insight/index.js

This file was deleted.

3 changes: 1 addition & 2 deletions lib/grpcServer/handlers/core/coreHandlersFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@ const broadcastTransactionHandlerFactory = require(
);

/**
* @param {InsightAPI} insightAPI
* @param {CoreRpcClient} coreRPCClient
* @param {boolean} isProductionEnvironment
* @returns {Object<string, function>}
*/
function coreHandlersFactory(insightAPI, coreRPCClient, isProductionEnvironment) {
function coreHandlersFactory(coreRPCClient, isProductionEnvironment) {
const wrapInErrorHandler = wrapInErrorHandlerFactory(log, isProductionEnvironment);

// getBlock
Expand Down
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions scripts/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const { validateConfig } = require('../lib/config/validator');
const log = require('../lib/log');
const rpcServer = require('../lib/rpcServer/server');
const DriveClient = require('../lib/externalApis/drive/DriveClient');
const insightAPI = require('../lib/externalApis/insight');
const dashCoreRpcClient = require('../lib/externalApis/dashcore/rpc');
const BlockchainListener = require('../lib/externalApis/tenderdash/BlockchainListener');
const DriveStateRepository = require('../lib/dpp/DriveStateRepository');
Expand Down Expand Up @@ -102,7 +101,6 @@ async function main() {
log.info('Starting GRPC server');

const coreHandlers = coreHandlersFactory(
insightAPI,
dashCoreRpcClient,
isProductionEnvironment,
);
Expand Down
1 change: 0 additions & 1 deletion test/mocks/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module.exports = {
getConfigFixture() {
return {
insightUri: '123',
dashcore: {
p2p: {
host: '123',
Expand Down
Loading

0 comments on commit 132f4d3

Please sign in to comment.