Why am I writing this tutorial? This year (2021) I participated in js13kgames, my third year, and because I like trying new things I gave the decentralized category a go. I managed to get something running in the nick of time, they even gave me a prize. So now thanks to Sasha from Human Guild reaching out to me, I'm learning everything I want to know about how to use NEAR with HTML5 games and writing a series of tutorials in the process.
The first thing you need to do to get started is set up all those horrible command line tools, if you already have those set up feel free to skip ahead.
First set up Ubuntu: Run power shell as administrator, use the tutorial for windows subsystem for linux WSL2, if you've got an older version of windows it will be more difficult, but there's a link in that tutorial for that.
Once you have Ubuntu installed you have to set up a username/password.
Then install and update everything!!!
sudo apt update
sudo apt install nodejs
nodejs -v (Should be version 12 or higher)
sudo apt install npm
npm -v
If your Ubuntu is using a version lower than 12 then you should use nvm to change the version.Link
You should also install yarn to make the NEAR boiler plate code run:
Testnet account set up tutorial
Install NEAR CLI (command line interface): tutorial
npm install -g near-cli
near login
Login should open in another window, so you can login with your testnet account
NEAR cli is a command line interface that call the methods you write for your contracts, docs
Try this command:
near view hello-world-contract.testnet hello
Let's break that down:
Some basic command line commands you'll need:
So you should be all set up to start now...
NEAR tutorial 1