Useful Links:
https://github.com/near-examples/coin-flip-workshop-js/tree/coin-flip
https://www.youtube.com/watch?v=QYNyC6__pw8
Start
npm install
Deploy
npx near dev-deploy build/contract.wasm
Export env
export CONTRACT_NAME=dev-1662994042789-50479875102850
View examples
npx near view $CONTRACT_NAME viewGreeting
npx near view $CONTRACT_NAME viewPoints '{"player": "'$CONTRACT_NAME'"}'
Write examples
npx near call $CONTRACT_NAME setGreeting '{"message": "GO TEAM!"}' --accountId $CONTRACT_NAME
npx near call $CONTRACT_NAME flipCoin '{"side": "tails"}' --accountId $CONTRACT_NAME
Start new project
npx create-near-app
After a new deploy, it will generate a new CONTRACT_NAME under neardev/dev-account
npm run deploy
Top comments (0)