Skip to content

Latest commit

 

History

History
62 lines (45 loc) · 1.75 KB

File metadata and controls

62 lines (45 loc) · 1.75 KB

Artifacts bundle for Python SDK

Python SDK now uses per-network artifact submodules directly. It does not depend on cloning the TS SDK monorepo.

Repository layout

Submodules live under:

  • artifacts_submodules/dev/l1_tvm_ton
  • artifacts_submodules/dev/l2-evm
  • artifacts_submodules/testnet/l1_tvm_ton
  • artifacts_submodules/testnet/l2-evm
  • artifacts_submodules/mainnet/l1_tvm_ton
  • artifacts_submodules/mainnet/l2-evm

Network metadata lives under:

  • artifacts/networks/<network>/ton.json
  • artifacts/networks/<network>/tac.json

Build bundle

One command:

python3 scripts/sync_artifacts_sources.py

What it does:

  1. git submodule sync --recursive && git submodule update --init --recursive
  2. Builds TON artifacts in each l1_tvm_ton
  3. Installs deps for each l2-evm, bootstraps local/offline solc cache for Hardhat, compiles TAC artifacts
  4. Exports bundle to artifacts/artifacts.bundle.json
  5. Exports pytvm fixtures to artifacts/sandbox_fixtures

Optional flags:

python3 scripts/sync_artifacts_sources.py --skip-submodule-sync
python3 scripts/sync_artifacts_sources.py --skip-ton-build
python3 scripts/sync_artifacts_sources.py --skip-hardhat-compile
python3 scripts/sync_artifacts_sources.py --skip-sandbox-fixtures
python3 scripts/sync_artifacts_sources.py --sources-root artifacts_submodules --metadata-root artifacts/networks --out artifacts/artifacts.bundle.json

Use in Python SDK

from sdk.TacSdk import TacSdk
from structs.Struct import SDKParams, Network

sdk = await TacSdk.create(
    SDKParams(
        network=Network.TESTNET,
        # artifacts is optional, default is artifacts/artifacts.bundle.json
    )
)

If artifacts is not passed, SDK tries artifacts/artifacts.bundle.json.