Closed dboreham closed 4 years ago
Re: bot record:
RB: ok — so is this record the record for a bot factory INSTANCE or a bot artifact?
what happens if two people register the same bot? (currently one would overwrite the other)
lots of issues here that we need to resolve before we bake this (already v2)
(also, this doesn’t sound like an “access key”)
call it “topic”?
queryRecords GQL API -> support server semantics for version
field in queries.
version
not provided OR version
=== 'latest', return only the latest version for each (type, name) combination.version
=== '*', return all versions Auto-created unique index in WNS that maps a reference
/ref
string of the form wrn:<type>:<name>#<version>
, to a particular record/CID. Also, a resolveRecords([ref])
GQL API that returns records given ref
strings.
Examples
wrn:protocol:wireline.io/chess
always points to the latest version, updated automatically when a record is published.wrn:protocol:wireline.io/chess#0.1.0
points to version 0.1.0 of the record, created automatically when the record is published.CLI commands
wire wns resolve wrn:bot:wireline.io/chess
(version is implicit, fetches the latest record) wire wns resolve wrn:bot:wireline.io/chess#^2.3.0
(semver based, fetches record for highest matching version)wire wns resolve wrn:bot:wireline.io/chess#0.1.0
(fetches record for specific version)Checks on ref
(unique index) when creating records.
ref
already exists. Disallows records with same (type, name, version) being created just by changing some other metadata, resulting in a different CID.owners
don't match latest version. Ensures a single dev/group/org is in control of the (type, name) combination.Refs make it easier for humans to refer to a particular artifact version, e.g. in config files. The tooling MUST throw an error if the mapping does not exist in WNS.
# bot.yml
id: wrn:bot:wireline.io/shogibot
name:ShogiBot
version: 0.1.0
protocol:
type: wrn:reference
ref: wrn:protocol:wireline.io/chess#0.1.0
# id: QmZBjSuaLhRuFVi7ti215678v26C1V4vWcrRaXmb7s65qi
Note: Use either ref
OR id
. If ref
, version should be explicit (i.e. no semver or 'latest').
Compute services and bots.
accessKey
to topic
. Topic could change and should be part of the mutable metadata in the record.CLI commands.
wire protocol register (currently: wire wns publish --filename="protocol.yml")
wire pad register
wire bot register
wire service register
wire service run
Prevent publishing of newer version if owners don't match latest version. Ensures a single dev/group/org is in control of the (type, name) combination.
This feels a bit like a kludge for "chess" being a first class name. I feel like people/orgs should be reserving names and then they are responsible for putting what they want under that name, i'm not sure i'm completely following along, so maybe I'm confused?
@AFDudley that's the idea. This work focused specifically on versions, but there's another task to take care of hierarchical namespace with subtree authority/access control. It turns out they're the same thing pretty much.
Namespace/access control issue: https://github.com/wirelineio/wns/issues/32
Having moved to immutable record naming in WNS, we need to figure out how to support concepts like "the latest version of xxxx" and friendly names for entities such as bots in WNS.