Skip to main content

Quick Look

DStack is under heavy development, currently some docs is not finished yet

Let's discover DStack in less than 15 minutes.

Introduction

DStack was created to bring together some of the popular libraries/technologies for the decentralized web (like IPFS) into a single ecosystem to provide an easy way for developing decentralized web applications where your infrastructure is a single source of truth.

For example, you can use PubSub API to create real-time events client-side

or Shard API to share temporary/preview files or structured data between clients without the need to upload to your servers

For example, you can create a collaborative real-time WYSIWYG editor with file preview support where all events and file previews are handled without your server infrastructure.

WYSIWYG Demo

Demo

Play with DStack in browser console

https://explorer.dstack.dev/

Add DStack to your project

yarn add @dstack-js/lib

Initialize Stack

import { Stack } from '@dstack-js/lib';

console.log('My Peer ID is:', stack.id);

Interact with PubSub

stack.pubsub.subscribe('topic', (msg) => {
  console.log('Received a message', msg.from, msg.data);
});

stack.pubsub.publish('topic', 'Hello, DStack!');

Interact with Store

// Set value
const shard = await Shard.new(stack, ShardKind.Object, {hello: 'world'})
await stack.store.set('hello', shard));

// Get value
const shard = await stack.store.get('hello');

Tell others that you use DStack

Here is an badge for you:

dstack

[![dstack](https://dstack.dev/img/badge.svg)](https://dstack.dev)

We are searching for projects who are interested to use DStack in production to collect feedback, bug reports and feature requests, you can apply here