generate-work at [8d7e39df83]

File examples/generate-work/generate-work artifact dad84c19fb part of check-in 8d7e39df83


#! /usr/bin/env tclsh

package require nano

if {[llength $argv] == 0} {
	puts stderr "Usage: generate-work <hash>..."

	exit 1
}

foreach arg $argv {
	if {[catch {
		set work [::nano::work::fromBlockhash $arg]
	} err]} {
		puts stderr "Error generating work for \"$arg\": $err"
	} else {
		puts "WORK($arg) = $work"
	}
}