Query your data from any website
Read data from the Uncloud storage network over peer-to-peer
Want to run a static website that queries dynamic data you own? With uncloud-p2p you can host a lightweight site anywhere, and clients pull the data from the nearest available node. Configure a node with the public data, and Uncloud distributes it across the storage network for a fraction of the cost.
No egress fees: clients establish a peer-to-peer connection directly to their nearest available node.
Implementation guide
From local files to a P2P stream in about five minutes.
Ingest Data
Load your datasets into your node by simply dragging and dropping files into the Uncloud Dashboard.
Configure Public Access
Create a Public Link to expose your data. You have granular control here: specify exactly which files or directories you want to make accessible to the P2P network.
Integrate the SDK
Copy your
linkId.
This unique identifier allows the
uncloud-p2p
NPM package to discover and query your node from any client
browser.
04 / Technical implementation
# Install the package
npm install uncloud-p2p
// Connect to a node and list its files
const p2p = new UncloudP2P({ nodeId });
await p2p.connect();
await p2p.waitForOpen();
const files = await ListFiles(p2p);
// Read a file into memory
for (const file of files) {
if (file.Name.endsWith(".csv")) {
const blob = await p2p.downloadToMemory(file.Name);
stockDataCache.set(file.Name, await blob.text());
}
}
// Download a file to the user's device
p2p.downloadFile(file.Name);
Live result
Example: a stock explorer reading CSV data live from a node