# Functions Subscription

### Connect MetaMask

Go to [Chainlink Functions](https://functions.chain.link/) and perform the following actions:

1. Make sure you are on Avalanche Fuji Testnet from the drop-down menu
2. Click the “Connect wallet” icon at the top right to connect your MetaMask wallet

<figure><img src="https://62720068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNQrWPKDHvXg0HQjwzHbY%2Fuploads%2F32QkzVrIhtKFcHABAXcl%2Ffunctions13.png?alt=media&#x26;token=fecca196-f0ec-4a29-abd5-214e751418f4" alt=""><figcaption><p>Connect MetaMask to Chainlink Functions</p></figcaption></figure>

<figure><img src="https://62720068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNQrWPKDHvXg0HQjwzHbY%2Fuploads%2FdjTRv5wMQ7qzdOlmcEe5%2Ffunctions14.png?alt=media&#x26;token=f3ec83f1-3e95-4564-8d98-46b367837fa6" alt=""><figcaption><p>Click the MetaMask icon the left</p></figcaption></figure>

MetaMask will pop-up to connect your wallet, click "Next":

<div align="left"><figure><img src="https://62720068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNQrWPKDHvXg0HQjwzHbY%2Fuploads%2FyXFjNzRRj0xciE0UGWcq%2Ffunctions15.png?alt=media&#x26;token=106988f3-c724-4ee7-b4bc-9c5b8f645470" alt=""><figcaption><p>Click "Next"</p></figcaption></figure></div>

Now click "Connect":

<div align="left"><figure><img src="https://62720068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNQrWPKDHvXg0HQjwzHbY%2Fuploads%2FDgn6kaa1oCGo2ASshCvL%2Ffunctions16.png?alt=media&#x26;token=1642957d-650e-477f-8465-422c266f0bba" alt=""><figcaption><p>Click "Connect"</p></figcaption></figure></div>

### Create a Subscription and Add Funds

Once you are connected to Chainlink Functions and on the Avalanche Fuji Testnet, click the “Create Subscription” button:

<figure><img src="https://62720068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNQrWPKDHvXg0HQjwzHbY%2Fuploads%2FArKLtaEdPgj3rwMPtBvq%2Ffunctions17.png?alt=media&#x26;token=9c810fab-0dca-482f-ab8c-a89c8c1724d7" alt=""><figcaption><p>Time to create a Chainlink subscription</p></figcaption></figure>

The next steps are:

* &#x20;add your email address (#1),&#x20;
* put in “Bootcamp Project” for “Subscription name” (#2) and
* accept the privacy policy and click the “Create Subscription” button (#3)

<figure><img src="https://62720068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNQrWPKDHvXg0HQjwzHbY%2Fuploads%2FKpy47m5rbB7TPCNapT5H%2Ffunctions18.png?alt=media&#x26;token=1c1492c4-ae61-46f7-b2b6-2bdb902120b2" alt=""><figcaption><p>Create Functions Subscription</p></figcaption></figure>

MetaMask will pop-up with a “Confirm” request, so click the “Confirm” button at the bottom right:

<div align="left"><figure><img src="https://62720068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNQrWPKDHvXg0HQjwzHbY%2Fuploads%2FoN9yKaD3RQZAvqhC6t1h%2Ffunctions19.png?alt=media&#x26;token=e6546185-f8b3-46f7-b5b2-f95c56528856" alt=""><figcaption><p>Click "Confirm"</p></figcaption></figure></div>

You need to approve the Functions terms of service and the subscription creation on the next MetaMask window, click the “Confirm” button at the bottom right to approve this request:

<figure><img src="https://62720068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNQrWPKDHvXg0HQjwzHbY%2Fuploads%2F6jqs7DL1ddcIK2yp0EvC%2Ffunctions20.png?alt=media&#x26;token=17d53ce0-f0fe-421a-8af3-5c76dc1a233f" alt=""><figcaption><p>Approve the subscription by cliicking "Confimr"</p></figcaption></figure>

After the transaction to approve the subscription, you need to sign the message to save your subscription name and email address. Click the “Sign” button at the bottom right to sign the message:

<figure><img src="https://62720068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNQrWPKDHvXg0HQjwzHbY%2Fuploads%2FfCgt9y0h2a8iolL1wxO0%2Ffunctions21.png?alt=media&#x26;token=87672046-08c3-4a56-8e37-85cb0707f2c2" alt=""><figcaption><p>Sign the message</p></figcaption></figure>

Upon a successful subscription creation, you need to add LINK to your Functions Subscription to fund the Chainlink oracles to run Chainlink Functions . Click the “Add funds'' button at the bottom:

<figure><img src="https://62720068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNQrWPKDHvXg0HQjwzHbY%2Fuploads%2F6opsHEvaPa7ivebXDGoj%2Ffunctions22.png?alt=media&#x26;token=b076fd94-4191-43c9-968f-b0b662dd265c" alt=""><figcaption><p>You will need to ass funds to pay for the subscription</p></figcaption></figure>

On the following page,  put in `5` for the LINK amount (#1) and then click the “Add funds” blue button (#2):

<figure><img src="https://62720068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNQrWPKDHvXg0HQjwzHbY%2Fuploads%2F60RVBklGF362UzuGsahC%2Ffunctions24.png?alt=media&#x26;token=ffd73a24-5ccd-4e1e-8735-bacf87b84807" alt=""><figcaption><p>Adding LINK to our subscription</p></figcaption></figure>

You will now need to confirm the transaction to send LINK to your Subscription.  MetaMask will pop-up and click the “Confirm” button at the bottom right to approve adding funds:

<figure><img src="https://62720068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNQrWPKDHvXg0HQjwzHbY%2Fuploads%2FN7UL3qynHTix5JafSv6V%2Ffunctions25.png?alt=media&#x26;token=cbe7f015-9b0a-4f22-89af-1488a46da4af" alt=""><figcaption><p>Confirm the adding of funds</p></figcaption></figure>

Once done, you can refresh the page, and see your subsciption's details and LINK balance.

<figure><img src="https://62720068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNQrWPKDHvXg0HQjwzHbY%2Fuploads%2F1YdSSUCJ6vQs79m8t9XW%2FLINKBalance.png?alt=media&#x26;token=9d09986f-28e3-4709-a785-c3c5f37e1c12" alt=""><figcaption><p>Successfully funded our subscription with LINK</p></figcaption></figure>
