Skip to content

Commit 68b7537

Browse files
committed
sync with master
2 parents 276fb3d + 1fe6773 commit 68b7537

File tree

4 files changed

+516
-297
lines changed

4 files changed

+516
-297
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bins/cfx_store/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ edition = "2021"
77
license-file.workspace = true
88

99
[dependencies]
10-
docopt = { workspace = true }
1110
env_logger = { workspace = true }
1211
num_cpus = { workspace = true }
1312
serde = { workspace = true }
1413
parking_lot = { workspace = true }
1514
cfxstore = { workspace = true }
1615
panic_hook = { workspace = true }
1716
dir = { workspace = true }
18-
17+
# todo use workspace version
18+
clap = { version = "4", features = ["derive"] }
1919
[[bin]]
2020
name = "cfxstore"
2121
path = "src/main.rs"

bins/cfx_store/README.md

Lines changed: 48 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -6,59 +6,37 @@ Conflux key management. It is built on top of the Parity Ethereum counterpart.
66

77
```
88
Conflux key management tool.
9-
Copyright 2020 Conflux Foundation
10-
11-
Usage:
12-
cfxstore insert <secret> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
13-
cfxstore change-pwd <address> <old-pwd> <new-pwd> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
14-
cfxstore list [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
15-
cfxstore import [--src DIR] [--dir DIR]
16-
cfxstore import-wallet <path> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
17-
cfxstore find-wallet-pass <path> <password>
18-
cfxstore remove <address> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
19-
cfxstore sign <address> <password> <message> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
20-
cfxstore public <address> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
21-
cfxstore list-vaults [--dir DIR]
22-
cfxstore create-vault <vault> <password> [--dir DIR]
23-
cfxstore change-vault-pwd <vault> <old-pwd> <new-pwd> [--dir DIR]
24-
cfxstore move-to-vault <address> <vault> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
25-
cfxstore move-from-vault <address> <vault> <password> [--dir DIR]
26-
cfxstore [-h | --help]
9+
Copyright 2020 Conflux Foundation
2710
28-
Options:
29-
-h, --help Display this message and exit.
30-
--dir DIR Specify the secret store directory. It may be either
31-
parity, parity-(chain), geth, geth-test
32-
or a path [default: parity].
33-
--vault VAULT Specify vault to use in this operation.
34-
--vault-pwd VAULTPWD Specify vault password to use in this operation. Please note
35-
that this option is required when vault option is set.
36-
Otherwise it is ignored.
37-
--src DIR Specify import source. It may be either
38-
parity, parity-(chain), geth, geth-test
39-
or a path [default: geth].
11+
Usage: cfxstore <COMMAND>
4012
4113
Commands:
42-
insert Save account with password.
43-
change-pwd Change password.
44-
list List accounts.
45-
import Import accounts from src.
46-
import-wallet Import presale wallet.
47-
find-wallet-pass Tries to open a wallet with list of passwords given.
48-
remove Remove account.
49-
sign Sign message.
50-
public Displays public key for an address.
51-
list-vaults List vaults.
52-
create-vault Create new vault.
53-
change-vault-pwd Change vault password.
54-
move-to-vault Move account to vault from another vault/root directory.
55-
move-from-vault Move account to root directory from given vault.
14+
insert Save account with password
15+
change-pwd Change password
16+
list List accounts
17+
import Import accounts from src
18+
import-wallet Import presale wallet
19+
find-wallet-pass Tries to open a wallet with list of passwords given
20+
remove Remove account
21+
sign Sign message
22+
public Displays public key for an address
23+
list-vaults List vaults
24+
create-vault Create new vault
25+
change-vault-pwd Change vault password
26+
move-to-vault Move account to vault from another vault/root directory
27+
move-from-vault Move account to root directory from given vault
28+
help Print this message or the help of the given subcommand(s)
29+
30+
Options:
31+
-h, --help Print help
32+
-V, --version Print version
5633
```
5734

5835
### Examples
5936

6037
#### `insert <secret> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]`
61-
*Encrypt secret with a password and save it in secret store.*
38+
39+
_Encrypt secret with a password and save it in secret store._
6240

6341
- `<secret>` - conflux secret, 32 bytes long
6442
- `<password>` - account password, file path
@@ -87,7 +65,8 @@ cfxstore insert `cfxkey generate random -s` "this is sparta"
8765
--
8866

8967
#### `change-pwd <address> <old-pwd> <new-pwd> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]`
90-
*Change account password.*
68+
69+
_Change account password._
9170

9271
- `<address>` - conflux address, 20 bytes long
9372
- `<old-pwd>` - old account password, file path
@@ -107,7 +86,8 @@ true
10786
--
10887

10988
#### `list [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]`
110-
*List secret store accounts.*
89+
90+
_List secret store accounts._
11191

11292
- `[--dir DIR]` - secret store directory, It may be either parity, parity-test, geth, geth-test or a path. default: parity
11393
- `[--vault VAULT]` - vault to use in this operation
@@ -126,7 +106,8 @@ cfxstore list
126106
--
127107

128108
#### `import [--src DIR] [--dir DIR]`
129-
*Import accounts from src.*
109+
110+
_Import accounts from src._
130111

131112
- `[--src DIR]` - secret store directory, It may be either parity, parity-test, geth, geth-test or a path. default: geth
132113
- `[--dir DIR]` - secret store directory, It may be either parity, parity-test, geth, geth-test or a path. default: parity
@@ -143,7 +124,8 @@ cfxstore import
143124
--
144125

145126
#### `import-wallet <path> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]`
146-
*Import account from presale wallet.*
127+
128+
_Import account from presale wallet._
147129

148130
- `<path>` - presale wallet path
149131
- `<password>` - account password, file path
@@ -159,10 +141,10 @@ cfxstore import-wallet ethwallet.json password.txt
159141
e6a3d25a7cb7cd21cb720df5b5e8afd154af1bbb
160142
```
161143

162-
163144
--
164145

165146
#### `find-wallet-pass <path> <password>`
147+
166148
Try to open presale wallet given a list of passwords from a file.
167149
The list of passwords can be generated using e.g. [Phildo/brutedist](https://github.com/Phildo/brutedist).
168150

@@ -177,11 +159,11 @@ cfxstore find-wallet-pass ethwallet.json passwords.txt
177159
Found password: test
178160
```
179161

180-
181162
--
182163

183164
#### `remove <address> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]`
184-
*Remove account from secret store.*
165+
166+
_Remove account from secret store._
185167

186168
- `<address>` - conflux address, 20 bytes long
187169
- `<password>` - account password, file path
@@ -200,7 +182,8 @@ true
200182
--
201183

202184
#### `sign <address> <password> <message> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]`
203-
*Sign message with account's secret.*
185+
186+
_Sign message with account's secret._
204187

205188
- `<address>` - conflux address, 20 bytes long
206189
- `<password>` - account password, file path
@@ -220,7 +203,8 @@ c6649f9555232d90ff716d7e552a744c5af771574425a74860e12f763479eb1b708c1f3a7dc0a0a7
220203
--
221204

222205
#### `public <address> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]`
223-
*Displays public key for an address.*
206+
207+
_Displays public key for an address._
224208

225209
- `<address>` - conflux address, 20 bytes long
226210
- `<password>` - account password, file path
@@ -239,7 +223,8 @@ cfxstore public 00e63fdb87ceb815ec96ae185b8f7381a0b4a5ea account_password.txt --
239223
--
240224

241225
#### `list-vaults [--dir DIR]`
242-
*List vaults.*
226+
227+
_List vaults._
243228

244229
- `[--dir DIR]` - secret store directory, It may be either parity, parity-test, geth, geth-test or a path. default: parity
245230

@@ -256,7 +241,8 @@ vault3
256241
--
257242

258243
#### `create-vault <vault> <password> [--dir DIR]`
259-
*Create new vault.*
244+
245+
_Create new vault._
260246

261247
- `<vault>` - name of new vault. This can only contain letters, digits, whitespaces, dashes and underscores
262248
- `<password>` - vault password, file path
@@ -273,7 +259,8 @@ OK
273259
--
274260

275261
#### `change-vault-pwd <vault> <old-pwd> <new-pwd> [--dir DIR]`
276-
*Change vault password.*
262+
263+
_Change vault password._
277264

278265
- `<vault>` - name of existing vault
279266
- `<old-pwd>` - old vault password, file path
@@ -291,7 +278,8 @@ OK
291278
--
292279

293280
#### `move-to-vault <address> <vault> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]`
294-
*Move account to vault from another vault/root directory.*
281+
282+
_Move account to vault from another vault/root directory._
295283

296284
- `<address>` - conflux address, 20 bytes long
297285
- `<vault>` - name of existing vault to move account to
@@ -300,7 +288,6 @@ OK
300288
- `[--vault VAULT]` - current vault of the `<address>` argument, if set
301289
- `[--vault-pwd VAULTPWD]` - password for the current vault of the `<address>` argument, if any. file path
302290

303-
304291
```
305292
cfxstore move-to-vault 00e63fdb87ceb815ec96ae185b8f7381a0b4a5ea vault3 vault3_password.txt
306293
cfxstore move-to-vault 00e63fdb87ceb815ec96ae185b8f7381a0b4a5ea vault1 vault1_password.txt --vault vault3 --vault-pwd vault3_password.txt
@@ -314,14 +301,14 @@ OK
314301
--
315302

316303
#### `move-from-vault <address> <vault> <password> [--dir DIR]`
317-
*Move account to root directory from given vault.*
304+
305+
_Move account to root directory from given vault._
318306

319307
- `<address>` - conflux address, 20 bytes long
320308
- `<vault>` - name of existing vault to move account to
321309
- `<password>` - password of existing `<vault>` to move account to, file path
322310
- `[--dir DIR]` - secret store directory, It may be either parity, parity-test, geth, geth-test or a path. default: parity
323311

324-
325312
```
326313
cfxstore move-from-vault 00e63fdb87ceb815ec96ae185b8f7381a0b4a5ea vault1 vault1_password.txt
327314
```

0 commit comments

Comments
 (0)