This directory contains maintenance and local-development scripts that are useful when working on this repo.
These scripts are not part of the runtime backend itself. They are operator and maintainer utilities.
Use regenerate-go-bindings.sh to regenerate the checked-in Ethereum contract bindings from Foundry artifacts in the companion agent-pay-contracts repo.
Generated outputs covered by this script:
chain/channel-eth-go/balancelimit/balancelimit.gochain/channel-eth-go/channel/channel.gochain/channel-eth-go/nativewrap/nativewrap.gochain/channel-eth-go/ledger/ledger.gochain/channel-eth-go/ledgerstruct/ledgerstruct.gochain/channel-eth-go/migrate/migrate.gochain/channel-eth-go/operation/operation.gochain/channel-eth-go/payregistry/payregistry.gochain/channel-eth-go/payresolver/payresolver.gochain/channel-eth-go/routerregistry/routerregistry.gochain/channel-eth-go/virtresolver/virtresolver.gochain/channel-eth-go/wallet/wallet.gochain/erc20.goroute/routerregistry/routerregistry.goapp/booleancond.go(regenerated fromagent-pay-contracts/src/lib/interface/IBooleanCond.sol; the canonical off-chainIBooleanCondbinding consumed byAppClient.GetBooleanOutcome)
Handwritten exception:
chain/channel-eth-go/deploy/deploy.gois maintained manually and is not regenerated.
Generated-file header convention:
The script prepends // Regenerated by tools/scripts/regenerate-go-bindings.sh — DO NOT EDIT. as the first line of each output (above abigen's own Code generated - DO NOT EDIT. banner) so a future reader who edits a generated file by mistake sees the right script to re-run. Files regenerated through this path carry the breadcrumb; any not-yet-regenerated file picks it up the next time the script runs, which produces a one-line diff per file unrelated to whatever else triggered the regen.
Default behavior:
- looks for a sibling contracts checkout at
../agent-pay-contracts - runs
forge buildin that repo unless told not to - runs
abigenthroughgo run github.com/ethereum/go-ethereum/cmd/abigen@v1.15.11 - writes outputs into this repo by default
Required tools:
gojqforge, unlessSKIP_FORGE_BUILD=1
Important environment variables:
CONTRACTS_REPO: override the contracts checkout locationOUTPUT_ROOT: write generated files somewhere other than this repo rootABIGEN_VERSION: override the default pinnedabigenversionABIGEN: use an already-installedabigenbinary instead ofgo run ...SKIP_FORGE_BUILD=1: reuse existing Foundry artifacts instead of rebuilding first
Common usage:
tools/scripts/regenerate-go-bindings.shSafe dry run:
tmp=$(mktemp -d)
OUTPUT_ROOT="$tmp" tools/scripts/regenerate-go-bindings.sh
find "$tmp" -type f | sortUse cockroachdb.sh as a lightweight local helper to start or stop a CockroachDB instance for development.
Current behavior:
- stores data under
$HOME/celerdbby default - starts CockroachDB in insecure local mode on
localhost:26257 - initializes the schema from
storage/schema.sql
Usage:
tools/scripts/cockroachdb.sh start
tools/scripts/cockroachdb.sh stopThis script is intentionally simple and is best treated as a local convenience helper, not a production deployment tool.