Check-in [4a127ff396]
Overview
Comment:Added an example for generating work from a given hash
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4a127ff396dbe54db0bef9f46245dbe06a5d9ee02711d2586ff29490565be838
User & Date: rkeene on 2018-07-03 19:29:36
Other Links: manifest | tags
Context
2018-07-03
19:51
Made default address format "xrb_" for now check-in: a6dade57ee user: rkeene tags: trunk
19:29
Added an example for generating work from a given hash check-in: 4a127ff396 user: rkeene tags: trunk
19:16
Added a work generation test check-in: dcaff32689 user: rkeene tags: trunk
Changes

Added examples/generate-work/generate-work version [5e6bfb3da3].











































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /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::internal::generateWork [binary decode hex $arg]]
		set work [binary encode hex $work]
		set work [string toupper $work]
	} err]} {
		puts stderr "Error generating work for \"$arg\": $err"
	} else {
		puts "WORK($arg) = $work"
	}
}