Giter Site home page Giter Site logo

npc's Introduction

George

Simple NPC game interactions using a stateful contract and atomic transfers

intro

DISCLAIMER: NO WARRANTY INCLUDED: This contract is for tutorial purposes and hasn't been through a security audit. Use this contract on mainnet AT YOUR OWN RISK! I won't be responsible for any loss incurred.

# node
make pvtnet     # create private net
make start      # start private net
make stop       # stop private net

# ci
make build      # build contract
make deploy     # deploy contract

# interact
make read       # read global state
make heal       # heal npc
make injure     # damage npc
make kill-npc   # run `injure` 6 times
make transcend-npc # run `heal` 6 times
make delete     # retire the app

If you've enjoyed this article you can tip me at: ZEWLZ7H4MITB2GGCNOR5YTDZXKBVJTKLDT7VDRCUAKEI6ZZ2D7KYKBH6TU

npc's People

Contributors

dzuqe avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

npc's Issues

Algorand Dev Portal article has issues fixed in this codebase

First, thank you immensely for the excellent tutorial on Algorand.org, as a web3 (EVM) game developer learning Algorand, it's educational and fun.

I wanted to give a heads up that the tutorial, Simple NPC game interactions using a stateful contract and atomic transfers, has a number of minor mistakes, which are fixed in this repo's code, but haven't been applied to the article yet.

  1. Missing definition of is_creator (line 10) of contract.py

  2. Bytes("damage") should be Bytes("injure") on Line 40 of contract.py

  3. Makefile references to $(ALGO_(DATA) and $(ALGO__DATA) (should be $(ALGO_DATA))

  4. Makefiles also require tabs, not spaces (This may not be fixable in the article, depending on their CMS)

  5. goal node start -d $(ALGO_PVTNET_DATA) is a useful command to add after the private node install. (I'm a complete AlgoN00b!)

  6. creatorAddress and differentAddress needing some figuring out. goal account new was useful for creating the differentAddress.
    It may be helpful to give commands to create and fund a second account:

    goal account new
    goal account list
    goal clerk send -a 200000 -f $CREATOR_ACCOUNT -t $NEW_ACCOUNT 
    

    I hope this helps! Thanks again!

Issue in Environment variables setup

I created the test net and started it.
checked the status using goal status and make status
All looks good.
The
wallet gets created under
~/algorand/algo-builder/infrastructure/node_data/Primary Not PrimaryNode like the example says

But when i deploy i get the following error

โžœ  npc make deploy
goal app create --creator IFM4HAAKD3Z7GAOKWQ4SZILY6AMOKHDSW6RWR4MS7MPIC25F4V2E2XDBDE \
                --approval-prog ./build/george_interact.teal \
    --clear-prog ./build/clear_state.teal \
                --local-byteslices 0 \
                --local-ints 0 \
                --global-byteslices 1 \
                --global-ints 1 -d "~/algorand/algo-builder/infrastructure/node_data"
No wallets found. Create a new wallet with `goal wallet new [wallet name]` 

The wallets exist under the Primary Directory
which i tried adding to the path and it complained about not finding algod.
Since this is a beginer example this needs to be fixed and made easy to implement.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.