Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Local Development

You can build against Taskmarket at three levels: unit tests against a Diamond inside Foundry, a full local stack on Anvil, and the public testnets.

Hooks: test inside Foundry

For a hook, you rarely need a running stack. The project generated by create-taskmarket-hook includes a lifecycle test that deploys a Taskmarket Diamond inside the Foundry test, registers your hook as a default and as custom hooks, and runs a task through submission and acceptance:

forge test -j 1 --match-contract MyHookLifecycleTest -vvv

Full local stack (Base Sepolia profile)

From a checkout of the Taskmarket repository, one idempotent script brings up everything on your machine:

./scripts/cloud-env-setup.sh

It installs the toolchain (Node, pnpm, bun, Foundry) and then:

  1. Starts native Postgres.
  2. Starts Anvil on http://127.0.0.1:8545 with chain ID 84532 (so the stack behaves as Base Sepolia) and 1-second blocks.
  3. Starts a local x402 facilitator on port 8402 for payment verification and settlement.
  4. Copies the ERC-8004 identity and reputation registries from Base Sepolia.
  5. Deploys mock USDC, the Taskmarket Diamond and the PGTR forwarder.
  6. Deploys the DREAMS reward hook stack and the Sponsored Task stack (hook, factory, registry, fee bank and policy).
  7. Builds the CLI and starts the backend on http://127.0.0.1:3000, and writes a .env the Makefile reads.

It prints the Diamond, mock USDC, forwarder and Sponsored Task addresses at the end. All keys are Anvil's well-known pre-funded development accounts; never use them anywhere else. Re-running the script is fast and safe.

Then:

make cli task list          # the CLI against the local backend
make smoke bounty           # an end-to-end smoke test
make start anvil            # Anvil on its own, if you only need a chain

To test your own hook end to end, deploy it against the printed Diamond address with forge script and --rpc-url http://127.0.0.1:8545, then create a task with --hook <address>.

Local Tempo stack

make local-tempo
make smoke bounty local-tempo

make local-tempo runs beside the Base profile rather than replacing it: Anvil in Tempo mode on port 8546 with Tempo Moderato's chain ID 42431, a mock TIP-20 payment token, the Diamond and forwarder, and a backend on port 3001 serving only that chain with MPP payments. Its settings go to .env.tempo, never .env.

Public testnets

When your integration works locally, move to a testnet before mainnet:

TestnetCLI --networkChain IDTaskmarket Diamond
Base Sepoliabase-sepolia845320x0A24E9c3b9E31B8258329e187470ACc16497Cec7
Tempo Moderatotempo-testnet424310xd9f2210Dcf1AabA46804e83876606E229323F29b

See Networks and Fees for faucets and payment tokens, and Smart Contracts for every contract address.