Skip to content

Commit

Permalink
adding debug messages for rpc connnection
Browse files Browse the repository at this point in the history
  • Loading branch information
coinchimp committed Aug 5, 2024
1 parent eaa97de commit fc24c76
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,23 @@ if (paymentInterval < 1 || paymentInterval > 24) {
if (DEBUG) monitoring.debug(`Main: Payment interval set to ${paymentInterval} hours`);

// Type annotations
let rpc: RpcClient | null = null;
if (DEBUG) monitoring.debug(`Main: Setting up RPC client`);
const resolverOptions = config.node ? { urls: config.node } : undefined;
const resolver = new Resolver(resolverOptions);

if (DEBUG) {
monitoring.debug(`Main: Resolver Options:`);
console.log(resolverOptions)
}
const rpc = new RpcClient({
resolver: resolver,
encoding: Encoding.Borsh,
networkId: config.network,
});
let transactionManager: trxManager | null = null;
let rpcConnected = false;

const startRpcConnection = async () => {
if (DEBUG) monitoring.debug(`Main: Setting up RPC client`);

const resolverOptions = config.node ? { urls: config.node } : undefined;
const resolver = new Resolver(resolverOptions);

if (DEBUG) monitoring.debug(`Main: Resolver(${resolverOptions})`);

rpc = new RpcClient({
resolver: resolver,
encoding: Encoding.Borsh,
networkId: config.network,
});

if (DEBUG) monitoring.debug(`Main: Starting RPC connection`);
try {
await rpc.connect();
Expand Down

0 comments on commit fc24c76

Please sign in to comment.