Artifact 727a1db77dd1a672edd8cb5c61d86bc37533672e972266f695955a09f37265df:
- Executable file examples/generate-work-rpc/generate-work-rpc — part of check-in [7cef158513] at 2018-09-25 01:22:56 on branch trunk — Added example script to generate work using the "work_generate" RPC (user: rkeene, size: 516) [annotate] [blame] [check-ins using]
#! /usr/bin/env tclsh package require nano if {[llength $argv] < 2} { puts stderr "Usage: generate-work-rpc <rpcURL> <hash>..." exit 1 } set rpcURL [lindex $argv 0] set argv [lrange $argv 1 end] package require http 2 ::nano::rpc::client::init url $rpcURL foreach arg $argv { if {[catch { set work [::nano::rpc::client work_generate -hash $arg -use_peers true] set work [dict get $work work] } err]} { puts stderr "Error generating work for \"$arg\": $err" } else { puts "WORK($arg) = $work" } }