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

feat!: support for CKB2023 #527

Merged
merged 80 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
caa5661
chore: unnecessary yarn
homura May 7, 2023
e3797f2
chore: missing dependencies
homura May 7, 2023
6d7cbda
chore: update to typescript 5
homura May 7, 2023
489e9ae
chore: remove unnecessary code
homura May 7, 2023
ea82a6e
chore: keep ts-node in same ver
homura May 7, 2023
7808dff
chore: update eslint
homura May 7, 2023
f9a2016
chore(website): correct dependencies
homura May 7, 2023
af5377f
fix: eslint error
homura May 10, 2023
7bb29d4
fix(website): correct the doc org
homura May 10, 2023
7a88d35
chore: move pkg manager to pnpm
homura May 10, 2023
7ece45e
chore: prettier before commit
homura May 10, 2023
95497b6
chore: migrate ci from yarn to pnpm
homura May 11, 2023
86f642b
fix: missing shx
homura May 11, 2023
c1270ec
chore: update lock file
homura May 11, 2023
ab43374
fix: e2e test failed
homura May 11, 2023
6944dc8
chore: merge with the latest
homura May 25, 2023
2abbe87
test(ckb-indexer): optimize test flow
homura May 26, 2023
feecc49
chore: debug ci
homura May 26, 2023
fc32bbe
chore: use npm to replace lerna when test
homura May 26, 2023
04de306
feat(utils): utility function library for lumos
homura Jun 4, 2023
b5eef2c
feat(runner): download/config ckb and light client binaries
homura Jun 4, 2023
00690b2
feat(runner): upgrade to [email protected] and [email protected]
homura Jun 4, 2023
08a8d1e
chore: update dependencies
homura Jun 4, 2023
ce5931f
Merge remote-tracking branch 'origin/develop' into pnpm-ts-5
homura Jun 4, 2023
a69db38
chore: bump to 0.20.0-alpha.3
homura Jun 4, 2023
cf458e4
fix(runner): check existence in findFileSync
homura Jun 4, 2023
9234e41
chore: update lockfile
homura Jun 4, 2023
4344178
fix: ensure port are free when running tests
homura Jun 4, 2023
7c4ffd4
chore: upgrade typedoc to build api
homura Jun 5, 2023
e042d44
refactor: remove unused code
homura Jun 5, 2023
c31567c
chore: typo
homura Jun 7, 2023
f5c83f0
chore: replace yarn with npx/npm
homura Jun 7, 2023
453a962
ci: update to the latest pnpm
homura Jun 7, 2023
17f8053
feat!: breaking change from ckb2023 rpc
homura Jun 15, 2023
d10cc7a
chore: pre-release when creating github release
homura Jun 15, 2023
355398b
test(rpc): update consensus test case
homura Jun 15, 2023
f008516
test: update tx structure to ckb2023
homura Jun 15, 2023
de4f003
Merge remote-tracking branch 'origin/ckb2023' into ckb2023
homura Jun 15, 2023
1701e12
test: upgrade tx structure in e2e-test
homura Jun 16, 2023
02a5228
test: decrease miner interval to speedup e2e
homura Jun 16, 2023
00e64f1
test: update test node to v0.111.0
homura Jun 16, 2023
eb8a733
chore: update lock file
homura Jun 16, 2023
51e5c5c
refactor: rm unused code
homura Jun 16, 2023
80b2d5d
feat: support data2 for ckb2023
homura Jun 19, 2023
3103d58
feat: revert hardfork features structure
zhangyouxin Jul 5, 2023
5d70de3
chore: upgrade ckb binary verison to v0.111.0-rc8
zhangyouxin Jul 5, 2023
6e1b340
Merge remote-tracking branch 'ckb-js/develop' into ckb2023
homura Aug 2, 2023
de0b53f
chore: update lockfile
homura Aug 2, 2023
526ab2f
feat(rpc): type def for different verbosity of get_transaction
homura Aug 3, 2023
4d2367a
chore: canary release for ckb2023
homura Aug 3, 2023
a98c0d3
refactor(base): correct data2 serialization
homura Sep 15, 2023
a50111a
chore(e2e-test): temp disable e2e test for light client
homura Sep 15, 2023
953518b
chore: indexer cannot stop in ci
homura Sep 17, 2023
310848e
Merge pull request #555 from ckb-js/data2
homura Sep 17, 2023
35dbe94
Merge branch 'revert-hardfork-feature' into ckb2023
homura Sep 25, 2023
32cb703
Merge remote-tracking branch 'ckb-js/ckb2023' into ckb2023
homura Sep 25, 2023
fe6c0e5
feat(rpc): support target param for get_fee_rate_statistics
homura Sep 25, 2023
02d881d
feat(rpc): added reason to txStatus
homura Sep 25, 2023
1e8389b
feat(rpc): support get_header with verbosity
homura Sep 25, 2023
dea17ab
feat(rpc): support withCycle for getBlock
homura Sep 25, 2023
624ef54
fix(rpc): ts-node cannot run with complex type
homura Sep 26, 2023
f2e6bcc
Merge remote-tracking branch 'ckb-js/develop' into ckb2023-rpc-improve
homura Sep 26, 2023
e831f10
chore(examples): support devnet transfer
homura Sep 26, 2023
3d5ff1e
chore: merged with develop
homura Sep 26, 2023
cd67b99
test(rpc): add test cases about with_cycles
homura Sep 26, 2023
64be5ef
Merge remote-tracking branch 'ckb-js/develop' into ckb2023
homura Sep 26, 2023
864a140
chore: update deps version
homura Sep 26, 2023
22b17ec
Merge pull request #557 from ckb-js/ckb2023-merge
homura Sep 26, 2023
df1c6cb
Merge remote-tracking branch 'ckb-js/ckb2023' into ckb2023-rpc-improve
homura Sep 26, 2023
72bca3f
Merge pull request #556 from ckb-js/ckb2023-rpc-improve
homura Sep 26, 2023
3fea672
feat(rpc): added `unknown | rejected` to `TxStatus`
homura Sep 27, 2023
0b9b247
Merge pull request #558 from ckb-js/ckb2023-tx-status
homura Sep 27, 2023
b6f6a00
fix(rpc): lack of the `reason` field in `TxStatus`
homura Sep 28, 2023
1c33153
test: defaults light client to v0.3.0
homura Nov 7, 2023
cbab8d9
feat: make data2 works with ScriptConfig
homura Nov 8, 2023
181e83d
feat(light-client): support ckb-light-client v0.3.0 (#567)
PainterPuppets Nov 14, 2023
06bce6e
Merge origin/develop into ckb2023
homura Nov 16, 2023
6e56c06
refactor(rpc): prettier
homura Nov 16, 2023
d4356fe
chore: make changelog more detailed
homura Nov 23, 2023
9d8b881
fix: data2 should be serialized to 4
homura Nov 23, 2023
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
68 changes: 29 additions & 39 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
- uses: pnpm/action-setup@v2
with:
version: 8.6.1
- uses: actions/setup-node@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: "pnpm"

- name: Install project dependencies and build
run: |
yarn --ignore-engines --frozen-lockfile
yarn build
pnpm install --frozen-lockfile
npm run build
git diff --exit-code

- name: Prettier check
run: yarn lint
run: npm run lint

- name: Run test with coverage
run: yarn test-coverage
run: npm run test-coverage

- uses: codecov/codecov-action@v3
with:
Expand All @@ -40,44 +35,39 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
- uses: pnpm/action-setup@v2
with:
version: 8.6.1
- uses: actions/setup-node@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: "pnpm"

- name: Install project dependencies and build
run: |
yarn --ignore-engines --frozen-lockfile
yarn build
docker-compose -f ./packages/e2e-test/docker/docker-compose.yml build
pnpm install --frozen-lockfile
npm run build
# TODO uncomment me
# docker-compose -f ./packages/e2e-test/docker/docker-compose.yml build
- name: e2e test
run: yarn e2e-test
run: npm run e2e-test

lint-staged:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
- uses: pnpm/action-setup@v2
with:
version: 8.6.1
- uses: actions/setup-node@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: "pnpm"

- name: Install project dependencies and build
run: |
yarn --ignore-engines --frozen-lockfile
yarn build
pnpm install --frozen-lockfile
npm run build
- name: Get changed files
uses: tj-actions/[email protected]
id: changed-files
Expand All @@ -91,4 +81,4 @@ jobs:
- name: Run lint for changed files
if: ${{ steps.changed-files.outputs.all_changed_files != '' }}
run: |
yarn eslint -c .eslintrc.next.js ${{ steps.changed-files.outputs.all_changed_files }}
npx eslint -c .eslintrc.next.js ${{ steps.changed-files.outputs.all_changed_files }}
81 changes: 36 additions & 45 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,77 +15,65 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
- uses: pnpm/action-setup@v2
with:
version: 8.6.1
- uses: actions/setup-node@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: 'pnpm'

- name: Install project dependencies and build
run: |
yarn --ignore-engines --frozen-lockfile
yarn build
pnpm install --frozen-lockfile
npm run build
git diff --exit-code

- name: Prettier check
run: yarn lint
run: npm run lint

- name: Run test with coverage
run: yarn test-coverage
run: npm run test-coverage

- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: ./coverage/cobertura-coverage.xml
verbose: true # optional (default = false)

test-e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
- uses: pnpm/action-setup@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
version: 8.6.1
- uses: actions/setup-node@v3
with:
cache: 'pnpm'

- name: Install project dependencies and build
run: |
yarn --ignore-engines --frozen-lockfile
yarn build
pnpm install --frozen-lockfile
npm run build
- name: e2e test
run: yarn e2e-test
run: npm run e2e-test

lint-staged:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
- uses: pnpm/action-setup@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
version: 8.6.1
- uses: actions/setup-node@v3
with:
cache: 'pnpm'

- name: Install project dependencies and build
run: |
yarn --ignore-engines --frozen-lockfile
yarn build
pnpm install --frozen-lockfile
npm run build
- name: Get changed files
uses: tj-actions/[email protected]
id: changed-files
Expand All @@ -99,18 +87,22 @@ jobs:
- name: Run lint for changed files
if: ${{ steps.changed-files.outputs.all_changed_files != '' }}
run: |
yarn eslint -c .eslintrc.next.js ${{ steps.changed-files.outputs.all_changed_files }}
npx eslint -c .eslintrc.next.js ${{ steps.changed-files.outputs.all_changed_files }}
publish:
needs: [test-unit, test-e2e, lint-staged]
name: Publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 8.6.1
- name: Setup Node ${{ matrix.node_version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'
registry-url: "https://registry.npmjs.org"
- name: Git Identity
run: |
Expand All @@ -120,7 +112,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install
run: yarn --frozen-lockfile --frozen-lockfile
run: pnpm install --frozen-lockfile
# Define ${CURRENT_VERSION}
- name: Set Current Version
run: |
Expand Down Expand Up @@ -180,14 +172,13 @@ jobs:
body: ${{ env.CHANGELOG }}
release_name: ${{ env.CURRENT_VERSION }}
draft: false
prerelease: ${{ steps.tag_check.prerelease_check.prerelease }}
prerelease: ${{ steps.prerelease_check.output.prerelease }}

- name: Publish
if: steps.tag_check.outputs.exists_tag == 'false'
run: |
yarn run build
yarn run build-release
yarn lerna publish from-package --yes --dist-tag $([ $PRERELEASE == 'true' ] && echo 'next' || echo 'latest')
npm run build
npx lerna publish from-package --yes --dist-tag $([ $PRERELEASE == 'true' ] && echo 'next' || echo 'latest')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit $1
npx commitlint --edit $1
npx lint-staged
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn run lint
npm run lint
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Publish

1. [Local] Checkout release branch: `git checkout v<version>` or `git checkout next/v<version>`
2. [Local] Run `yarn run versionup` or `yarn run versionup:prerelease`
2. [Local] Run `npm run versionup` or `npm run versionup:prerelease`
- Update CHANGELOG.md and `package.json`'s `version`, and `lerna.json`'s `version`
- It does not git tag
3. [Local] Submit to Release Pull Request
Expand Down
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,42 +34,40 @@ we have provided some use cases for Lumos, such as interactions with MetaMask, t
### Requirements

- [Node.js](https://nodejs.org)
- [Yarn](https://yarnpkg.com/)
- [node-gyp](https://github.com/nodejs/node-gyp)
- [pnpm](https://pnpm.io)

```bash
sudo apt-get update
sudo apt install nodejs
npm install --global yarn
sudo apt install build-essential
npm install -g pnpm
```

### Build

```bash
yarn run build
npm run build
```

### Test (ava)

```bash
yarn run test
npm run test
```

### Test Coverage (c8)

```bash
yarn run test-coverage
npm run test-coverage
```

### Format & Lint

```bash
yarn run lint
npm run lint
```

### Clean

```bash
yarn run clean
npm run clean
```
1 change: 1 addition & 0 deletions assets/readme-typedoc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Here is the API documentation of Lumos. It is generated by [TypeDoc](https://typedoc.org/).
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ const scopeEnumValues = [
"website",
"codec",
"debugger",
"utils",
"runner",
"e2e-test",
];
const Configuration = {
extends: ["@commitlint/config-conventional"],
Expand Down
7 changes: 3 additions & 4 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
```sh
git clone https://github.com/ckb-js/lumos.git
cd lumos
yarn
yarn build
yarn build-release
pnpm install
pnpm run build
```

### Check if the build is working

```
yarn ts-node examples/config-manager.ts
npx ts-node examples/config-manager.ts
```

## Online Preview
Expand Down
4 changes: 2 additions & 2 deletions examples/cardano-lock-namiwallet/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@lumos-examples/cardano-lock-namiwallet",
"version": "0.20.0-alpha.0",
"version": "0.20.0-alpha.3",
"description": "",
"main": "index.js",
"scripts": {
Expand All @@ -12,7 +12,7 @@
"author": "",
"license": "MIT",
"dependencies": {
"@ckb-lumos/lumos": "0.20.0-alpha.1",
"@ckb-lumos/lumos": "0.20.0-alpha.3",
"@emurgo/cardano-message-signing-asmjs": "^1.0.1",
"@emurgo/cardano-serialization-lib-asmjs": "^10.0.4",
"@types/react": "^18.0.25",
Expand Down
Loading