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
inCallParam
, we can just passstr:to_bytes
instead of using anew Uint8Array(Buffer.from('to_bytes'))
. But don't abusestr:
, it seems only used in App args but not inkey
ofgetLocalState(id,addr,key)
. I made this error on 22Feb19. - "Algobuilder
appArgs
withint:1
actually parses to an byte-array[1n]
. instead of a1n
ofuint64
".
- when passing
- I only used test with the
.teal
externally generated. It's possible to- Write
.py
in asset with some modification - Configure with
JS
from folderscripts
- Write
- Bonus tips:
package.json.scipts
can be set to{"postinstall": "yarn test", "test": "algob test"}
for the ease of use.
Further reading#
- htlc-pyteal-ts example project
- templates