Skip to content

Commit

Permalink
Remove unused files
Browse files Browse the repository at this point in the history
in particular, the old indexer
  • Loading branch information
cronokirby committed Sep 27, 2024
1 parent 47f12c4 commit 984adc4
Show file tree
Hide file tree
Showing 23 changed files with 22 additions and 955 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ or plug in credentials for an already running database via environment variables
```
# add these to e.g. `.envrc`:
export PENUMBRA_GRPC_ENDPOINT="https://testnet.plinfra.net"
export PENUMBRA_INDEXER_ENDPOINT="postgresql://<PGUSER>:<PGPASS>@<PGHOST>:<PGPORT>/<PGDATABASE>?sslmode=require""
export PENUMBRA_INDEXER="postgresql://<PGUSER>:<PGPASS>@<PGHOST>:<PGPORT>/<PGDATABASE>?sslmode=require""
export NEXT_PUBLIC_CHAIN_ID="penumbra-testnet-phobos-2"
# optional: if you see "self-signed certificate in certificate chain" errors,
# you'll likely need to export a `ca-cert.pem` file for the DB TLS.
Expand All @@ -35,7 +35,7 @@ export NEXT_PUBLIC_CHAIN_ID="penumbra-testnet-phobos-2"
If you see an error `self-signed certificate in certificate chain`, then you'll need to:

1. obtain the CA certificate file for the backend database you're connecting to, and export it as `PENUMBRA_INDEXER_CA_CERT`.
2. _remove_ the `sslmode=require` string on the `PENUMBRA_INDEXER_ENDPOINT` var.
2. _remove_ the `sslmode=require` string on the `PENUMBRA_INDEXER` var.

See context in #55. After configuring that information, run `just dev` again in the nix shell, and you should have events visible.

Expand All @@ -47,7 +47,7 @@ with [ABCI event indexing enabled](https://guide.penumbra.zone/node/pd/indexing-
you'll want to set are:

* `PENUMBRA_GRPC_ENDPOINT`: the URL to a remote node's `pd` gRPC service
* `PENUMBRA_INDEXER_ENDPOINT`: the URL to a Postgre database containing ABCI events
* `PENUMBRA_INDEXER`: the URL to a Postgre database containing derived events from pindexer
* `PENUMBRA_INDEXER_CA_CERT`: optional; if set, the database connection will use the provided certificate authority when validating TLS
* `NEXT_PUBLIC_CHAIN_ID`: the chain id for the network being indexed, controls asset-registry lookups
* `NEXT_PUBLIC_CUILOA_URL`: the URL for a block-explorer application, for generating URLs for more block/transaction info
Expand Down
11 changes: 0 additions & 11 deletions scripts/tmp-lint-excludes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ export default [
'src/components/executionHistory/blockDetails.tsx',
'src/components/executionHistory/blockSummary.tsx',
'src/components/layout.tsx',
'src/components/liquidityPositions/closedStatus.tsx',
'src/components/liquidityPositions/currentStatus.tsx',
'src/components/liquidityPositions/executionEvent.tsx',
'src/components/liquidityPositions/openStatus.tsx',
'src/components/liquidityPositions/timelinePosition.tsx',
'src/components/liquidityPositions/withdrawnStatus.tsx',
'src/components/lpAssetView.tsx',
'src/components/lpSearchBar.tsx',
'src/components/navbar.tsx',
// "src/components/pairSelector.tsx",
Expand All @@ -27,11 +21,7 @@ export default [
// "src/constants/configConstants.ts",
'src/pages/_app.tsx',
// 'src/pages/api/arbs/[...params].ts',
'src/pages/api/blockTimestamps/[...params].js',
'src/pages/api/lp/[lp_nft_id]/position.ts',
'src/pages/api/lp/[lp_nft_id]/trades.js',
'src/pages/api/lp/[lp_nft_id].js',
'src/pages/api/lp/block/[...params].js',
'src/pages/api/lp/positionsByPrice/[...params].ts',
'src/pages/api/ohlc/[...params].ts',
'src/pages/api/shieldedPool/[token_inner].ts',
Expand All @@ -40,7 +30,6 @@ export default [
'src/pages/block/[block_height].tsx',
'src/pages/explorer/index.tsx',
'src/pages/index.tsx',
'src/pages/lp/[lp_nft_id].tsx',
'src/pages/lp/utils.tsx',
'src/pages/pair/[...params].tsx',
'src/pages/pair/index.tsx',
Expand Down
10 changes: 6 additions & 4 deletions src/backend/indexer/lp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ export class LPQuerier {
* These will be ordered from first to last.
*/
async updates(id: LPID): Promise<LPUpdate[]> {
// TODO: remove is null after pindexer update.
const rows = await this.pool.query({
text: `
SELECT
id::INTEGER,
(SELECT json_array(b.height, b.timestamp) FROM block_details b WHERE b.height = d.height LIMIT 1),
encode(position_id, 'base64'),
split_part(state, '_', 1),
reserves1::TEXT,
reserves2::TEXT,
COALESCE(reserves1::TEXT, '0'),
COALESCE(reserves2::TEXT, '0'),
(SELECT
json_array(inflow1, inflow2, encode(context_start, 'base64'), encode(context_end, 'base64'))
FROM
Expand All @@ -66,15 +67,16 @@ export class LPQuerier {

private async stateEvent(state: LPState, start?: number, end?: number): Promise<LPUpdate[]> {
const MAX_EVENTS = 10_000;
// TODO: remove is null after pindexer update.
const rows = await this.pool.query({
text: `
SELECT
id::INTEGER,
(SELECT json_array(b.height, b.timestamp) FROM block_details b WHERE b.height = d.height LIMIT 1),
encode(position_id, 'base64'),
split_part(state, '_', 1),
reserves1::TEXT,
reserves2::TEXT,
COALESCE(reserves1::TEXT, '0'),
COALESCE(reserves2::TEXT, '0'),
NULL
FROM
dex_lp_update d
Expand Down
2 changes: 1 addition & 1 deletion src/components/blocks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { LoadingSpinner } from "@/components/util/loadingSpinner";
import { useEffect, useRef, useState } from "react";
import { BlockSummary } from "@/components/executionHistory/blockSummary";
import { BlockInfo as OldBlockInfo } from "@/utils/indexer/types/lps";
import { BlockInfo as OldBlockInfo } from "@/utils/types/block";
import { SwapExecutionWithBlockHeight } from "@/utils/protos/types/DexQueryServiceClientInterface";
import { BlockInfoMap } from "@/utils/types/block";
import { BlockInfo } from "@/penumbra/block";
Expand Down
2 changes: 1 addition & 1 deletion src/components/executionHistory/blockSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const BlockSummary = ({ blockHeight, blockSummary }: BlockSummaryProps) =
<Box w='50%'>
<Text
as='a'
href={'/block/' + blockHeight}
href={`/block/${blockHeight}`}
fontSize='large'
fontWeight='bold'
w='50%'
Expand Down
37 changes: 0 additions & 37 deletions src/components/liquidityPositions/closedStatus.tsx

This file was deleted.

71 changes: 0 additions & 71 deletions src/components/liquidityPositions/executionEvent.tsx

This file was deleted.

51 changes: 0 additions & 51 deletions src/components/liquidityPositions/openStatus.tsx

This file was deleted.

49 changes: 0 additions & 49 deletions src/components/liquidityPositions/timelinePosition.tsx

This file was deleted.

42 changes: 0 additions & 42 deletions src/components/liquidityPositions/withdrawnStatus.tsx

This file was deleted.

Loading

0 comments on commit 984adc4

Please sign in to comment.