Skip to content

Commit

Permalink
protbuf refactor; initial renamings; rm unused stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
d-roak committed Nov 18, 2024
1 parent e4a1ecf commit e499b7e
Show file tree
Hide file tree
Showing 31 changed files with 528 additions and 667 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div align="center">
<img src="https://avatars.githubusercontent.com/u/157637200" height="128">
<br />
<h1>The TypeScript implementation of the Topology Protocol</h1>
<h1>The TypeScript implementation of Distributed Replicated Programs (DRP)</h1>
</div>

<div align="center">
Expand All @@ -17,34 +17,36 @@
[![X](https://img.shields.io/badge/X-000000)](https://x.com/topology_gg)
[![Telegram](https://img.shields.io/badge/Telegram-24A1DE)](https://t.me/topologyfrens)
[![Discord](https://img.shields.io/badge/Discord-7289da)](https://discord.gg/GUDGzBP5mn)

</div>

# Overview

This is the official TypeScript implementation of the Topology Protocol. The Topology Protocol is a local-first decentralized protocol for real-time applications. It introduces a new concept for Conflict-free Replicated Objects (CRO), that are built on top of libp2p and composed of CRDTs.
This is the official TypeScript implementation of Distributed Replicated Programs (DRP). DRP is a local-first decentralized protocol for real-time applications. It is built on top of libp2p and with a similar design with CRDTs.

# Specifications

The specifications of the Topology Protocol are shared across different client implementations and can be found in the [specs repository](https://github.com/topology-foundation/specs). Currently the specifications are starting to be written based on this implementation.
The specifications of DRP are shared across different client implementations and can be found in the [specs repository](https://github.com/topology-foundation/specs). Currently the specifications are starting to be written based on this implementation.

# Packages

This repository is a monorepo that contains the following packages:

| Package | Description |
|---------|--------------------------------------------------|
| crdt | CRDT implementations intended to use as builtins |
| network | Network middleware to abstract libp2p |
| node | Topology Node library and CLI |
| object | CRO objects structure implementation |
| Package | Description |
| ---------- | ----------------------------------------------- |
| blueprints | Blueprints of some DRPs that can be freely used |
| logger | Logger for the whole project |
| network | Network middleware to abstract libp2p |
| node | Node for interacting with DRPs library and CLI |
| object | DRP objects structure implementation |

# Examples

All the examples are located in the `examples` directory. Currently, there is only one example, which is a simple canvas where you can paint pixels. You can also look into the [counter-splash](https://github.com/topology-foundation/counter-splash) (demo for EthCC 2024) repository for a more complex example.

# Usage

This workspae has all packages and examples linked together, so you can run the following commands to start the development:
This workspace has all packages and examples linked together, so you can run the following commands to start the development:

```bash
# pnpm
Expand Down
3 changes: 1 addition & 2 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"**/doc/*",
"**/*_pb.js",
"**/*_pb.ts",
"**/bundle/*",
"**/package.json"
"**/bundle/*"
]
},
"linter": {
Expand Down
6 changes: 0 additions & 6 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,3 @@ plugins:
out: .
opt:
- ts_proto_opt=esModuleInterop=true
inputs:
- directory: ./packages
exclude_paths:
- packages/node
- packages/network/node_modules
- packages/object/node_modules
54 changes: 27 additions & 27 deletions examples/canvas/package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"name": "ts-topology-examples-canvas",
"version": "0.3.1",
"license": "MIT",
"scripts": {
"build": "vite build",
"clean": "rm -rf dist/ node_modules/",
"dev": "vite serve",
"start": "ts-node ./src/index.ts"
},
"dependencies": {
"@topology-foundation/blueprints": "0.3.1",
"@topology-foundation/network": "0.3.1",
"@topology-foundation/node": "0.3.1",
"@topology-foundation/object": "0.3.1",
"crypto-browserify": "^3.12.0",
"process": "^0.11.10",
"stream-browserify": "^3.0.0",
"ts-node": "^10.9.2",
"vm-browserify": "^1.1.2"
},
"devDependencies": {
"@types/node": "^22.5.4",
"ts-loader": "^9.3.1",
"typescript": "^5.5.4",
"vite": "^5.4.9",
"vite-plugin-node-polyfills": "^0.22.0"
}
"name": "ts-drp-examples-canvas",
"version": "0.3.1",
"license": "MIT",
"scripts": {
"build": "vite build",
"clean": "rm -rf dist/ node_modules/",
"dev": "vite serve",
"start": "ts-node ./src/index.ts"
},
"dependencies": {
"@topology-foundation/blueprints": "0.3.1",
"@topology-foundation/network": "0.3.1",
"@topology-foundation/node": "0.3.1",
"@topology-foundation/object": "0.3.1",
"crypto-browserify": "^3.12.0",
"process": "^0.11.10",
"stream-browserify": "^3.0.0",
"ts-node": "^10.9.2",
"vm-browserify": "^1.1.2"
},
"devDependencies": {
"@types/node": "^22.5.4",
"ts-loader": "^9.3.1",
"typescript": "^5.5.4",
"vite": "^5.4.9",
"vite-plugin-node-polyfills": "^0.22.0"
}
}
63 changes: 30 additions & 33 deletions examples/chat/package.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
{
"name": "topology-example-chat",
"version": "0.3.1",
"description": "Topology Protocol Chat Example",
"main": "src/index.ts",
"repository": "https://github.com/topology-foundation/ts-topology.git",
"license": "MIT",
"scripts": {
"asbuild": "asc --config asconfig.json --target release",
"build": "vite build",
"clean": "rm -rf dist/ node_modules/",
"dev": "vite serve",
"start": "ts-node ./src/index.ts"
},
"dependencies": {
"@topology-foundation/blueprints": "0.3.1",
"@topology-foundation/network": "0.3.1",
"@topology-foundation/node": "0.3.1",
"@topology-foundation/object": "0.3.1",
"assemblyscript": "^0.27.29",
"crypto-browserify": "^3.12.0",
"process": "^0.11.10",
"stream-browserify": "^3.0.0",
"ts-node": "^10.9.2",
"uint8arrays": "^5.1.0",
"vm-browserify": "^1.1.2"
},
"devDependencies": {
"@types/node": "^22.5.4",
"ts-loader": "^9.5.1",
"typescript": "^5.5.4",
"vite": "^5.4.9",
"vite-plugin-node-polyfills": "^0.22.0"
}
"name": "ts-drp-example-chat",
"version": "0.3.1",
"license": "MIT",
"scripts": {
"asbuild": "asc --config asconfig.json --target release",
"build": "vite build",
"clean": "rm -rf dist/ node_modules/",
"dev": "vite serve",
"start": "ts-node ./src/index.ts"
},
"dependencies": {
"@topology-foundation/blueprints": "0.3.1",
"@topology-foundation/network": "0.3.1",
"@topology-foundation/node": "0.3.1",
"@topology-foundation/object": "0.3.1",
"assemblyscript": "^0.27.29",
"crypto-browserify": "^3.12.0",
"process": "^0.11.10",
"stream-browserify": "^3.0.0",
"ts-node": "^10.9.2",
"uint8arrays": "^5.1.0",
"vm-browserify": "^1.1.2"
},
"devDependencies": {
"@types/node": "^22.5.4",
"ts-loader": "^9.5.1",
"typescript": "^5.5.4",
"vite": "^5.4.9",
"vite-plugin-node-polyfills": "^0.22.0"
}
}
65 changes: 31 additions & 34 deletions examples/grid/package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
{
"name": "topology-example-grid",
"version": "0.3.1",
"description": "Topology Protocol Grid Exmaple",
"main": "src/index.ts",
"repository": "https://github.com/topology-foundation/ts-topology.git",
"license": "MIT",
"scripts": {
"asbuild": "asc --config asconfig.json --target release",
"build": "vite build",
"clean": "rm -rf dist/ node_modules/",
"dev": "vite serve",
"start": "ts-node ./src/index.ts"
},
"dependencies": {
"@topology-foundation/network": "0.3.1",
"@topology-foundation/node": "0.3.1",
"@topology-foundation/object": "0.3.1",
"assemblyscript": "^0.27.29",
"crypto-browserify": "^3.12.0",
"memfs": "^4.11.1",
"process": "^0.11.10",
"react-spring": "^9.7.4",
"stream-browserify": "^3.0.0",
"ts-node": "^10.9.2",
"uint8arrays": "^5.1.0",
"vm-browserify": "^1.1.2"
},
"devDependencies": {
"@types/node": "^22.5.4",
"ts-loader": "^9.5.1",
"typescript": "^5.5.4",
"vite": "^5.4.9",
"vite-plugin-node-polyfills": "^0.22.0"
}
"name": "ts-drp-example-grid",
"version": "0.3.1",
"license": "MIT",
"scripts": {
"asbuild": "asc --config asconfig.json --target release",
"build": "vite build",
"clean": "rm -rf dist/ node_modules/",
"dev": "vite serve",
"start": "ts-node ./src/index.ts"
},
"dependencies": {
"@topology-foundation/network": "0.3.1",
"@topology-foundation/node": "0.3.1",
"@topology-foundation/object": "0.3.1",
"assemblyscript": "^0.27.29",
"crypto-browserify": "^3.12.0",
"memfs": "^4.11.1",
"process": "^0.11.10",
"react-spring": "^9.7.4",
"stream-browserify": "^3.0.0",
"ts-node": "^10.9.2",
"uint8arrays": "^5.1.0",
"vm-browserify": "^1.1.2"
},
"devDependencies": {
"@types/node": "^22.5.4",
"ts-loader": "^9.5.1",
"typescript": "^5.5.4",
"vite": "^5.4.9",
"vite-plugin-node-polyfills": "^0.22.0"
}
}
63 changes: 30 additions & 33 deletions examples/local-bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
{
"name": "topology-example-localdev",
"version": "0.3.1",
"description": "Topology Protocol Local Dev Example",
"main": "src/index.ts",
"repository": "https://github.com/topology-foundation/ts-topology.git",
"license": "MIT",
"scripts": {
"asbuild": "asc --config asconfig.json --target release",
"build": "vite build",
"clean": "rm -rf dist/ node_modules/",
"dev": "vite serve",
"start": "ts-node ./src/index.ts"
},
"dependencies": {
"@topology-foundation/blueprints": "0.3.1",
"@topology-foundation/network": "0.3.1",
"@topology-foundation/node": "0.3.1",
"@topology-foundation/object": "0.3.1",
"assemblyscript": "^0.27.29",
"crypto-browserify": "^3.12.0",
"process": "^0.11.10",
"stream-browserify": "^3.0.0",
"ts-node": "^10.9.2",
"uint8arrays": "^5.1.0",
"vm-browserify": "^1.1.2"
},
"devDependencies": {
"@types/node": "^22.5.4",
"ts-loader": "^9.5.1",
"typescript": "^5.5.4",
"vite": "^5.4.6",
"vite-plugin-node-polyfills": "^0.22.0"
}
"name": "ts-drp-example-localdev",
"version": "0.3.1",
"license": "MIT",
"scripts": {
"asbuild": "asc --config asconfig.json --target release",
"build": "vite build",
"clean": "rm -rf dist/ node_modules/",
"dev": "vite serve",
"start": "ts-node ./src/index.ts"
},
"dependencies": {
"@topology-foundation/blueprints": "0.3.1",
"@topology-foundation/network": "0.3.1",
"@topology-foundation/node": "0.3.1",
"@topology-foundation/object": "0.3.1",
"assemblyscript": "^0.27.29",
"crypto-browserify": "^3.12.0",
"process": "^0.11.10",
"stream-browserify": "^3.0.0",
"ts-node": "^10.9.2",
"uint8arrays": "^5.1.0",
"vm-browserify": "^1.1.2"
},
"devDependencies": {
"@types/node": "^22.5.4",
"ts-loader": "^9.5.1",
"typescript": "^5.5.4",
"vite": "^5.4.6",
"vite-plugin-node-polyfills": "^0.22.0"
}
}
Loading

0 comments on commit e499b7e

Please sign in to comment.