diff --git a/indexer/services/e2e-testing/.env b/indexer/services/e2e-testing/.env deleted file mode 100644 index b14b5166bc..0000000000 --- a/indexer/services/e2e-testing/.env +++ /dev/null @@ -1 +0,0 @@ -SERVICE_NAME=e2e-testing diff --git a/indexer/services/e2e-testing/.env.development b/indexer/services/e2e-testing/.env.development deleted file mode 100644 index bf2d5c312f..0000000000 --- a/indexer/services/e2e-testing/.env.development +++ /dev/null @@ -1,12 +0,0 @@ -# Service Level Variables - -DB_NAME=dydx_dev -DB_USERNAME=dydx_dev -DB_PASSWORD=dydxserver123 -PG_POOL_MAX=2 -PG_POOL_MIN=1 -DB_HOSTNAME=localhost -DB_READONLY_HOSTNAME=localhost -DB_PORT=5435 - -KAFKA_BROKER_URLS=kafka:9092 diff --git a/indexer/services/e2e-testing/.env.test b/indexer/services/e2e-testing/.env.test deleted file mode 100644 index bf2d5c312f..0000000000 --- a/indexer/services/e2e-testing/.env.test +++ /dev/null @@ -1,12 +0,0 @@ -# Service Level Variables - -DB_NAME=dydx_dev -DB_USERNAME=dydx_dev -DB_PASSWORD=dydxserver123 -PG_POOL_MAX=2 -PG_POOL_MIN=1 -DB_HOSTNAME=localhost -DB_READONLY_HOSTNAME=localhost -DB_PORT=5435 - -KAFKA_BROKER_URLS=kafka:9092 diff --git a/indexer/services/e2e-testing/.eslintrc.js b/indexer/services/e2e-testing/.eslintrc.js deleted file mode 100644 index e82ac076cc..0000000000 --- a/indexer/services/e2e-testing/.eslintrc.js +++ /dev/null @@ -1,11 +0,0 @@ -const baseConfig = require('./node_modules/@dydxprotocol-indexer/dev/.eslintrc'); - -module.exports = { - ...baseConfig, - - // Override the base configuraiton to set the correct tsconfigRootDir. - parserOptions: { - ...baseConfig.parserOptions, - tsconfigRootDir: __dirname, - }, -}; diff --git a/indexer/services/e2e-testing/README.md b/indexer/services/e2e-testing/README.md deleted file mode 100644 index 56e7973d92..0000000000 --- a/indexer/services/e2e-testing/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# E2E testing - -E2E testing framework for Indexer/protocol. - -### Instructions - -Spin up a containerized environment running both the network and Indexer services: - -``` -cd indexer -docker compose -f docker-compose-e2e-test.yml up -``` - -``` -cd indexer/services/e2e-testing -pnpm build && pnpm test -``` diff --git a/indexer/services/e2e-testing/__tests__/index.test.ts b/indexer/services/e2e-testing/__tests__/index.test.ts deleted file mode 100644 index 30be32bb90..0000000000 --- a/indexer/services/e2e-testing/__tests__/index.test.ts +++ /dev/null @@ -1,48 +0,0 @@ -import Long from 'long'; - -import { - Network, - LocalWallet, - ValidatorClient, - BECH32_PREFIX, - SubaccountInfo, -} from '@dydxprotocol/v4-client-js'; -import { - Ordering, - TransferColumns, - TransferFromDatabase, - TransferTable, - SubaccountTable, -} from '@dydxprotocol-indexer/postgres'; - -export const DYDX_LOCAL_ADDRESS = 'dydx199tqg4wdlnu4qjlxchpd7seg454937hjrknju4'; -export const DYDX_LOCAL_MNEMONIC = 'merge panther lobster crazy road hollow amused security before critic about cliff exhibit cause coyote talent happy where lion river tobacco option coconut small'; - -describe('index', () => { - it('test transfers', async () => { - const wallet = await LocalWallet.fromMnemonic(DYDX_LOCAL_MNEMONIC, BECH32_PREFIX); - // console.log(wallet); - - const client = await ValidatorClient.connect(Network.local().validatorConfig); - // console.log('**Client**'); - // console.log(client); - - const subaccount = new SubaccountInfo(wallet, 0); - const tx = await client.post.deposit( - subaccount, - 0, - new Long(10_000_000), - ); - // console.log('**Deposit Tx**'); - // console.log(tx); - - const defaultSubaccountId: string = SubaccountTable.uuid(wallet.address!, 0); - const transfers: TransferFromDatabase[] = await TransferTable.findAllToOrFromSubaccountId( - { subaccountId: [defaultSubaccountId] }, - [], { - orderBy: [[TransferColumns.id, Ordering.ASC]], - }); - - expect(transfers.length).toBeGreaterThan(0); - }); -}); diff --git a/indexer/services/e2e-testing/jest.config.js b/indexer/services/e2e-testing/jest.config.js deleted file mode 100644 index 54982b9e45..0000000000 --- a/indexer/services/e2e-testing/jest.config.js +++ /dev/null @@ -1,2 +0,0 @@ -// Use the base configuration as-is. -module.exports = require('./node_modules/@dydxprotocol-indexer/dev/jest.config'); diff --git a/indexer/services/e2e-testing/jest.globalSetup.js b/indexer/services/e2e-testing/jest.globalSetup.js deleted file mode 100644 index 7fc6c3e551..0000000000 --- a/indexer/services/e2e-testing/jest.globalSetup.js +++ /dev/null @@ -1,6 +0,0 @@ -// This function runs once before all tests. -module.exports = () => { - // This loads the environment variables for tests. - // eslint-disable-next-line global-require - require('dotenv-flow/config'); -}; diff --git a/indexer/services/e2e-testing/jest.setup.js b/indexer/services/e2e-testing/jest.setup.js deleted file mode 100644 index cd2fbe11a2..0000000000 --- a/indexer/services/e2e-testing/jest.setup.js +++ /dev/null @@ -1 +0,0 @@ -// This file runs before each test file. diff --git a/indexer/services/e2e-testing/package.json b/indexer/services/e2e-testing/package.json deleted file mode 100644 index 3cc8be9a08..0000000000 --- a/indexer/services/e2e-testing/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "e2e-testing", - "version": "0.0.1", - "description": "", - "main": "build/index", - "scripts": { - "start": "node --heapsnapshot-signal=SIGUSR2 -r dotenv-flow/config build/src/index.js", - "build": "rm -rf build/ && tsc", - "build:prod": "pnpm run build", - "build:watch": "pnpm run build -- --watch", - "validate-pnl": "ts-node src/validate-pnl.ts", - "print-block": "ts-node src/print-block.ts", - "coverage": "pnpm test -- --coverage", - "lint": "eslint --ext .ts,.js .", - "lint:fix": "eslint --ext .ts,.js . --fix", - "test": "NODE_ENV=test jest --runInBand --forceExit" - }, - "author": "", - "license": "AGPL-3.0", - "dependencies": { - "@dydxprotocol-indexer/base": "workspace:^0.0.1", - "@dydxprotocol-indexer/kafka": "workspace:^0.0.1", - "@dydxprotocol-indexer/postgres": "workspace:^0.0.1", - "@dydxprotocol-indexer/v4-proto-parser": "workspace:^0.0.1", - "@dydxprotocol-indexer/v4-protos": "workspace:^0.0.1", - "@dydxprotocol/v4-client-js": "^1.0.9", - "big.js": "^6.0.2", - "dotenv-flow": "^3.2.0", - "kafkajs": "^2.1.0", - "lodash": "^4.17.21", - "long": "^5.2.1", - "yargs": "^13.3.0" - }, - "devDependencies": { - "@dydxprotocol-indexer/dev": "workspace:^0.0.1", - "@types/jest": "^28.1.4", - "@types/node": "^18.0.3", - "@types/yargs": "^16.0.0", - "jest": "^28.1.2", - "ts-node": "^10.8.2", - "tsconfig-paths": "^4.0.0", - "typescript": "4.7.4" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/dydxprotocol/indexer.git" - }, - "bugs": { - "url": "https://github.com/dydxprotocol/indexer/issues" - }, - "homepage": "https://github.com/dydxprotocol/indexer#readme" -} diff --git a/indexer/services/e2e-testing/pnpm-global/5/pnpm-lock.yaml b/indexer/services/e2e-testing/pnpm-global/5/pnpm-lock.yaml deleted file mode 100644 index e9da0ceb03..0000000000 --- a/indexer/services/e2e-testing/pnpm-global/5/pnpm-lock.yaml +++ /dev/null @@ -1,7 +0,0 @@ -lockfileVersion: 5.3 - -specifiers: - '@dydxprotocol/v4-client-js': ^1.0.9 - -dependencies: - '@dydxprotocol/v4-client-js': link:../../../../../../../.nvm/versions/node/v18.19.0/pnpm-global/5/node_modules/@dydxprotocol/v4-client-js diff --git a/indexer/services/e2e-testing/src/config.ts b/indexer/services/e2e-testing/src/config.ts deleted file mode 100644 index 8369f10af4..0000000000 --- a/indexer/services/e2e-testing/src/config.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { baseConfigSchema, parseSchema } from '@dydxprotocol-indexer/base'; -import { kafkaConfigSchema } from '@dydxprotocol-indexer/kafka'; -import { postgresConfigSchema } from '@dydxprotocol-indexer/postgres'; - -export const configSchema = { - ...baseConfigSchema, - ...postgresConfigSchema, - ...kafkaConfigSchema, -}; - -export default parseSchema(configSchema); diff --git a/indexer/services/e2e-testing/src/index.ts b/indexer/services/e2e-testing/src/index.ts deleted file mode 100644 index cb0ff5c3b5..0000000000 --- a/indexer/services/e2e-testing/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/indexer/services/e2e-testing/tsconfig.eslint.json b/indexer/services/e2e-testing/tsconfig.eslint.json deleted file mode 100644 index d8fd94c4a8..0000000000 --- a/indexer/services/e2e-testing/tsconfig.eslint.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "./tsconfig.json", - "include": [ - // Repeat included files from tsconfig.json. - "__tests__", - "src", - // Include e.g. configuration files. - "./.*.js", - "./*.js" - ] -} diff --git a/indexer/services/e2e-testing/tsconfig.json b/indexer/services/e2e-testing/tsconfig.json deleted file mode 100644 index 75a714d813..0000000000 --- a/indexer/services/e2e-testing/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "build", - }, - "include": [ - "src", - "__tests__", - ] -}