Skip to content

Commit

Permalink
clearful log
Browse files Browse the repository at this point in the history
  • Loading branch information
fewensa committed Nov 8, 2024
1 parent a3cf2d9 commit 0627825
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/common/src/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export abstract class AbstractGraphqlService {
},
});
} catch (e: any) {
throw new Error(`[${query.endpoint}]: ${e}`);
throw new Error(`[${query.endpoint}]: \n${requestBody} \n${e}`);
}
const { errors, data } = response.data;
if (errors) {
Expand Down
25 changes: 12 additions & 13 deletions packages/publisher-client/src/command/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class PublisherStarter {
endpoint: this._nearGraphqlEndpoint!,
ids: options.aggregatorAddresses,
});
} catch (e) {
} catch (e: any) {
// @ts-ignore
logger.error(`==== Fetch aggregators failed: ${e.message}`, {
target: "main",
Expand Down Expand Up @@ -406,7 +406,7 @@ export class PublisherStarter {
],
deriveAddress,
);
} catch (e) {
} catch (e: any) {
// @ts-ignore
logger.error(
`===> estimate gasLimit error: ${JSON.stringify(e.cause)}, ${
Expand Down Expand Up @@ -452,9 +452,9 @@ export class PublisherStarter {

let result;
try {
// @ts-ignore
result = await lifecycle.near
.contractAggregator(aggregated.aggregator!)
// @ts-ignore
.publish_external({
signerAccount: new NearAccount(
lifecycle.near.near.connection,
Expand All @@ -472,7 +472,7 @@ export class PublisherStarter {
gas: "300000000000000",
amount: 0,
});
} catch (e) {
} catch (e: any) {
// @ts-ignore
logger.error(
`===> publish_external error, try get result from indexer: ${e.message}`,
Expand Down Expand Up @@ -519,8 +519,7 @@ export class PublisherStarter {
result.mpc_options,
lifecycle,
);
} catch (e) {
// @ts-ignore
} catch (e: any) {
logger.error(
`===> relayMpcTx error: ${JSON.stringify(e.cause)}, ${e.reason}`,
{
Expand Down Expand Up @@ -569,7 +568,7 @@ export class PublisherStarter {
],
deriveAddress,
);
} catch (e) {
} catch (e: any) {
// @ts-ignore
logger.error(
`===> estimate gasLimit error: ${JSON.stringify(e.cause)}, ${
Expand Down Expand Up @@ -614,9 +613,9 @@ export class PublisherStarter {

let result;
try {
// @ts-ignore
result = await lifecycle.near
.contractAggregator(publishChainConfig.aggregator!)
// @ts-ignore
.sync_publish_config_to_remote({
signerAccount: new NearAccount(
lifecycle.near.near.connection,
Expand All @@ -634,7 +633,7 @@ export class PublisherStarter {
gas: "300000000000000",
amount: 0,
});
} catch (e) {
} catch (e: any) {
// @ts-ignore
logger.error(
`===> sync_publish_config_to_remote error, try get result from indexer: ${e.message}`,
Expand Down Expand Up @@ -687,7 +686,7 @@ export class PublisherStarter {
result.mpc_options,
lifecycle,
);
} catch (e) {
} catch (e: any) {
// @ts-ignore
logger.error(
`===> relayMpcTx error: ${JSON.stringify(e.cause)}, ${e.reason}`,
Expand Down Expand Up @@ -772,9 +771,9 @@ export class PublisherStarter {
aggregator: string,
lifecycle: PublisherLifecycle,
): Promise<boolean> {
// @ts-ignore
const mpcConfig = await lifecycle.near
.contractAggregator(aggregator)
// @ts-ignore
.get_mpc_config();
logger.debug(`===> mpcConfig: ${JSON.stringify(mpcConfig)}`, {
target: "check-aggregator-balance",
Expand All @@ -785,9 +784,9 @@ export class PublisherStarter {

let signerDepositRequired = new Decimal(0);
try {
// @ts-ignore
const _signerDepositRequired = await lifecycle.near
.contractSigner(mpcConfig.mpc_contract)
// @ts-ignore
.experimental_signature_deposit();
logger.debug(`===> signerDepositRequired: ${_signerDepositRequired}`, {
target: "check-aggregator-balance",
Expand All @@ -808,7 +807,7 @@ export class PublisherStarter {
return false;
}
}
} catch (e) {
} catch (e: any) {
// @ts-ignore
logger.error(`==> Fetch signature_deposit error: ${e.message}`, {
target: "check-aggregator-balance",
Expand Down
2 changes: 1 addition & 1 deletion scripts/start-reporter-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORK_PATH=${BIN_PATH}/../

cd ${WORK_PATH}

# npm run build:offchain
npm run build:offchain

cd ${WORK_PATH}/packages/reporter-client

Expand Down

0 comments on commit 0627825

Please sign in to comment.