atto icon indicating copy to clipboard operation
atto copied to clipboard

Flag to Use Non-Default Node

Open zQueal opened this issue 2 years ago • 4 comments

Changing the node for atto can be a little weird to do. Recompiling just to change the node kind of limits atto in a few ways. Adding a --node flag would override the default node in config.go without recompiling it, or changing it forever.

Especially useful for periods of downtime;

echo $SEED | atto --node "https://rainstorm.city/api" -a 0 balance

Check the balance of apex index from $SEED using the rainstorm.city node, overwriting the default https://proxy.powernode.cc/proxy.

I think it could be very useful. Any thoughts?

zQueal avatar Aug 18 '22 17:08 zQueal

I thought that I would expand on this a bit. I have several compiled versions of atto which each use a different node; atto_rainstorm, atto_powernode etc. It just seems a bit superfluous.

zQueal avatar Aug 30 '22 03:08 zQueal

Thanks for sharing your idea! Hardcoding config for things that shouldn't usually change is a design decision I took from the suckless community. I'm not yet convinced I should complicate the code to allow switching nodes, since this isn't something a regular user should have to do.

Could you elaborate a little bit on your use cases? Do you only do this when a server is down? In this case I would maybe consider putting a list of nodes into config.go; if one node fails to respond, the next would be used automatically. Generally, however, I would advice not to use a node that frequently goes offline.

codesoap avatar Aug 31 '22 13:08 codesoap

Could you elaborate a little bit on your use cases? Do you only do this when a server is down?

Yes. Something like this would only be for when a node is down. Offloading that decision to atto on connection failure would accomplish the same thing, so equally desirable.

The use case, currently, is if the primary hard-coded node is down the only two things you can do is either wait, or recompile with a new node. Adding a flag would allow you to change without recompiling, and on the fly. Round robin connecting would basically do the same thing (on error).

zQueal avatar Aug 31 '22 18:08 zQueal

Hmm, I'm still not too convinced improving atto for this is necessary.

Can you elaborate on why you nodes go down so frequently? I feel like you have chosen a bad node, if it goes down so regularly, that you already have a go-to workaround for this.

codesoap avatar Sep 02 '22 16:09 codesoap

Can you elaborate on why you nodes go down so frequently? I feel like you have chosen a bad node, if it goes down so regularly, that you already have a go-to workaround for this.

I use the natrium node. It goes down every so often, and when it is down, to use nano (as atto is my only wallet), I have to recompile or wait. It's a bit of a hassle, especially when using such a popular node. It's happened about three times this year so far.

zQueal avatar Nov 25 '22 12:11 zQueal

It's unfortunate that the natrium node is that unreliable and I can give you no recommendation for a better node, but after thinking about it, I don't think this is a problem that I want to work around with atto. I don't want to complicate the code, just because some nodes are unstable. Sorry. I'm closing this issue for now.

codesoap avatar Dec 14 '22 16:12 codesoap