{"id":31745005,"url":"https://github.com/dotbithq/ckb-time-generator","last_synced_at":"2025-10-09T12:28:44.061Z","repository":{"id":143840940,"uuid":"367011750","full_name":"dotbitHQ/ckb-time-generator","owner":"dotbitHQ","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-23T14:22:45.000Z","size":405,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-01-23T15:23:08.539Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dotbitHQ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-13T10:19:55.000Z","updated_at":"2025-01-23T14:22:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"cd472592-1799-403e-b3da-af49496d31a9","html_url":"https://github.com/dotbitHQ/ckb-time-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dotbitHQ/ckb-time-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotbitHQ%2Fckb-time-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotbitHQ%2Fckb-time-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotbitHQ%2Fckb-time-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotbitHQ%2Fckb-time-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotbitHQ","download_url":"https://codeload.github.com/dotbitHQ/ckb-time-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotbitHQ%2Fckb-time-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001445,"owners_count":26083078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-09T12:28:22.806Z","updated_at":"2025-10-09T12:28:44.056Z","avatar_url":"https://github.com/dotbitHQ.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ckb-time-generator\n\n[![ci](https://github.com/dotbitHQ/ckb-time-generator/actions/workflows/ci.yaml/badge.svg)](https://github.com/dotbitHQ/ckb-time-generator/actions/workflows/ci.yaml)\n\nThe generator of [ckb-time-scripts](https://github.com/DeAccountSystems/ckb-time-script).\n\n\n## How to Work\n\n- Clone and install every dependencies with [npm](https://www.npmjs.com/).\n- Install [pm2](https://pm2.keymetrics.io/docs/usage/quick-start/) globally.\n- Copy `config/{env}.yaml` to `config/local-{env}.yaml`, edit configs as needed.\n- Run with `npm run reload_testnet` or `npm run reload_mainnet` base on environment.\n\n\u003e If it is needed to kown more details of the config file loading order, click this link [node-config](https://github.com/node-config/node-config/wiki/Configuration-Files#file-load-order) .\n\n\n## Tool Commands\n\n\u003e WARNING! Pnpm may not properly execute the following commands.\n\n- `npm run mainnet -- status -t timestamp` check status of TimeCells and their IndexStateCell on-chain.\n- `npm run mainnet -- fix -t timestamp` recycle redundant TimeCells and their IndexStateCell on-chain.\n- `npm run mainnet -- update -t timestamp` keep updating TimeCells and their IndexStateCell on-chain.\n\nThe `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`.\n\n\n## Development\n\nFirst, you need to create `config/local-{env}.yaml`, input private keys like below:\n\n```typescript\nloglevel: 'debug'\ntimestamp:\n  PayersPrivateKey: '0x000000000...'\nblocknumber:\n  PayersPrivateKey: '0x000000000...'\nquote:\n  PayersPrivateKey: '0x000000000...'\n```\n\nThen, you will be able to run commands in testnet environment like below:\n\n```bash\nnpm run dev\n\nnpm run testnet -- {commands}\n```\n\nThe `testnet` script will load `config/local-testnet.yaml` and `config/testnet.yaml` by default.\n\n\n## CKB Node Restart Script\n\nBecause 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:\n\n```bash\npm2 start --cron-restart=\"* * * * *\" \\\n./scripts/ckb-node-monit.mjs -- \\\n--block-timeout 180 \\\n--log /path_to_ckb_node_log_dir/run.log \\\n--data ./ckb-node-status.json\n```\n\n\u003e The script needs permission to execute `systemctl restart ckb-node` command, so it is required to run it with root permission.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotbithq%2Fckb-time-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotbithq%2Fckb-time-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotbithq%2Fckb-time-generator/lists"}