HTTP Client-Server model
Deprecate sia-cli in favor of a real Sia daemon (siad) that processes requests from a Sia client (siac, and eventually a web front-end). Running make
will produce binaries for both siad and siac.
Limitations/extensions:
- Some configuration values are hardcoded, such as the port number. This is trivial to fix, I just haven't gotten around to it.
siad
should probably use cobra to facilitate this. - siac can start siad, but does so by calling
exec.Cmd()
. This feels like a hack, and it's not cross platform. Worst case, we can just drop this functionality; it's not a huge deal to call siad separately. - siad needs to more rigorously check its inputs. Specifically, every instance of
fmt.Sscan
needs error checking. - I'd like siad to log requests and such, which implies a
--log
flag for specifying what file to log to. - The usage information provided by cobra is lacking. For example, the proper usage of the "host" subcommand is
siac host [MB] [price] [freezeCoins] [freezeBlocks]
, but cobra doesn't know that because they aren't flags. I expect this will be a tedious and verbose task.
I'm going to bed.