Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdesu committed Jul 9, 2024
2 parents 7b83828 + f94be69 commit 65f578b
Show file tree
Hide file tree
Showing 24 changed files with 665 additions and 2,645 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
root: true,
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
}
14 changes: 0 additions & 14 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build-and-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.yaml') }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

- name: Install dependency
run: npm install
Expand Down
99 changes: 2 additions & 97 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,103 +6,8 @@ yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

dist/
.idea/

config/local*
*.json
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ The generator of [ckb-time-scripts](https://github.com/DeAccountSystems/ckb-time

> WARNING! Pnpm may not properly execute the following commands.
- `npm run main -- status -t timestamp` check status of TimeCells and their IndexStateCell on-chain.
- `npm run main -- fix -t timestamp` recycle redundant TimeCells and their IndexStateCell on-chain.
- `npm run main -- update -t timestamp` keep updating TimeCells and their IndexStateCell on-chain.
- `npm run mainnet -- status -t timestamp` check status of TimeCells and their IndexStateCell on-chain.
- `npm run mainnet -- fix -t timestamp` recycle redundant TimeCells and their IndexStateCell on-chain.
- `npm run mainnet -- update -t timestamp` keep updating TimeCells and their IndexStateCell on-chain.

Same as `timestamp` other option of `-t` can be `blocknumber` and `quote`, for more help information, please try `npm run main -- --help` .
The `mainnet` argument can also be changed to `testnet`. Similarly, besides using `timestamp`, the `-t` option can also be set as either `height` or `quote`. For further assistance, please refer to the help information by running `npm run main -- --help`.


## Development
Expand All @@ -43,19 +43,22 @@ quote:
Then, you will be able to run commands in testnet environment like below:

```bash
npm run dev -- {sub commands}
npm run dev

npm run testnet -- {commands}
```

The `dev` script will load `config/local-testnet.ts` and `config/testnet.ts` by default.
The `testnet` script will load `config/local-testnet.yaml` and `config/testnet.yaml` by default.


## CKB Node Restart Script

Because of unstable network, sometimes the CKB node may disconnect from peers and stop syncing blocks. To solve this problem, the script `scripts/ckb-node-monit.js` can restart the CKB node automatically:
Because of unstable network, sometimes the CKB node may disconnect from peers and stop syncing blocks. To solve this problem, the script `scripts/ckb-node-monit.mjs` can restart the CKB node automatically:

```bash
pm2 start --cron-restart="* * * * *" \
./scripts/ckb-node-monit.js -- \
./scripts/ckb-node-monit.mjs -- \
--block-timeout 180 \
--log /path_to_ckb_node_log_dir/run.log \
--data ./ckb-node-status.json
```
Expand Down
File renamed without changes.
Loading

0 comments on commit 65f578b

Please sign in to comment.