Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ REDIS_URL="redis://localhost:6379"
BLOCK_BUILDER_URL=http://localhost:3001

# proxy
BUILDER_TARGET_NETWORK=testnet
BLOCK_BUILDER_VERSION=0.0.0
PROXY_DOMAIN=localhost
PROXY_FRP_TOKEN=dummy
Expand Down
1 change: 1 addition & 0 deletions packages/indexer/src/services/proxy.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { config } from "@intmax2-function/shared";

export const getProxyMeta = async () => {
return {
targetNetwork: config.BUILDER_TARGET_NETWORK,
version: config.BLOCK_BUILDER_VERSION,
domain: config.PROXY_DOMAIN,
token: config.PROXY_FRP_TOKEN,
Expand Down
5 changes: 5 additions & 0 deletions packages/shared/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ export const config = cleanEnv(process.env, {
// block builder
BLOCK_BUILDER_URL: url({ devDefault: "http://localhost:3001" }),
// proxy
BUILDER_TARGET_NETWORK: str({
choices: ["devnet", "testnet", "mainnet"],
default: "testnet",
desc: "Target network environment for the builder",
}),
BLOCK_BUILDER_VERSION: str({ default: "0.0.0" }),
PROXY_DOMAIN: str({ default: "localhost", desc: "" }),
PROXY_FRP_TOKEN: str({ default: "dummy", desc: "" }),
Expand Down
12 changes: 8 additions & 4 deletions packages/shared/src/db/baseIndexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export class BaseIndexer {
await batch.commit();
// this.invalidateCache();
} catch (error) {
logger.error(error);
logger.error(
`Failed to add or update indexers: ${error instanceof Error ? error.message : error}`,
);
throw new AppError(500, ErrorCode.INTERNAL_SERVER_ERROR, "Failed to add or update indexers");
}
}
Expand Down Expand Up @@ -75,7 +77,9 @@ export class BaseIndexer {

// this.invalidateCache();
} catch (error) {
logger.error(`Failed to update indexer active status: ${error}`);
logger.error(
`Failed to update indexer active status: ${error instanceof Error ? error.message : error}`,
);
throw new AppError(
500,
ErrorCode.INTERNAL_SERVER_ERROR,
Expand All @@ -102,7 +106,7 @@ export class BaseIndexer {

return indexers;
} catch (error) {
logger.error(error);
logger.error(`Failed to list indexers: ${error instanceof Error ? error.message : error}`);
throw new AppError(500, ErrorCode.INTERNAL_SERVER_ERROR, "Failed to list indexers");
}
}
Expand Down Expand Up @@ -139,7 +143,7 @@ export class BaseIndexer {

return allItems;
} catch (error) {
logger.error(error);
logger.error(`Failed to list indexers: ${error instanceof Error ? error.message : error}`);
throw new AppError(
500,
ErrorCode.INTERNAL_SERVER_ERROR,
Expand Down