{"id":49307974,"url":"https://github.com/origintrail/dkg-hello-world","last_synced_at":"2026-04-30T14:01:08.348Z","repository":{"id":353865993,"uuid":"1220024260","full_name":"OriginTrail/dkg-hello-world","owner":"OriginTrail","description":"Minimal reference integration for DKG v10. Writes a greeting into Working Memory and reads it back via the node's public HTTP API — the smallest working end-to-end round trip, ~150 lines, zero dependencies. Fork as a starting template.","archived":false,"fork":false,"pushed_at":"2026-04-24T21:26:19.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-26T10:31:26.199Z","etag":null,"topics":["dkg","example","integration","knowledge-graph","origintrail","template","working-memory"],"latest_commit_sha":null,"homepage":"https://github.com/OriginTrail/dkg-integrations","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OriginTrail.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-24T13:16:55.000Z","updated_at":"2026-04-24T20:38:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/OriginTrail/dkg-hello-world","commit_stats":null,"previous_names":["origintrail/dkg-hello-world"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/OriginTrail/dkg-hello-world","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OriginTrail%2Fdkg-hello-world","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OriginTrail%2Fdkg-hello-world/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OriginTrail%2Fdkg-hello-world/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OriginTrail%2Fdkg-hello-world/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OriginTrail","download_url":"https://codeload.github.com/OriginTrail/dkg-hello-world/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OriginTrail%2Fdkg-hello-world/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32333199,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dkg","example","integration","knowledge-graph","origintrail","template","working-memory"],"created_at":"2026-04-26T10:30:44.338Z","updated_at":"2026-04-27T11:01:06.123Z","avatar_url":"https://github.com/OriginTrail.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DKG Hello World\n\nThe minimal reference integration for the OriginTrail Decentralized Knowledge Graph v10.\n\nThis is the simplest possible integration that actually exercises a DKG node's memory model: it writes a greeting to Working Memory and reads it back, using nothing but the node's public HTTP API and Node.js's built-in `fetch`. Zero external dependencies, ~150 lines of code, one file.\n\nUse it as a starting template for your own integration. Clone the repo, rename the package, replace the greeting logic with whatever you're actually building.\n\n---\n\n## Install\n\n```bash\n# Via the DKG integration registry (recommended)\ndkg integration install dkg-hello-world\n\n# Or directly from npm\nnpm install -g @origintrail-official/dkg-hello-world\n```\n\nYou need a running DKG v10 node (`dkg start`). The integration picks up its auth token from `~/.dkg/auth.token` automatically, or from `DKG_AUTH_TOKEN` if you set it.\n\n## Use\n\n```bash\ndkg-hello-world greet \"first post from DKG Hello World\"\n# → ok · greeting \"first post...\" written to WM/dkg-hello-world/greetings\n#      https://origintrail.io/dkg-hello-world/greeting/1714000000000-abcd1234\n\ndkg-hello-world greet \"the DKG is up\"\ndkg-hello-world greet \"agent integrations live here\"\n\ndkg-hello-world list\n# 1. \"first post from DKG Hello World\"\n#    by did:dkg:agent:0x… at 2026-04-24T13:37:00.000Z\n#    https://origintrail.io/dkg-hello-world/greeting/…\n# 2. \"the DKG is up\"\n# 3. \"agent integrations live here\"\n\ndkg-hello-world whoami\n# → { \"agentAddress\": \"0x…\", \"agentDid\": \"did:dkg:agent:0x…\", … }\n```\n\n## What it does, step by step\n\n1. **Loads the auth token.** From `DKG_AUTH_TOKEN` or `~/.dkg/auth.token`. No third-party credentials.\n2. **Ensures a context graph named `dkg-hello-world` exists.** Calls `POST /api/context-graph/create`; treats `409 Conflict` as \"already there\" so re-running is idempotent.\n3. **Ensures a Working Memory assertion named `greetings` exists** in that context graph.\n4. **Writes four RDF triples per greeting** to that WM assertion via `POST /api/assertion/greetings/write`:\n   - the greeting's `rdf:type` → `dkg-hello-world:Greeting`\n   - `schema:description` → the message text\n   - `dcterms:created` → the current timestamp\n   - `dcterms:creator` → the DID of the calling agent (from `GET /api/agent/identity`)\n5. **On `list`, reads those triples back** via `POST /api/assertion/greetings/query` and groups them by subject for display.\n\nThat's the whole integration. No SWM promotion, no VM publishing, no Curator-authority operations — just WM write + read, as a template.\n\n## Extend it\n\nTo turn this into a real integration:\n\n1. **Replace the greeting domain** with whatever you're modeling (Slack messages, GitHub issues, research notes, sensor readings).\n2. **Promote matured assertions to Shared Memory** by adding a `POST /api/assertion/greetings/promote` call, so peers can see what you've written.\n3. **Add a publish path** for assertions that should end up in Verified Memory, when your domain warrants it.\n4. **Ship the integration's registry entry** to [`OriginTrail/dkg-integrations`](https://github.com/OriginTrail/dkg-integrations).\n\nSee [`DESIGN.md`](DESIGN.md) for the full design brief.\n\n## License\n\nApache-2.0. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forigintrail%2Fdkg-hello-world","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forigintrail%2Fdkg-hello-world","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forigintrail%2Fdkg-hello-world/lists"}