Setting Up Your Development Environment
I'm going to show you how to setup your development environment using what I use. This is just one of many different ways to approach development and if you don't like the tools/methods I use - then by all means, set things up how it suits you. In the end as long as you have something you can write and compile AssemblyScript code with - you're good to go.
If you want to follow along exactly as I do, then you'll need the following environment setup:
- Windows running Windows Sub-System for Linux 2 (WSL2) with Ubuntu 18.04 LTS
- Visual Studio Code (VSCode) with following extensions: Remote-WSL and ESLint
- NodeJS - v14.15.4 - which automatically adds node package manager (npm). You may want to consider nvm as well if you need to switch node versions for projects.
- A directory where you want to store your projects (good to stay organized)
None of this is rocket science to setup. If any of it is for you at the moment, that's fine, but you have to understand that part of learning to code means figuring out problems. You'll do a lot of Googling and asking questions which never really stops no matter how proficient you become. So, this is what you need to install - over to you to figure out how to do that.
- Installing WSL-2 and Ubuntu 18.04 LTS - Use this manual installation method.
- Installing VS Code and its extensions.
- Install NodeJS (LTS version)
- Install Git
- Install NEAR-CLI globally
- Create a projects directory somewhere in your file system.
So, go ahead and do that, then come on back. We'll quickly test you setup to make sure you're ready to go.
...insert appropriate elevator music or Jeopardy theme here...
Back already. Good. Next up, you should watch and/or follow along with the video walkthrough below. In it we'll do the following:
- Open up VS Code to a new workspace
- Clone some boilerplate project code into a new project directory and open it up
- Write a very basic AssemblyScript contract and build it
- Visit NEAR wallet to create a TestNet account
- Use the account we create to create a new contract account belonging to our account and then deploy the contract code to the NEAR blockchain
- Use Near-CLI to see if the contract is working. If it is, we know your development environment is good to go.