All Projects → near-examples → guest-book

near-examples / guest-book

Licence: other
Sign in with NEAR and add a message to the guest book!

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
rust
11053 projects
SCSS
7915 projects
HTML
75241 projects

Projects that are alternatives of or similar to guest-book

counter
Increment and decrement a counter with this simple smart contract via a web page.
Stars: ✭ 21 (-69.12%)
Mutual labels:  ready-to-use, assemblyscript
as-bignum
Fixed length big numbers for AssemblyScript 🚀
Stars: ✭ 49 (-27.94%)
Mutual labels:  assemblyscript
blurhash-as
Blurhash implementation in AssemblyScript
Stars: ✭ 26 (-61.76%)
Mutual labels:  assemblyscript
pallet-contracts-waterfall
Collection of simple Substrate smart contract examples written in Rust, AssemblyScript, Solang and the smart contract language ink! to test substrates pallet-contracts module
Stars: ✭ 28 (-58.82%)
Mutual labels:  assemblyscript
TensorFlow-Binary-Image-Classification-using-CNN-s
Binary Image Classification in TensorFlow
Stars: ✭ 26 (-61.76%)
Mutual labels:  ready-to-use
atari2600-wasm
An Atari 2600 emulator written in AssemblyScript compiled to WebAssembly
Stars: ✭ 50 (-26.47%)
Mutual labels:  assemblyscript
Lunatic
Lunatic is an Erlang-inspired runtime for WebAssembly
Stars: ✭ 2,074 (+2950%)
Mutual labels:  assemblyscript
assemblyscript-json
JSON encoder / decoder for AssemblyScript
Stars: ✭ 140 (+105.88%)
Mutual labels:  assemblyscript
as-string-sink
An efficient dynamically sized string buffer (aka String Builder) for AssemblyScript
Stars: ✭ 23 (-66.18%)
Mutual labels:  assemblyscript
FT
Example implementations of money-like tokens, where one token is the same as any other, using the NEP-141 spec (similar to ERC-20)
Stars: ✭ 97 (+42.65%)
Mutual labels:  ready-to-use
NFT
Example implementations of tokens to represent unique assets, such as collectibles or deeds, using the NEP-171 spec (similar to ERC-721)
Stars: ✭ 291 (+327.94%)
Mutual labels:  ready-to-use
examples
A collection of AssemblyScript examples.
Stars: ✭ 233 (+242.65%)
Mutual labels:  assemblyscript
website
AssemblyScript's website and documentation.
Stars: ✭ 47 (-30.88%)
Mutual labels:  assemblyscript
ask
Ask! is a framework to write Wasm smart contracts for Substrate Frame Pallet-Contracts in AssemblyScript
Stars: ✭ 44 (-35.29%)
Mutual labels:  assemblyscript
easegress-assemblyscript-sdk
AssemblyScript SDK for Easegress
Stars: ✭ 15 (-77.94%)
Mutual labels:  assemblyscript
Assemblyscript
A TypeScript-like language for WebAssembly.
Stars: ✭ 13,152 (+19241.18%)
Mutual labels:  assemblyscript
wasm4
Build retro games using WebAssembly for a fantasy console.
Stars: ✭ 711 (+945.59%)
Mutual labels:  assemblyscript
gomoku-wasm
A Gomoku game implements with WebAssembly
Stars: ✭ 30 (-55.88%)
Mutual labels:  assemblyscript
rabin-wasm
Rabin fingerprinting implemented in WASM
Stars: ✭ 26 (-61.76%)
Mutual labels:  assemblyscript
rust-counter
Simple counter in Rust. Increment, decrement, and reset. See branches for extended usage.
Stars: ✭ 53 (-22.06%)
Mutual labels:  ready-to-use

Guest Book

Build Status

Open in Gitpod

Sign in with NEAR and add a message to the guest book! A starter app built with an AssemblyScript backend and a React frontend.

Quick Start

To run this project locally:

  1. Prerequisites: Make sure you have Node.js ≥ 12 installed (https://nodejs.org), then use it to install yarn: npm install --global yarn (or just npm i -g yarn)
  2. Run the local development server: yarn && yarn dev (see package.json for a full list of scripts you can run with yarn)

Now you'll have a local development environment backed by the NEAR TestNet! Running yarn dev will tell you the URL you can visit in your browser to see the app.

Exploring The Code

  1. The backend code lives in the /assembly folder. This code gets deployed to the NEAR blockchain when you run yarn deploy:contract. This sort of code-that-runs-on-a-blockchain is called a "smart contract" – learn more about NEAR smart contracts.
  2. The frontend code lives in the /src folder. /src/index.html is a great place to start exploring. Note that it loads in /src/index.js, where you can learn how the frontend connects to the NEAR blockchain.
  3. 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.

Deploy

Every smart contract in NEAR has its own associated account. When you run yarn dev, your smart contracts get deployed to the live NEAR TestNet with a throwaway account. When you're ready to make it permanent, here's how.

Step 0: Install near-cli

You need near-cli installed globally. Here's how:

npm install --global near-cli

This will give you the near CLI tool. Ensure that it's installed with:

near --version

Step 1: Create an account for the contract

Visit NEAR Wallet and make a new account. You'll be deploying these smart contracts to this new account.

Now authorize NEAR CLI for this new account, and follow the instructions it gives you:

near login

Step 2: set contract name in code

Modify the line in src/config.js that sets the account name of the contract. Set it to the account id you used above.

const CONTRACT_NAME = process.env.CONTRACT_NAME || 'your-account-here!'

Step 3: change remote URL if you cloned this repo

Unless you forked this repository you will need to change the remote URL to a repo that you have commit access to. This will allow auto deployment to GitHub Pages from the command line.

  1. go to GitHub and create a new repository for this project

  2. open your terminal and in the root of this project enter the following:

    $ git remote set-url origin https://github.com/YOUR_USERNAME/YOUR_REPOSITORY.git

Step 4: deploy!

One command:

yarn deploy

As you can see in package.json, this does two things:

  1. builds & deploys smart contracts to NEAR TestNet
  2. builds & deploys frontend code to GitHub using gh-pages. This will only work if the project already has a repository set up on GitHub. Feel free to modify the deploy script in package.json to deploy elsewhere.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].