This page will provide a high-level overview of how applications are put together on NEAR and a suggested path you can use to learn how to build your own.
Overview of NEAR Applications
Applications on the NEAR platform typically have two distinct parts, which are conceptually similar to the back-end and front-end parts of a typical web application:
- Building the Smart Contract(s): Writing and deploying smart contracts to the blockchain, which handle storing and modifying data on the chain. The contract(s) will need to expose an API.
Building Smart Contracts
You can build smart contracts using any language which compiles to Web Assembly (Wasm), but the ones currently supported by these docs are:
- Rust (the "Most Loved" language on Stack Overflow). To write smart contracts in Rust, you will use the SDK
near-sdk-rs, a wrapper which provides improved safety for the Rust programming language for high value contracts.
- AssemblyScript (closely related to the #2 most-loved language, TypeScript. To write smart contracts in AssemblyScript, you will use the SDK
near-sdk-as, a collection of helpers that make your SmartContracts look similar to TypeScript while compiling to Wasm for execution. AssemblyScript is currently not recommended for production financial applications.
For details on how to build, test and deploy smart contracts, see the section on Smart Contracts.
Calling Smart Contracts
Testing Smart Contracts
Smart contracts can be easily tested using whichever language you prefer. See the Test Your Smart Contracts tutorial and the respective SDK explanations for more information.
Deploying Smart Contracts
While there is only one "MainNet" ('official' production network), there are many other potential networks you could deploy your application to. These range from your local environment's TestNet to any number of third-party networks available in the wild. See Networks for more information.
This is just a high level overview of smart contracts. The section on Smart Contracts goes into greater depth on all of these concepts.
Getting up to Speed: First Steps
One approach to learning app development with NEAR is to read through all of the sections identified above before writing your contract.
If you prefer a more experimental and rapid approach, try the following:
- Explore NEAR Examples to deploy one of several sample applications in minutes. You will be able to deploy them using Gitpod's web-hosted environment, modify the code, play with them in the browser there and view transactions on the blockchain via an explorer or wallet. You can modify this code into your own apps.
- Use your own development environment to create dApps
- Create an account
- Authenticate with NEAR CLI
- Explore levels of abstraction in
- Send yourself money (after hacking on our wallet storage to learn how it works)
- Follow our end-to-end guided walkthroughs
If you have feedback or suggestions for improvement, please don't keep quiet about it.