uncloud-p2p

Query your data from any website

Host a lightweight static site anywhere and let its visitors read the data you own straight from a storage node, peer to peer.

A storage node's historical folder of stock CSV files, open in the Uncloud iPhone app

Why peer to peer

No egress fees

Visitors connect peer to peer to the nearest available node, so you don't pay to serve your data out of a cloud.

Configure a node with the public data and Uncloud distributes it across the storage network for a fraction of the cost.

A silver mini PC, plugged in and running as an Uncloud Storage Node, held in one hand
Your data is served from a node like this, not a data centre.
  1. Load your data

    Drag and drop your datasets into your node from the Uncloud Dashboard.

    The historical folder on a node: A.csv, AAA.csv, AAPL.csv and more, each encrypted
  2. Create a public link

    A public link exposes exactly the files or folders you choose to the peer-to-peer network, and nothing else.

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

    Your linkId is how the uncloud-p2p package finds and queries your node from any visitor's browser.

    Copy it from the public link you just made.

  4. Query it in the browser

    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());
      }
    }

    Or download it to the visitor's device.

    p2p.downloadFile(file.Name);

Built with it

The result

A stock explorer that reads its CSV data live from a node.

A live Stock Explorer web app pulling CSV data directly from a node over the peer-to-peer connection