Skip to content

Commit

Permalink
Merge pull request #254 from onflow/release/v21
Browse files Browse the repository at this point in the history
Version 0.21.0
  • Loading branch information
sideninja authored May 24, 2021
2 parents 82dee15 + e25549e commit cf4263b
Show file tree
Hide file tree
Showing 46 changed files with 655 additions and 244 deletions.
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ Default command response should be to the stdout and not saved to a file. Anytim
the output to be saved to a file we should explicitly specify so by using `--save filename.txt`
flag and providing the path.

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

```
Address 179b6b1cb6755e31
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![](./logo-cli.svg)

# Flow CLI

The Flow CLI is a command-line interface that provides useful utilities for building Flow applications.
Expand Down
6 changes: 4 additions & 2 deletions cmd/flow/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/onflow/flow-cli/internal/events"
"github.com/onflow/flow-cli/internal/keys"
"github.com/onflow/flow-cli/internal/project"
"github.com/onflow/flow-cli/internal/quick"
"github.com/onflow/flow-cli/internal/scripts"
"github.com/onflow/flow-cli/internal/status"
"github.com/onflow/flow-cli/internal/transactions"
Expand All @@ -45,8 +46,8 @@ func main() {
TraverseChildren: true,
}

// hot commands
config.InitCommand.AddToParent(cmd)
// quick commands
quick.InitCommand.AddToParent(cmd)
status.Command.AddToParent(cmd)

// structured commands
Expand All @@ -61,6 +62,7 @@ func main() {
cmd.AddCommand(blocks.Cmd)
cmd.AddCommand(collections.Cmd)
cmd.AddCommand(project.Cmd)
cmd.AddCommand(config.Cmd)

command.InitFlags(cmd)

Expand Down
2 changes: 1 addition & 1 deletion docs/build-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ The `Type` must be the same as type in the transaction source code for that argu

### Arguments JSON

- Flag: `--argsJSON`
- Flag: `--args-json`
- Valid inputs: arguments in JSON-Cadence form.

Arguments passed to the Cadence transaction in Cadence JSON format.
Expand Down
7 changes: 7 additions & 0 deletions docs/create-accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ and pay the account creation fee.

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

### Include Fields

- Flag: `--include`
- Valid inputs: `contracts`

Specify fields to include in the result output. Applies only to the text output.

### Host

- Flag: `--host`
Expand Down
49 changes: 49 additions & 0 deletions docs/decode-keys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: Decode Account Key with the Flow CLI
sidebar_title: Decode Account Keys
description: How to decode rlp encoded key pair from the command line
---

The Flow CLI provides a command to decode RLP encoded account key.

```shell
flow keys decode <rlp encoded account key>
```

## Example Usage

```shell
> flow keys decode f847b84084d716c14b051ad6b001624f738f5d302636e6b07cc75e4530af7776a4368a2b586dbefc0564ee28384c2696f178cbed52e62811bcc9ecb59568c996d342db2402038203e8

Public Key 84d716c14b051ad6b001624f738f5d302636e6b07cc75e4530af7776a4368a2b586dbefc0564ee28384c2696f178cbed52e62811bcc9ecb59568c996d342db24
Signature algorithm ECDSA_P256
Hash algorithm SHA3_256
Weight 1000
Revoked false
```

## Flags

### Filter

- Flag: `--filter`
- Short Flag: `-x`
- Valid inputs: a case-sensitive name of the result property.

Specify any property name from the result you want to return as the only value.

### Output

- Flag: `--output`
- Short Flag: `-o`
- Valid inputs: `json`, `inline`

Specify the format of the command results.

### Save

- Flag: `--save`
- Short Flag: `-s`
- Valid inputs: a path in the current filesystem.

Specify the filename where you want the result to be saved
72 changes: 72 additions & 0 deletions docs/developer-updates/release-notes-v21.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
## ⬆️ Install or Upgrade

Follow the [Flow CLI installation guide](https://docs.onflow.org/flow-cli/install/) for instructions on how to install or upgrade the CLI.


## 💥 Breaking Changes

### Flow Go SDK Update
Update Flow Go SDK version from v0.19.0 to v0.20.0.
Read more about new version in the [release notes](https://github.com/onflow/flow-go-sdk/releases/tag/v0.20.0).

## ⭐ Features

### New Command To Manage Configuration
Add or remove resources from the configuration using the new `flow config` command.
Usage is possible via interactive prompt or by using flags. Command syntax is as follows:
```js
flow config <add|remove> <account|contract|deployment|network>
```

Example for adding an account to the config via interactive prompt:

```bash
Name: Foo
Address: f8d6e0586b0a20c7
✔ ECDSA_P256
✔ SHA3_256
Private key: 1286...01afc
Key index (Default: 0): 0

Account Foo added to the configuration
```

Example for adding an account to the config without interactive prompt:

```bash
./main config add account --address f8d6e0586b0a20c7 --name Foo --private-key 1286...01afc

Account Foo added to the configuration
```

We recommend using manage command to do any changes in the configuration as it will also
validate input values for you and will abstract any changes in the configuration format.

### Decode Keys
Command for decoding public keys in the RLP encoded format.

Example of using the command:

```bash
> flow keys decode f847b84084d716c14b051ad6b001624f738f5d302636e6b07cc75e4530af7776a4368a2b586dbefc0564ee28384c2696f178cbed52e62811bcc9ecb59568c996d342db2402038203e8

Public Key 84d716c14b051ad6b001624f738f5d302636e6b07cc75e4530af7776a4368a2b586dbefc0564ee28384c2696f178cbed52e62811bcc9ecb59568c996d342db24
Signature algorithm ECDSA_P256
Hash algorithm SHA3_256
Weight 1000
Revoked false
```

## 🎉 Improvements

### Include And Exclude Flags
Include and Exclude flags were added to the transaction and account resource thus
allowing you to further specify verbosity of the output.

### Documentation Changes
Multiple reported documentation fixes.

## 🐞 Bug Fixes

### Import Detection Fix
Fix for a reported bug: An error occurs when executing a script that imports a built-in contract (Crypto contract) with Flow CLI command.
2 changes: 1 addition & 1 deletion docs/execute-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The `Type` must be the same as type in the script source code for that argument.

### Arguments JSON

- Flag: `--argsJSON`
- Flag: `--args-json`
- Valid inputs: arguments in JSON-Cadence form.

Arguments passed to the Cadence script in `Type:Value` format.
Expand Down
9 changes: 8 additions & 1 deletion docs/get-accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,18 @@ Flow [account address](https://docs.onflow.org/concepts/accounts-and-keys/) (pre

## Flags

### Include Fields

- Flag: `--include`
- Valid inputs: `contracts`

Specify fields to include in the result output. Applies only to the text output.

### Contracts

- Flag: `--contracts`

Display contracts deployed to the account.
⚠️ Deprecated: use include flag.

### Code
⚠️ No longer supported: use contracts flag instead.
Expand Down
81 changes: 60 additions & 21 deletions docs/get-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,50 @@ flow transactions get <tx_id>
## Example Usage

```shell
> flow transactions get ff35821007322405608c0d3da79312617f8d16e118afe63e764b5e68edc96dd5 --host access.mainnet.nodes.onflow.org:9000

ID ff35821007322405608c0d3da79312617f8d16e118afe63e764b5e68edc96dd5
Status SEALED
Payer 12e354a23e4f791d
Events
Index 0
Type flow.AccountCreated
Tx ID ff35821007322405608c0d3da79312617f8d16e118afe63e764b5e68edc96dd5
Values
address (Address) 18c4931b5f3c7151

Index 1
Type flow.AccountKeyAdded
Tx ID ff35821007322405608c0d3da79312617f8d16e118afe63e764b5e68edc96dd5
Values
address (Address) 18c4931b5f3c7151
publicKey (Unknown) f847b8404c296679364d2...7b168678cc762bc08f342d8d92e0a36e6ecfdcf15850721821823e8
> flow transactions get 40bc4b100c1930c61381c22e0f4c10a7f5827975ee25715527c1061b8d71e5aa --network mainnet

Status ✅ SEALED
ID 40bc4b100c1930c61381c22e0f4c10a7f5827975ee25715527c1061b8d71e5aa
Payer 18eb4ee6b3c026d2
Authorizers [18eb4ee6b3c026d2]

Proposal Key:
Address 18eb4ee6b3c026d2
Index 11
Sequence 17930

Payload Signature 0: 18eb4ee6b3c026d2
Payload Signature 1: 18eb4ee6b3c026d2
Envelope Signature 0: 18eb4ee6b3c026d2
Signatures (minimized, use --include signatures)

Events:
Index 0
Type A.1654653399040a61.FlowToken.TokensWithdrawn
Tx ID 40bc4b100c1930c61381c22e0f4c10a7f5827975ee25715527c1061b8d71e5aa
Values
- amount (UFix64): 0.00100000
- from ({}?): 18eb4ee6b3c026d2

Index 1
Type A.1654653399040a61.FlowToken.TokensDeposited
Tx ID 40bc4b100c1930c61381c22e0f4c10a7f5827975ee25715527c1061b8d71e5aa
Values
- amount (UFix64): 0.00100000
- to ({}?): 5068e27f275c546c

Index 2
Type A.18eb4ee6b3c026d2.PrivateReceiverForwarder.PrivateDeposit
Tx ID 40bc4b100c1930c61381c22e0f4c10a7f5827975ee25715527c1061b8d71e5aa
Values
- amount (UFix64): 0.00100000
- to ({}?): 5068e27f275c546c



Code (hidden, use --include code)

Payload (hidden, use --include payload)
```

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

## Flags

### Display Transaction Code
### Include Fields

- Flag: `--include`
- Valid inputs: `code`, `payload`, `signatures`

Specify fields to include in the result output. Applies only to the text output.

### Code

- Flag: `--code`
- Default: `false`

Indicate whether to print the transaction Cadence code.
⚠️ Deprecated: use include flag.

### Wait for Seal

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

### Exclude Fields

- Flag: `--exclude`
- Valid inputs: `events`

Specify fields to exclude from the result output. Applies only to the text output.

### Host

- Flag: `--host`
Expand Down
Loading

0 comments on commit cf4263b

Please sign in to comment.