ntls-io / ntc-smart-contract-mvp

Smart Contract development for NTC MVP.
GNU Affero General Public License v3.0
0 stars 0 forks source link

Development Setup

  1. Install Docker Desktop

  2. Install Algorand sandbox and add this project folder as bind volume in sandbox docker-compose.yml under key services.algod:

    volumes:
     - type: bind
       source: <path>
       target: /data
  3. Start sandbox:

    $ ./sandbox up
  4. Install Python virtual environment (Python 3.10+) in project folder:

    $ python -m venv venv
    $ source ./venv/Scripts/activate # Windows
    $ source ./venv/bin/activate # Linux
  5. Use Python interpreter: ./venv/Scripts/python.exe VSCode: Python: Select Interpreter

  6. Install dependencies:

    $ pip install -r requirements.txt
  7. Set PythonPath :

    $ export PYTHONPATH=.
  8. Run Deployment Test:

    $ python python_sdk/test_methods.py 

When finished, the sandbox can be stopped with ./sandbox down

Interact with Smart Contract Manually

General Calls

These are general calls made to your sandboxed algorand blockchain using the goal cli. Please enter the sandbox to execute these commands.

See global variables of smart contract

goal app read --global --app-id $APP_ID --guess-format

See application info of smart contract

goal app info --app-id $APP_ID

See account info of the smart contract (or other accounts)

goal account info -a $ACCOUNT_APP

See local variables of opted in accounts

goal app read --local --from $ACCOUNT_2 --app-id $APP_ID

Links