Skip to content

Commit

Permalink
Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
0237h committed Dec 12, 2023
2 parents 2ec04e9 + 755d4b1 commit a2ba714
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/clickhouse/createClient.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// from: https://github.com/pinax-network/substreams-clock-api/blob/main/src/clickhouse/createClient.ts
import { createClient } from "@clickhouse/client-web";
import { ping } from "./ping.js";
import { APP_NAME, config } from "../config.js";
Expand Down
1 change: 0 additions & 1 deletion src/clickhouse/makeQuery.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// from: https://github.com/pinax-network/substreams-clock-api/blob/main/src/clickhouse/makeQuery.ts
import { logger } from "../logger.js";
import * as prometheus from "../prometheus.js";
import client from "./createClient.js";
Expand Down
1 change: 0 additions & 1 deletion src/clickhouse/ping.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// from: https://github.com/pinax-network/substreams-clock-api/blob/main/src/clickhouse/ping.ts
import { PingResult } from "@clickhouse/client-web";
import client from "./createClient.js";

Expand Down
6 changes: 3 additions & 3 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ const opts = program
.description(pkg.description)
.showHelpAfterError()
.addOption(new Option("-p, --port <number>", "HTTP port on which to attach the API").env("PORT").default(DEFAULT_PORT))
.addOption(new Option("-v, --verbose <boolean>", "Enable verbose logging").choices(["true", "false"]).env("VERBOSE").default(DEFAULT_VERBOSE))
.addOption(new Option("--hostname <string>", "Server listen on HTTP hostname").env("HOSTNAME").default(DEFAULT_HOSTNAME))
.addOption(new Option("--host <string>", "Database HTTP hostname").env("HOST").default(DEFAULT_HOST))
.addOption(new Option("--database <string>", "The database to use inside ClickHouse").env("DATABASE").default(DEFAULT_DATABASE))
.addOption(new Option("--username <string>", "Database user").env("USERNAME").default(DEFAULT_USERNAME))
.addOption(new Option("--password <string>", "Password associated with the specified username").env("PASSWORD").default(DEFAULT_PASSWORD))
.addOption(new Option("--database <string>", "The database to use inside ClickHouse").env("DATABASE").default(DEFAULT_DATABASE))
.addOption(new Option("--max-limit <number>", "Maximum LIMIT queries").env("MAX_LIMIT").default(DEFAULT_MAX_LIMIT))
.addOption(new Option("-v, --verbose <boolean>", "Enable verbose logging").choices(["true", "false"]).env("VERBOSE").default(DEFAULT_VERBOSE))
.parse()
.opts();

Expand All @@ -41,4 +41,4 @@ export const config = z.object({
password: z.string(),
maxLimit: z.coerce.number(),
verbose: z.coerce.boolean(),
}).parse(opts);
}).parse(opts);
2 changes: 1 addition & 1 deletion src/fetch/GET.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ export default async function (req: Request) {
logger.warn(`Not found: ${pathname}`);
prometheus.request_error.inc({ pathname, status: 404 });
return new Response("Not found", { status: 404 });
}
}
1 change: 0 additions & 1 deletion src/fetch/chains.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// from: https://github.com/pinax-network/substreams-clock-api/blob/main/src/fetch/chains.ts
import { makeQuery } from "../clickhouse/makeQuery.js";
import { logger } from "../logger.js";
import * as prometheus from "../prometheus.js";
Expand Down
1 change: 0 additions & 1 deletion src/fetch/health.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// from: https://github.com/pinax-network/substreams-clock-api/blob/main/src/fetch/health.ts
import client from "../clickhouse/createClient.js";
import { logger } from "../logger.js";
import * as prometheus from "../prometheus.js";
Expand Down
2 changes: 0 additions & 2 deletions src/fetch/openapi.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// from: https://github.com/pinax-network/substreams-clock-api/blob/main/src/fetch/openapi.ts
import pkg from "../../package.json" assert { type: "json" };

import { OpenApiBuilder, SchemaObject, ExampleObject, ParameterObject } from "openapi3-ts/oas31";
Expand Down Expand Up @@ -100,7 +99,6 @@ const amountFilter = amountExamplesArrayFilter.map(name => {
} as ParameterObject
})


export default new OpenApiBuilder()
.addInfo({
title: pkg.name,
Expand Down
2 changes: 0 additions & 2 deletions src/queries.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// from: https://github.com/pinax-network/substreams-clock-api/blob/main/src/queries.spec.ts

import { expect, test } from "bun:test";
import {
getChain,
Expand Down
2 changes: 1 addition & 1 deletion src/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,4 @@ export function getTransfers(searchParams: URLSearchParams, example?: boolean) {

export function getChain() {
return `SELECT DISTINCT chain FROM module_hashes`;
}
}
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ export function parseTimestamp(timestamp?: string | null | number) {
}
}
return undefined;
}
}

0 comments on commit a2ba714

Please sign in to comment.