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 --versionThe 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-tombVerify the install:
pha-tomb --version
pha-tomb --helpBuild 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.slnPublished build:
dotnet publish Compiler/TombCompiler.csproj -c ReleaseCurrent 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.
- Right-click on the Start Button
- Select “System” from the context menu.
- Click “Advanced system settings”
- Go to the “Advanced” tab
- Click “Environment Variables…”
- Click variable called “Path” and click “Edit…”
- Click “New”
- Enter the path to the folder containing
pha-tomb.exe
Example:
pha-tomb my_contract.tombLinux & 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.tombUsing 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