Add `--initial-interests` configuration variable
It would be great to be able to ship a ceramic-one configuration in a compose or env file which includes which models it should initially care about, and not have to manually set interests with the http-client or a request to /interests.
I imagine this functionality: when the daemon starts, pass any models in --initial-interests to whatever handles interests, and "upsert" those into potentially existing interests.
(Note: I do plan to PR this myself, but any pointers to where/how would be appreciated 👌 )
This seems helpful. I could see it as a path to a config json object with one field for now, or its own flag (Vec<String> of multibase encoded interests). Here are two ideas about how it might be implemented:
- Update the DaemonOpts to include this flag, load the file/config, and process it (probably by passing it to the API server, which can then register the interests, or it could happen before starting the server).
- Create a new Command that does these sort of admin operations. This would require some information about connecting to the database and creating the interest/event services to process the changes (the
Migrationscommand should give an idea of what this looks like). As the database requires a lock, this wouldn't work while the server is running unless it was able to use the http routes in that case.. so I think option one is simpler.