Skip to content
This repository was archived by the owner on Nov 23, 2022. It is now read-only.

Commit 0d306d1

Browse files
committed
wip #14 - PoC 🥳
1 parent 292e483 commit 0d306d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+10738
-336
lines changed

.eslintrc.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": ["**/*"],
4+
"plugins": ["@nrwl/nx"],
5+
"overrides": [
6+
{
7+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
8+
"rules": {
9+
"@nrwl/nx/enforce-module-boundaries": [
10+
"error",
11+
{
12+
"enforceBuildableLibDependency": true,
13+
"allow": [],
14+
"depConstraints": [
15+
{
16+
"sourceTag": "*",
17+
"onlyDependOnLibsWithTags": ["*"]
18+
}
19+
]
20+
}
21+
]
22+
}
23+
},
24+
{
25+
"files": ["*.ts", "*.tsx"],
26+
"extends": ["plugin:@nrwl/nx/typescript"],
27+
"rules": {}
28+
},
29+
{
30+
"files": ["*.js", "*.jsx"],
31+
"extends": ["plugin:@nrwl/nx/javascript"],
32+
"rules": {}
33+
}
34+
]
35+
}

.gitignore

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# See http://help.github.com/ignore-files/ for more about ignoring files.
22

33
# compiled output
4-
/dist
5-
/tmp
6-
/out-tsc
4+
dist
5+
tmp
6+
out-tsc
7+
.parcel-cache
78

89
# dependencies
9-
/node_modules
10+
node_modules
11+
12+
# IPFS
13+
repo
1014

1115
# IDEs and editors
1216
/.idea

.vscode/extensions.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"recommendations": [
3-
43
"nrwl.angular-console",
5-
"esbenp.prettier-vscode"
4+
"esbenp.prettier-vscode",
5+
"dbaeumer.vscode-eslint",
6+
"firsttris.vscode-jest-runner"
67
]
78
}

LICENSE

+674
Large diffs are not rendered by default.

README.md

-94
This file was deleted.

SECURITY.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
| Version | Supported |
6+
| ------- | ------------------ |
7+
| 0.0.x | :white_check_mark: |
8+
9+
## Reporting a Vulnerability
10+
11+
Contact me at [email protected],
12+
also you can encrypt a message
13+
using this [public pgp key (BC01F8F07ED8FE47)](https://keybase.io/0x77dev/pgp_keys.asc?fingerprint=b889fa47da6dda0e940c951bbc01f8f07ed8fe47).

demo/index.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Demo</title>
8+
</head>
9+
<body>
10+
<script src="index.ts" type="module"></script>
11+
</body>
12+
</html>

demo/index.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { create } from "@dstack-js/ipfs"
2+
import { Store, Shard } from "@dstack-js/lib"
3+
import { CID } from "multiformats/cid"
4+
5+
const run = async () => {
6+
const ipfs = await create({ config: { Addresses: { Swarm: ['/ip4/192.168.31.54/tcp/9090/ws/p2p-webrtc-star/'] }, Bootstrap: [] } })
7+
// @ts-ignore
8+
window.ipfs = ipfs
9+
// @ts-ignore
10+
window.CID = CID
11+
12+
const { addresses } = await ipfs.id()
13+
14+
for (const address of addresses) {
15+
console.log(address.toString())
16+
}
17+
18+
const store = new Store(ipfs, 'demo')
19+
// @ts-ignore
20+
window.store = store
21+
// @ts-ignore
22+
window.Shard = Shard
23+
}
24+
25+
26+
run()

demo/package.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"alias": {
3+
"@dstack-js/ipfs": "../dist/packages/ipfs",
4+
"@dstack-js/lib": "../dist/packages/lib"
5+
},
6+
"dependencies": {
7+
"multiformats": "^9.5.8"
8+
},
9+
"devDependencies": {
10+
"ipfs": "^0.61.0",
11+
"libp2p-webrtc-star-signalling-server": "^0.1.2",
12+
"parcel": "^2.1.1"
13+
},
14+
"license": "GPL-3.0",
15+
"name": "@dstack-js/demo",
16+
"private": true,
17+
"scripts": {
18+
"start": "webrtc-star & parcel index.html"
19+
},
20+
"version": "0.0.0"
21+
}

demo/tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "../tsconfig.base.json"
3+
}

docs/.gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

docs/README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# DStack
2+
3+
<img width="16" src="./static/img/logo.svg" /> Technology stack as a library for developing decentralized web applications
4+
5+
[![npm-badge]][npm] [![issues-badge]][issues] [![license-badge]][license]
6+
7+
## Getting started
8+
9+
See [Tutorial](https://dstack.0x77.dev/docs/intro) to get started using DStack in your dapp
10+
11+
## Introduction
12+
13+
DStack was created to bring together some of the popular libraries for the decentralized web into a single ecosystem
14+
15+
## What DStack offers
16+
17+
Currently you can use DStack as a peer-to-peer distributed KV/Graph database
18+
19+
_**[See milestones](https://github.com/0x77dev/dstack/milestones)**_
20+
21+
[license]: https://github.com/0x77dev/dstack/blob/main/LICENSE
22+
[license-badge]: https://img.shields.io/github/license/0x77dev/dstack
23+
[issues]: https://github.com/0x77dev/dstack/issues
24+
[issues-badge]: https://img.shields.io/github/issues/0x77dev/dstack
25+
[npm]: https://www.npmjs.com/package/@dstack-js/lib
26+
[npm-badge]: https://img.shields.io/npm/v/@dstack-js/lib

docs/babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

docs/blog/authors.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
0x77dev:
2+
name: Mykhailo Marynenko
3+
title: Maintainer of DStack
4+
url: https://github.com/0x77dev
5+
image_url: https://github.com/0x77dev.png

docs/blog/hello-world.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
slug: hello-world
3+
title: Hello, World!
4+
authors:
5+
- 0x77dev
6+
tags: [dstack, getting-started]
7+
---
8+
9+
## Introduction
10+
11+
This post was created to explain what DStack is and its uses
12+
13+
DStack was created to bring together some of the popular libraries for the decentralized web into a single ecosystem
14+
15+
## What DStack offers
16+
17+
Currently you can use DStack as a globally distributed GraphQL cache system built on top of [IPFS DAG API](https://github.com/ipfs/js-ipfs/blob/master/docs/core-api/DAG.md#dag-api-)
18+
19+
## Getting started
20+
21+
See [Tutorial](/docs/intro) to get started using DStack in your app
22+

docs/docs/api/_category_.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
label: "API"

docs/docs/api/index.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
id: "index"
3+
title: "dstack-js"
4+
slug: "/api/"
5+
sidebar_label: "Readme"
6+
sidebar_position: 0
7+
custom_edit_url: null
8+
---
9+

0 commit comments

Comments
 (0)