Guides
Keep-alive
Prepay renewals once. The keeper renews your file before Portaldot drops it, and can only take what each renewal costs.
Why
Portaldot keeps data for 100,800 blocks after it was stored or renewed. Someone has to call renew for every block of a file before that runs out. Anyone can, but nobody remembers to.
Prepay
Choose 5 or 13 weeks in the Drive, or pass --keep <weeks> to the CLI. The extra value goes into the registry with register as msg.value, held per file. Anyone can top up a file with fund(root), so a community can keep a file alive. The owner can withdraw(root) the remainder at any time.
The keeper
A Vercel cron calls /api/keeper once a day, authenticated with CRON_SECRET. For each registry file with a balance:
- Walk the file's DAG and locate every block in
TransactionStorage.Transactions. - Skip it if the earliest expiry is more than 36 hours away. A daily run leaves a full missed run of slack.
- Price every
renew(block, index)withpaymentInfo. Skip if the balance can't cover it. - Send the renewals, then call
renewed(root, newExpiry, cost)to be reimbursed exactly that amount.
function renewed(bytes32 root, uint32 expiresAt, uint256 cost) external {
if (msg.sender != keeper) revert NotKeeper();
File storage f = _files[root];
if (cost > f.keepAlive) revert InsufficientKeepAlive(); // capped per file
f.keepAlive -= uint128(cost);
if (expiresAt > f.expiresAt) f.expiresAt = expiresAt;
emit Renewed(root, f.expiresAt, cost, msg.sender);
_send(msg.sender, cost);
}Dry run
GET /api/keeper?dry runs the whole pass without sending anything and returns what it would do for each file: healthy, renewed, underfunded or expired.