Now that we've confirmed that we've got our cycles moved into our wallet and that we've linked up our 1
wallet, then it's time to actually deploy our project. Again, making sure that you're inside the dbank 2
project folder, 3
go ahead and run npm install just to make sure that all of the required packages are up and running 4
and installed. 5
And if it's already up to date, then that should only take a few seconds. And then we can go ahead and 6
deploy it. 7
So similarly, it's dfx deploy, but this time we add the --network and then we specify 8
the network as ic, 9
so the Internet computer. 10
Now, this might take a few minutes and it's going to create your canister on the Internet computer, 11
and then it's going to deploy what's inside dbank assets onto the live network. 12
Now, once that's done, it will have told you deployed canisters, and now we can actually go ahead and 13
view the live website on the Internet. 14
So if you go ahead and enter dfx canister --network ic id dbank_assets, which 15
contains the index.html and all of the other frontend parts of our project, 16
then you'll get a canister ID which you can type into the browser bar. And the structure is https: 17
-- and then the canister ID and then .raw.ic0.app. 18
And once you head over to that address, it's almost like a web URL and you will be able to see your 19
live deployed dbank application. 20
And this you can send to anyone in the world. 21
As long as they've got access to the Internet, they'll be able to check it out as well. 22
So let's try it out. 23
Let's give it some money to top up with. 24
And we should see that working. 25
And now these computations are happening live on the Internet computer. 26
Now, one thing to note, though, is if you head back to your cycles wallet and you refresh it, you 27
might need to log in again. 28
You can see that the initial balance so I had initial balance of 14 terra cycles will have been dropped 29
because as I said, the deployment part is one of the most expensive parts of using dfinity. 30
So in order to conserve cycles, we got to be really careful when we actually deploy a new canister. 31
Now it's different when we update a canister. 32
So let's say I decided to just comment out these two lines of code, hit save and I wanted to deploy again, 33
that dfx deploy --network 34
ic command, again and you'll see that this time, instead of creating a canister, it says all canisters 35
have already been created and it's simply just upgrading the code for that canister, which, as you'll 36
notice, does not cost a lot in terms of cycles.