So one thing to be aware of is that cycles can run out and when it does, because maybe you've created 1
too many new canisters, because you've hosted too large a file on there, then you either have to stick 2
with local development or somehow get hold of some ICP tokens. 3
Typically, the way to get ICP tokens is via a cryptocurrency exchange. 4
Using an exchange, you can buy ICP tokens with your dollars or pounds or whatever your local currency 5
is. 6
You can see the largest and most established exchange is listed here, and at the time of recording 7
I've seen ICP tokens available on Binance, Coinbase and Kucoin, for example. 8
But let me show you a neat trick on how you can get ICP for free. 9
Coinbase has this learn and earn section where you can take quizzes about various blockchain projects 10
and earn their tokens. 11
So, for example, in this case, at the moment, there's a $3 prize on learning about fetch. 12
So we can read through this and we can do the quiz, and then we can earn prizes in the form of tokens 13
in this currency. 14
So now I've earned $3 in fetch, and now I can go back and go to buy and sell. 15
And convert my $3 of fetch tokens into Internet computer or ICP tokens. 16
So let's go ahead and press convert all. 17
And you can see that this is the current exchange rate. 18
So I should get back about 0.016 of ICP, which is currently changing because the price varies on a 19
second by second basis. 20
So let's go ahead and click convert now and we should be able to get hold of some ICP for free. 21
So now that we've got this amount of ICP, let's go ahead and convert it into cycles. 22
So to do that, we have to go to the network nervous system and let's go ahead and log in. 23
Once you're logged in and authorized, when you click on the ICP tab, you'll be able to see your wallet 24
address for your principal. 25
So here you can see I've got zero ICP currently, so if I copy this wallet address and I go back to 26
Coinbase and I go to send and receive, I'm going to select ICP to pay with. 27
And I'm going to send my $3, 28
or if you have more, you can click on Send All. And I'm going to send it to that address that I got. 29
So now we can go ahead and click Continue and click Send now. 30
And says that it has been sent. 31
So now let's click done. 32
Let's go back to our networks nervous system and let's hit refresh and see if that actually works. 33
And you can see it right now. 34
The ICP has been transferred from Coinbase and now it's inside my account, which I'm authorized with. 35
So now that we've got some ICP in our account, we can go ahead and convert some of those into cycles. 36
And to do that, we first have to head over to the canisters and then we're going to click on Create 37
or link a canister and we're going to link it to our wallet. 38
So head over to your wallet and go ahead and copy it. 39
Alternatively, you can go into the command line and type dfx identity --network ic get 40
wallet and you'll see the default wallet that's linked to your account. 41
So what we want is this canister ID for our wallet and then click attach canister, which may take a 42
while. 43
Now sometimes I get this error that says you're not the controller of this canister and cannot access its 44
details. 45
But then it sort of goes away. 46
So I'm not quite sure what's going on there. 47
Now, let's go ahead and add some cycles to this wallet 48
and we're going to select Main as our source account and we're going to give it two cycles. 49
Two cycles is the minimum amount. 50
So let's go ahead and review our cycle purchase. 51
We're going to convert this many ICP into this many terra cycles or trillion cycles, and we can go 52
ahead and click confirm and send. 53
So now it says Transaction completed, let's hit close. 54
And if we go back to our cycles wallet and hit refresh... 55
we'll just have to log in and authenticate again. 56
Now, sometimes when you authenticate, you might see this register device because it doesn't recognize 57
it or something like this. 58
But actually, if you refresh the page, it normally updates. 59
So now you can see our balance is updated and we've received two terra cycles and we've topped up our 60
balance. 61
There you have it. 62
That's how you convert ICP into cycles to use for development. 63
And if we head back to our main wallet, you can see that it has gone down from 0.3376 to 64
0.2066. 65
So we've spent some ICP and we've converted it into cycles. 66
So just in case you run out of cycles for deployment, this is how you can convert ICP into cycles and 67
continue to power your canisters. 68
Now in the next lesson, I've got a small challenge for you, and the challenge is to use the Internet 69
computer to host one of the websites that we built in the early part of this course. 70
So for all of that and more, I'll see you on the next lesson.