Error rendering node's pubkey when there's no match on tx
pdp2121 opened this issue · 11 comments
This is because clio nodes don't provide a public key with their clio response.
@pdp2121 Can you give me the link for the example that you have provided in the image?
- Also, what code section/what files do I need to check to possibly explore the solution?
- Is this something that can be solved by making changes in the explorer repository itself or does the root of this problem/issue lie in the clio repo, some other repository or elsewhere?
Please let me know if this issue is still relevant so I can give it a try.
@pdp2121 Can you give me the link for the example that you have provided in the image?
You can see it on any invalid transaction hash, e.g. https://livenet.xrpl.org/transactions/E64A81D9FDE13F2FE28A98F337809D894E3279C75ED8E784114C650A04DFC65D
- Also, what code section/what files do I need to check to possibly explore the solution?
- Is this something that can be solved by making changes in the explorer repository itself or does the root of this problem/issue lie in the clio repo, some other repository or elsewhere?
This is definitely an Explorer problem. The Transactions
folder should be a good place to start - you can find the error message and figure out a better error message to put in for a Clio node.
The code that has the translation is here: https://github.com/ripple/explorer/blob/staging/src/containers/Transactions/index.tsx#L26-L29
The code that makes the connection info of xrpl-client is here: https://github.com/ripple/explorer/blob/staging/src/containers/NoMatch/index.tsx#L33
The translation is here: https://github.com/ripple/explorer/blob/staging/public/locales/en-US/translations.json#L203C4-L203C23
The issue stems from connection.server.publicKey
not being available so there needs to be a conditional check but I dont believe that can be done within the value for an i18n-next translation.
One option is scrapping listing the node you are connected to even though this can be helpful information when tracking down why a transaction doesnt exist. Many times it is because a node does not have that ledger.
Seems like the problem might be with nvm, the Clio xrpl-client
and its Clio support, then.server_info
response doesn't have any pubkey info.
One option is scrapping listing the node you are connected to even though this can be helpful information when tracking down why a transaction doesnt exist. Many times it is because a node does not have that ledger.
I would still display it if it exists.
@mvadari mentioned in a later comment that "nvm, the Clio server_info response doesn't have any pubKey info." I've reached the same conclusion. Upon debugging, I saw that the publicKey is empty.
There are these fields in server:
"version": "empty",
"uptime": "server's total uptime",
"publicKey": "empty",
"networkId": "current network being used (perhaps the mainnet)",
"uri": "server's webSocket address and port number"
I tried changing the line in translations.json and, it worked:
I changed it as such:
"server_ledgers_hint": "This node {{connection.server.uptime}} only contains ledgers {{connection.ledger.validated}}",
And it correctly shows the uptime. But the pubKey just won't show up because it is empty.
I am genuinely stuck. Is there any solution to this? Or can it not be solved at all?
I'd personally just leave out the public key part if it doesn't exist, or rewrite the hint to say This Clio node ...
instead.
I'd personally just leave out the public key part if it doesn't exist, or rewrite the hint to say
This Clio node ...
instead.
Okay, will do