Module @ndn/repo-external


This package is part of NDNts, Named Data Networking libraries for the modern web.

This package allows inserting and deleting Data in ndn-python-repo. PyRepoClient type is a client for ndn-python-repo protocol. PyRepoStore type implements a subset of DataStore interfaces defined in @ndn/repo-api package.

This implementation is compatible with ndn-python-repo version 0.2a5. Newer versions of ndn-python-repo are not supported due to ndn-python-repo issue #60. To install the specified version, run:

pip install ndn-python-repo==0.2a5 python-ndn==0.2b2.post1
import { PyRepoStore } from "@ndn/repo-external";

import { Forwarder } from "@ndn/fw";
import { L3Face } from "@ndn/l3face";
import { enableNfdPrefixReg } from "@ndn/nfdmgmt";
import { UnixTransport } from "@ndn/node-transport";
import { Data, digestSigning, Name } from "@ndn/packet";

const repoPrefix = process.env.DEMO_PYREPO_PREFIX;
if (!repoPrefix) {
To run @ndn/repo-external demo, set the following environment variables:
DEMO_PYREPO_PREFIX= command prefix of ndn-python-repo
const dataPrefix = new Name(`/NDNts-repo-external/${Math.trunc(Math.random() * 1e8)}`);

const face = await UnixTransport.createFace({}, process.env.DEMO_NFD_UNIX ?? "/run/nfd.sock");

const store = new PyRepoStore({
repoPrefix: new Name(repoPrefix),

const packets: Data[] = [];
for (let i = 0; i < 256; ++i) {
const data = new Data(dataPrefix.append(`${i}`));
data.freshnessPeriod = 1;
await digestSigning.sign(data);

console.log(`Inserting ${packets.length} packets under ${dataPrefix} to ${repoPrefix}`);
try {
await store.insert(...packets);
} finally {
await store.close();




Generated using TypeDoc