Skip to content

Commit

Permalink
add faucet guide
Browse files Browse the repository at this point in the history
  • Loading branch information
sisyphusSmiling committed Nov 5, 2024
1 parent 41d6388 commit 8c67738
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 0 deletions.
Binary file added docs/ecosystem/faucet-account-created.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/ecosystem/faucet-create-account.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/ecosystem/faucet-fund-account.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/ecosystem/faucet-input-public-key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions docs/ecosystem/faucets.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,75 @@ Network Faucets provide free Flow tokens for testing purposes, functioning like
- [Testnet](https://learnweb3.io/faucets/flow)

</div>

## Using Flow Faucet

### Funding Your Account

If you already have a Flow account, you can fund it simply from the Faucet's landing page. Simply paste the address of the account you want to fund, complete the CAPTCHA, and click "Fund Your Account."

![fund-your-account](./faucet-fund-account.png)

After a few seconds, you'll see your account's FLOW balance as a confirmation. Note, the Faucet will automatically determine if the address you paste is a Flow or EVM address and will fund the account accordingly.

### Creating a Flow Account

#### Generate a Key Pair

To create a Flow-native account, you'll need to generate a key pair. You can do this most easily [Flow CLI](../build/getting-started/flow-cli.md) with the [`keys generate` command](../tools/flow-cli/keys/generate-keys.md)

```sh
flow keys generate
```

You'll receive a private key and a public key pair with default `ECDSA_P256` signature and `SHA3_256` hash algorithms.

```sh
❯ flow keys generate

🔴️ Store private key safely and don't share with anyone!
Private Key <PRIVATE_KEY>
Public Key <PUBLIC_KEY>
Mnemonic <MNEMONIC_PHRASE>
Derivation Path m/44'/539'/0'/0/0
Signature Algorithm ECDSA_P256
```

You can then use the public key to create a new Flow account on the Faucet. Copy the resulting public key for the next step.

#### Create a Flow Account

From the Faucet's landing page, click on the "Create Account" button. You'll be prompted to enter your public key. Paste the public key you generated using the Flow CLI and click "Create Account."

![create-flow-account](./faucet-create-account.png)

You can then paste your public key into the input field, complete the CAPTCHA, and click "Create Account."

![input-public-key](./faucet-input-public-key.png)

You'll be met with a confirmation screen, showing your Flow account address and the funded balance.

![account-created](./faucet-account-created.png)

#### Using your Flow Account

Once your account has been created, you can add the account to your `flow.json` configuration file under the `accounts` attribute, like so:

```json
{
"accounts": {
"testnet-dev-account": {
"address": "<YOUR_ADDRESS>",
"key": "<PRIVATE_KEY>"
}
}
}
```

:::warning

If you plan on using your flow.json in a production environment, you'll want to look at alternative methods to manage your keys more securely, at minimum using environment variables instead of storing your account private keys in plain text. See [How to Securely Use CLI](../tools/flow-cli/flow.json/security.md) for more information on alternate key management strategies and how to configure them in your `flow.json` file.

:::

After adding your account to your `flow.json` file, you're ready to use your account in your project. You can now deploy contracts, run transactions, and interact with the Flow blockchain using your new account.

0 comments on commit 8c67738

Please sign in to comment.