Algo Builder specs

Algo Builder specs

Repository organization

Components

We will use builder/core package as a base. The idea is to copy it and remove all necessary things, mostly related to Ethereum. We want to reuse the CLI part of it and REPL integration and plug-in architecture. 
Each feature will be a new plugin:
  • assets and smart-contracts management
  • deployment
  • testing
  • devnet

How it will work?

We will have a single binary: algob which will be a CLI for different tasks / functionality. Depending on  the task, it will either use Algorand goal tool directly or use Algorand API through SDK or REST.

User project

Here we describe how the Algorand builder is used by user.
User starts by creating a new project with algob init. This will create the following:

Directory structure:

  • /assets/*.teal — smart contracts written directly in TEAL
  • We will also support smart-contracts written in higher level language:
  • /assets/*.py — smart contracts written directly in Python
  • The code will be compiled to a bytecode (for Python / Scheme, it will first get compiled to TEAL) and the bytecode with metadata will be stored in /artifacts/contracts/  (per network - as in truffle)
  • assets/asa.yaml — this will contain an ASA (Algorand Standard Assets) description in a YAML format which will handle the ASA creation.
  • Example: 
// asa.yaml or multiple with: asa[_a-z]*.yaml
abtc:
  total: 5912599999515
  decimals: 0
  defaultFrozen: false
  unitName: "ABTC"
  url: "url"
  # User may get "signature validation failed" from node if shorter hash is used.
  metadataHash: "12312442142141241244444411111133"
  note: "note"
  noteb64: "noteb64"
  manager: "WWYNX3TKQYVEREVSW6QQP3SXSFOCE3SKUSEIVJ7YAGUPEACNI5UGI4DZCE"
  reserve: "WWYNX3TKQYVEREVSW6QQP3SXSFOCE3SKUSEIVJ7YAGUPEACNI5UGI4DZCE"
  freeze: "WWYNX3TKQYVEREVSW6QQP3SXSFOCE3SKUSEIVJ7YAGUPEACNI5UGI4DZCE"
  clawback: "WWYNX3TKQYVEREVSW6QQP3SXSFOCE3SKUSEIVJ7YAGUPEACNI5UGI4DZCE"
  optInAccNames: ["john-account"]
COIN2:
  ...
  • /scripts :  this will contain scripts deploy assets and smart-contracts (more about it in the next section).
  • /test : tests, will reuse scripts to deployment
  • /artifacts :  will contain build and deployment information.
  • If a smart contract is build 
  • Here we will store information about assets creation transactions and all metadata (per network).
  • Example: COIN2
  • The file will be something like:
... // some common metadata if needed
networks: {