Bitcoin Forum

Other => Off-topic => Topic started by: joshuatee on December 20, 2015, 08:34:03 AM



Title: im in love with PoSh ...and effin retarded ;(
Post by: joshuatee on December 20, 2015, 08:34:03 AM
morning chaps an chaparelles

so, I spent the night drinking beer, listening to

Quote
Playing: https://www.youtube.com/results?search_query=testament

Playing: ytdl://https://www.youtube.com/watch?v=OVsgyQeaba4
 (+) Video --vid=1 (*) (h264)
 (+) Audio --aid=1 --alang=und (*) (aac)
[vo/opengl] The OpenGL driver does not support OpenGL 3.x
[vo/opengl] Suspected software renderer or indirect context.
AO: [wasapi] 48000Hz stereo 2ch float
VO: [direct3d_shaders] 1280x720 yuv420p
AV: 01:33:37 / 02:42:21 (57%) A-V:  0.000 Dropped: 29 Cache: 10s+73MB

Playing: ytdl://https://www.youtube.com/watch?v=09rHDabBQfA
 (+) Video --vid=1 (*) (h264)
 (+) Audio --aid=1 --alang=und (*) (aac)
VO: [direct3d_shaders] 640x360 yuv420p

etc ...fcuk OGL btw :D

and among all the fun trying to write a powershell script that controls the bitcoin daemon (teh JSON-RPC thingie)

fine, I might be retarded but certainly not so much to copy-pasta all teh method's(79 if I get em right?) names, descriptions, return types etc, .. why not make a script that asks the daemon for the methods, politely, and generates all teh sh1t?

sounds like aplan. even a retard like me can write:

https://ghostbin.com/paste/8xbck (https://ghostbin.com/paste/8xbck)

and the template:

https://ghostbin.com/paste/ffj8w (https://ghostbin.com/paste/ffj8w)

and get a pretty decent looking (oh, shap :D) object, in json:

https://ghostbin.com/paste/fo54g (https://ghostbin.com/paste/fo54g)

Happy, happy, time for a few more beers  8)

havinq some fun time, sadly running outta beer and I happen to stumble on this shhh... addmultisigaddress:

Quote
    {
        "Index":  43,
        "Method":  "addmultisigaddress",
        "Description":  "Add a nrequired-to-sign multisignature address to the wallet.\nEach key is a Bitcoin address or hex-encoded public key.\nIf \u0027account\u0027 is specified (DEPRECATED), assign address to that account.",
        "Arguments":  [
                          {
                              "Name":  "nrequired",
                              "Type":  "numeric",
                              "Required":  "required",
                              "Description":  "The number of required signatures out of the n keys or addresses."
                          },
                          {
                              "Name":  "keysobject",
                              "Type":  "string",
                              "Required":  "required",
                              "Description":  "A json array of bitcoin addresses or hex-encoded public keys"
                          },
                          {
                              "Name":  "account",
                              "Type":  "string",
                              "Required":  "optional",
                              "Description":  "DEPRECATED. An account to assign the addresses to."
                          }
                      ]
    }

mah drama is the bc daemon seems to be opinionated about it:

Quote
addmultisigaddress nrequired ["key",...] ( "account" )

Add a nrequired-to-sign multisignature address to the wallet.
Each key is a Bitcoin address or hex-encoded public key.
If 'account' is specified (DEPRECATED), assign address to that account.

Arguments:
1. nrequired        (numeric, required) The number of required signatures out of the n keys or addresses.
2. "keysobject"   (string, required) A json array of bitcoin addresses or hex-encoded public keys
     [
       "address"  (string) bitcoin address or hex-encoded public key
       ...,
     ]
3. "account"      (string, optional) DEPRECATED. An account to assign the addresses to.

Result:
"bitcoinaddress"  (string) A bitcoin address associated with the keys.

Examples:

Add a multisig address from 2 addresses
> bitcoin-cli addmultisigaddress 2 "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]"

As json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addmultisigaddress", "params": [2, "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

and tats just starting teh alphabet... HUGE DRAMA  :'(  :'(  :'(

teh funny part is that the deamon seems to believe all arrays are strings and all strings are arrays? :D

seriously, much kosistens, wow taipinq