forest icon indicating copy to clipboard operation
forest copied to clipboard

Split the Forest client and Forest node into two separate binaries

Open lemmih opened this issue 1 year ago • 1 comments

Issue summary

Right now, the Forest node (aka the daemon) and the Forest client are included in the same executable. This creates awkward situations when we're parsing command-line arguments and it adds a bunch of unnecessary dependencies to both the node and the client (ie the client depends on daemonize-me even though that crate is only used by the daemon).

We should split the programs into separate executables. For now, we can keep them both in the same crate if it is too much trouble to split them up.

This code snippet shows where the daemon and client part ways. If cmd is Some(_), the client runs. If there's no command, the daemon runs: https://github.com/ChainSafe/forest/blob/ecc35b0582f08068ac013e3af7a2a8e2739b72a5/forest/src/main.rs#L101-L106

Other information and links

lemmih avatar Sep 13 '22 08:09 lemmih

Sounds like a good idea. We could go even further by adding a 3rd binary, something along the lines of forest-util. The difference between it and the client binary would be that it wouldn't depend on a node running anywhere, e.g. for forest chain fetch. Though if we don't expect many more standalone commands in the future it may not be that useful.

LesnyRumcajs avatar Sep 13 '22 08:09 LesnyRumcajs