I made a very simple skeleton repo that makes creating a new DVM trivial, all you need to do is write the algorithm you want to implement Even cooler, you can run multiple DVMs with different algorithms in the same process with segregated pubkeys:, e.g. * one DVM for content discovery where it only looks at the requester's follows activity * another for extended network * another for the user's relays' activity * another one that only returns notes with images etc, etc, etc I open sourced this here

Replies (1)

THIS! I have been so confused and trying to figure out how you'd write a DVM. This is very, very helpful! I hope that one day it could be simplified to a flat API like import dvm from "..."; dvm.create({ key: privkey, title: "...", desc: "...", relays: []/*, ...*/ }).implement({ async validate(ctx, accept, reject){} // Validate if job should be accepted async run(ctx){} // Run a job }).start();