From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mimir.eigenstate.org ([206.124.132.107]) by ewsd; Tue Sep 1 00:57:32 EDT 2020 Received: from abbatoir.fios-router.home (pool-74-101-2-6.nycmny.fios.verizon.net [74.101.2.6]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id f88973db (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO) for <9front@9front.org>; Mon, 31 Aug 2020 21:57:23 -0700 (PDT) Message-ID: <6BA572726B74565AC9F09D780007F6E7@eigenstate.org> To: 9front@9front.org Subject: Re: [9front] ndb/registry Date: Mon, 31 Aug 2020 21:57:22 -0700 From: ori@eigenstate.org In-Reply-To: <324735A7-38EE-4288-87B3-765667AEF962@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: compliant base scripting WEB2.0 package cloud-oriented interface > Hey, I’ve been working this last week on bringing ndb/registry over from inferno, but in a way that matches well with the rest of our ndb. > I have two binaries, ndb/registry and ndb/regquery. ndb/registry reads from /lib/ndb/registry, which would contain a list of local services you want to register on start up. They’re in regular ndb format, and look like > > service=tcp!myipaddr!1234 > auth=none label=myservice > mtpt=/n/myservice > > You can add a service by writing, `add tcp!myipaddr!1234 label myservice [mtpt mymtpt label mylabel]` to /net/registry, rm `rm tcp!myipaddr!1234`, edit, `update tcp!myipaddr!1234 label newlabel` or any other tuple. Dump will create a dump of the current registry to /lib/ndb/regdump, refresh will reload the services from the db - while keeping any that you’ve added after startup untouched. > > regquery opens and reads /net/registry, and outputs any matching service descriptions `ndb/regquery myservice`, in tuple format; or as a plumbable string (currently only srv and srvtls) with -s, and will list all services when passed `ndb/regquery all`. > > eg: > > ndb/regquery grid > service=tcp!myservice!1234 label=gridchat auth=none mtpt=/n/chat > [ … ] // any other matches > > ndb/regquery -s grid > srv tcp!myservice!1234 gridchat /n/chat > [ … ] // any other matches > > I use this with a database containing, at the moment the 9grid list of services, but would be useful for a general index of what services exist on a given network outright, on a remote network for bookkeeping, etc. > > The code is fresh, and may have bugs I haven’t caught! I’ll include the diff here, thanks! > > - halfwit (Mostly repeating what I said on grid) I'll try to take a look at this soon, but I'd be against merging it until this gets used in anger. Usually it's when an API actually gets used that improvements come out. If you have code that uses this, I'd like to see it.