Ice.ts 0.1 is released - Hardhat for the IC

Ice.ts v0.1 is live - TypeScript-native tooling for the IC

Hey everyone, itโ€™s been a while since I posted here :smiley:
Earlier this year I announced my project Ice

Back then it was still a prototype and it has since then evolved quite a bit.
I can now happily say that its usable for full end-to-end deployment, including mainnet.

Of course still early days, only 0.1 after all, but Iโ€™m eager to hear your thoughts.
And please do try it out! :folded_hands:

TDLR;

Ice is a TypeScript powered task-runner like Hardhat for the IC. Its main purpose is to upgrade the DX on the IC, turn the setup process & scripting of canisters into a breeze and enable new tooling to be built on top.

The video shows just the basics, but theres a lot more that I didnt cover (was in a rush to get it finished). I recommend checking the docs

Or just ask here if you have any questions :slight_smile:

Some highlights

No external downloads.
PocketIC is downloaded automatically by Ice. Just npm install and thats it.


Npm distributed canisters.
You can just npm install canister or publish ones yourself.

Complex setups can be abstracted away easily. Just import the other config like you would any other javascript module, and pick and choose what you need.

Quick Start

Install the runner and the canisters package in your project:

npm i -S @ice.ts/runner @ice.ts/canisters

Setup

Create an ice.config.ts file in your project root. This is the entry point for your environment configuration.

import { Ice, PICReplica } from '@ice.ts/runner';

// The configuration wrapper
export default Ice(async (env) => {
  return {
    // 1. Define your network (logical name)
    network: 'local',

    // 2. Define the replica (local PocketIC in this case)
    replica: new PICReplica({ port: 8080 }),

    // 3. (Optional) Define users/identities
    users: {
      // Use an existing identity:
      default: await Ids.fromDfx("default"),
      // Or:
      // default: await Ids.fromPem("....")
    }
  };
});

Your First Task

In the same file (or imported), define a task using the task() builder.

import { task } from '@ice.ts/runner';

// Define the task
export const hello = task("My first task")
  .run(async ({ ctx }) => {
    console.log(`Hello ${ctx.users.default.principal}`);
  })
  .make();

Running Tasks

You can run tasks using the CLI:

# Run the specific task
npx ice run hello

# List all available tasks
npx ice

:electric_plug: VS Code Extension

Install from the Visual Studio Marketplace.

  • Inline CodeLens: Quickly execute tasks directly from your source code.
  • Inline Results: See execution output without switching context.

Kapture 2025-02-23 at 22 16 11

Resources

Cooking some new features :hot_face:

In the mean timeโ€ฆ

Example repo here showing some of the basics and hopefully some helpful comments:

just git clone & npm install to get it running!