-
Notifications
You must be signed in to change notification settings - Fork 370
[Discussion] Checking if a node supports attachToTangle #854
Comments
Imo option 2 is better because it is more explicit. Option 1 is aequivalent to sending an invalid and (potentially) unauthorized command, so it is not clear what takes precedence: validation or authorization check. In my opinion that would be a confusing API. But it is a valid solution if defined. Also when using validation frameworks it would probably be cumbersome to work around validation to adhere to the API and to not output misleading error messages. Option 3 could be a separate command for checking if pow is enabled or a more general for checking certain features (easier to extend with further features). Something like
|
@georgmittendorfer nice! I think Option 3 is a great idea as well |
I guess easiest to implement would be to add the commands appearing in REMOTE_LIMIT_API in the getNodeInfo response. |
@nuriel77 that's a good idea as well and pretty easy to do |
Hmmmm There is this PR: #760 It is just a matter of priority. |
That looks quite similar and is a nice approach. Pow capabilities would fit into the getApiConfiguration, wouldn't it? Or would it need another command? |
Something based off of #760 can be implemented and make use of the new configuration interfaces that will be part of 1.5.5. Edit: since this is a place for discussing this already. I've created two separate issues for this (#1038 & #1039) I think @rajivshah3 , @nuriel77, @georgmittendorfer - thoughts? |
Sounds good to me. Aren’t supportsAttachToTangle and supportsRemotePoW the same though? Or am I missing something? |
Sorry, fixed. |
I think |
Closing this discussion in favor of #1062 now being merged :) Thank you for the input everyone! |
Description
Currently, Trinity will send an empty
attachToTangle
request to check if a node supports remote PoW. However, this seems to show in the IRI logs asAPI Validation failed: Invalid parameters
. If the node does not support remote PoW, Trinity recognizes that from the response "attachToTangle is not available on this node" (or something similar). I think there should be a more definitive way (and it should be documented) for checking if a node supportsattachToTangle
.Motivation
As more and more applications and projects use IOTA, there should be definitive and documented ways of checking if nodes support certain features, such as
attachToTangle
. The current implementation requires an emptyattachToTangle
request to be sent and causes a message in the logs to appear (API Validation failed
). This could mislead users into thinking that something is wrong.Proposal
I have two solutions in mind:
1
attachToTangle
requests as the standard way to check if a node supports remote PoW, and document it2
getNodeInfo
response (supportsAttachToTangle
orsupportsRemotePow
, for example). It can be eithertrue
orfalse
getNodeInfo
request is needed (which is already necessary to determine whether a node is in sync) to determine support for remote PoW. This will eliminate the need to send another API requestAm I planning to do it myself with a PR?
Yes, but I first wanted to get other opinions on which proposal would be preferred
The text was updated successfully, but these errors were encountered: