Skip to content

AlgoBuilder Basics

What#

Algo Builder is a

framework for Algorand dapps, Algorand Standard Assets, Tokens and Smart Contracts.

From Algo Builder

Why#

  • Faster than all current ways to test. Current ways are
    • TealTester:python+py-algosdk
    • dev-console:JS+js-algosdk
  • recommended by Bo.

How#

  • Follow Guide in Algo Builder docs. I skipped the "requirements" section since It's offered by the python package.
  • Instead of "Create a blockchain", I just followed "Create an algob project". And mostly using our python exporter to export the compiled TEAL files and params.
  • It's possible (not confirmed #TOCONFIRM) to move an new JS project to TS via yarn run algob init --typescript. I don't remember if I "upgraded" or re-created.
  • After creation, continue with templates and examples. Some tricks in examples are not called out in the README or docs, like
    • when passing appArgs in CallParam, we can just pass str:to_bytes instead of using a new Uint8Array(Buffer.from('to_bytes')). But don't abuse str:, it seems only used in App args but not in key of getLocalState(id,addr,key). I made this error on 22Feb19.
    • "Algobuilder appArgs with int:1 actually parses to an byte-array [1n] . instead of a 1n of uint64".
  • I only used test with the .teal externally generated. It's possible to
    • Write .py in asset with some modification
    • Configure with JS from folder scripts
  • Bonus tips: package.json.scipts can be set to {"postinstall": "yarn test", "test": "algob test"} for the ease of use.

Further reading#