Oddbean new post about | logout
 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();