rust-ceramic icon indicating copy to clipboard operation
rust-ceramic copied to clipboard

Add `--initial-interests` configuration variable

Open m0ar opened this issue 10 months ago • 1 comments

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 👌 )

m0ar avatar Mar 28 '25 08:03 m0ar

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:

  1. 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).
  2. 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 Migrations command 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.

dav1do avatar Mar 31 '25 16:03 dav1do