constfw = Forwarder.create();// Create up to four faces, and consider default IPv4 gateway as a candidate.// In case NDN-FCH is unavailable, use a list of backup routers.letfaces = awaitconnectToTestbed({count:4,fw,tryDefaultGateway:true,fchFallback: ["hobo.cs.arizona.edu", "titan.cs.memphis.edu"],});assert(faces.length > 0);for (constfaceoffaces) {console.log("connected to", `${face}`);face.close();}// Try up to four candidates with 3-second timeout, and keep the fastest face only.faces = awaitconnectToTestbed({count:4,fw,preferFastest:true,connectTimeout:3000,testConnection:newName(`/ndn/edu/arizona/ping/${Math.floor(Math.random() *1e9)}`),tryDefaultGateway:false,});assert.equal(faces.length, 1);const [fastestFace] = faces;console.log("fastest face is", `${fastestFace}`);// By default, default route "/" is added to the face, so that you can send Interests right away.awaitnewEndpoint({ fw }).consume(`/ndn/edu/ucla/ping/${Math.floor(Math.random() *1e9)}`);fastestFace.close();
@ndn/autoconfig
This package is part of NDNts, Named Data Networking libraries for the modern web.
This package enables connection to global NDN testbed using NDN-FCH service.
Query NDN-FCH Service
queryFch
function sends a query to NDN-FCH service.Connect to Testbed