Skip to content

Commit cf4263b

Browse files
authored
Merge pull request #254 from onflow/release/v21
Version 0.21.0
2 parents 82dee15 + e25549e commit cf4263b

46 files changed

Lines changed: 655 additions & 244 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ Default command response should be to the stdout and not saved to a file. Anytim
242242
the output to be saved to a file we should explicitly specify so by using `--save filename.txt`
243243
flag and providing the path.
244244

245+
Result output should include only information that is commonly used and relevant,
246+
don't use too much of user screen drowning what’s truly important,
247+
instead provide a way to include that data when the user requests by having include, exclude flags.
245248

246249
```
247250
Address 179b6b1cb6755e31

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
![](./logo-cli.svg)
2+
13
# Flow CLI
24

35
The Flow CLI is a command-line interface that provides useful utilities for building Flow applications.

cmd/flow/main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
"github.com/onflow/flow-cli/internal/events"
3333
"github.com/onflow/flow-cli/internal/keys"
3434
"github.com/onflow/flow-cli/internal/project"
35+
"github.com/onflow/flow-cli/internal/quick"
3536
"github.com/onflow/flow-cli/internal/scripts"
3637
"github.com/onflow/flow-cli/internal/status"
3738
"github.com/onflow/flow-cli/internal/transactions"
@@ -45,8 +46,8 @@ func main() {
4546
TraverseChildren: true,
4647
}
4748

48-
// hot commands
49-
config.InitCommand.AddToParent(cmd)
49+
// quick commands
50+
quick.InitCommand.AddToParent(cmd)
5051
status.Command.AddToParent(cmd)
5152

5253
// structured commands
@@ -61,6 +62,7 @@ func main() {
6162
cmd.AddCommand(blocks.Cmd)
6263
cmd.AddCommand(collections.Cmd)
6364
cmd.AddCommand(project.Cmd)
65+
cmd.AddCommand(config.Cmd)
6466

6567
command.InitFlags(cmd)
6668

docs/build-transactions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ The `Type` must be the same as type in the transaction source code for that argu
124124

125125
### Arguments JSON
126126

127-
- Flag: `--argsJSON`
127+
- Flag: `--args-json`
128128
- Valid inputs: arguments in JSON-Cadence form.
129129

130130
Arguments passed to the Cadence transaction in Cadence JSON format.

docs/create-accounts.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ and pay the account creation fee.
103103

104104
Specify one or more contracts to be deployed during account creation.
105105

106+
### Include Fields
107+
108+
- Flag: `--include`
109+
- Valid inputs: `contracts`
110+
111+
Specify fields to include in the result output. Applies only to the text output.
112+
106113
### Host
107114

108115
- Flag: `--host`

docs/decode-keys.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: Decode Account Key with the Flow CLI
3+
sidebar_title: Decode Account Keys
4+
description: How to decode rlp encoded key pair from the command line
5+
---
6+
7+
The Flow CLI provides a command to decode RLP encoded account key.
8+
9+
```shell
10+
flow keys decode <rlp encoded account key>
11+
```
12+
13+
## Example Usage
14+
15+
```shell
16+
> flow keys decode f847b84084d716c14b051ad6b001624f738f5d302636e6b07cc75e4530af7776a4368a2b586dbefc0564ee28384c2696f178cbed52e62811bcc9ecb59568c996d342db2402038203e8
17+
18+
Public Key 84d716c14b051ad6b001624f738f5d302636e6b07cc75e4530af7776a4368a2b586dbefc0564ee28384c2696f178cbed52e62811bcc9ecb59568c996d342db24
19+
Signature algorithm ECDSA_P256
20+
Hash algorithm SHA3_256
21+
Weight 1000
22+
Revoked false
23+
```
24+
25+
## Flags
26+
27+
### Filter
28+
29+
- Flag: `--filter`
30+
- Short Flag: `-x`
31+
- Valid inputs: a case-sensitive name of the result property.
32+
33+
Specify any property name from the result you want to return as the only value.
34+
35+
### Output
36+
37+
- Flag: `--output`
38+
- Short Flag: `-o`
39+
- Valid inputs: `json`, `inline`
40+
41+
Specify the format of the command results.
42+
43+
### Save
44+
45+
- Flag: `--save`
46+
- Short Flag: `-s`
47+
- Valid inputs: a path in the current filesystem.
48+
49+
Specify the filename where you want the result to be saved
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
## ⬆️ Install or Upgrade
2+
3+
Follow the [Flow CLI installation guide](https://docs.onflow.org/flow-cli/install/) for instructions on how to install or upgrade the CLI.
4+
5+
6+
## 💥 Breaking Changes
7+
8+
### Flow Go SDK Update
9+
Update Flow Go SDK version from v0.19.0 to v0.20.0.
10+
Read more about new version in the [release notes](https://github.com/onflow/flow-go-sdk/releases/tag/v0.20.0).
11+
12+
## ⭐ Features
13+
14+
### New Command To Manage Configuration
15+
Add or remove resources from the configuration using the new `flow config` command.
16+
Usage is possible via interactive prompt or by using flags. Command syntax is as follows:
17+
```js
18+
flow config <add|remove> <account|contract|deployment|network>
19+
```
20+
21+
Example for adding an account to the config via interactive prompt:
22+
23+
```bash
24+
Name: Foo
25+
Address: f8d6e0586b0a20c7
26+
✔ ECDSA_P256
27+
✔ SHA3_256
28+
Private key: 1286...01afc
29+
Key index (Default: 0): 0
30+
31+
Account Foo added to the configuration
32+
```
33+
34+
Example for adding an account to the config without interactive prompt:
35+
36+
```bash
37+
./main config add account --address f8d6e0586b0a20c7 --name Foo --private-key 1286...01afc
38+
39+
Account Foo added to the configuration
40+
```
41+
42+
We recommend using manage command to do any changes in the configuration as it will also
43+
validate input values for you and will abstract any changes in the configuration format.
44+
45+
### Decode Keys
46+
Command for decoding public keys in the RLP encoded format.
47+
48+
Example of using the command:
49+
50+
```bash
51+
> flow keys decode f847b84084d716c14b051ad6b001624f738f5d302636e6b07cc75e4530af7776a4368a2b586dbefc0564ee28384c2696f178cbed52e62811bcc9ecb59568c996d342db2402038203e8
52+
53+
Public Key 84d716c14b051ad6b001624f738f5d302636e6b07cc75e4530af7776a4368a2b586dbefc0564ee28384c2696f178cbed52e62811bcc9ecb59568c996d342db24
54+
Signature algorithm ECDSA_P256
55+
Hash algorithm SHA3_256
56+
Weight 1000
57+
Revoked false
58+
```
59+
60+
## 🎉 Improvements
61+
62+
### Include And Exclude Flags
63+
Include and Exclude flags were added to the transaction and account resource thus
64+
allowing you to further specify verbosity of the output.
65+
66+
### Documentation Changes
67+
Multiple reported documentation fixes.
68+
69+
## 🐞 Bug Fixes
70+
71+
### Import Detection Fix
72+
Fix for a reported bug: An error occurs when executing a script that imports a built-in contract (Crypto contract) with Flow CLI command.

docs/execute-scripts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The `Type` must be the same as type in the script source code for that argument.
4242

4343
### Arguments JSON
4444

45-
- Flag: `--argsJSON`
45+
- Flag: `--args-json`
4646
- Valid inputs: arguments in JSON-Cadence form.
4747

4848
Arguments passed to the Cadence script in `Type:Value` format.

docs/get-accounts.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,18 @@ Flow [account address](https://docs.onflow.org/concepts/accounts-and-keys/) (pre
4949

5050
## Flags
5151

52+
### Include Fields
53+
54+
- Flag: `--include`
55+
- Valid inputs: `contracts`
56+
57+
Specify fields to include in the result output. Applies only to the text output.
58+
5259
### Contracts
5360

5461
- Flag: `--contracts`
5562

56-
Display contracts deployed to the account.
63+
⚠️ Deprecated: use include flag.
5764

5865
### Code
5966
⚠️ No longer supported: use contracts flag instead.

docs/get-transactions.md

Lines changed: 60 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,50 @@ flow transactions get <tx_id>
1414
## Example Usage
1515

1616
```shell
17-
> flow transactions get ff35821007322405608c0d3da79312617f8d16e118afe63e764b5e68edc96dd5 --host access.mainnet.nodes.onflow.org:9000
18-
19-
ID ff35821007322405608c0d3da79312617f8d16e118afe63e764b5e68edc96dd5
20-
Status SEALED
21-
Payer 12e354a23e4f791d
22-
Events
23-
Index 0
24-
Type flow.AccountCreated
25-
Tx ID ff35821007322405608c0d3da79312617f8d16e118afe63e764b5e68edc96dd5
26-
Values
27-
address (Address) 18c4931b5f3c7151
28-
29-
Index 1
30-
Type flow.AccountKeyAdded
31-
Tx ID ff35821007322405608c0d3da79312617f8d16e118afe63e764b5e68edc96dd5
32-
Values
33-
address (Address) 18c4931b5f3c7151
34-
publicKey (Unknown) f847b8404c296679364d2...7b168678cc762bc08f342d8d92e0a36e6ecfdcf15850721821823e8
17+
> flow transactions get 40bc4b100c1930c61381c22e0f4c10a7f5827975ee25715527c1061b8d71e5aa --network mainnet
18+
19+
Status ✅ SEALED
20+
ID 40bc4b100c1930c61381c22e0f4c10a7f5827975ee25715527c1061b8d71e5aa
21+
Payer 18eb4ee6b3c026d2
22+
Authorizers [18eb4ee6b3c026d2]
23+
24+
Proposal Key:
25+
Address 18eb4ee6b3c026d2
26+
Index 11
27+
Sequence 17930
28+
29+
Payload Signature 0: 18eb4ee6b3c026d2
30+
Payload Signature 1: 18eb4ee6b3c026d2
31+
Envelope Signature 0: 18eb4ee6b3c026d2
32+
Signatures (minimized, use --include signatures)
33+
34+
Events:
35+
Index 0
36+
Type A.1654653399040a61.FlowToken.TokensWithdrawn
37+
Tx ID 40bc4b100c1930c61381c22e0f4c10a7f5827975ee25715527c1061b8d71e5aa
38+
Values
39+
- amount (UFix64): 0.00100000
40+
- from ({}?): 18eb4ee6b3c026d2
41+
42+
Index 1
43+
Type A.1654653399040a61.FlowToken.TokensDeposited
44+
Tx ID 40bc4b100c1930c61381c22e0f4c10a7f5827975ee25715527c1061b8d71e5aa
45+
Values
46+
- amount (UFix64): 0.00100000
47+
- to ({}?): 5068e27f275c546c
48+
49+
Index 2
50+
Type A.18eb4ee6b3c026d2.PrivateReceiverForwarder.PrivateDeposit
51+
Tx ID 40bc4b100c1930c61381c22e0f4c10a7f5827975ee25715527c1061b8d71e5aa
52+
Values
53+
- amount (UFix64): 0.00100000
54+
- to ({}?): 5068e27f275c546c
55+
56+
57+
58+
Code (hidden, use --include code)
59+
60+
Payload (hidden, use --include payload)
3561
```
3662

3763
## Arguments
@@ -45,12 +71,18 @@ The first argument is the ID (hash) of the transaction.
4571

4672
## Flags
4773

48-
### Display Transaction Code
74+
### Include Fields
75+
76+
- Flag: `--include`
77+
- Valid inputs: `code`, `payload`, `signatures`
78+
79+
Specify fields to include in the result output. Applies only to the text output.
80+
81+
### Code
4982

5083
- Flag: `--code`
51-
- Default: `false`
5284

53-
Indicate whether to print the transaction Cadence code.
85+
⚠️ Deprecated: use include flag.
5486

5587
### Wait for Seal
5688

@@ -60,6 +92,13 @@ Indicate whether to print the transaction Cadence code.
6092
Indicate whether to wait for the transaction to be sealed
6193
before displaying the result.
6294

95+
### Exclude Fields
96+
97+
- Flag: `--exclude`
98+
- Valid inputs: `events`
99+
100+
Specify fields to exclude from the result output. Applies only to the text output.
101+
63102
### Host
64103

65104
- Flag: `--host`

0 commit comments

Comments
 (0)