Skip to content

Commit

Permalink
Merge pull request #5 from chasefleming/feature/flow-dev
Browse files Browse the repository at this point in the history
Feature: integrate flow dev
  • Loading branch information
chasefleming authored May 1, 2023
2 parents 4d2fe9e + bf41819 commit 60af55c
Show file tree
Hide file tree
Showing 4 changed files with 381 additions and 6,474 deletions.
33 changes: 7 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,15 @@ First run:
npm install
```

### Local with Dev Wallet and the Emulator
### Local with Flow Dev, the Emulator, and Dev Wallet

In one terminal, run emulator:
Run the following to run Flow Dev, the Emulator, and Dev Wallet:

```bash
flow emulator start
npm run dev:local
```

Then, in another terminal, run Dev Wallet:

```bash
flow dev-wallet
```

```bash
npm run dev:local:deploy
```
Note: Flow Dev will will automatically create new accounts and deploy for you while developing. Your flow.json will be updated automatically. Committing these changes for local development is unncessary.

### Testnet

Expand All @@ -50,20 +42,9 @@ If you haven't yet created a testnet account, in the CLI run:
flow accounts create
```

Follow the steps and select testnet. This will create a `testnet-account.private.json` file.

Then in `flow.json`, add your testnet address prefixed with an `0x` as an alias for `testnet` just like `emulator`.

You'll also need to add your new testnet account to your flow.json:

```
// Inside of "accounts"
"testnet-account": {
"fromFile": "./testnet-account.private.json"
}
```
Follow the steps and select testnet. This will create a `[name].pkey` file (make sure this is gitignored) and add your account to flow.json.

And add a deployment for this account:
Then in `flow.json`, add the contracts you'd like to be deployed to testnet under this account:

```
// Inside of "deployments"
Expand All @@ -80,7 +61,7 @@ Then run:
npm run dev:testnet:deploy
```

Whenever you need to redeploy changed contracts to Testnet, you can run:
Whenever you need to redeploy changed contracts to Testnet while seeing the diff between deployed contracts and updates being pushed, you can run:

```
npm run dev:testnet:update
Expand Down
12 changes: 3 additions & 9 deletions flow.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"contracts": {
"HelloWorld": "./cadence/contracts/HelloWorld.cdc"
"HelloWorld": "cadence/contracts/HelloWorld.cdc"
},
"networks": {
"emulator": "127.0.0.1:3569",
Expand All @@ -16,11 +16,5 @@
}
}
},
"deployments": {
"emulator": {
"emulator-account": [
"HelloWorld"
]
}
}
}
"deployments": {}
}
Loading

0 comments on commit 60af55c

Please sign in to comment.