Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-pousette committed Dec 27, 2024
1 parent 4e58cd0 commit 009babd
Show file tree
Hide file tree
Showing 167 changed files with 23,776 additions and 8,887 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ jobs:
cache: yarn
- name: Install deps
run: |
yarn && npx playwright install-deps
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
yarn
npx playwright install-deps
- name: Build
run: |
yarn build
Expand Down Expand Up @@ -59,7 +61,9 @@ jobs:
cache: yarn
- name: Install deps
run: |
yarn && npx playwright install-deps
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
yarn
npx playwright install-deps
- name: Build
run: |
yarn build
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ jobs:
with:
node-version: lts/*
registry-url: 'https://registry.npmjs.org'

- name: Install deps
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
yarn
- name: Build Packages
if: ${{ steps.release.outputs.releases_created }}
run: |
Expand Down
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
**/public/peerbit/**
**/public/peerbit/**
**/target/**
**/pkg/**
36 changes: 18 additions & 18 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@
"packages/transport/blocks": "2.1.8",
"packages/transport/blocks-interface": "1.3.7",
"packages/utils/cache": "2.1.0",
"packages/programs/clock-service": "3.0.29",
"packages/programs/clock-service": "3.0.31",
"packages/utils/crypto": "2.3.2",
"packages/programs/data/document/document": "7.1.14",
"packages/programs/acl/identity-access-controller": "4.0.29",
"packages/programs/data/document/document": "7.1.16",
"packages/programs/acl/identity-access-controller": "4.0.31",
"packages/transport/libp2p-test-utils": "2.1.9",
"packages/log": "4.0.19",
"packages/log": "4.0.21",
"packages/utils/logger": "1.0.3",
"packages/programs/program": "5.0.8",
"packages/clients/peerbit-proxy/proxy": "5.0.2",
"packages/clients/peerbit-proxy/proxy": "5.0.4",
"packages/transport/pubsub": "3.0.13",
"packages/transport/pubsub-interface": "3.1.1",
"packages/programs/rpc": "5.0.17",
"packages/clients/peerbit-server/node": "5.0.54",
"packages/programs/data/shared-log": "9.2.11",
"packages/programs/rpc": "5.0.19",
"packages/clients/peerbit-server/node": "5.0.56",
"packages/programs/data/shared-log": "9.2.13",
"packages/transport/stream": "4.1.2",
"packages/transport/stream-interface": "5.1.1",
"packages/programs/data/string": "5.0.25",
"packages/clients/test-utils": "2.1.7",
"packages/programs/data/string": "5.0.27",
"packages/clients/test-utils": "2.1.9",
"packages/utils/time": "2.0.7",
"packages/programs/acl/trusted-network": "4.1.14",
"packages/clients/peerbit": "4.0.25",
"packages/clients/peerbit-proxy/window": "3.0.52",
"packages/programs/acl/trusted-network": "4.1.16",
"packages/clients/peerbit": "4.0.27",
"packages/clients/peerbit-proxy/window": "3.0.54",
"packages/utils/any-store/any-store": "2.1.2",
"packages/utils/keychain": "1.0.20",
"packages/utils/any-store/interface": "1.0.0",
"packages/utils/any-store/opfs": "1.0.2",
"packages/programs/data/document/interface": "1.0.6",
"packages/utils/indexer/interface": "1.1.1",
"packages/utils/indexer/simple": "1.1.1",
"packages/utils/indexer/sqlite3": "1.1.2",
"packages/utils/indexer/tests": "1.1.1",
"packages/programs/data/document/interface": "1.0.8",
"packages/utils/indexer/interface": "2.0.1",
"packages/utils/indexer/simple": "1.1.3",
"packages/utils/indexer/sqlite3": "1.1.4",
"packages/utils/indexer/tests": "1.1.3",
"packages/clients/vite": "1.0.4"
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"packages/utils/cache",
"packages/utils/logger",
"packages/utils/keychain",
"packages/utils/indexer/*"
"packages/utils/indexer/*",
"packages/utils/rateless-iblt"
],
"engines": {
"node": ">=18"
Expand Down Expand Up @@ -87,6 +88,7 @@
"aegir": "github:marcus-pousette/aegir#multiple-assets",
"eslint-config-peerbit": "https://github.com/dao-xyz/eslint-config-peerbit",
"benchmark": "^2.1.4",
"tinybench": "^3",
"chai-as-promised": "^7.1.1",
"dotenv": "^16.4.5",
"eslint-plugin-n": "^17.10.2",
Expand Down
22 changes: 22 additions & 0 deletions packages/clients/peerbit-proxy/proxy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,28 @@
* devDependencies
* @peerbit/test-utils bumped from 2.0.32 to 2.0.33

## [5.0.4](https://github.com/dao-xyz/peerbit/compare/proxy-v5.0.3...proxy-v5.0.4) (2024-11-08)


### Dependencies

* The following workspace dependencies were updated
* dependencies
* @peerbit/indexer-simple bumped from ^1.1.2 to ^1.1.3
* devDependencies
* @peerbit/test-utils bumped from 2.1.8 to 2.1.9

## [5.0.3](https://github.com/dao-xyz/peerbit/compare/proxy-v5.0.2...proxy-v5.0.3) (2024-11-07)


### Dependencies

* The following workspace dependencies were updated
* dependencies
* @peerbit/indexer-simple bumped from ^1.1.1 to ^1.1.2
* devDependencies
* @peerbit/test-utils bumped from 2.1.7 to 2.1.8

## [5.0.2](https://github.com/dao-xyz/peerbit/compare/proxy-v5.0.1...proxy-v5.0.2) (2024-10-28)


Expand Down
6 changes: 3 additions & 3 deletions packages/clients/peerbit-proxy/proxy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@peerbit/proxy",
"version": "5.0.2",
"version": "5.0.4",
"description": "Peerbit proxy host/server",
"author": "dao.xyz",
"license": "MIT",
Expand Down Expand Up @@ -53,11 +53,11 @@
"dependencies": {
"@peerbit/program": "^5.0.8",
"@peerbit/any-store-interface": "^1.0.0",
"@peerbit/indexer-simple": "^1.1.1",
"@peerbit/indexer-simple": "^1.1.3",
"uuid": "^10.0.0"
},
"devDependencies": {
"@peerbit/test-utils": "2.1.7"
"@peerbit/test-utils": "2.1.9"
},
"scripts": {
"clean": "aegir clean",
Expand Down
6 changes: 6 additions & 0 deletions packages/clients/peerbit-proxy/proxy/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,12 @@ export class PeerbitProxyClient implements ProgramClient {
return response.value;
}

async hangUp(
_address: PeerId | PublicSignKey | string | Multiaddr,
): Promise<void> {
throw new Error("Not implemented");
}

get services(): { pubsub: PubSub; blocks: Blocks; keychain: Keychain } {
return this._services;
}
Expand Down
6 changes: 5 additions & 1 deletion packages/clients/peerbit-proxy/proxy/src/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type PeerId } from "@libp2p/interface";
import { type Multiaddr } from "@multiformats/multiaddr";
import { type AnyStore } from "@peerbit/any-store-interface";
import { type Blocks } from "@peerbit/blocks-interface";
import { Ed25519Keypair } from "@peerbit/crypto";
import { Ed25519Keypair, type PublicSignKey } from "@peerbit/crypto";
import type { Indices } from "@peerbit/indexer-interface";
import { type Keychain } from "@peerbit/keychain";
import { type ProgramClient } from "@peerbit/program";
Expand Down Expand Up @@ -82,6 +82,10 @@ export class PeerbitProxyHost implements ProgramClient {
return this.hostClient.dial(address);
}

hangUp(address: PeerId | PublicSignKey | string | Multiaddr): Promise<void> {
return this.hostClient.hangUp(address);
}

get services(): { pubsub: PubSub; blocks: Blocks; keychain: Keychain } {
return this.hostClient.services;
}
Expand Down
22 changes: 22 additions & 0 deletions packages/clients/peerbit-proxy/window/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,28 @@
* devDependencies
* @peerbit/test-utils bumped from 2.0.32 to 2.0.33

## [3.0.54](https://github.com/dao-xyz/peerbit/compare/proxy-window-v3.0.53...proxy-window-v3.0.54) (2024-11-08)


### Dependencies

* The following workspace dependencies were updated
* dependencies
* @peerbit/proxy bumped from ^5.0.3 to ^5.0.4
* devDependencies
* @peerbit/test-utils bumped from 2.1.8 to 2.1.9

## [3.0.53](https://github.com/dao-xyz/peerbit/compare/proxy-window-v3.0.52...proxy-window-v3.0.53) (2024-11-07)


### Dependencies

* The following workspace dependencies were updated
* dependencies
* @peerbit/proxy bumped from ^5.0.2 to ^5.0.3
* devDependencies
* @peerbit/test-utils bumped from 2.1.7 to 2.1.8

## [3.0.52](https://github.com/dao-xyz/peerbit/compare/proxy-window-v3.0.51...proxy-window-v3.0.52) (2024-10-28)


Expand Down
27 changes: 15 additions & 12 deletions packages/clients/peerbit-proxy/window/e2e/browser/child/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const client = await createClient("*");

export const App = () => {
const mounted = useRef<boolean>(false);
const dbRef = useRef<SharedLog>();
const dbRef = useRef<SharedLog<any, any>>();
const [_, forceUpdate] = useReducer((x) => x + 1, 0);
useEffect(() => {
const queryParameters = new URLSearchParams(window.location.search);
Expand All @@ -18,19 +18,22 @@ export const App = () => {
}
mounted.current = true;
client
.open<SharedLog<Uint8Array>>(new SharedLog({ id: new Uint8Array(32) }), {
args: {
onChange: (change: Change<Uint8Array>) => {
forceUpdate();
setTimeout(() => {
dbRef.current?.log.load().then(() => {
forceUpdate();
console.log(client.messages.id, dbRef.current?.log.length);
});
}, 1000);
.open<SharedLog<Uint8Array, any>>(
new SharedLog({ id: new Uint8Array(32) }),
{
args: {
onChange: (change: Change<Uint8Array>) => {
forceUpdate();
setTimeout(() => {
dbRef.current?.log.load().then(() => {
forceUpdate();
console.log(client.messages.id, dbRef.current?.log.length);
});
}, 1000);
},
},
},
})
)
.then((x: any) => {
dbRef.current = x;
if (queryParameters.get("read") !== "true") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { SharedLog } from "@peerbit/shared-log";
@variant("test-log")
export class TestLog extends Program {
@field({ type: SharedLog })
log: SharedLog<Uint8Array>;
log: SharedLog<Uint8Array, any>;

constructor() {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ export default defineConfig({
{
command: "yarn --cwd ./child start",
url: "http://localhost:5201",
reuseExistingServer: true,
},
{
command: "yarn --cwd ./parent start",
url: "http://localhost:5202",
reuseExistingServer: true,
},
],
});
6 changes: 3 additions & 3 deletions packages/clients/peerbit-proxy/window/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@peerbit/proxy-window",
"version": "3.0.52",
"version": "3.0.54",
"description": "Peerbit proxy host/server",
"author": "dao.xyz",
"license": "MIT",
Expand Down Expand Up @@ -59,10 +59,10 @@
"node": ">=16.15.1"
},
"dependencies": {
"@peerbit/proxy": "^5.0.2"
"@peerbit/proxy": "^5.0.4"
},
"devDependencies": {
"@peerbit/test-utils": "2.1.7"
"@peerbit/test-utils": "2.1.9"
},
"scripts": {
"clean": "aegir clean",
Expand Down
22 changes: 22 additions & 0 deletions packages/clients/peerbit-server/node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,28 @@
* devDependencies
* @peerbit/test-utils bumped from 2.0.31 to 2.0.32

## [5.0.56](https://github.com/dao-xyz/peerbit/compare/server-v5.0.55...server-v5.0.56) (2024-11-08)


### Dependencies

* The following workspace dependencies were updated
* dependencies
* peerbit bumped from 4.0.26 to 4.0.27
* devDependencies
* @peerbit/test-utils bumped from 2.1.8 to 2.1.9

## [5.0.55](https://github.com/dao-xyz/peerbit/compare/server-v5.0.54...server-v5.0.55) (2024-11-07)


### Dependencies

* The following workspace dependencies were updated
* dependencies
* peerbit bumped from 4.0.25 to 4.0.26
* devDependencies
* @peerbit/test-utils bumped from 2.1.7 to 2.1.8

## [5.0.54](https://github.com/dao-xyz/peerbit/compare/server-v5.0.53...server-v5.0.54) (2024-10-28)


Expand Down
8 changes: 4 additions & 4 deletions packages/clients/peerbit-server/node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@peerbit/server",
"version": "5.0.54",
"version": "5.0.56",
"author": "dao.xyz",
"repository": {
"type": "git",
Expand Down Expand Up @@ -62,12 +62,12 @@
"build-lib": "tsc -p tsconfig.json",
"build-ui": "cd ../frontend && yarn build && cd ../node",
"postbuild": "cp src/nginx-template.conf dist/src/ && cp -r ../frontend/dist/. dist/ui",
"test": "aegir test",
"test": "aegir test --t node",
"lint": "aegir lint"
},
"devDependencies": {
"@peerbit/test-lib": "^0.0.1",
"@peerbit/test-utils": "2.1.7",
"@peerbit/test-utils": "2.1.9",
"@types/yargs": "17.0.24",
"aws-sdk": "^2.1259.0",
"dotenv": "^16.1.4",
Expand All @@ -78,7 +78,7 @@
"dependencies": {
"axios": "^1.4.0",
"chalk": "^5.3.0",
"peerbit": "4.0.25",
"peerbit": "4.0.27",
"yargs": "^17.7.2",
"tar-stream": "^3.1.7",
"tmp": "^0.2.1",
Expand Down
3 changes: 2 additions & 1 deletion packages/clients/peerbit-server/node/test/api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ describe("server", () => {
let node: Peerbit;

afterEach(async () => {
// @ts-ignore
await node?.stop();
// @ts-ignore
server?.close();
});
it("bootstrap on start", async () => {
Expand All @@ -92,7 +94,6 @@ describe("server", () => {
describe("api", () => {
let session: TestSession, peer: ProgramClient, server: http.Server;
let db: PermissionedString;

before(async () => {});

beforeEach(async () => {
Expand Down
1 change: 0 additions & 1 deletion packages/clients/peerbit-server/node/test/client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ describe("client", () => {
).to.be.instanceOf(AnyBlockStore);
expect((client.services.blocks as any)["canRelayMessage"]).equal(true);
expect((client.services.pubsub as any)["canRelayMessage"]).equal(true);
expect((client.services as any)["relay"]).to.exist;
});
});
Loading

0 comments on commit 009babd

Please sign in to comment.