You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to generate operator id in the Guardian UI I was experiencing gRPC Timeout Errors.
I noticed that these errors are logged in guardian-service, worker-service-1 and worker-service-2
I did some debugging in the worker-service and I figured out that the localnode address in the Environment class (worker-service/src/api/helpers/environment.ts) is always localhost despite the fact that I set it to the correct IP address in the LOCALNODE_ADDRESS environment variable.
Further debugging showed that the localnode address is read from the queue message in the worker service (worker-service/src/api/worker.ts:239) but it is always undefined.
I looked into the guardian-service code and I saw that neither localNodeAddress nor localNodeProtocol is set in the message (see Workers.addNonRetryableTask - common/src/helpers/workers.ts:118)
I ended up adding the following piece of code to the localNodeAddress and localNodeProtocol functions and this proved to be a workaround to my problem - Guardian started connecting to Hedera properly.
if (!task.data.localNodeAddress) {
task.data.localNodeAddress = Environment.localNodeAddress;
}
if (!task.data.localNodeProtocol) {
task.data.localNodeProtocol = Environment.localNodeProtocol;
}
After the change these functions look as follows:
/**
* Add non retryable task
* @param task
* @param priority
*/
public addNonRetryableTask(task: ITask, priority: number): Promise<any> {
if (!task.dWorkers.addNonRetryableTaskata.network) {
task.data.network = Environment.network;
}
if (!task.data.nodes) {
task.data.nodes = Environment.nodes;
}
if (!task.data.mirrorNodes) {
task.data.mirrorNodes = Environment.mirrorNodes;
}
if (!task.data.localNodeAddress) {
task.data.localNodeAddress = Environment.localNodeAddress;
}
if (!task.data.localNodeProtocol) {
task.data.localNodeProtocol = Environment.localNodeProtocol;
}
return this.addTask(task, priority, false);
}
/**
* Add retryable task
* @param task
* @param priority
* @param attempts
*/
public addRetryableTask(task: ITask, priority: number, attempts: number = 0): Promise<any> {
if (!task.data.network) {
task.data.network = Environment.network;
}
if (!task.data.nodes) {
task.data.nodes = Environment.nodes;
}
if (!task.data.mirrorNodes) {
task.data.mirrorNodes = Environment.mirrorNodes;
}
if (!task.data.localNodeAddress) {
task.data.localNodeAddress = Environment.localNodeAddress;
}
if (!task.data.localNodeProtocol) {
task.data.localNodeProtocol = Environment.localNodeProtocol;
}
return this.addTask(task, priority, true, attempts);
}
Could you please verify if this is a bug?
Step to reproduce
Steps to reproduce the behavior:
Deploy Hedera Local Node on one host
Deploy Guardian on a different host and point it to the local Hedera node by IP address
Create account in Guardian and generate operator id
The operation will fail with gRPC timeout error.
Expected behavior
Guardian connects to Hedera local node without additional code modifications.
The text was updated successfully, but these errors were encountered:
Problem description
I set up Hedera Local Node and Guardian using docker on two different virtual machines.
I experienced the following issue for this code revision (commit 141b80b (HEAD -> main, tag: v2.20.1, origin/main, origin/HEAD))
I configured LOCALNODE_ADDRESS in
configs/.env.develop.guardian.system
to point to the IP address of my Hedera VM.When trying to generate operator id in the Guardian UI I was experiencing gRPC Timeout Errors.
I noticed that these errors are logged in
guardian-service
,worker-service-1
andworker-service-2
I did some debugging in the
worker-service
and I figured out that the localnode address in the Environment class (worker-service/src/api/helpers/environment.ts) is always localhost despite the fact that I set it to the correct IP address in the LOCALNODE_ADDRESS environment variable.Further debugging showed that the localnode address is read from the queue message in the worker service (worker-service/src/api/worker.ts:239) but it is always undefined.
I looked into the guardian-service code and I saw that neither
localNodeAddress
norlocalNodeProtocol
is set in the message (see Workers.addNonRetryableTask - common/src/helpers/workers.ts:118)I ended up adding the following piece of code to the
localNodeAddress
andlocalNodeProtocol
functions and this proved to be a workaround to my problem - Guardian started connecting to Hedera properly.After the change these functions look as follows:
Could you please verify if this is a bug?
Step to reproduce
Steps to reproduce the behavior:
Expected behavior
Guardian connects to Hedera local node without additional code modifications.
The text was updated successfully, but these errors were encountered: