Skip to content

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.

01

Ingest Data

Load your datasets into your node by simply dragging and dropping files into the Uncloud Dashboard.

02

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.

The Create Public Link dialog, where you name the link and choose which folders it can read from and write to.
03

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);
05

Live result

A live Stock Explorer web app pulling CSV data directly from a node over the P2P connection.

Example: a stock explorer reading CSV data live from a node