To get a TRV, you have to convince the visa officer that you're going to Canada temporarily. The best way to do this is to have significant ties to your home country like a house, job, and relatives. You should also be able to afford the trip by yourself.
Your friend can only give you a letter of invitation.