@offckb/cli 0.1.0-rc2 → 0.1.0-rc3
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 +31 -9
- package/dist/cli.js +11 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,24 +5,46 @@ ckb development environment for professionals
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
|
|
9
|
-
cd offckb && alias offckb='yarn start'
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
eventually you will do simple
|
|
13
|
-
```sh
|
|
14
|
-
npm install -g offckb // not yet, todo
|
|
8
|
+
npm install -g @offckb/cli
|
|
15
9
|
```
|
|
16
10
|
|
|
17
11
|
## Usage
|
|
18
12
|
|
|
19
13
|
```sh
|
|
20
14
|
offckb node // start the devnet of CKB
|
|
21
|
-
offckb init // init a typescript boilerplate with lumos to get started with to build CKB DAPP,think 'hardhat init'
|
|
22
|
-
offckb list-hashes // list scripts hashes, equals `ckb list-hashes`
|
|
15
|
+
offckb init <project-name> // init a typescript boilerplate with lumos to get started with to build CKB DAPP,think 'hardhat init'
|
|
23
16
|
offckb accounts // list 20 accounts info with prefund CKB tokens
|
|
17
|
+
offckb list-hashes // list scripts hashes, equals `ckb list-hashes`
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Get started
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
offckb init my-awesome-ckb-dapp
|
|
24
|
+
cd my-awesome-ckb-dapp
|
|
25
|
+
yarn && yarn start
|
|
26
|
+
|
|
27
|
+
## results
|
|
28
|
+
yarn run v1.22.19
|
|
29
|
+
$ parcel index.html
|
|
30
|
+
Server running at http://localhost:1234
|
|
31
|
+
✨ Built in 10ms
|
|
24
32
|
```
|
|
25
33
|
|
|
34
|
+
open another terminal and start the devnet:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
offckb node
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
open another terminal and check the accounts to use:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
offckb accounts
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Copy some private keys and visit http://localhost:1234 to play basic CKB transfer!
|
|
47
|
+
|
|
26
48
|
### Built-in scripts
|
|
27
49
|
|
|
28
50
|
- [x] xUDT https://github.com/nervosnetwork/rfcs/pull/428
|
package/dist/cli.js
CHANGED
|
@@ -16,11 +16,20 @@ program
|
|
|
16
16
|
.name('offckb')
|
|
17
17
|
.description('CLI to provide full ckb development environment for professionals')
|
|
18
18
|
.version(version);
|
|
19
|
+
program
|
|
20
|
+
.command('init')
|
|
21
|
+
.description('init dapp project with lumos')
|
|
22
|
+
.argument('<string>', 'name of the dapp')
|
|
23
|
+
.action((str) => {
|
|
24
|
+
const name = str !== null && str !== void 0 ? str : 'offckb-dapp';
|
|
25
|
+
return (0, init_1.init)(name);
|
|
26
|
+
});
|
|
27
|
+
program.command('node').description('Use the CKB to start devnet').action(node_1.node);
|
|
28
|
+
program.command('accounts').description('print account list info').action(accounts_1.accounts);
|
|
29
|
+
program.command('list-hashes').description('Use the CKB to list blockchain scripts hashes').action(list_hashes_1.listHashes);
|
|
19
30
|
// Define the CLI commands and options
|
|
20
31
|
program.command('install').description('Install the ckb dependency binary').action(install_1.installDependency);
|
|
21
32
|
program.command('genkey').description('generate 20 accounts').action(genkey_1.genkey);
|
|
22
|
-
program.command('list-hashes').description('Use the CKB to list blockchain scripts hashes').action(list_hashes_1.listHashes);
|
|
23
|
-
program.command('node').description('Use the CKB to start devnet').action(node_1.node);
|
|
24
33
|
program.command('init-chain').description('Use the CKB to init devnet').action(init_chain_1.initChainIfNeeded);
|
|
25
34
|
program.command('build-lumos-config').description('Use the CKB to generate lumos config.json').action(build_lumos_config_1.buildLumosConfig);
|
|
26
35
|
program.command('build-accounts').description('generate accounts with prefunded CKB tokens').action(genkey_1.buildAccounts);
|
|
@@ -28,15 +37,6 @@ program
|
|
|
28
37
|
.command('print-account-issue-info')
|
|
29
38
|
.description('print account issue cells config toml sections')
|
|
30
39
|
.action(genkey_1.printIssueSectionForToml);
|
|
31
|
-
program.command('accounts').description('print account list info').action(accounts_1.accounts);
|
|
32
|
-
program
|
|
33
|
-
.command('init')
|
|
34
|
-
.description('init dapp project with lumos')
|
|
35
|
-
.argument('<string>', 'name of the dapp')
|
|
36
|
-
.action((str) => {
|
|
37
|
-
const name = str !== null && str !== void 0 ? str : 'offckb-dapp';
|
|
38
|
-
return (0, init_1.init)(name);
|
|
39
|
-
});
|
|
40
40
|
// Parse command-line arguments
|
|
41
41
|
program.parse(process.argv);
|
|
42
42
|
// If no command is specified, display help
|