Closed MorningLightMountain713 closed 2 months ago
All tests passing. We've cracked 2k tests!
I added another check - if sudo systemctl status zelcash.service
returns an error, we skip enabling zmq
The above command will return an error if the service is not running, or doesn't exist.
Have also added another test around this.
Fixed up function name where I had a typo too.
If we get this merged, I'll get a pull in to update the default fluxd multitoolbox config
What this pull does
fullnode
packge entirelyDaemonConfig
class to service utils to replace the fullnode package.file:xxx
hack that was inpackage.json
zeromq
package (5.3.0 is compatible with Ubuntu 18 and 20)localhost:16126
This pull request is a precursor for one of my other pulls so I can make it smaller.
Background
Currently, we have to poll fluxd whenever we want updates. This means data is stale, and there is a lot of unnecessary cycles burnt looking for data, and we are using multiple levels of caching, which aren't really a good fit for what we are trying to do.
With the zmq endpoint enabled, we can subscribe to block updates, and know exactly when new information is ready to fetch. So we don't need to poll anymore.
This pub / sub endpoint is read only and only available on localhost.
Testing
I've tested this on Ubuntu 18 running Node 14.18.1 - the only caveat is that zeromq has to build from source on ubuntu 18, which takes roughly an extra 30 seconds to install on the first run.
I've tested it on an ubuntu 20 and 22 node - both update fine after the 20 minute timeout. (give fluxd time to warm up)
I've added quite a lot of tests and checks around the fluxd config file. Obviously we don't want to break fluxd. This is the process and the assumptions that have been made:
Assumption made that all nodes have
zelcash.service
as the supervisor of fluxd.getblockcount
otherwise update is skippedmultitoolbox
flux.conf.new
fileflux.conf.bak
of the exact config as read from the file.flux-cli
is run with theconf=
flag pointing to the flux.conf.new file to check the file syntax.zmqEnabled
lock file so the updater only runs once.I'd like to get this run on a bunch of nodes first, or feedback on if there are nodes out there that are running non standard config file locations and stuff.