Skip to content

Commit 611b1c4

Browse files
authored
Merge pull request #71 from firstbatchxyz/erhant/peer-deps
Issue fixes & peer dependency fix
2 parents a58fd15 + eb4e5d3 commit 611b1c4

File tree

21 files changed

+12168
-1115
lines changed

21 files changed

+12168
-1115
lines changed

.editorconfig

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 21 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,65 +5,43 @@ on:
55
types: [published]
66

77
jobs:
8-
test:
8+
publish:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v2
12+
- name: Checkout
13+
uses: actions/checkout@v3
1314

1415
- name: Install Node.js
15-
uses: actions/setup-node@v1
16+
uses: actions/setup-node@v3
1617
with:
17-
node-version: 19.x
18+
node-version: 20
1819

19-
- name: Start Redis
20-
uses: supercharge/redis-github-action@1.5.0
20+
- uses: pnpm/action-setup@v2
21+
name: Install pnpm
2122
with:
22-
redis-version: 7
23-
redis-port: 6379
23+
version: 8
24+
run_install: false # use caching via later commands
2425

25-
- name: Get yarn cache directory path
26-
id: yarn-cache-dir-path
27-
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
26+
- name: Get pnpm store directory
27+
shell: bash
28+
run: |
29+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
2830
29-
- name: Restore yarn cache
30-
uses: actions/cache@v3
31-
id: yarn-cache
31+
- uses: actions/cache@v3
32+
name: Setup pnpm cache
3233
with:
33-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
34-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
34+
path: ${{ env.STORE_PATH }}
35+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
3536
restore-keys: |
36-
${{ runner.os }}-yarn-
37+
${{ runner.os }}-pnpm-store-
3738
3839
- name: Install dependencies
39-
run: yarn
40-
41-
- name: Formatting
42-
run: yarn format
43-
44-
- name: Linting
45-
run: yarn lint
40+
run: pnpm install
4641

47-
- name: Build
48-
run: yarn build
49-
50-
- name: Run tests
51-
run: yarn test
52-
53-
publish:
54-
needs: test
55-
runs-on: ubuntu-latest
56-
57-
steps:
58-
- uses: actions/checkout@v4
59-
60-
- uses: actions/setup-node@v3
61-
with:
62-
node-version: '20'
63-
registry-url: 'https://registry.npmjs.org'
42+
- name: Build package
43+
run: pnpm build
6444

65-
- run: yarn
66-
- run: yarn build
6745
- uses: JS-DevTools/npm-publish@v3
6846
id: publish
6947
with:

.github/workflows/test.yml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,57 @@
11
name: test
22

3-
# run when `dev` has a push or PR
4-
# or when `master` has a push
53
on:
64
pull_request:
75
types:
86
- opened
97
branches:
10-
- dev
8+
- master
119
push:
1210
branches:
1311
- master
14-
- dev
1512

1613
jobs:
1714
test:
1815
runs-on: ubuntu-latest
1916

2017
steps:
21-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
2219

2320
- name: Install Node.js
24-
uses: actions/setup-node@v1
21+
uses: actions/setup-node@v3
2522
with:
26-
node-version: 19.x
23+
node-version: 20
2724

2825
- name: Start Redis
2926
uses: supercharge/redis-github-action@1.5.0
3027
with:
3128
redis-version: 7
3229
redis-port: 6379
3330

34-
- name: Get yarn cache directory path
35-
id: yarn-cache-dir-path
36-
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
31+
- uses: pnpm/action-setup@v2
32+
name: Install pnpm
33+
with:
34+
version: 8
35+
run_install: false
36+
37+
- name: Get pnpm store directory
38+
shell: bash
39+
run: |
40+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
3741
38-
- name: Restore yarn cache
39-
uses: actions/cache@v3
40-
id: yarn-cache
42+
- uses: actions/cache@v3
43+
name: Setup pnpm cache
4144
with:
42-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
43-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
45+
path: ${{ env.STORE_PATH }}
46+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
4447
restore-keys: |
45-
${{ runner.os }}-yarn-
48+
${{ runner.os }}-pnpm-store-
4649
4750
- name: Install dependencies
48-
run: yarn
51+
run: pnpm install
52+
53+
- name: Build package
54+
run: pnpm build
4955

5056
- name: Run tests
51-
run: yarn test
57+
run: pnpm test

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<p align="center">
1515
<a href="https://opensource.org/licenses/MIT" target="_blank">
16-
<img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-yellow.svg">
16+
<img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-7CB9E8.svg">
1717
</a>
1818
<a href="https://www.npmjs.com/package/hollowdb" target="_blank">
1919
<img alt="NPM" src="https://img.shields.io/npm/v/hollowdb?logo=npm&color=CB3837">
@@ -24,9 +24,6 @@
2424
<a href="./.github/workflows/test.yml" target="_blank">
2525
<img alt="Workflow: Tests" src="https://github.com/firstbatchxyz/hollowdb/actions/workflows/test.yml/badge.svg?branch=master">
2626
</a>
27-
<a href="./.github/workflows/build.yml" target="_blank">
28-
<img alt="Workflow: Build" src="https://github.com/firstbatchxyz/hollowdb/actions/workflows/build.yml/badge.svg?branch=master">
29-
</a>
3027
<a href="https://discord.gg/2wuU9ym6fq" target="_blank">
3128
<img alt="Discord" src="https://dcbadge.vercel.app/api/server/2wuU9ym6fq?style=flat">
3229
</a>
@@ -47,10 +44,15 @@ Depending on your use-cases, we have several optional dependencies:
4744
- You can use [hollowdb-prover](https://www.npmjs.com/package/hollowdb-prover) as a simple utility that generates zero-knowledge proofs that are verifiable by HollowDB.
4845
- You can use LMDB cache within your Warp instance via [warp-contracts-lmdb](https://www.npmjs.com/package/warp-contracts-lmdb).
4946
- You can use Redis cache within your warp instance via [warp-contracts-redis](https://www.npmjs.com/package/warp-contracts-redis) together with [ioredis](https://www.npmjs.com/package/ioredis).
47+
- When you are evaluating a contract that uses ZK proofs, you should also use [warp-contracts-plugin-snarkjs](https://www.npmjs.com/package/warp-contracts-plugin-snarkjs) and [warp-contracts-plugin-ethers](https://www.npmjs.com/package/warp-contracts-plugin-ethers).
5048

5149
## Usage
5250

53-
You can read the full documentation of HollowDB at <https://docs.hollowdb.xyz>. If you are interested in customizing the smart contract of HollowDB and extending its SDKs, refer to this [README](./src/contracts/README.md).
51+
You can read the full documentation of HollowDB at <https://docs.hollowdb.xyz>.
52+
53+
> [!NOTE]
54+
>
55+
> If you are interested in customizing the smart contract of HollowDB and extending its SDKs, refer to this [README](./src/contracts/README.md).
5456
5557
## Examples
5658

@@ -64,7 +66,7 @@ Check out the [examples](./examples/) folder for a few examples of HollowDB usag
6466
You can run all tests via:
6567

6668
```sh
67-
yarn test
69+
pnpm test
6870
```
6971

7072
Tests operate on a local Arweave instance using [arlocal](https://www.npmjs.com/package/arlocal). They will run for all cache types (LMDB, Redis, LevelDB). You will need to have a Redis server running for some of the tests to pass, the URL shall be specified [here](./tests/constants/index.ts).
@@ -74,6 +76,6 @@ Tests operate on a local Arweave instance using [arlocal](https://www.npmjs.com/
7476
You can check the formatting of the code or lint everything with the following commands:
7577

7678
```sh
77-
yarn format # prettier
78-
yarn lint # eslint
79+
pnpm format # prettier
80+
pnpm lint # eslint
7981
```

examples/simple/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Simple Example
2+
3+
In this example, we simply put and get a value from HollowDB.
4+
5+
```sh
6+
yarn install
7+
```
8+
9+
Run the example:
10+
11+
```sh
12+
node index.js
13+
```
14+
15+
You can also use a bundler (Irys) with, if you have funded your wallet:
16+
17+
```sh
18+
USE_IRYS=true node index.js
19+
```

examples/simple/example.js

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)