Skip to content

Commit 22883b8

Browse files
authored
Merge pull request #189 from onflow/release/v19
Release v19
2 parents dfae7c0 + bb14064 commit 22883b8

Some content is hidden

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

82 files changed

+3164
-615
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ You can find the CLI documentation on the [Flow documentation website](https://d
1616

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

cmd/flow/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333
"github.com/onflow/flow-cli/internal/keys"
3434
"github.com/onflow/flow-cli/internal/project"
3535
"github.com/onflow/flow-cli/internal/scripts"
36+
"github.com/onflow/flow-cli/internal/status"
3637
"github.com/onflow/flow-cli/internal/transactions"
3738
"github.com/onflow/flow-cli/internal/version"
3839
"github.com/onflow/flow-cli/pkg/flowcli/util"
@@ -46,6 +47,7 @@ func main() {
4647

4748
// hot commands
4849
config.InitCommand.AddToParent(cmd)
50+
status.Command.AddToParent(cmd)
4951

5052
// structured commands
5153
cmd.AddCommand(cadence.Cmd)

docs/build-transactions.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ transaction to be executed.
7979

8080
## Flags
8181

82-
8382
### Payer
8483

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

117+
### Arguments
118+
119+
- Flag: `--arg`
120+
- Valid inputs: argument in `Type:Value` format.
121+
122+
Arguments passed to the Cadence transaction in `Type:Value` format.
123+
The `Type` must be the same as type in the transaction source code for that argument.
124+
125+
### Arguments JSON
126+
127+
- Flag: `--argsJSON`
128+
- Valid inputs: arguments in JSON-Cadence form.
129+
130+
Arguments passed to the Cadence transaction in Cadence JSON format.
131+
Cadence JSON format contains `type` and `value` keys and is
132+
[documented here](https://docs.onflow.org/cadence/json-cadence-spec/).
133+
118134
### Host
119135

120136
- Flag: `--host`

docs/configuration.md

Lines changed: 9 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,14 @@ Flow configuration (`flow.json`) file will contain the following properties:
2525
}
2626
},
2727
"networks": {
28-
"emulator": {
29-
"host": "127.0.0.1:3569",
30-
"chain": "flow-emulator"
31-
},
32-
"mainnet": {
33-
"host": "access.mainnet.nodes.onflow.org:9000",
34-
"chain": "flow-mainnet"
35-
},
36-
"testnet": {
37-
"host": "access.devnet.nodes.onflow.org:9000",
38-
"chain": "flow-testnet"
39-
}
28+
"emulator": "127.0.0.1:3569",
29+
"mainnet": "access.mainnet.nodes.onflow.org:9000",
30+
"testnet": "access.devnet.nodes.onflow.org:9000"
4031
},
4132
"accounts": {
4233
"emulator-account": {
4334
"address": "f8d6e0586b0a20c7",
4435
"keys": "ae1b44c0f5e8f6992ef2348898a35e50a8b0b9684000da8b1dade1b3bcd6ebee",
45-
"chain": "flow-emulator"
4636
}
4737
},
4838
"deployments": {},
@@ -98,23 +88,13 @@ We'll walk through each property one by one.
9888
"emulator-account": {
9989
"address": "f8d6e0586b0a20c7",
10090
"keys": "2eae2f31cb5b756151fa11d82949c634b8f28796a711d7eb1e52cc301ed11111",
101-
"chain": "flow-emulator"
10291
}
10392
},
10493

10594
"networks": {
106-
"emulator": {
107-
"host": "127.0.0.1:3569",
108-
"chain": "flow-emulator"
109-
},
110-
"mainnet": {
111-
"host": "access.mainnet.nodes.onflow.org:9000",
112-
"chain": "flow-mainnet"
113-
},
114-
"testnet": {
115-
"host": "access.devnet.nodes.onflow.org:9000",
116-
"chain": "flow-testnet"
117-
}
95+
"emulator": "127.0.0.1:3569",
96+
"mainnet": "access.mainnet.nodes.onflow.org:9000",
97+
"testnet": "access.devnet.nodes.onflow.org:9000"
11898
},
11999

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

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

273-
#### Simple format
274-
275252
```json
276253
...
277254

278255
"networks": {
279-
"emulator": {
280-
"host": "127.0.0.1:3569",
281-
"chain": "flow-emulator"
282-
},
283-
"mainnet": {
284-
"host": "access.mainnet.nodes.onflow.org:9000",
285-
"chain": "flow-mainnet"
286-
},
287-
"testnet": {
288-
"host": "access.devnet.nodes.onflow.org:9000",
289-
"chain": "flow-testnet"
290-
}
256+
"emulator": "127.0.0.1:3569",
257+
"mainnet": "access.mainnet.nodes.onflow.org:9000",
258+
"testnet": "access.devnet.nodes.onflow.org:9000"
291259
}
292260

293261
...

docs/create-accounts.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ flow accounts create
1919
# Create an account on Flow Testnet
2020
> flow accounts create \
2121
--key a69c6986e846ba6d0....1397f5904cd319c3e01e96375d5777f1a47010 \
22-
--host access.testnet.nodes.onflow.org:9000 \
2322
--signer my-testnet-account
2423

2524
Address 0x01cf0e2f2f715450

docs/deploy-project-contracts.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,32 @@ pub contract KittyItems {
6161
}
6262
```
6363

64+
## Initialization Arguments
65+
Deploying contracts that take initialization arguments
66+
can be achieved with adding those arguments to the configuration.
67+
68+
Each deployment can be specified as an object containing
69+
`name` and `args` key specifying arguments to be
70+
used during the deployment. Example:
71+
72+
```
73+
...
74+
"deployments": {
75+
"testnet": {
76+
"my-testnet-account": [
77+
"NonFungibleToken", {
78+
"name": "Foo",
79+
"args": [
80+
{ "type": "String", "value": "Hello World" },
81+
{ "type": "UInt32", "value": "10" }
82+
]
83+
}]
84+
}
85+
}
86+
...
87+
```
88+
89+
6490
⚠️ Warning: before proceeding,
6591
we recommend reading the [Flow CLI security guidelines](https://docs.onflow.org/flow-cli/security/)
6692
to learn about the best practices for private key storage.
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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+
## ⭐ Features
6+
7+
### Project Deployment with Contract Initialization Arguments
8+
Project deployment was improved, and it now supports providing initialization
9+
arguments during the deployment of contracts. It is easy to specify all
10+
the arguments in the configuration like so:
11+
12+
```
13+
...
14+
"deployments": {
15+
"testnet": {
16+
"my-testnet-account": [
17+
"NonFungibleToken", {
18+
"name": "Foo",
19+
"args": [
20+
{ "type": "String", "value": "Hello World" },
21+
{ "type": "UInt32", "value": "10" }
22+
]
23+
}]
24+
}
25+
}
26+
...
27+
```
28+
29+
### Network Status Command
30+
Network status command allows you to query the status of each network and
31+
see if the network is available.
32+
33+
Example:
34+
```
35+
> flow status --network testnet
36+
37+
Status: 🟢 ONLINE
38+
Network: testnet
39+
Access Node: access.devnet.nodes.onflow.org:9000
40+
```
41+
42+
### Global Configuration
43+
Flow CLI now supports global configuration which is a `flow.json` file saved in your home
44+
directory and loaded as the first configuration file wherever you execute the CLI command.
45+
46+
You can generate a global configuration using `--global` flag.
47+
48+
Command example: `flow init --global`.
49+
50+
Global flow configuration is saved as:
51+
- MacOs: `~/flow.json`
52+
- Linux: `~/flow.json`
53+
- Windows: `C:\Users\$USER\flow.json`
54+
55+
You can read more about it in [the docs](https://docs.onflow.org/flow-cli/initialize-configuration/).
56+
57+
### Environment File Support
58+
59+
The CLI will load environment variables defined in the
60+
`.env` file in the active directory, if one exists.
61+
These variables can be substituted inside the `flow.json`,
62+
just like any other environment variable.
63+
64+
Example `.env` file:
65+
```bash
66+
PRIVATE_KEY=123
67+
```
68+
69+
```json
70+
// flow.json
71+
{
72+
...
73+
"accounts": {
74+
"my-testnet-account": {
75+
"address": "3ae53cb6e3f42a79",
76+
"keys": "$PRIVATE_KEY"
77+
}
78+
}
79+
...
80+
}
81+
```
82+
83+
## 🎉 Improvements
84+
85+
### Default Network Without Configuration
86+
Default network is provided even if no configuration is present which
87+
allows you to use the CLI on even more commands without the requirement of
88+
having a configuration pre-initialized.
89+
90+
### Chain ID Removed
91+
Chain ID property was removed from the configuration as it is not needed anymore.
92+
With this improvement, the new configuration is less complex and shorter.
93+
94+
95+
## 🐞 Bug Fixes
96+
97+
### Keys Generate JSON output
98+
Keys generation output in JSON format was fixed and it now shows correctly
99+
private and public keys.
100+
101+
### Account Key Index When Sending Transactions
102+
Account key index is now fetched from the configuration and
103+
it doesn't default to 0 anymore.
104+
105+
### Transaction Boolean Argument
106+
Transaction boolean argument wasn't parsed correctly when passed
107+
in comma split format.
108+
109+
### Transaction JSON Output
110+
Transaction JSON output caused a crash when the transaction
111+
was successfully processed.

docs/developer-updates/v17.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)