This project contains an implementation of a token contract similar to ERC20 but simpler. We'll visit a page, sign in and use your browser's console to run commands to initialize, send, and get the balance of a custom token.
This README is specific to Gitpod. For local development, please see README.md.
Gitpod has taken care of installing all the necessary tools and dependencies. If you're viewing this file in Gitpod, at the bottom of the page you'll see a terminal which will display a link to follow:
Server running at http://localhost:1234
A small dialog appears showing options similar to this:
The "Open Preview" option will open the site in a tab within the IDE. Note that Gitpod may need a little time to spin up the website. It's possible this step might require reloading after a brief pause.
The "Open Browser" option will open a new tab in your browser. Either option will work and is up to your preference.
Once you've opened the web app in your browser, follow the directions displayed on the web page by copy and pasting the commands into the browser console.
In many modern browsers you may find this by right-clicking anywhere on the page, selecting Inspect, and navigating to the Console tab.
- The backend code lives in the
/assembly
folder. This code gets deployed to the NEAR blockchain when you runyarn deploy:contract
. This sort of code-that-runs-on-a-blockchain is called a "smart contract" – learn more about NEAR smart contracts. - The frontend code lives in the
/src
folder. /src/index.html is a great place to start exploring. Note that it loads in/src/main.js
, where you can learn how the frontend connects to the NEAR blockchain. - Tests: there are different kinds of tests for the frontend and backend. The
backend code gets tested with the asp command for running the backend
AssemblyScript tests, and jest for running frontend tests. You can run
both of these at once with
yarn test
.
Both contract and client-side code will auto-reload as you change source files.
By using Gitpod in this project, you agree to opt-in to basic, anonymous analytics. No personal information is transmitted. Instead, these usage statistics aid in discovering potential bugs and user flow information.