Skip to content

Setup

Recommended installation

The current pha-tomb NuGet tool package requires the .NET 10 SDK. Check the SDK selected by your shell before installing:

dotnet --version

The command should resolve to a 10.x SDK. If it resolves to 9.x, dotnet tool install can fail with a misleading DotnetToolSettings.xml error because the package is built for net10.0.

Install pha-tomb as a .NET global tool:

dotnet tool install --global pha-tomb
dotnet tool update --global pha-tomb

Verify the install:

pha-tomb --version
pha-tomb --help

Build from source

If you want to pin a local compiler build, work on the compiler itself, or avoid relying on the global pha-tomb found first in PATH, build it from source.

Source repository:

  • https://github.com/phantasma-io/TOMB

Basic source build:

git clone https://github.com/phantasma-io/TOMB
cd TOMB
dotnet build TombCompiler.sln

Published build:

dotnet publish Compiler/TombCompiler.csproj -c Release

Current project notes:

  • executable name: pha-tomb
  • target framework: net10.0
  • source extension: .tomb

Add the compiler to PATH

This is useful when you want to invoke pha-tomb directly without a full path.

Windows

Add the directory containing pha-tomb.exe to Path.

  1. Right-click on the Start Button
  2. Select “System” from the context menu.
  3. Click “Advanced system settings”
  4. Go to the “Advanced” tab
  5. Click “Environment Variables…”
  6. Click variable called “Path” and click “Edit…”
  7. Click “New”
  8. Enter the path to the folder containing pha-tomb.exe

Example:

pha-tomb my_contract.tomb

Linux & MacOS

Add the directory containing pha-tomb to PATH.

Example:

export PATH="$PATH:/path/to/pha-tomb-directory"

Then you can run:

pha-tomb my_contract.tomb

Using a pinned compiler with pha-deploy

When using pha-deploy contract compile, you can pin an exact compiler binary instead of relying on PATH.

Use either:

pha-deploy contract compile --compiler /path/to/pha-tomb ...

or:

export PHA_TOMB_PATH=/path/to/pha-tomb