@offckb/cli 0.1.2-canary-82c0f55.0 → 0.2.0-canary-d61d116.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,8 +11,8 @@
11
11
  - One-line command to start a devnet
12
12
  - no docker required
13
13
  - pre-funded test accounts
14
- - packed with the most useful scripts like Omnilock and Spore-contract
15
- - multiple minimal Dapp templates to learn and get your hands dirty
14
+ - built-in scripts like [Omnilock](https://github.com/cryptape/omnilock) and [Spore-contract](https://github.com/sporeprotocol/spore-contract)
15
+ - multiple minimal dApp templates to learn and get your hands dirty
16
16
 
17
17
  Start building on Nervos blockchain, right now, right away!
18
18
 
@@ -23,10 +23,11 @@ Start building on Nervos blockchain, right now, right away!
23
23
  - [Install](#install)
24
24
  - [Usage](#usage)
25
25
  - [Get started](#get-started)
26
- - [Step 1: Create A Project](#step-1-create-a-project)
26
+ - [Run A dApp Example](#run-a-dapp-example)
27
+ - [Step 1: Select A dApp To Init](#step-1-select-a-dapp-to-init)
27
28
  - [Step 2: Start the Devnet](#step-2-start-the-devnet)
28
29
  - [Step 3: Access Pre-funded Accounts](#step-3-access-pre-funded-accounts)
29
- - [Dapp Templates](#dapp-templates)
30
+ - [dApp Examples with Detailed Tutorial](#dapp-examples-with-detailed-tutorial)
30
31
  - [View and transfer balance](#view-and-transfer-balance)
31
32
  - [Write \& read on-chain messages](#write--read-on-chain-messages)
32
33
  - [Issue custom token via xUDT scripts](#issue-custom-token-via-xudt-scripts)
@@ -42,26 +43,55 @@ Start building on Nervos blockchain, right now, right away!
42
43
  npm install -g @offckb/cli
43
44
  ```
44
45
 
46
+ *We recommand using [LTS](https://nodejs.org/en/download/package-manager) version of Node to run `offckb`*
47
+
45
48
  ## Usage
46
49
 
47
50
  ```sh
48
- offckb node # start the devnet of CKB, `ctrl-c` to stop running the chain
49
- offckb clean # clean the devnet data, needs to stop running the chain first
51
+ Usage: offckb [options] [command]
52
+
53
+ ckb development network for your first try
54
+
55
+ Options:
56
+ -V, --version output the version number
57
+ -h, --help display help for command
58
+
59
+ Commands:
60
+ init [your-project-name] Init a example dApp to learn and run
61
+ create [your-project-name] Create a new dApp from bare templates
62
+ node Use the CKB to start devnet
63
+ clean Clean the devnet data, need to stop running the chain first
64
+ accounts Print account list info
65
+ list-hashes Use the CKB to list blockchain scripts hashes
66
+ inject-config Add offckb.config.ts to your workspace
67
+ update-config Update offckb.config.ts in your workspace
68
+ deposit [options] [toAddress] [amountInShannon] Deposit CKB tokens to address, only devnet and testnet
69
+ transfer [options] [toAddress] [amountInShannon] Transfer CKB tokens to address, only devnet and testnet
70
+ balance [options] [toAddress] Check account balance, only devnet and testnet
71
+ deploy [options] Deploy contracts to different networks, only supports devnet and testnet
72
+ help [command] display help for command
73
+ ```
74
+
75
+ *Use `offckb [command] -h` to learn more about a specific command.*
76
+
77
+ ## Get started
50
78
 
51
- offckb init <project-name> # init a CKB Dapp typescript boilerplate from multiple templates
79
+ Create a new project from predefined boilerplates.
52
80
 
53
- offckb accounts # list 20 accounts info with prefund CKB tokens
54
- offckb list-hashes # list built-in scripts hashes, equals `ckb list-hashes`
81
+ ```sh
82
+ offckb create <your-project-name, eg:my-first-ckb-project>
55
83
  ```
56
84
 
57
- ## Get started
85
+ The boilerplate can be targeting on different CKB networks. Check README.md in the project to get started.
58
86
 
59
- ### Step 1: Create A Project
87
+ ## Run A dApp Example
88
+
89
+ ### Step 1: Select A dApp To Init
60
90
 
61
91
  ```sh
62
- offckb init my-awesome-ckb-dapp
92
+ offckb init <your-project-name, eg:my-awesome-ckb-dapp>
63
93
 
64
- ## select the template for your boilerplate
94
+ ## Select an example dApp
65
95
  ? Select a dapp template (Use arrow keys)
66
96
  ❯ Transfer CKB
67
97
  Issue Coin With XUDT scripts
@@ -104,57 +134,66 @@ Open another terminal and check the accounts to use:
104
134
  ```sh
105
135
  offckb accounts
106
136
 
107
- # result
108
- Print account list, each account is funded with 42_000_000_00000000 capacity in the genesis block.
109
- [
110
- {
111
- privkey: '0x6109170b275a09ad54877b82f7d9930f88cab5717d484fb4741ae9d1dd078cd6',
112
- pubkey: '0x02025fa7b61b2365aa459807b84df065f1949d58c0ae590ff22dd2595157bffefa',
113
- lockScript: {
114
- codeHash: '0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8',
115
- hashType: 'type',
116
- args: '0x8e42b1999f265a0078503c4acec4d5e134534297'
117
- },
118
- address: 'ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqvwg2cen8extgq8s5puft8vf40px3f599cytcyd8',
119
- args: '0x8e42b1999f265a0078503c4acec4d5e134534297'
120
- },
121
- {
122
- privkey: '0x9f315d5a9618a39fdc487c7a67a8581d40b045bd7a42d83648ca80ef3b2cb4a1',
123
- pubkey: '0x026efa0579f09cc7c1129b78544f70098c90b2ab155c10746316f945829c034a2d',
124
- lockScript: {
137
+ # results
138
+
139
+ #### ALL ACCOUNTS ARE FOR TEST AND DEVELOP ONLY ####
140
+ #### DON'T USE THESE ACCOUNTS ON MAINNET ####
141
+ #### OTHERWISE YOU WILL LOOSE YOUR MONEY ####
142
+
143
+ Print account list, each account is funded with 42_000_000_00000000 capacity in the devnet genesis block.
144
+
145
+ - "#": 0
146
+ address: ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqvwg2cen8extgq8s5puft8vf40px3f599cytcyd8
147
+ privkey: 0x6109170b275a09ad54877b82f7d9930f88cab5717d484fb4741ae9d1dd078cd6
148
+ pubkey: 0x02025fa7b61b2365aa459807b84df065f1949d58c0ae590ff22dd2595157bffefa
149
+ lock_arg: 0x8e42b1999f265a0078503c4acec4d5e134534297
150
+ lockScript:
151
+ codeHash: 0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8
152
+ hashType: type
153
+ args: 0x8e42b1999f265a0078503c4acec4d5e134534297
154
+
155
+ - "#": 1
156
+ address: ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqt435c3epyrupszm7khk6weq5lrlyt52lg48ucew
157
+ privkey: 0x9f315d5a9618a39fdc487c7a67a8581d40b045bd7a42d83648ca80ef3b2cb4a1
158
+ pubkey: 0x026efa0579f09cc7c1129b78544f70098c90b2ab155c10746316f945829c034a2d
159
+ lock_arg: 0x758d311c8483e0602dfad7b69d9053e3f917457d
160
+ lockScript:
161
+ codeHash: 0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8
162
+ hashType: type
163
+ args: 0x758d311c8483e0602dfad7b69d9053e3f917457d
125
164
  ```
126
165
 
127
- Copy some private keys and visit http://localhost:1234 to play your first CKB Dapp!
166
+ Copy some private keys and visit http://localhost:1234 to play your first CKB dApp!
128
167
 
129
- ## Dapp Templates
168
+ ## dApp Examples with Detailed Tutorial
130
169
 
131
- `offckb` packs some basic minimal Dapp templates for you to learn and get started with. By running `offckb init`, you can select the different Dapp templates to quickly set up a local Dapp project targeting the local blockchain with built-in scripts and accounts.
170
+ `offckb` packs some basic minimal dApp examples for you to learn and get started with. By running `offckb init`, you can select the different dApp examples to quickly set up a local dApp project targeting the local blockchain with built-in scripts and accounts.
132
171
 
133
- The Dapp templates often involve interaction with some most useful smart contracts on CKB like xUDT/Spore/Omnilock. The best thing is those Dapp examples also come with detailed tutorial documents from [docs.nervos.org](https://docs.nervos.org/). The source codes of these templates are also maintained [here](https://github.com/nervosnetwork/docs.nervos.org/tree/develop-v2/examples).
172
+ The dApp examples often involve interaction with some most useful smart contracts on CKB like xUDT/Spore/Omnilock. The best thing is those dApp examples also come with detailed tutorial documents from [docs.nervos.org](https://docs.nervos.org/). The source codes of these templates are also maintained [here](https://github.com/nervosnetwork/docs.nervos.org/tree/develop-v2/examples).
134
173
 
135
174
  ### View and transfer balance
136
175
 
137
- A simple Dapp to check CKB balance and transfer CKB.
176
+ A simple dApp to check CKB balance and transfer CKB.
138
177
 
139
- [Tutorial](https://nervos-ckb-docs-git-develop-v2-cryptape.vercel.app/docs/dapp/view-and-transfer-balance)
178
+ [Tutorial](https://docs.nervos.org/docs/getting-started/transfer-ckb)
140
179
 
141
180
  ### Write & read on-chain messages
142
181
 
143
- A simple Dapp to issue your own token via XUDT scripts.
182
+ A simple dApp to issue your own token via XUDT scripts.
144
183
 
145
- [Tutorial](https://nervos-ckb-docs-git-develop-v2-cryptape.vercel.app/docs/dapp/write-and-read-on-chain-message)
184
+ [Tutorial](https://docs.nervos.org/docs/getting-started/write-message)
146
185
 
147
186
  ### Issue custom token via xUDT scripts
148
187
 
149
- A simple Dapp to store & retrieve data from a Cell.
188
+ A simple dApp to store & retrieve data from a Cell.
150
189
 
151
- [Tutorial](https://nervos-ckb-docs-git-develop-v2-cryptape.vercel.app/docs/dapp/issue-custom-token)
190
+ [Tutorial](https://docs.nervos.org/docs/getting-started/create-token)
152
191
 
153
192
  ### Create on-chain digital object via Spore protocol
154
193
 
155
- A simple Dapp to create on-chain digital objects with spore scripts.
194
+ A simple dApp to create on-chain digital objects with spore scripts.
156
195
 
157
- [Tutorial](https://nervos-ckb-docs-git-develop-v2-cryptape.vercel.app/docs/dapp/create-nft)
196
+ [Tutorial](https://docs.nervos.org/docs/getting-started/create-dob)
158
197
 
159
198
  ## Built-in scripts
160
199
 
@@ -180,7 +219,7 @@ detail informations about each account are recorded in the `account/account.json
180
219
 
181
220
  ## About Lumos
182
221
 
183
- `offckb` uses [Lumos](https://github.com/ckb-js/lumos) as the CKB Dapp framework to build the template projects.
222
+ `offckb` uses [Lumos](https://github.com/ckb-js/lumos) as the CKB dApp framework to build the template projects.
184
223
 
185
224
  ## Contributing
186
225
 
@@ -16,7 +16,7 @@ export declare const minimalRequiredCKBVersion = "0.113.1";
16
16
  export declare const defaultLumosVersion = "0.21.0";
17
17
  export declare const dappTemplateGitRepoUserAndName = "nervosnetwork/docs.nervos.org";
18
18
  export declare const dappTemplateGitUrl = "https://github.com/nervosnetwork/docs.nervos.org";
19
- export declare const dappTemplateGitBranch = "v2";
19
+ export declare const dappTemplateGitBranch = "develop";
20
20
  export declare const dappTemplateGitFolder = "examples";
21
21
  export declare const dappTemplateGitSelectOptionFile = "options.json";
22
22
  export declare const bareTemplateGitSelectOptionFile = "template.json";
package/dist/cfg/const.js CHANGED
@@ -46,7 +46,7 @@ exports.defaultLumosVersion = '0.21.0';
46
46
  // url
47
47
  exports.dappTemplateGitRepoUserAndName = 'nervosnetwork/docs.nervos.org';
48
48
  exports.dappTemplateGitUrl = `https://github.com/${exports.dappTemplateGitRepoUserAndName}`;
49
- exports.dappTemplateGitBranch = 'v2';
49
+ exports.dappTemplateGitBranch = 'develop';
50
50
  exports.dappTemplateGitFolder = 'examples';
51
51
  exports.dappTemplateGitSelectOptionFile = 'options.json';
52
52
  exports.bareTemplateGitSelectOptionFile = 'template.json';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@offckb/cli",
3
- "version": "0.1.2-canary-82c0f55.0",
3
+ "version": "0.2.0-canary-d61d116.0",
4
4
  "description": "ckb development network for your first try",
5
5
  "author": "Retric Su <retric@cryptape.com>",
6
6
  "license": "MIT",