Released docs. You are viewing the documentation published with v0.49.0. Development docs are available at Latest.
Publish and consume a Registry Discovery index
For the operator and consumer or verifier
You will package an index from one provider’s public description, serve it, and then, as an application, ask it which Registry Evidence service can answer a question.
Install Registry Stack
Section titled “Install Registry Stack”Download one exact rstack-vX.Y.Z-install.sh and the verification material from the same Registry
Stack release. Follow the
release verification procedure
before running the installer. From the verified release directory, install the discovery
component:
tag="vX.Y.Z"bash "rstack-${tag}-install.sh" discoveryrstack discovery --versionThe managed installation exposes rstack on your PATH. The discovery component supplies the
Discovery runtime and its command-line tools from the same release.
Clone the same release for the example project and synthetic provider description:
git clone --branch "$tag" --depth 1 --quiet https://github.com/registrystack/registry-stack.gitcd registry-stackCheck the project
Section titled “Check the project”Copy the example project out of the checkout:
cp -R products/discovery/tutorial/project discovery-projectAs the operator, you approve each provider by the URL of its public description, in
discovery-project/origins.yaml:
apiVersion: id.registrystack.org/formats/discovery/origins/v1alpha1kind: DiscoveryOriginsorigins: tutorial-evidence: catalogUrl: http://127.0.0.1:38090/evidence.jsonld profile: registry-discovery-v1alpha1You also say which Evidence types meet a requirement an application may have.
discovery-project/mappings/adult-status.yaml maps the adult-status requirement to one type:
apiVersion: id.registrystack.org/formats/discovery/evidence-mapping/v1alpha1kind: DiscoveryEvidenceMappingmappingId: urn:example:mapping:adult-statusmappingAuthorityId: urn:example:mapping-authorityrequirementId: urn:example:requirement:adult-statusjurisdiction: urn:example:jurisdictionalternatives: - evidenceTypeListId: urn:example:evidence-type-list:adult-status evidenceTypeIds: - urn:example:evidence-type:adult-statusCheck the project in development to accept its loopback catalog URL. Production catalogs use HTTPS URLs on non-loopback hosts.
rstack discovery check --project discovery-project --posture developmentvalid origins=1 mappings=1warning[discovery.posture.loopback-catalog-url] discovery-project/origins.yaml:5:17 /origins/tutorial-evidence/catalogUrl the index advertises an address on the reader's own machine; production refuses it next: Publish HTTPS URLs on non-loopback hosts.0 errors, 1 warning in 3 filesThe third file is runtime.yaml, which you use to serve the index. The check never contacts the
provider URL; a refused file gets one finding per problem, with its line, column, and fix.
Package the index
Section titled “Package the index”Play the provider: open a second shell at the checkout root and serve its description at the approved URL.
python3 products/discovery/tutorial/publication_server.py \ --descriptions products/discovery/fixtures/descriptionsBack in the first shell, package the index:
rstack discovery package \ --project discovery-project \ --output discovery-project/package \ --posture developmentpackaged packageDigest=sha256:<package-digest> catalogRevision=sha256:7e0799f2c5fd24957e4d1372f757c40abef694110eb70fc260a0abdc312ca963 mappingRevision=sha256:332004ca3920c498539180946e8f2637e9998ba7e49cd98f31e19d6f818857acwarning[discovery.posture.loopback-catalog-url] discovery-project/package/discovery-index.json /origins/0/catalogUrl the index advertises an address on the reader's own machine; production refuses it next: Publish HTTPS URLs on non-loopback hosts.warning[discovery.posture.loopback-catalog-url] discovery-project/package/discovery-index.json /services/0/originUrl the index advertises an address on the reader's own machine; production refuses it next: Publish HTTPS URLs on non-loopback hosts.Packaging fetched the description once. The catalogue revision digests what the descriptions mean and the mapping revision digests your mappings, so they match on any machine; the package digest also covers when this run fetched, so yours differs.
Stop the publication server with Ctrl+C. Discovery never contacts a provider while it serves.
Serve the index
Section titled “Serve the index”discovery-project/runtime.yaml names the listener, the limits, and a package root read from
DISCOVERY_PACKAGE_ROOT. Both paths must be absolute. In the first shell, start Discovery:
DISCOVERY_PACKAGE_ROOT="$PWD/discovery-project/package" \ rstack discovery serve --runtime-config "$PWD/discovery-project/runtime.yaml" --posture developmentIt checks the package against its SHA256SUMS file before it listens. In the second shell:
curl -s http://127.0.0.1:38080/ready{"developmentSettings":[{"code":"discovery.posture.loopback-catalog-url","pointer":"/origins/0/catalogUrl"},{"code":"discovery.posture.loopback-catalog-url","pointer":"/services/0/originUrl"}],"posture":"development","status":"ready"}Resolve a requirement
Section titled “Resolve a requirement”Now play the application. It knows it must establish that a person is an adult, but not which provider can say so. Ask Discovery which Evidence types satisfy that requirement:
rstack discovery api /v1/evidence-types/resolve \ --url http://127.0.0.1:38080 \ --input - <<'JSON'{"requirementId":"urn:example:requirement:adult-status","jurisdiction":"urn:example:jurisdiction"}JSON{ "requirementId": "urn:example:requirement:adult-status", "jurisdiction": "urn:example:jurisdiction", "mappingRevision": "sha256:332004ca3920c498539180946e8f2637e9998ba7e49cd98f31e19d6f818857ac", "alternatives": [ { "evidenceTypeListId": "urn:example:evidence-type-list:adult-status", "evidenceTypeIds": ["urn:example:evidence-type:adult-status"], "mappingId": "urn:example:mapping:adult-status", "mappingAuthorityId": "urn:example:mapping-authority" } ]}Each alternative lists types that are required together; here there is one alternative with one type.
Find the provider
Section titled “Find the provider”Search for Registry Evidence services that assert that type:
rstack discovery api \ '/v1/services?serviceKind=evidence&evidenceType=urn%3Aexample%3Aevidence-type%3Aadult-status' \ --url http://127.0.0.1:38080The response carries the catalogRevision from the package step and one item. Its key fields:
{ "recordId": "urn:registrystack:discovery:record:sha256:676659c10ce5cc9d353f4fd2816673c7947e612151efbbe1cc4d42372d9be9d5", "bindingId": "urn:registrystack:discovery:binding:sha256:2f9ccc4629c7ea2409d986a9c0ee6e3afe6e63326ca7b1be7d9eb8c69082d96c", "serviceKind": "evidence", "endpointUrl": "https://evidence.example.org", "originUrl": "http://127.0.0.1:38090/evidence.jsonld", "originContentDigest": "sha256:fc96f3a8cb0d82239425ea5712dceca975a5899e5528616648174da661fae905"}originContentDigest is the SHA-256 of the exact bytes the provider published.
The application saves a selection: the recordId and bindingId it chose, and the two revisions
it chose under. A selection is public metadata, not a credential. Whether to trust
endpointUrl is decided by the application’s own Evidence configuration, and the call to it never
passes through Discovery. The Discovery namespace of the
Registry Stack client runs these searches and
saves selections from Rust, Node.js, or Python.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
| A service stops at startup | Port 38090 or 38080 is in use | Stop the process using the port, then start the service again |
rstack discovery package cannot fetch an origin | The publication server is not running | Start it, then package again; a failed run writes no package |
rstack discovery package refuses the output directory | discovery-project/package exists from an earlier run | Remove it, then package again |
Discovery is still running. Package and run a Discovery index
continues from here, with HTTPS origins and a pinned package. To stop instead, press Ctrl+C in
the first shell and remove discovery-project.
The Registry Discovery overview explains why trust stays with the application.
Cookies on Registry Stack
We use optional cookies to understand how you use the main Registry Stack website and this documentation. If you contact us, we may link this activity to your enquiry. You can change your choice at any time. Read the privacy policy.
Your browser asks sites not to track you, so optional tracking stays off.
We could not use or save that choice. Optional tracking remains off.