Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue fixes & peer dependency fix #71

Merged
merged 6 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .editorconfig

This file was deleted.

50 changes: 0 additions & 50 deletions .github/workflows/build.yml

This file was deleted.

64 changes: 21 additions & 43 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,43 @@ on:
types: [published]

jobs:
test:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 19.x
node-version: 20

- name: Start Redis
uses: supercharge/redis-github-action@1.5.0
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
redis-version: 7
redis-port: 6379
version: 8
run_install: false # use caching via later commands

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: yarn

- name: Formatting
run: yarn format

- name: Linting
run: yarn lint
run: pnpm install

- name: Build
run: yarn build

- name: Run tests
run: yarn test

publish:
needs: test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Build package
run: pnpm build

- run: yarn
- run: yarn build
- uses: JS-DevTools/npm-publish@v3
id: publish
with:
Expand Down
42 changes: 24 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,57 @@
name: test

# run when `dev` has a push or PR
# or when `master` has a push
on:
pull_request:
types:
- opened
branches:
- dev
- master
push:
branches:
- master
- dev

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 19.x
node-version: 20

- name: Start Redis
uses: supercharge/redis-github-action@1.5.0
with:
redis-version: 7
redis-port: 6379

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: yarn
run: pnpm install

- name: Build package
run: pnpm build

- name: Run tests
run: yarn test
run: pnpm test
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<p align="center">
<a href="https://opensource.org/licenses/MIT" target="_blank">
<img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-yellow.svg">
<img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-7CB9E8.svg">
</a>
<a href="https://www.npmjs.com/package/hollowdb" target="_blank">
<img alt="NPM" src="https://img.shields.io/npm/v/hollowdb?logo=npm&color=CB3837">
Expand All @@ -24,9 +24,6 @@
<a href="./.github/workflows/test.yml" target="_blank">
<img alt="Workflow: Tests" src="https://github.com/firstbatchxyz/hollowdb/actions/workflows/test.yml/badge.svg?branch=master">
</a>
<a href="./.github/workflows/build.yml" target="_blank">
<img alt="Workflow: Build" src="https://github.com/firstbatchxyz/hollowdb/actions/workflows/build.yml/badge.svg?branch=master">
</a>
<a href="https://discord.gg/2wuU9ym6fq" target="_blank">
<img alt="Discord" src="https://dcbadge.vercel.app/api/server/2wuU9ym6fq?style=flat">
</a>
Expand All @@ -47,10 +44,15 @@ Depending on your use-cases, we have several optional dependencies:
- 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.
- You can use LMDB cache within your Warp instance via [warp-contracts-lmdb](https://www.npmjs.com/package/warp-contracts-lmdb).
- 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).
- 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).

## Usage

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).
You can read the full documentation of HollowDB at <https://docs.hollowdb.xyz>.

> [!NOTE]
>
> If you are interested in customizing the smart contract of HollowDB and extending its SDKs, refer to this [README](./src/contracts/README.md).

## Examples

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

```sh
yarn test
pnpm test
```

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).
Expand All @@ -74,6 +76,6 @@ Tests operate on a local Arweave instance using [arlocal](https://www.npmjs.com/
You can check the formatting of the code or lint everything with the following commands:

```sh
yarn format # prettier
yarn lint # eslint
pnpm format # prettier
pnpm lint # eslint
```
19 changes: 19 additions & 0 deletions examples/simple/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Simple Example

In this example, we simply put and get a value from HollowDB.

```sh
yarn install
```

Run the example:

```sh
node index.js
```

You can also use a bundler (Irys) with, if you have funded your wallet:

```sh
USE_IRYS=true node index.js
```
44 changes: 0 additions & 44 deletions examples/simple/example.js

This file was deleted.

Loading