Skip to content

Commit

Permalink
Merge pull request #189 from onflow/release/v19
Browse files Browse the repository at this point in the history
Release v19
  • Loading branch information
sideninja authored Apr 30, 2021
2 parents dfae7c0 + bb14064 commit 22883b8
Show file tree
Hide file tree
Showing 82 changed files with 3,164 additions and 615 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ You can find the CLI documentation on the [Flow documentation website](https://d

- Tag a new release and push it
- Build the binaries: `make versioned-binaries`
- Test built binaries locally
- Upload the binaries: `make publish`
- Update the Homebrew formula: e.g. `brew bump-formula-pr flow-cli --version=0.12.3`

Expand Down
2 changes: 2 additions & 0 deletions cmd/flow/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/onflow/flow-cli/internal/keys"
"github.com/onflow/flow-cli/internal/project"
"github.com/onflow/flow-cli/internal/scripts"
"github.com/onflow/flow-cli/internal/status"
"github.com/onflow/flow-cli/internal/transactions"
"github.com/onflow/flow-cli/internal/version"
"github.com/onflow/flow-cli/pkg/flowcli/util"
Expand All @@ -46,6 +47,7 @@ func main() {

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

// structured commands
cmd.AddCommand(cadence.Cmd)
Expand Down
18 changes: 17 additions & 1 deletion docs/build-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ transaction to be executed.

## Flags


### Payer

- Flag: `--payer`
Expand Down Expand Up @@ -115,6 +114,23 @@ Specify key index for the proposer account.
Additional authorizer addresses to add to the transaction.
Read more about authorizers [here](https://docs.onflow.org/concepts/accounts-and-keys/).

### Arguments

- Flag: `--arg`
- Valid inputs: argument in `Type:Value` format.

Arguments passed to the Cadence transaction in `Type:Value` format.
The `Type` must be the same as type in the transaction source code for that argument.

### Arguments JSON

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

Arguments passed to the Cadence transaction in Cadence JSON format.
Cadence JSON format contains `type` and `value` keys and is
[documented here](https://docs.onflow.org/cadence/json-cadence-spec/).

### Host

- Flag: `--host`
Expand Down
50 changes: 9 additions & 41 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,14 @@ Flow configuration (`flow.json`) file will contain the following properties:
}
},
"networks": {
"emulator": {
"host": "127.0.0.1:3569",
"chain": "flow-emulator"
},
"mainnet": {
"host": "access.mainnet.nodes.onflow.org:9000",
"chain": "flow-mainnet"
},
"testnet": {
"host": "access.devnet.nodes.onflow.org:9000",
"chain": "flow-testnet"
}
"emulator": "127.0.0.1:3569",
"mainnet": "access.mainnet.nodes.onflow.org:9000",
"testnet": "access.devnet.nodes.onflow.org:9000"
},
"accounts": {
"emulator-account": {
"address": "f8d6e0586b0a20c7",
"keys": "ae1b44c0f5e8f6992ef2348898a35e50a8b0b9684000da8b1dade1b3bcd6ebee",
"chain": "flow-emulator"
}
},
"deployments": {},
Expand Down Expand Up @@ -98,23 +88,13 @@ We'll walk through each property one by one.
"emulator-account": {
"address": "f8d6e0586b0a20c7",
"keys": "2eae2f31cb5b756151fa11d82949c634b8f28796a711d7eb1e52cc301ed11111",
"chain": "flow-emulator"
}
},

"networks": {
"emulator": {
"host": "127.0.0.1:3569",
"chain": "flow-emulator"
},
"mainnet": {
"host": "access.mainnet.nodes.onflow.org:9000",
"chain": "flow-mainnet"
},
"testnet": {
"host": "access.devnet.nodes.onflow.org:9000",
"chain": "flow-testnet"
}
"emulator": "127.0.0.1:3569",
"mainnet": "access.mainnet.nodes.onflow.org:9000",
"testnet": "access.devnet.nodes.onflow.org:9000"
},

"emulators": {
Expand Down Expand Up @@ -208,7 +188,6 @@ value that is defined on the run time to the default service address on the emul
"accounts": {
"admin-account-multiple-keys": {
"address": "service",
"chain": "flow-emulator",
"keys": [
{
"type": "hex",
Expand Down Expand Up @@ -270,24 +249,13 @@ contracts and networks, all of which are referenced by name.

Use this section to define networks and connection parameters for that specific network.

#### Simple format

```json
...

"networks": {
"emulator": {
"host": "127.0.0.1:3569",
"chain": "flow-emulator"
},
"mainnet": {
"host": "access.mainnet.nodes.onflow.org:9000",
"chain": "flow-mainnet"
},
"testnet": {
"host": "access.devnet.nodes.onflow.org:9000",
"chain": "flow-testnet"
}
"emulator": "127.0.0.1:3569",
"mainnet": "access.mainnet.nodes.onflow.org:9000",
"testnet": "access.devnet.nodes.onflow.org:9000"
}

...
Expand Down
1 change: 0 additions & 1 deletion docs/create-accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ flow accounts create
# Create an account on Flow Testnet
> flow accounts create \
--key a69c6986e846ba6d0....1397f5904cd319c3e01e96375d5777f1a47010 \
--host access.testnet.nodes.onflow.org:9000 \
--signer my-testnet-account

Address 0x01cf0e2f2f715450
Expand Down
26 changes: 26 additions & 0 deletions docs/deploy-project-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,32 @@ pub contract KittyItems {
}
```

## Initialization Arguments
Deploying contracts that take initialization arguments
can be achieved with adding those arguments to the configuration.

Each deployment can be specified as an object containing
`name` and `args` key specifying arguments to be
used during the deployment. Example:

```
...
"deployments": {
"testnet": {
"my-testnet-account": [
"NonFungibleToken", {
"name": "Foo",
"args": [
{ "type": "String", "value": "Hello World" },
{ "type": "UInt32", "value": "10" }
]
}]
}
}
...
```


⚠️ Warning: before proceeding,
we recommend reading the [Flow CLI security guidelines](https://docs.onflow.org/flow-cli/security/)
to learn about the best practices for private key storage.
Expand Down
111 changes: 111 additions & 0 deletions docs/developer-updates/release-notes-v19.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
## ⬆️ 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.

## ⭐ Features

### Project Deployment with Contract Initialization Arguments
Project deployment was improved, and it now supports providing initialization
arguments during the deployment of contracts. It is easy to specify all
the arguments in the configuration like so:

```
...
"deployments": {
"testnet": {
"my-testnet-account": [
"NonFungibleToken", {
"name": "Foo",
"args": [
{ "type": "String", "value": "Hello World" },
{ "type": "UInt32", "value": "10" }
]
}]
}
}
...
```

### Network Status Command
Network status command allows you to query the status of each network and
see if the network is available.

Example:
```
> flow status --network testnet
Status: 🟢 ONLINE
Network: testnet
Access Node: access.devnet.nodes.onflow.org:9000
```

### Global Configuration
Flow CLI now supports global configuration which is a `flow.json` file saved in your home
directory and loaded as the first configuration file wherever you execute the CLI command.

You can generate a global configuration using `--global` flag.

Command example: `flow init --global`.

Global flow configuration is saved as:
- MacOs: `~/flow.json`
- Linux: `~/flow.json`
- Windows: `C:\Users\$USER\flow.json`

You can read more about it in [the docs](https://docs.onflow.org/flow-cli/initialize-configuration/).

### Environment File Support

The CLI will load environment variables defined in the
`.env` file in the active directory, if one exists.
These variables can be substituted inside the `flow.json`,
just like any other environment variable.

Example `.env` file:
```bash
PRIVATE_KEY=123
```

```json
// flow.json
{
...
"accounts": {
"my-testnet-account": {
"address": "3ae53cb6e3f42a79",
"keys": "$PRIVATE_KEY"
}
}
...
}
```

## 🎉 Improvements

### Default Network Without Configuration
Default network is provided even if no configuration is present which
allows you to use the CLI on even more commands without the requirement of
having a configuration pre-initialized.

### Chain ID Removed
Chain ID property was removed from the configuration as it is not needed anymore.
With this improvement, the new configuration is less complex and shorter.


## 🐞 Bug Fixes

### Keys Generate JSON output
Keys generation output in JSON format was fixed and it now shows correctly
private and public keys.

### Account Key Index When Sending Transactions
Account key index is now fetched from the configuration and
it doesn't default to 0 anymore.

### Transaction Boolean Argument
Transaction boolean argument wasn't parsed correctly when passed
in comma split format.

### Transaction JSON Output
Transaction JSON output caused a crash when the transaction
was successfully processed.
30 changes: 0 additions & 30 deletions docs/developer-updates/v17.md

This file was deleted.

Loading

0 comments on commit 22883b8

Please sign in to comment.