diff --git a/iguana/Kashi/Getnewaddress_dumpprivkey b/iguana/Kashi/Getnewaddress_dumpprivkey new file mode 100755 index 000000000..6a8a215e7 --- /dev/null +++ b/iguana/Kashi/Getnewaddress_dumpprivkey @@ -0,0 +1,12 @@ +#!/bin/bash + +echo "unlocking the wallet" +echo "" +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"walletpassphrase\",\"password\":\"kashifAli!123\",\"timeout\":300}" +echo "" + +echo "Generating new address" +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getnewaddress\",\"account\":\"kashif\"}" >/tmp/newAddresses +echo "" + ./json_extract /tmp/newAddresses address + diff --git a/iguana/Kashi/Reg_bitcoinRPCs b/iguana/Kashi/Reg_bitcoinRPCs new file mode 100755 index 000000000..5c8b0bdf5 --- /dev/null +++ b/iguana/Kashi/Reg_bitcoinRPCs @@ -0,0 +1,1034 @@ +#!/bin/bash +clear +printf "\n" +echo " ***************************************" +echo " * IGUANA *" +echo " * Automated RPC REGRESSION Testing *" +echo " * Script *" +echo " ***************************************" +printf "\n" +printf "\t\t\tTest started at %s\n\n\n" "$(date)" + + +# declaring global integer variables +declare -ix failed=0 +declare -ix passed=0 +declare -ix addr_match=0 +declare -ix addr_unmatch=0 +declare -ix addr_match_sa=0 +declare -ix addr_unmatch_sa=0 + +startCoin="BTCD" + + +# RPC START BTCD COIN +printf "Executing [RPC: startBTCD]\n" +printf "==============================\n" +~/tests/./startBTCD_p2p > /tmp/startBTCD_p2p.txt +printf "\n" + +# call json_extract script to get the RPC result value +result=$(~/tests/./json_extract /tmp/startBTCD_p2p.txt result) +error=$(~/tests/./json_extract /tmp/startBTCD_p2p.txt error) + + if [ "$result" != "coin added" ] + then + printf "RESULT_STARTBTCD_ERROR MISMATCH(result -> %s)\n" "$result" + printf "info: BTCD coin should have been added successfully!\n\n" + fi + + if [ "$result" == "coin added" ] + then + printf "RESULT_PASSED: RPC START BTCD\n\n" + let passed+=1 + rm -f /tmp/startBTCD_p2p.txt + + else + printf "RESULT_FAILED:RPC START BTCD (%s)\n\n" "$error" + let failed+=1 + fi + +# ACTIVE HANDLE RPC before WALLETPASSPHRASE +printf "\n" +sleep 3 + +printf "Executing [RPC: ACTIVEHANDLE]\n" +printf "==============================\n" + +~/tests/./activehandle > /tmp/activehandle.txt +printf "\n +" +# call json_extract script to get the RPC status value +Wstatus=$(~/tests/./json_extract /tmp/activehandle.txt status) +err_ah=$(~/tests/./json_extract /tmp/activehandle.txt error) + + if [ "$Wstatus" != "locked" ] + then + printf "RESULT_ACTIVEHANDLE_ERROR MISMATCH(STATUS -> %s)\n" "$Wstatus" + printf "info: wallet should be \n\n" + fi + + if [ "$Wstatus" == "locked" ] + then + printf "RESULT_PASSED: RPC ACTIVEHANDLE\n\n" + let passed+=1 + rm -f /tmp/activehandle.txt + + else + printf "RESULT_FAILED: RPC ACTIVEHANDLE (%s)\n\n" "$err_ah" + let failed+=1 + fi + +# GETINFO RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: GETINFO]\n" +printf "==============================\n" + +~/tests/./getinfo > /tmp/getinfo.txt +printf "\n" + +# call json_extract script to get the RPC status value +r_getinfo=$(~/tests/./json_extract /tmp/getinfo.txt result) +err_getinfo=$(~/tests/./json_extract /tmp/getinfo.txt error) + + if [ "$r_getinfo" == "success" ] + then + printf "RESULT_PASSED: RPC GET INFO\n\n" + let passed+=1 + rm -f /tmp/getinfo.txt + + else + printf "RESULT_FAILED: RPC GET INFO(%s)\n\n" "$err_getinfo" + let failed+=1 + fi + +# ENCRYPTWALLET RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: ENCRYPTWALLET]\n" +printf "==================================\n" + +~/tests/./encryptwallet_SP > /tmp/encryptwallet_SP +printf "\n" + +# call json_extract script to get the RPC status & result values +r_ew=$(~/tests/./json_extract /tmp/encryptwallet_SP result) +s_ew=$(~/tests/./json_extract /tmp/encryptwallet_SP status) +err_ew=$(~/tests/./json_extract /tmp/encryptwallet_SP error) + + if [ "$s_ew" != "unlocked" ] + then + printf "RESULT_ENCRYPTWALLET_ERROR MISMATCH(STATUS -> %s)\n" "$s_ew" + printf "info: wallet should have \n\n" + fi + + if [ "$r_ew" == "success" ] && [ "$s_ew" == "unlocked" ] + then + printf "RESULT_PASSED: RPC ENCRYPTWALLET\n\n" + let passed+=1 + rm -f /tmp/encryptwallet_SP + + else + printf "RESULT_FAILED: RPC ENCRYPTWALLET (%s)\n\n" "$err_ew" + let failed+=1 + + fi + +# WALLETPASSPHRASE RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: WALLETPASSPHRASE]\n" +printf "==============================\n" + +~/tests/./walletpassphrase_WVP > /tmp/walletpassphrase_WVP +printf "\n" + +# call json_extract script to get the RPC status & result values +r_wpp=$(~/tests/./json_extract /tmp/walletpassphrase_WVP result) +s_wpp=$(~/tests/./json_extract /tmp/walletpassphrase_WVP status) +err_wpp=$(~/tests/./json_extract /tmp/walletpassphrase_WVP error) + + if [ "$s_wpp" != "unlocked" ] + then + printf "RESULT_WALLETPASSPHRASE_ERROR MISMATCH(STATUS -> %s)\n" "$s_wpp" + printf "info: wallet should be \n" + fi + + + if [ "$r_wpp" == "success" ] && [ "$s_wpp" == "unlocked" ] + then + printf "RESULT_PASSED: RPC WALLETPASSPHRASE\n\n" + let passed+=1 + rm -f /tmp/walletpassphrase_WVP + + else + printf "RESULT_FAILED: RPC WALLETPASSPHRASE (%s)\n\n" "$err_wpp" + let failed+=1 + fi + +# WALLETLOCK + +sleep 3 +printf "\n" + +printf "Executing [RPC: WALLETLOCK]\n" +printf "==============================\n" + +result=$(~/tests/./walletlock) +printf "\n" + + + if [ "$result" != "success" ] + then + printf "RESULT_WALLETLOCK_ERROR MISMATCH(STATUS -> %s)\n" "$result" + printf "info: wallet should be \n\n" + fi + + + if [ "$result" == "success" ] + then + printf "RESULT_PASSED: RPC WALLETLOCK\n\n" + let passed+=1 + + else + printf "RESULT_FAILED: RPC WALLETLOCK (%s)\n\n" "$result" + let failed+=1 + fi + + +# WALLETPASSPHRASE RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: WALLETPASSPHRASE]\n" +printf "==============================\n" + +~/tests/./walletpassphrase_WVP > /tmp/walletpassphrase_WVP +printf "\n" + +# call json_extract script to get the RPC status & result values +r_wpp=$(~/tests/./json_extract /tmp/walletpassphrase_WVP result) +s_wpp=$(~/tests/./json_extract /tmp/walletpassphrase_WVP status) +err_wpp=$(~/tests/./json_extract /tmp/walletpassphrase_WVP error) + + if [ "$s_wpp" != "unlocked" ] + then + printf "RESULT_WALLETPASSPHRASE_ERROR: MISMATCH(STATUS -> %s)\n" "$s_wpp" + printf "info: wallet should be \n\n" + fi + + + if [ "$r_wpp" == "success" ] && [ "$s_wpp" == "unlocked" ] + then + printf "RESULT_PASSED: RPC WALLETPASSPHRASE\n\n" + rm -f /tmp/walletpassphrase_WVP + + else + printf "RESULT_FAILED: RPC WALLETPASSPHRASE (%s)\n\n" "$err_wpp" + fi + + + +# CHECKWALLET RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: CEHCKWALLET]\n" +printf "==============================\n" + +~/tests/./checkwallet > /tmp/checkwallet +printf "\n" + +# call json_extract script to get the RPC status & result values +b_cw=$(~/tests/./json_extracti /tmp/checkwallet bad) +err_cw=$(~/tests/./json_extracti /tmp/checkwallet error) + +if [ "$b_cw" -ne 0 ] + then + printf "RESULT_CHECKWALLET_ERROR MISMATCH(BAD -> %d)\n" "$b_cw" + printf "info: bad should be <0>\n\n" +fi + + if [ "$b_cw" -eq 0 ] + then + printf "RESULT_PASSED: RPC CHECKWALLET\n\n" + let passed+=1 + rm -f /tmp/checkwallet + + else + printf "RESULT_FAILED: ERROR: %s\n\n" + let failed+=1 + fi + + +# ACTIVE HANDLE RPC after WALLETPASSPHRASE +printf "\n" +sleep 3 + +printf "Executing [RPC: ACTIVEHANDLE]\n" +printf "==============================\n" + +~/tests/./activehandle > /tmp/activehandle.txt +printf "\n +" +# call json_extract script to get the RPC status value +Wstatus=$(~/tests/./json_extract /tmp/activehandle.txt status) +err_ah=$(~/tests/./json_extract /tmp/activehandle.txt error) + + if [ "$Wstatus" != "unlocked" ] + then + printf "RESULT_ACTIVEHANDLE_ERROR MISMATCH(STATUS -> %s)\n" "$Wstatus" + printf "info: Wallet should have \n\n" + fi + + + if [ "$Wstatus" == "unlocked" ] + then + printf "RESULT_PASSED: RPC ACTIVEHANDLE\n\n" + let passed+=1 + rm -f /tmp/activehandle.txt + + else + printf "RESULT_FAILED: RPC ACTIVEHANDLE(%s)\n\n" "$err_ah" + let failed+=1 + fi + + + +# WALLETPASSPHRASE RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: WALLETPASSPHRASE]\n" +printf "==============================\n" + +~/tests/./walletpassphrase_WVP > /tmp/walletpassphrase_WVP +printf "\n" + +# call json_extract script to get the RPC status & result values +r_wpp=$(~/tests/./json_extract /tmp/walletpassphrase_WVP result) +s_wpp=$(~/tests/./json_extract /tmp/walletpassphrase_WVP status) +err_wpp=$(~/tests/./json_extract /tmp/walletpassphrase_WVP error) + + if [ "$s_wpp" != "unlocked" ] + then + printf "RESULT_WALLETPASSPHRASE_ERROR (STATUS -> %s)\n" "$s_wpp" + printf "info: wallet should be \n\n" + fi + + + if [ "$r_wpp" == "success" ] && [ "$s_wpp" == "unlocked" ] + then + printf "RESULT_PASSED: RPC WALLETPASSPHRASE\n\n" + let passed+=1 + rm -f /tmp/walletpassphrase_WVP + + else + printf "RESULT_FAILED: RPC WALLETPASSPHRASE (%s)\n\n" "$err_wpp" + let failed+=1 + fi + + +# BACKUPWALLET RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: BACKUPWALLET]\n" +printf "=================================\n" + +~/tests/./backupwallet > /tmp/backupwallet +printf "\n" + +# call json_extract script to get the RPC status value +r_bw=$(~/tests/./json_extract /tmp/backupwallet result) +err_bw=$(~/tests/./json_extract /tmp/backupwallet error) + + + if [ "$r_bw" != "wallet backup saved" ] + then + printf "RESULT_BACKUPWALLET_ERROR MISMATCH (RESULT -> %s)\n" "$r_bw" + printf "info: wallet backup should be \n\n" + fi + + if [ "$r_bw" == "wallet backup saved" ] + then + printf "RESULT_PASSED: RPC BACKUPWALLET\n\n" + let passed+=1 + rm -f /tmp/walletpassphrase_WVP + + else + printf "RESULT_FAILED: RPC BACKUPWALLET (%s)\n" "$err_bw" + let failed+=1 + fi + + +#GETACCOUNTADDRESS RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: GETACCOUNTADDRESS]\n" +printf "=====================================\n" + +~/tests/./getaccountaddress_WVA > /tmp/getaccountaddress_WVA +printf "\n" + +# call json_extract script to get the RPC status value +addr_gaa=$(~/tests/./json_extract /tmp/getaccountaddress_WVA address) +acc_gaa=$(~/tests/./json_extract /tmp/getaccountaddress_WVA account) +pkey_gaa=$(~/tests/./json_extract /tmp/getaccountaddress_WVA pubkey) +r_gaa=$(~/tests/./json_extract /tmp/getaccountaddress_WVA result) +err_gaa=$(~/tests/./json_extract /tmp/getaccountaddress_WVA error) + + +if [ "$acc_gaa" != "IGUANA" ] +then + printf "RESULT_GETACCOUNTADDRESS_ERROR MISMATCH (ACCOUNT -> %s)\n" "$acc_gaa" + printf "info: Account should be created!\n\n" +fi + + + if [ "$acc_gaa" == "IGUANA" ] && [ "$r_gaa" == "success" ] + then + printf "RESULT_PASSED: RPC GETACCOUNTADDRESS\n\n" + let passed+=1 + rm -f /tmp/getaccountaddress_WVA + + else + printf "RESULT_FAILED: RPC GETACCOUNTADDRESS (ERROR:%s\n)" "$err_gaa" + let failed+=1 + fi + + +#GETACCOUNT RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: GETACCOUNT]\n" +printf "==============================\n" + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getaccount\",\"address\":\"$addr_gaa\"}" > /tmp/getaccount +printf "\n" + +# call json_extract script to get the RPC status value +acc_ga=$(~/tests/./json_extract /tmp/getaccount account) +r_ga=$(~/tests/./json_extract /tmp/getaccount result) +err_ga=$(~/tests/./json_extract /tmp/getaccount error) + + if [ "$acc_ga" != "$acc_gaa" ] + then + printf "RESULT_GETACCOUNT_ERROR MISMATCH(ACCOUNT -> %s)\n" "$acc_ga" + printf "info: account name should be \n\n" + fi + + if [ "$acc_ga" == "$acc_gaa" ] && [ "$r_ga" == "success" ] + then + printf "RESULT_PASSED: RPC GETACCOUNT\n\n" + let passed+=1 + rm -f /tmp/getaccount + + else + printf "RESULT_FAILED: RPC GETACCOUNT ERROR(%s)\n" "$err_ga" + let failed+=1 + fi + +#DUMPPRIVKEY RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: DUMPPRIVKEY]\n" +printf "==============================\n" + +curl -s --url "http://127.0.0.1:7778" --data "{\"method\":\"dumpprivkey\",\"params\":[\"$addr_gaa\"]}"> /tmp/dumprivkeyI +prvkey=$(cat /tmp/dumprivkeyI) +printf "\n" + + if [ "$prvkey" != "" ] + then + printf "RESULT_PASSED: RPC DUMPRIVKEY\n\n" + let passed+=1 + rm -f /tmp/dumprivkeyI + + else + printf "RESULT_FAILED: RPC DUMPPRIVKEY\n\n" + let failed+=1 + fi + + +#WIF2PRV + +sleep 3 +printf "\n" + +printf "Executing [RPC: WIF2PRV]\n" +printf "==============================\n" + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"SuperNET\",\"method\":\"wif2priv\",\"wif\":\"$prvkey\"}" > /tmp/wif2prv +privkey=$(~/tests/./json_extract /tmp/wif2prv privkey) +res=$(~/tests/./json_extract /tmp/wif2prv result) +err=$(~/tests/./json_extract /tmp/wif2prv error) + + +printf "\n" + + if [ "$privkey" != "" ] && [ "$res" == "success" ] + then + printf "RESULT_PASSED: RPC WIF2PRV\n\n" + let passed+=1 + rm -f /tmp/wif2prv + + else + printf "RESULT_FAILED: RPC WIF2PRV\n\n" + printf "ERROR: %s\n" "$err" + let failed+=1 + fi + +#PRV2PUB + +sleep 3 +printf "\n" + +printf "Executing [RPC: PRV2PUB]\n" +printf "==============================\n" + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"SuperNET\",\"method\":\"priv2pub\",\"privkey\":\"$privkey\",\"addrtype\":\"\"}"> /tmp/prv2pub + +secp256k1=$(~/tests/./json_extract /tmp/prv2pub secp256k1) +addr=$(~/tests/./json_extract /tmp/prv2pub result) +err1=$(~/tests/./json_extract /tmp/prv2pub error) + +printf "\n" + + if [ "$secp256k1" == "$pkey_gaa" ] + then + printf "RESULT_PASSED: PUBKEY/PRVKEY PAIRS MATCHES\n" + let passed+=1 + rm -f /tmp/prv2pub + + else + printf "RESULT_FAILED: PUBKEY/PRIVKEY PAIRS MISMATCH\n" + printf "SECP256K1\n" "$secp256k1" + printf "PUBKEY:\n" "$pkey_gaa" + printf "ERROR: %s\n" "$err1" + let failed+=1 + fi + +#VALIDATEPUBKEY + +sleep 3 +printf "\n" + +printf "Executing [RPC: VALIDATEPUBKEY]\n" +printf "==============================\n" + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"validatepubkey\",\"pubkey\":\"$secp256k1\"}"> /tmp/validatepubkey + +pubkey=$(~/tests/./json_extract /tmp/validatepubkey pubkey) +result=$(~/tests/./json_extract /tmp/validatepubkey result) +coin=$(~/tests/./json_extract /tmp/validatepubkey coin) +address=$(~/tests/./json_extract /tmp/validatepubkey address) +err1=$(~/tests/./json_extract /tmp/validatepubkey error) + +if [ "$pubkey" != "$secp256k1" ] +then + printf "RESULT_VALIDATEPUBKEY_ERROR MISMATCH(pubkey-> <%s>)\n" "$pubkey" + printf "info: PUBKEY should be <%s>\n\n" "$secp256k1" +fi + +if [ "$result" != "success" ] +then + printf "RESULT_VALIDATEPUBKEY_ERROR MISMATCH(result-> %s)\n" "$result" + printf "info: Result should be \n\n" +fi + +if [ "$coin" != "$startCoin" ] +then + printf "RESULT_VALIDATEPUBKEY_ERROR MISMATCH(result-> %s)\n" "$coin" + printf "info: COIN should be <%s>\n" "$startCoin" +fi + +printf "\n" + + if [ "$secp256k1" == "$pkey_gaa" ] + then + printf "RESULT_PASSED: PUBKEY/PRVKEY PAIRS MATCHES\n\n" + let passed+=1 + rm -f /tmp/prv2pub + + else + printf "RESULT_FAILED: PUBKEY/PRIVKEY PAIRS MISMATCH\n\n" + printf "ERROR: %s\n" "$err1" + let failed+=1 + fi + + + + +#GETADDRESSBYACCOUNT RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: GETADDRESSBYACCOUNT]\n" +printf "========================================\n" + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getaddressesbyaccount\",\"account\":\"$acc_ga\"}" > /tmp/getaddressbyaccount + +# call json_extract script to get the RPC status value +addr_gaba=$(~/tests/./json_extracta /tmp/getaddressbyaccount result) +err_gaba=$(~/tests/./json_extracta /tmp/getaddressbyaccount error) + + +#split the string based on delims[,] and get the array of addresses returned in addr_gaba + +addrs=$(echo $addr_gaba | tr "[,]" "\n") + +if [ -z "$addrs" ] +then + printf "RESULT_GETADDRESSBYACCOUNT_ERROR\n" + printf "info: address list returned by GETADDRESSBYACCOUNT RPC!\n\n" + let addr_unmatch+=1 + +else + + +for iguana_addrs in $addrs +do + +# split the address string again based on delim "" from iguana_addrs +actual_addrs=($(echo $iguana_addrs | tr -d '""')) + +# call GETACCOUNT RPC to get the account name associated with that address and match it with account created with RPC GETACCOUNTADDRESS + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getaccount\",\"address\":\"$actual_addrs\"}"> /tmp/getaccount + +# call json_extract script to get the RPC status value +acc_name=$(~/tests/./json_extract /tmp/getaccount account) + + if [ "$acc_name" != "$acc_gaa" ] + then + printf "RESULT_GETACCOUNTBYADDRESS_ERROR MISMATCH(ACCOUNT -> %s\n)" "$acc_name" + printf "info: ACCOUNT name should be iguana becuase all addresses associated with IGUANA account\n\n" + fi + + if [ "$acc_name" == "$acc_gaa" ] + then + let addr_match+=1 + IGUANA_ADDR=$actual_addrs + + else + let addr_unmatch+=1 + printf "RESULT_MISMATCH_addr:%s\n" "$actual_addrs" + fi + +done +fi + +if [ "$addr_unmatch" -eq 0 ] +then + printf "RESULT_PASSED: RPC GETADDRESSBYACCOUNT\n\n" + let passed+=1 + rm -f /tmp/getaddressbyaccount +else + printf "RESULT_FAILED: RPC GETADDRESSBYACCOUNT\n\n" + let failed+=1 +fi + +#SETTX RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: SETTX]\n" +printf "=====================================\n" + +~/tests/./settx > /tmp/settx +printf "\n" + +# call json_extract script to get the RPC results value +r_st=$(~/tests/./json_extracti /tmp/settx result) +err_st=$(~/tests/./json_extracti /tmp/settx error) + +if [ "$r_st" != "true" ] +then + printf "RESULT_SETTX_ERROR MISMATCH(result -> %s)\n" "$r_st" + printf "info: settx should \n\n" +fi + + if [ "$r_st" == "true" ] + then + printf "RESULT_PASSED: RPC SETTX\n\n" + let passed+=1 + rm -f /tmp/settx + + else + printf "RESULT_FAILED: RPC SETTX\n" + printf "ERROR: %s \n\n" "$err_st" + let failed+=1 + fi + +#GETBESTBLOCKHASH RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: GETBESTBLOCKHASH]\n" +printf "=====================================\n" + +~/tests/./getbestblockhash > /tmp/getbestblockhash +printf "\n" + +# call json_extract script to get the RPC results value +r_gbbh=$(~/tests/./json_extract /tmp/getbestblockhash result) +err_gbbh=$(~/tests/./json_extract /tmp/getbestblockhash error) + +if [ "$r_gbbh" == "" ] +then + printf "RESULT_GETBESTBLOCKHASH_ERROR\n\n" +fi + + if [ "$r_gbbh" != "0000000000000000000000000000000000000000000000000000000000000000" ] + then + printf "RESULT_PASSED: RPC GETBESTBLOCKHASH\n\n" + let passed+=1 + rm -f /tmp/getbestblockhash + + else + printf "RESULT_FAILED: RPC GETBESTBLOCKHASH\n\n" + printf "ERROR: %s \n\n" "$err_gbbh" + let failed+=1 + fi + + +#GETBLOCKHASH RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: GETBLOCKHASH]\n" +printf "=====================================\n" + +~/tests/./getblockhash > /tmp/getblockhash +printf "\n" + +# call json_extract script to get the RPC results value +r_gbh=$(~/tests/./json_extract /tmp/getblockhash result) +err_gbh=$(~/tests/./json_extract /tmp/getblockhash error) + +if [ "$r_gbh" != "50a4f738d4319ad1f437df56ec90fdfb2592b95f5508db379c41227b2cc992c0" ] +then + printf "RESULT_GETBLOCKHASH_ERROR MISMATCH (hash -> %s)\n\n" "$r_gbh" + printf "info: Hash should be <50a4f738d4319ad1f437df56ec90fdfb2592b95f5508db379c41227b2cc992c0>\n\n" +fi + + if [ "$r_gbh" == "50a4f738d4319ad1f437df56ec90fdfb2592b95f5508db379c41227b2cc992c0" ] + then + printf "RESULT_PASSED: RPC GETBLOCKHASH\n\n" + let passed+=1 + rm -f /tmp/getblockhash + + else + printf "RESULT_FAILED: RPC GETBLOCKHASH\n\n" + printf "ERROR: %s\n\n" "$err_gaa" + let failed+=1 + fi + + +#GETBLOCK RPC +printf "\n" + +printf "Executing [RPC: GETBLOCK]\n" +printf "============================\n" + +~/tests/./getblock > /tmp/getblock +printf "\n" + +# call json_extract script to get the RPC results value +r_gb=$(~/tests/./json_extract /tmp/getblock result) +bh_gb=$(~/tests/./json_extract /tmp/getblock hash) +h_gb=$(~/tests/./json_extracti /tmp/getblock height) +ver_gb=$(~/tests/./json_extracti /tmp/getblock version) +prvblock_gb=$(~/tests/./json_extract /tmp/getblock previousblockhash) +nxtblock_gb=$(~/tests/./json_extract /tmp/getblock nextblockhash) +err_gb=$(~/tests/./json_extract /tmp/getblock error) + +# get previous block header hash + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getblockhash\",\"height\":\"345323\"}" > /tmp/prvblockheader + +prvbh=$(./json_extract /tmp/prvblockheader result) + +# get nex block header hash + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getblockhash\",\"height\":\"345325\"}" > /tmp/nxtblockheader + +nxtbh=$(./json_extract /tmp/nxtblockheader result) + + if [ "$r_gb" != "success" ] + then + printf "RESULT_GETBLOCK_ERROR MISMATCH ( RESULT -> %s)\n" "$r_gb" + printf "info: RESULT should be \n\n" + fi + + if [ "$bh_gb" != "$r_gbh" ] + then + printf "RESULT_GETBLOCK_ERROR MISMATCH ( HASH -> %s)\n" "$bh_gb" + printf "info: HASH should be <%s>\n\n" "$r_gbh" + fi + + if [ "$h_gb" -ne 345324 ] + then + printf "RESULT_GETBLOCK_ERROR MISMATCH ( HEIGHT -> %d)\n" "$h_gb" + printf "info: Height should be <345324>\n\n" + fi + + if [ "$ver_gb" -ne 1 ] + then + printf "RESULT_GETBLOCK_ERROR MISMATCH (VERSION -> %d)\n" "$ver_gb" + printf "info: Version should be <1>\n\n" + fi + + if [ "$prvblock_gb" != "$prvbh" ] + then + printf "RESULT_GETBLOCK_ERROR MISMATCH(PRVIOUS_BLOCK -> %s)\n" "$prvblock_gb" + printf "info: Previous block should be <%s>\n\n" "$prvbh" + fi + + if [ "$nxtblock_gb" != "$nxtbh" ] + then + printf "RESULT_GETBLOCK_ERROR MISMATCH (NEXT_BLOCK -> %s)\n" "$nxtblock_gb" + printf "info: Next Block should be <%s>\n\n" "$nxtbh" + fi + + if [ "$r_gb" == "success" ] && [ "$bh_gb" == "$r_gbh" ] && [ "$h_gb" -eq 345324 ] && [ "$ver_gb" -eq 1 ] && [ "$prvblock_gb" == "$prvbh" ] && [ "$nxtblock_gb" == "$nxtbh" ] + then + printf "RESULT_PASSED: RPC GETBLOCK\n\n" + let passed+=1 + rm -f /tmp/getblock + + else + printf "RESULT_FAILED: RPC GETBLOCK\n" + printf "ERROR: %s : %s\n\n" "$err_gb" + let failed+=1 + fi + +#GETNEWADDRESS RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: GETNEWADDRESS]\n" +printf "=====================================\n" + +~/tests/./getnewaddress > /tmp/getnewaddress +printf "\n" + +# call json_extract script to get the RPC results value +r_gna=$(~/tests/./json_extract /tmp/getnewaddress result) +c_gna=$(~/tests/./json_extract /tmp/getnewaddress coin) +acc_gna=$(~/tests/./json_extract /tmp/getnewaddress account) +addr_gna=$(~/tests/./json_extract /tmp/getnewaddress address) +err_gna=$(~/tests/./json_extract /tmp/getnewaddress error) + + if [ "$addr_gna" == "" ] + then + printf "RESULT_GETNEWADDRESS_ERROR MISMATCH(ADDRESS -> %s)\n" "$addr_gna" + printf "info: ADDRESS was generated!\n\n" + fi + + if [ "$acc_gna" != "IGUANA" ] + then + printf "RESULT_GETNEWADDRESS_ERROR MISMATCH (ACCOUNT -> %s)\n" "$acc_gna" + printf "info: Account name should be \n\n" + fi + + if [ "$r_gna" != "success" ] + then + printf "RESULT_GETNEWADDRESS_ERROR MISMATCH (RESULT -> %s)\n" "$r_gna" + printf "info: Result should be \n\n" + fi + + if [ "$c_gna" != "$startCoin" ] + then + printf "RESULT_GETNEWADDRESS_ERROR MISMATCH (COIN -> %s)\n" "$c_gna" + printf "info: Coin should be <%s>!\n\n" "$startCoin" + fi + + + if [ "$r_gna" == "success" ] && [ "$c_gna" == "$startCoin" ] && [ "$acc_gna" == "IGUANA" ] && [ "$addr_gna" != "" ] + then + printf "RESULT_PASSED: RPC GETNEWADDRESS\n\n" + let passed+=1 + rm -f /tmp/getnewaddress + + else + printf "RESULT_FAILED: RPC GETNEWADDRESS\n" + printf "ERROR: %s:\n\n" "$err_gna" + let failed+=1 + fi + +#SIGNMESSAGE RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: SIGNMESSAGE]\n" +printf "=====================================\n" + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"signmessage\",\"address\":\"$addr_gna\",\"message\":\"testMessage\"}" > /tmp/signmessage +printf "\n" + +# call json_extract script to get the RPC results value +r_sm=$(~/tests/./json_extract /tmp/signmessage result) +err_sm=$(~/tests/./json_extract /tmp/signmessage error) + + if [ "$r_sm" == "" ] + then + printf "RESULT_SIGNMESSAGE_ERROR MISMATCH(result -> %s)\n" "$r_sm" + printf "info: SIGNMESSAGE was generated!\n\n" + fi + + if [ "$r_sm" != "" ] + then + printf "RESULT_PASSED: RPC SIGNMESSAGE\n\n" + let passed+=1 + rm -f /tmp/signmessage + + else + printf "RESULT_FAILED: RPC SIGNMESSAGE\n" + let failed+=1 + fi + +#VERIFYMESSAGE RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: VERIFYMESSAGE]\n" +printf "=====================================\n" + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"verifymessage\",\"address\":\"$addr_gna\",\"sig\":\"$r_sm\",\"message\":\"testMessage\"}" > /tmp/verifymessage +printf "\n" + +# call json_extract script to get the RPC results value +r_vm=$(~/tests/./json_extract /tmp/verifymessage result) +addr_vm=$(~/tests/./json_extract /tmp/verifymessage address) +m_vm=$(~/tests/./json_extract /tmp/verifymessage message) +err_vm=$(~/tests/./json_extract /tmp/verifymessage error) + + if [ "$r_vm" != "true" ] + then + printf "RESULT_VERIFYMESSAGE_ERROR MISMATCH(result -> %s)\n" "$r_vm" + printf "info: Result should have been \n\n" + fi + + if [ "$addr_vm" != "$addr_gna" ] + then + printf "RESULT_VERIFYMESSAGE_ERROR MISMATCH(addr -> %s)\n" "$addr_vm" + printf "info: Address should have been <%s>\n\n" "$addr_vm" + fi + + if [ "$m_vm" != "testMessage" ] + then + printf "RESULT_VERIFYMESSAGE_ERROR MISMATCH(Message -> %s)\n" "$m_vm" + printf "info: Message should have been \n\n" + fi + + + + if [ "$r_vm" == "true" ] && [ "$addr_vm" == "$addr_gna" ] && [ "$m_vm" == "testMessage" ] + then + printf "RESULT_PASSED: RPC VERIFYMESSAGE\n\n" + let passed+=1 + rm -f /tmp/verifymessage + + else + printf "RESULT_FAILED: RPC VERIFYMESSAGE\n" + let failed+=1 + fi + + +#SETACCOUNT RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: SETACCOUNT]\n" +printf "=====================================\n" + +result=$(curl -s --url "http://127.0.0.1:7778" --data "{\"method\":\"setaccount\",\"params\":[\"$addr_gna\", \"iguana_change\"]}") +printf "\n" + +# Executing getaddressbyaccount rpc to verify that setaccout rpc has successfully associate the particular address to particular account + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getaddressesbyaccount\",\"account\":\"iguana_change\"}" >/tmp/iguana_change + + + # call json_extract script to get the RPC status value +addr_sa=$(~/tests/./json_extracta /tmp/iguana_change result) +err_sa=$(~/tests/./json_extracta /tmp/iguana_change error) + + +#split the string based on delims[,] and get the array of addresses returned in addr_gaba + +addrs_sa=$(echo $addr_sa | tr "[,]" "\n") + +if [ -z "$addrs_sa" ] +then + printf "RESULT_SETACCOUNT_ERROR\n" + printf "info: address list returned by SETACCOUNT RPC!\n\n" + let addr_unmatch_sa+=1 + +else + + for iguana_addr in $addrs_sa + do + +# split the address string again based on delim "" from iguana_addrs +actual_addr_sa=($(echo $iguana_addr | tr -d '""')) + +# call GETACCOUNT RPC to get the account name associated with that address and match it with account created with RPC GETNEWADDRESS + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getaccount\",\"address\":\"$actual_addr_sa\"}"> /tmp/getaccount + +# call json_extract script to get the RPC status value +acc_name_sa=$(~/tests/./json_extract /tmp/getaccount account) + + if [ "$acc_name_sa" != "iguana_change" ] + then + printf "RESULT_SETACCOUNT_ERROR MISMATCH(ACCOUNT -> %s\n)" "$acc_name_sa" + printf "info: ACCOUNT name should be iguana_change\n\n" + let addr_unmatch_sa+=1 + + fi + + if [ "$addr_gna" != "$actual_addr_sa" ] + then + printf "RESULT_SETACCOUNT_ERROR MISMATCH(ADDRESS -> %s\n)" "$actual_addr_sa" + printf "info: ADDRESS should be <%s>\n\n" "$addr_gna" + let addr_unmatch_sa+=1 + + + fi + + if [ "$addr_unmatch_sa" -eq 0 ] + then + let addr_match_sa+=1 + + else + let addr_unmatch_sa+=1 + fi + + done +fi + +if [ "$addr_unmatch_sa" -eq 0 ] +then + printf "RESULT_PASSED: RPC SETACCOUNT\n\n" + let passed+=1 + rm -f /tmp/getaddressbyaccount +else + printf "RESULT_FAILED: RPC SETACCOUNT\n\n" + let failed+=1 +fi + +printf "\n\n" +printf "Regression Test FINISHED: PASSED=%i FAILED=%i\n" "$passed" "$failed" +printf "\n" + + diff --git a/iguana/Kashi/activehandle b/iguana/Kashi/activehandle new file mode 100755 index 000000000..113cd1057 --- /dev/null +++ b/iguana/Kashi/activehandle @@ -0,0 +1 @@ +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"SuperNET\",\"method\":\"activehandle\"}" diff --git a/iguana/Kashi/addmultisig b/iguana/Kashi/addmultisig new file mode 100755 index 000000000..10891244b --- /dev/null +++ b/iguana/Kashi/addmultisig @@ -0,0 +1,2 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"addmultisig\",\"params\":[2, [\"1CHzgAakwGCvGX2BG1duWygDuVE6s7tzZ6\", \"d0296ed1364639c696c374730320480301f3194c86231f62f0409cd76467f87c\", \"d045925b3e6f648bca6ed0c65149ee445137f0ab14e88cf60013d88419bcdd60\"], \"msigs\"]}" + diff --git a/iguana/Kashi/backupwallet b/iguana/Kashi/backupwallet new file mode 100755 index 000000000..5c8af9a8c --- /dev/null +++ b/iguana/Kashi/backupwallet @@ -0,0 +1 @@ +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"backupwallet\",\"filename\":\"wallet1.txt\"}" diff --git a/iguana/Kashi/bitcoinrpc b/iguana/Kashi/bitcoinrpc new file mode 100755 index 000000000..dba1bd3de --- /dev/null +++ b/iguana/Kashi/bitcoinrpc @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"SuperNET\",\"method\":\"bitcoinrpc\",\"setcoin\":\"$1\"}" diff --git a/iguana/Kashi/bjsoncmp.c b/iguana/Kashi/bjsoncmp.c new file mode 100755 index 000000000..04ab98dd5 --- /dev/null +++ b/iguana/Kashi/bjsoncmp.c @@ -0,0 +1,47 @@ +#include +#include +#include "../../includes/cJSON.h" +#include "../../crypto777/OS_portable.h" + +int32_t main(int32_t argc,char **argv) +{ + cJSON *argjson,*array,*filejson,*obj,*fobj; char *fname,*filestr,*fstr,*str,*field; int32_t i,n; long filesize; + printf("argv[2]: %s\n",argv[2]); + if ( argc > 2 && (argjson= cJSON_Parse(argv[2])) != 0 ) + { + fname = argv[1]; + printf("got file: %s\n",fname); + if ( (filestr= OS_filestr(&filesize,fname)) != 0 ) + { + if ( (filejson= cJSON_Parse(filestr)) != 0 ) + { + if ( (array= jarray(&n,argjson,"fields")) != 0 ) + { + for (i=0; ichild) != 0 ) + { + if ( (fobj= jobj(filejson,field)) != 0 ) + { + fstr = jprint(fobj,0); + str = jprint(obj,0); + if ( strcmp(fstr,str) != 0 ) + { + printf("{\"error\":\"field.(%s) in (%s) i.%d of n.%d mismatch (%s) != (%s)\"}\n",field,fname,i,n,fstr,str); + fprintf(stderr,"{\"error\":\"field.(%s) in (%s) i.%d of n.%d mismatch (%s) != (%s)\"}\n",field,fname,i,n,fstr,str); + } + else printf("{\"result\":\"MATCHED.[%s] (%s).(%s)\"}\n",fname,field,fstr); + free(str); + free(fstr); + } else fprintf(stderr,"cant find field.(%s) in (%s)\n",field,fname); + } else fprintf(stderr,"no fieldname array[%d]\n",i); + } + } else fprintf(stderr,"no fields array\n"); + free_json(filejson); + } else fprintf(stderr,"cant parse.(%s)\n",filestr); + free(filestr); + } else fprintf(stderr,"cant load (%s)\n",fname); + } else fprintf(stderr,"argc.%d fname.(%s) error\n",argc,argv[1]); +} + diff --git a/iguana/Kashi/checkwallet b/iguana/Kashi/checkwallet new file mode 100755 index 000000000..9a74a45e5 --- /dev/null +++ b/iguana/Kashi/checkwallet @@ -0,0 +1,5 @@ +#!/bin/bash + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"checkwallet\"}" + + diff --git a/iguana/Kashi/createmultisig b/iguana/Kashi/createmultisig new file mode 100755 index 000000000..3ebde792c --- /dev/null +++ b/iguana/Kashi/createmultisig @@ -0,0 +1,7 @@ +#!/bin/bash + + +#curl --url "http://127.0.0.1:7778" --data "{\"method\":\"createmultisig\",\"params\":[2, [\"026b49ef6a53346455a947c462bbb2a6af25d68ea08fcacb9c288dc7ca727937fe\"]}" + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"createmultisig\",\"Message\":\"1\",\"pubkeys\":\"026b49ef6a53346455a947c462bbb2a6af25d68ea08fcacb9c288dc7ca727937fe\",\"ignore\":\"\"}" + diff --git a/iguana/Kashi/createrawtransaction b/iguana/Kashi/createrawtransaction new file mode 100755 index 000000000..c34c63b49 --- /dev/null +++ b/iguana/Kashi/createrawtransaction @@ -0,0 +1,2 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"createrawtransaction\",\"params\":[[{\"txid\":\"d8e4c1e92fad9e58ecc3352f35b90298fc0b81241577897b11f414ee88ff11e3\",\"vout\":1}], {\"RAoMou7euzvDwa9dQwjrNB5A41hrAWgvBt\":0.01}]}" + diff --git a/iguana/Kashi/decoderawtransaction b/iguana/Kashi/decoderawtransaction new file mode 100755 index 000000000..3d30869e0 --- /dev/null +++ b/iguana/Kashi/decoderawtransaction @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"decoderawtransaction\",\"params\":[\"9869064cd9d571ebc6690cd42dcefeafa2245af625da0e9d34dd540cca3ca6c2","signedtx":"010000005280b357019a1cfa971b8f66f39494d8ec369cfcdbc5096461f52a6d71ec23d9b5867b67a9010000006b483045022100dcffe92e3d1d74a55341f4262141ee0ccff56778d5df58922e00451303f82384022039d5162c9369aaa42d5d20b685b8656fe52cf95313c41d235da71b3b29a353b001210300f1c5870675f3fb332213967ebf6a6af16a036cd324297afc6c32a2d27a0953ffffffff02409c0000000000001976a914b7592ae8a9edd516e6b64731bf575ed5c094fc6288acb0feea0b000000001976a914c7d64ee16ec73e65a7274271170081100f09f89388ac00000000\"]}" diff --git a/iguana/Kashi/decoderawtransactionB b/iguana/Kashi/decoderawtransactionB new file mode 100755 index 000000000..5338b3df9 --- /dev/null +++ b/iguana/Kashi/decoderawtransactionB @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"decoderawtransaction\",\"params\":[\"01000000dc4f24570156bb006164173811be6647f68f9a46eab4322e6fdef816aeb3e71e419ca49bfe180000006a473044022027e0e1983c88832e9adcad681692e905333f32905553bedc6df2fcacc250574d0220259aa91c7fb0378561c37477c2b5e7872b5c9a1daababe087945639fe79593e0012102d14a195654f536df6dfe5a38278d1b470d00f17de78eeb5ce9e9eea9edb2c212ffffffff01588c0200000000001976a914d8b8c039206af6cec82bca950f592801e62808cb88ac00000000\"]}" diff --git a/iguana/Kashi/decodescript b/iguana/Kashi/decodescript new file mode 100755 index 000000000..c3d245b46 --- /dev/null +++ b/iguana/Kashi/decodescript @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"decodescript\",\"scriptstr\":\"76a914dcc39f9cfc5558b09fc7862535cafc98e5a4d63088ac\"}" diff --git a/iguana/Kashi/dumpprivkey b/iguana/Kashi/dumpprivkey new file mode 100755 index 000000000..38d2ccb0e --- /dev/null +++ b/iguana/Kashi/dumpprivkey @@ -0,0 +1,9 @@ +<<<<<<< Updated upstream +<<<<<<< Updated upstream +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"dumpprivkey\",\"params\":[\"RLaBkgU3Y61VLXPNjBd2cW1RfkghXU8yHt\"]}" +======= +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"dumpprivkey\",\"params\":[\"RTzXyTyEYQAELSsSzdfG3orcNyES9jrXGX\"]}" +>>>>>>> Stashed changes +======= +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"dumpprivkey\",\"params\":[\"RTzXyTyEYQAELSsSzdfG3orcNyES9jrXGX\"]}" +>>>>>>> Stashed changes diff --git a/iguana/Kashi/dumpprivkeyB b/iguana/Kashi/dumpprivkeyB new file mode 100755 index 000000000..3c6151dc5 --- /dev/null +++ b/iguana/Kashi/dumpprivkeyB @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"dumpprivkey\",\"params\":[\"RLaBkgU3Y61VLXPNjBd2cW1RfkghXU8yHt\"]}" diff --git a/iguana/Kashi/dumpprivkeyC b/iguana/Kashi/dumpprivkeyC new file mode 100755 index 000000000..f5e88c91a --- /dev/null +++ b/iguana/Kashi/dumpprivkeyC @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"dumpprivkey\",\"params\":[\"RBNzdRUrY2iDsjucQVEtEF1jyohYLg1d7U\"]}" diff --git a/iguana/Kashi/dumpprivkeyI b/iguana/Kashi/dumpprivkeyI new file mode 100755 index 000000000..eea0e7b26 --- /dev/null +++ b/iguana/Kashi/dumpprivkeyI @@ -0,0 +1,3 @@ +#!/bin/bash + +curl -s --url "http://127.0.0.1:7778" --data "{\"method\":\"dumpprivkey\",\"params\":[\"RJy9q8GbvqKGZkHmHn6cav96fJqCREWr8d\"]}" diff --git a/iguana/Kashi/dumpprivkeyP b/iguana/Kashi/dumpprivkeyP new file mode 100755 index 000000000..3e3b60245 --- /dev/null +++ b/iguana/Kashi/dumpprivkeyP @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"dumpprivkey\",\"params\":[\"RPEz7SQ5qn3F5A1uXkab19kzwDf3ryvhvP\"]}" diff --git a/iguana/Kashi/dumpprivkeyR b/iguana/Kashi/dumpprivkeyR new file mode 100755 index 000000000..15572b565 --- /dev/null +++ b/iguana/Kashi/dumpprivkeyR @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"dumpprivkey\",\"params\":[\"522102c866c51b603e2d943774314b88aff1eb04aef3971fcf34503c8f07d27915bc1d2102e053cc9d98d9e157917ed74bcabeaf72006b1ecf019d148dd3eac06271b6bcf02102869ca05bf6b476bb8cb433e08846a67037b921062f49cd0f9f66087454e88abb53ae\"]}" diff --git a/iguana/Kashi/dumpwallet b/iguana/Kashi/dumpwallet new file mode 100755 index 000000000..5ec708ec9 --- /dev/null +++ b/iguana/Kashi/dumpwallet @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"dumpwallet\",\"params\":[]}" diff --git a/iguana/Kashi/dumpwallet_B b/iguana/Kashi/dumpwallet_B new file mode 100755 index 000000000..d5ac5bd52 --- /dev/null +++ b/iguana/Kashi/dumpwallet_B @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"dumpwallet\",\"filename\":\"dump.txt\"}" diff --git a/iguana/Kashi/encryptwallet b/iguana/Kashi/encryptwallet new file mode 100755 index 000000000..9e4bb9185 --- /dev/null +++ b/iguana/Kashi/encryptwallet @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"encryptwallet\",\"passphrase\":\"testingaccount\"}" diff --git a/iguana/Kashi/encryptwallet_LP b/iguana/Kashi/encryptwallet_LP new file mode 100755 index 000000000..8ee594037 --- /dev/null +++ b/iguana/Kashi/encryptwallet_LP @@ -0,0 +1,18 @@ +#!/bin/bash + +clear +echo "" +echo " +The encryptwallet RPC encrypts the wallet with a passphrase. +This is only to enable encryption for the first time. After encryption is enabled, +you will need to enter the passphrase to use private keys" +echo "" +echo "" + +echo "Scenario: Test encryptwallet RPC with long passphrase]" +echo "Result: Should Return status:locked" +echo "" + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"encryptwallet\",\"passphrase\":\"This is a very long passphrase i set to test the encryptwallet rpc\"}" +echo "" +echo "" diff --git a/iguana/Kashi/encryptwallet_SP b/iguana/Kashi/encryptwallet_SP new file mode 100755 index 000000000..fd8fecdf7 --- /dev/null +++ b/iguana/Kashi/encryptwallet_SP @@ -0,0 +1,4 @@ +#!/bin/bash + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"encryptwallet\",\"passphrase\":\"Admin1234@\"}" + diff --git a/iguana/Kashi/encryptwallet_WOP b/iguana/Kashi/encryptwallet_WOP new file mode 100755 index 000000000..425fb3d3f --- /dev/null +++ b/iguana/Kashi/encryptwallet_WOP @@ -0,0 +1,18 @@ +#!/bin/bash + +clear +echo "" +echo " +The encryptwallet RPC encrypts the wallet with a passphrase. +This is only to enable encryption for the first time. After encryption is enabled, +you will need to enter the passphrase to use private keys" +echo "" +echo "" + +echo "Scenario: Test encryptwallet RPC without passphrase" +echo "Result: Should Return an error message indicating passphrase required" +echo "" + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"encryptwallet\",\"passphrase\":\"\"}" +echo "" +echo "" diff --git a/iguana/Kashi/getaccount b/iguana/Kashi/getaccount new file mode 100755 index 000000000..f4ae76754 --- /dev/null +++ b/iguana/Kashi/getaccount @@ -0,0 +1,16 @@ +#!/bin/bash + +echo "" +echo " + +The getaccount RPC returns the name of the account associated with the given address. + +Parameter #1—a Bitcoin address +Result—an account name + +" +echo "" + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getaccount\",\"address\":\"RQbUDfuCitztPgJkG8edBU5dy59GD7WQqT\"}" +echo "" + diff --git a/iguana/Kashi/getaccount_WOA b/iguana/Kashi/getaccount_WOA new file mode 100755 index 000000000..ab99cc4f7 --- /dev/null +++ b/iguana/Kashi/getaccount_WOA @@ -0,0 +1,21 @@ +#!/bin/bash + +echo "" +echo " + +The getaccount RPC returns the name of the account associated with the given address. + +Parameter #1—a Bitcoin address +Result—an account name" +echo "" +echo "" + +echo "Scenario: Verify the error return incase address field is set empty" +echo "Expected: No account for that address" +echo "" + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getaccount\",\"address\":\"RSrtzi1tPkdxD9KfHkXmxDynvPqYc7scV6\"}" + +echo "" + + diff --git a/iguana/Kashi/getaccount_WVA b/iguana/Kashi/getaccount_WVA new file mode 100755 index 000000000..3ade6ad3a --- /dev/null +++ b/iguana/Kashi/getaccount_WVA @@ -0,0 +1,23 @@ +#!/bin/bash + +echo "" +echo " + +The getaccount RPC returns the name of the account associated with the given address. + +Parameter #1—a Bitcoin address +Result—an account name" +echo "" +echo "" +echo "Dependencies:" +echo "Getaccountaddress RPC, use the address return by getaccountaddress RPC" +echo "" + +echo "Scenario: Verify the valid account's name is returned" +echo "Expected: RPCtesting account name should be returned" +echo "" + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getaccount\",\"address\":\"RQ9mx8ZMc5TcrsjZ8HJmgGzGZcT1DEqM1K\"}" +echo "" + + diff --git a/iguana/Kashi/getaccountaddress b/iguana/Kashi/getaccountaddress new file mode 100755 index 000000000..0aaa95b10 --- /dev/null +++ b/iguana/Kashi/getaccountaddress @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getaccountaddress\",\"account\":\"check\"}" diff --git a/iguana/Kashi/getaccountaddress_WVA b/iguana/Kashi/getaccountaddress_WVA new file mode 100755 index 000000000..4516b64f1 --- /dev/null +++ b/iguana/Kashi/getaccountaddress_WVA @@ -0,0 +1,5 @@ +#!/bin/bash + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getaccountaddress\",\"account\":\"IGUANA\"}" + + diff --git a/iguana/Kashi/getaddressFromBundle b/iguana/Kashi/getaddressFromBundle new file mode 100755 index 000000000..6d71a4727 --- /dev/null +++ b/iguana/Kashi/getaddressFromBundle @@ -0,0 +1,2 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"bundleaddresses\",\"activecoin\":\"BTCD\",\"height\":\"500\"}" + diff --git a/iguana/Kashi/getaddressbyaccount_DA b/iguana/Kashi/getaddressbyaccount_DA new file mode 100755 index 000000000..5ab7b7e4a --- /dev/null +++ b/iguana/Kashi/getaddressbyaccount_DA @@ -0,0 +1,21 @@ +#!/bin/bash + +echo "" +echo " + +The getaddressesbyaccount RPC returns a list of every address assigned to a particular account. + +Parameter #1—the account name +Result—a list of addresses +" +echo "" +echo "Dependencies:" +echo "getaccountaddress_WVA RPC" +echo "" + +echo "Scenario: Verify the addresses associated with default account" +echo "Result: List of default account addresses" +echo "" + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getaddressesbyaccount\",\"account\":\"\"}" +echo "" diff --git a/iguana/Kashi/getaddressbyaccount_WVN b/iguana/Kashi/getaddressbyaccount_WVN new file mode 100755 index 000000000..8bf6f719d --- /dev/null +++ b/iguana/Kashi/getaddressbyaccount_WVN @@ -0,0 +1,4 @@ +#!/bin/bash + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getaddressesbyaccount\",\"account\":\"change\"}" +echo "" diff --git a/iguana/Kashi/getbalance_PA b/iguana/Kashi/getbalance_PA new file mode 100755 index 000000000..b03d1b69c --- /dev/null +++ b/iguana/Kashi/getbalance_PA @@ -0,0 +1,3 @@ +#!/bin/bash + +curl -s --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"getbalance\",\"params\":[\"IGUANA\",1,0]}" diff --git a/iguana/Kashi/getbalance_casuingCrash b/iguana/Kashi/getbalance_casuingCrash new file mode 100755 index 000000000..02657290e --- /dev/null +++ b/iguana/Kashi/getbalance_casuingCrash @@ -0,0 +1,19 @@ +#!/bin/bash + +echo "" +echo " + +The getbalance RPC gets the balance in decimal bitcoins across all accounts or for a particular account. + +Parameter #1—an account name +Parameter #2—the minimum number of confirmations +Parameter #3—whether to include watch-only addresses +Result—the balance in bitcoins +" + +echo "" +echo "" + +#curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getbalance\",\"confirmations\":\"\",\"includeempty\":\"0\",\"watchonly\":\"0\"}" + +curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"getbalance\",\"params\":[*,6,0]}" diff --git a/iguana/Kashi/getbestblockhash b/iguana/Kashi/getbestblockhash new file mode 100755 index 000000000..ea98f3865 --- /dev/null +++ b/iguana/Kashi/getbestblockhash @@ -0,0 +1,5 @@ +#!/bin/bash + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getbestblockhash\"}" + + diff --git a/iguana/Kashi/getblock b/iguana/Kashi/getblock new file mode 100755 index 000000000..9f00dec3d --- /dev/null +++ b/iguana/Kashi/getblock @@ -0,0 +1,3 @@ +#!/bin/bash + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getblock\",\"blockhash\":\"50a4f738d4319ad1f437df56ec90fdfb2592b95f5508db379c41227b2cc992c0\",\"verbose\":\"1\",\"remoteonly\":\"0\"}" diff --git a/iguana/Kashi/getblockcount b/iguana/Kashi/getblockcount new file mode 100755 index 000000000..2594b7a48 --- /dev/null +++ b/iguana/Kashi/getblockcount @@ -0,0 +1,5 @@ +#!/bin/bash + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getblockcount\"}" + + diff --git a/iguana/Kashi/getblockhash b/iguana/Kashi/getblockhash new file mode 100755 index 000000000..03733b802 --- /dev/null +++ b/iguana/Kashi/getblockhash @@ -0,0 +1,4 @@ +#!/bin/bash + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getblockhash\",\"height\":\"345324\"}" + diff --git a/iguana/Kashi/getblockhash.c b/iguana/Kashi/getblockhash.c new file mode 100755 index 000000000..af5c9da99 --- /dev/null +++ b/iguana/Kashi/getblockhash.c @@ -0,0 +1,340 @@ + + +/****************************************************************************** + * * + * * + * Using Brute force techinque program will randomly pick the block and * + * would compare is header hash. The expected header hashes for the blocks * + * are accurate and caculated using local bitcoind * + * * + * All api calls are made on Iguana Core * + * * + ******************************************************************************/ + +#include +#include +#include +#include +#include +#include +#define MAX_HEADER 45 +#define STR_LEN 64 +struct MemoryStruct +{ + char *memory; + size_t size; +}; + +static size_t +WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp) +{ + size_t realsize = size * nmemb; + struct MemoryStruct *mem = (struct MemoryStruct *)userp; + + mem->memory = realloc(mem->memory, mem->size + realsize + 1); + if(mem->memory == NULL) { + /* out of memory! */ + printf("not enough memory (realloc returned NULL)\n"); + return 0; + } + + memcpy(&(mem->memory[mem->size]), contents, realsize); + mem->size += realsize; + mem->memory[mem->size] = 0; + + return realsize; +} + + + +void fetchBlockHeader(const char * jsonrpc); +void bruteforceHashComparer(); +int hash_index = 0; +int in=0; +int ind=0; +//char ActualHash[STR_LEN]; +//char ExpectedHash[STR_LEN]; +char *ActualHash; +char *ExpectedHash; + +const char *hashes[MAX_HEADER] = + {"00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048", + "0000000026f34d197f653c5e80cb805e40612eadb0f45d00d7ea4164a20faa33", + "000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a", + "000000009ca75733b4cf527fe193b919201a2ed38c9e147a5665fdfade551f4d", + "000000008f1a7008320c16b8402b7f11e82951f44ca2663caf6860ab2eeef320", + "000000004e833644bc7fb021abd3da831c64ec82bae73042cfa63923d47d3303", + "0000000062b69e4a2c3312a5782d7798b0711e9ebac065cd5d19f946439f8609", + "00000000e286ad94972e44b0532f2823bcda3977661a5136ff4d9d7db107d944", + "000000002dd9919f0a67590bb7c945cb57270a060ce39e85d8d37536a71928c3", + "00000000e474895c09bcdaf9261845960b35ea54ed3ecaf60d8a392940f1f3f9", + "000000004ff664bfa7d217f6df64c1627089061429408e1da5ef903b8f3c77db", + "00000000314ff43c77573a3b8094951ce4b0f86aceee65e226914eb737ada575", + "00000000c7f956a913bbef9c94f517c318805821b59ea6227175f3841792ea88", + "00000000d3ebca0f1cf140987959ba9231e9da43f3f76aed02d0cfe9d88b71d7", + "0000000084d973c18381c87a63a2430ad2eff1d84934ec34e3bfd78ffd3cd9c1", + "00000000ad8174a71c1b2c01fd6076143c2cf57d768bf80d7c11b6721d3a2525", + "00000000def8545899ea7274e5c59bda5982f8f960052774df45b7d5c64f9c5d", + "00000000923a992877f070d2c8fa5ae67e66f6edcd828b321caa75885136386b", + "00000000e684309e67fabdf765bea193cdf8532111079b7f53a0839746d19240", + "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", + "000000009cd3f93cd2d843202155561eb773b2a7b7c97561ddef31e707f4eb4b", + "00000000f0b6da96d1e3272e87e181a7057c3d79bf984b420d4f6fd6d7a49fc7", + "0000000047a712b762d9c91aa1cc2e33fb48ea64276a7086c3c10aa252a934ab", + "00000000c9c28d2bb760225beaddbc212a01720869b624f088e9311df5b5d8f2", + "000000007d07681a955b7bb9d96c473e847395b592b6e9e5a73b15b594bd4013", + "00000000f6b38fee667afb9cb2eedc5a9988d345e7b61ce220d34005d2d5b8bf", + "000000009bf03aa138b1bb31491261221f8d4562941c1022a798acda7e3158d4", + "00000000046d4e2de13c9a31dec05fafcae393ae7de773242abd4db47e9e747f", + "00000000e67f39a80dbba80e5bf130294ef460b89022c7a56c3df76ab2df2e71", + "00000000dfd5d65c9d8561b4b8f60a63018fe3933ecb131fb37f905f87da951a", + "00000000d5092034c3a92473d42f28e3fd279f0652e2d5b0049c7d40fcbc990b", + "0000000070118b55e0436a721d4533fc3d09a0238f72a5380e8a694c9dbf948e", + "0000000091a5fdf4b5f5fe07ed869bf82049b3d61a403f2771b5cbd1937dad09", + "00000000081038eb250216ebb27f94d8896d2984dc962020c53e6a2852b92967", + "00000000d84724559f1691d916b2ed63a44884d495d155197647ce7667116b16", + "0000000091a7488531bb1050f24c0f8f90d4da873673eb4dec62bbce56a32910", + "000000001731f7bb532ebd8ff11c253f128a9e3108eaf038d8155fedeba5bc0c", + "00000000d10250150162aefbf7d64ab10f3b4706ffe4d04ae59ca410f672e97b", + "00000000a4342e04aa766386cdb4da70137efd47ac271f1a4e18429af3020a7c", + "000000004a81b9aa469b11649996ecb0a452c16d1181e72f9f980850a1c5ecce", + "00000000bccaab487030fe7c0d8d66a80fefc157bd75f0de40b6b8d61ea1d287", + "00000000b6641cc18693437c5208bf362730c533fd3ea4cca364793603bba957", + "00000000bfa35a68d94bf878a712c538484d8bc272c6ddd70de4e636d55f45de", + "00000000b590a5ff44afeb50e51444d8b6ccd08f6232951316f33e19b5ca5ff2", + "00000000922e2aa9e84a474350a3555f49f06061fd49df50a9352f156692a842" + }; + +const char *jsonRPC[MAX_HEADER] = + { "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [1] }", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [50] }", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [100]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [150]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [200]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [250]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [300]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [350]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [400]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [450]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [500]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [550]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [600]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [650]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [700]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [750]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [800]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [850]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [900]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [1000]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [1100]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [1200]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [1300]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [1400]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [1500]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [1600]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [1700]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [1800]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [1900]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [2000]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [2100]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [2200]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [2300]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [2400]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [2500]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [2600]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [2700]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [2800]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [2900]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [3000]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [3200]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [3400]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [3600]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [3800]}", + "{\"id\":\"jl777\", \"method\": \"getblockhash\", \"params\": [4000]}"}; + + + +int main() +{ + int api; + CURL *curl; + CURLcode res; + + // struct MemoryStruct chunk; + + // chunk.memory = malloc(1); /* will be grown as needed by the realloc above */ + // chunk.size = 0; /* no data at this point */ + + // curl_global_init(CURL_GLOBAL_ALL); + // initialize all sub modules and return an easy handle for upcoming easy transfer + // curl = curl_easy_init(); + + // raise an assertion if handle is NULL + + for(api=0; api<(MAX_HEADER-1); api++) + { + // printf("api == %d\n",api); + fetchBlockHeader(jsonRPC[api]); + } + + + + return 0; +} + +void fetchBlockHeader(const char* jsonrpc) +{ + + CURL *curl; + CURLcode res; + struct MemoryStruct chunk; + + chunk.memory = malloc(1); /* will be grown as needed by the realloc above */ + chunk.size = 0; /* no data at this point */ + + curl_global_init(CURL_GLOBAL_ALL); + // initialize all sub modules and return an easy handle for upcoming easy transfer + curl = curl_easy_init(); + + if(curl == NULL) + { + assert(curl); + } + + ActualHash = (char*)calloc(64,sizeof(char)); + ExpectedHash = (char*)calloc(64,sizeof(char)); + if(ActualHash == NULL) + { + printf("ERROR: memory allocation failed for ActualHash\n"); + exit(1); + } + + if(ExpectedHash == NULL) + { + printf("ERROR: memory allocation failed for ExpectedHash\n"); + exit(1); + } + + + + + printf("\n"); + printf("RPC:%s\n\n",jsonrpc); + // set the properties and options for curl + // printf("1\n"); + curl_easy_setopt(curl, CURLOPT_URL, "http://127.0.0.1:7778"); + + /* send all data to this function */ + // printf("2\n"); + + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback); + + /* we pass our 'chunk' struct to the callback function */ + // printf("3\n"); + + curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk); + + // calculate the length of data that will be passed using POST method to server + // printf("4\n"); + + curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) strlen(jsonrpc)); + + // the data parameter should be a pointer to character + // printf("5\n"); + + curl_easy_setopt(curl, CURLOPT_POSTFIELDS, jsonrpc); + + // request using SSL for the transfer, otherwise normal transfer + // printf("6\n"); + + curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_TRY); + // printf("7\n"); + + res =curl_easy_perform(curl); + // printf("8\n"); + + /* check for errors */ + if(res != CURLE_OK) { + fprintf(stderr, "curl_easy_perform() failed: %s\n", + curl_easy_strerror(res)); + } + else + { + // printf("9\n"); + + strcpy(ActualHash,chunk.memory); + //remove space from string +/* + while(ActualHash[in] !='\0') + { + if((ActualHash[in] != ' ') (ActualHash[in+1] != ' ')) + { + + iguanaResp[ind] = ActualHash[in]; + ind++; + } + else + { + printf("Got whitespace\n"); + } + in++; + } + iguanaResp[ind] = '\0'; +*/ + // printf("10\n"); + + bruteforceHashComparer(curl); + + + } + + sleep(2); + + free(ActualHash); + // printf("11\n"); + + free(ExpectedHash); + // printf("12\n"); + free(chunk.memory); + // printf("13\n"); + + in=0; + ind=0; + curl_easy_cleanup(curl); + //printf("14\n"); + + + + +} + +void bruteforceHashComparer() +{ + + int ret; + strcpy(ExpectedHash,hashes[hash_index]); + printf("Expect Hash: %s\n",ExpectedHash); + printf("Acutal Hash: %s\n",ActualHash); + + ret = strncmp(ExpectedHash,ActualHash,64); + if(ret == 0) + { + printf("\t****************** PASSED ****************\n"); + } + + else + { + printf("\t****************** FAILED ****************\n"); + + } + + hash_index++; + + if(hash_index == MAX_HEADER) + { + hash_index = 0; + // curl_easy_cleanup(curl); + } + + +} diff --git a/iguana/Kashi/getblockhash_cp b/iguana/Kashi/getblockhash_cp new file mode 100755 index 000000000..d7994ee81 --- /dev/null +++ b/iguana/Kashi/getblockhash_cp @@ -0,0 +1,4 @@ +#!/bin/bash + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getblockhash\",\"height\":\"50\"}" + diff --git a/iguana/Kashi/getinfo b/iguana/Kashi/getinfo new file mode 100755 index 000000000..da84a9b26 --- /dev/null +++ b/iguana/Kashi/getinfo @@ -0,0 +1,4 @@ +#!/bin/bash + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getinfo\"}" + diff --git a/iguana/Kashi/getnewaddress b/iguana/Kashi/getnewaddress new file mode 100755 index 000000000..03b72abca --- /dev/null +++ b/iguana/Kashi/getnewaddress @@ -0,0 +1 @@ +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getnewaddress\",\"account\":\"IGUANA\"}" diff --git a/iguana/Kashi/getrawchangeaddress_notImplemented b/iguana/Kashi/getrawchangeaddress_notImplemented new file mode 100755 index 000000000..12934c191 --- /dev/null +++ b/iguana/Kashi/getrawchangeaddress_notImplemented @@ -0,0 +1,20 @@ +#!/bin/bash + +echo "" +echo " +The getrawchangeaddress RPC returns a new Bitcoin address for receiving change. +This is for use with raw transactions, not normal use." + +echo "" + +echo "Result: +A P2PKH address which has not previously been returned by this RPC. +The address will be removed from the keypool but not marked as a receiving address, +so RPCs such as the dumpwallet RPC will show it as a change address." + +echo "" + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getrawchangeaddress\"}" + +echo "" + diff --git a/iguana/Kashi/getrawtransaction b/iguana/Kashi/getrawtransaction new file mode 100755 index 000000000..5efc8136e --- /dev/null +++ b/iguana/Kashi/getrawtransaction @@ -0,0 +1,18 @@ +#!/bin/bash +echo "" +echo " + +The getrawtransaction RPC gets a hex-encoded serialized transaction or a JSON object describing the transaction. By default, Bitcoin Core only stores complete transaction data for UTXOs and your own transactions, so the RPC may fail on historic transactions unless you use the non-default txindex=1 in your Bitcoin Core startup settings. + +Parameter #1—the TXID of the transaction to get +Parameter #2—whether to get the serialized or decoded transaction +Result (if transaction not found)—null +" + +echo "" + + + + +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"getrawtransaction\",\"params\":[\"7173c6a02ed2882ffaf6365cad9ed256bd5a60515658a26ab7ba5fcf4793c3bc\"]}" +echo "" diff --git a/iguana/Kashi/getreceivedbyaccount_WIA b/iguana/Kashi/getreceivedbyaccount_WIA new file mode 100755 index 000000000..ac7cb744e --- /dev/null +++ b/iguana/Kashi/getreceivedbyaccount_WIA @@ -0,0 +1,13 @@ +#!/bin/bash + +echo "" + +echo "Dependencies:" +echo "getaccoutaddress, setaccount" +echo "" +echo "Scenario: Verify that correct total amount is retured for mentioned account" +echo "" + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getreceivedbyaccount\",\"account\":\"R\",\"includeempty\":\"2\"}" + +echo "" diff --git a/iguana/Kashi/getreceivedbyaccount_WVA b/iguana/Kashi/getreceivedbyaccount_WVA new file mode 100755 index 000000000..15b1e0c1e --- /dev/null +++ b/iguana/Kashi/getreceivedbyaccount_WVA @@ -0,0 +1,13 @@ +#!/bin/bash + +echo "" + +echo "Dependencies:" +echo "getaccoutaddress, setaccount" +echo "" +echo "Scenario: Verify that correct total amount is retured for mentioned account" +echo "" + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getreceivedbyaccount\",\"account\":\"IGUANA\",\"includeempty\":\"2\"}" + +echo "" diff --git a/iguana/Kashi/getreceivedbyaddress b/iguana/Kashi/getreceivedbyaddress new file mode 100755 index 000000000..675193ac3 --- /dev/null +++ b/iguana/Kashi/getreceivedbyaddress @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"getreceivedbyaddress\",\"params\":[\"17outUgtsnLkguDuXm14tcQ7dMbdD8KZGK\"]}" diff --git a/iguana/Kashi/getreceivedbyaddress_WVA b/iguana/Kashi/getreceivedbyaddress_WVA new file mode 100755 index 000000000..4a1071c7c --- /dev/null +++ b/iguana/Kashi/getreceivedbyaddress_WVA @@ -0,0 +1,25 @@ +#!/bin/bash + +echo "" +echo " The getreceivedbyaddress RPC returns the total amount received by the specified address in transactions with the specified number of confirmations. It does not count coinbase transactions. + +Parameter #1—the address +Parameter #2—the minimum number of confirmations +Result—the number of bitcoins receiv" + +echo "" +echo "Dependencies:" +echo "Wallpassphrase, incase wallet is locked" +echo "getaccountaddres, incase account and address don't exist already" +echo "sendtoaddress, if you want to send some coins to that address" +echo "" + +echo "Senario: Verify that correct amount is returned for mentioned address" +echo "Result: Correct amount for provided address should be returned" +echo "" + + + + +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"getreceivedbyaddress\",\"params\":[\"RMcHHn9RtkdtgVHiCxysrG8q2EQTYiJfRT\"]}" +echo "" diff --git a/iguana/Kashi/getrecev b/iguana/Kashi/getrecev new file mode 100755 index 000000000..5c4246049 --- /dev/null +++ b/iguana/Kashi/getrecev @@ -0,0 +1,30 @@ +#!/bin/bash + +#GETRECEIVEDBYACCOUNT RPC +sleep 3 +printf "\n" + +printf "Executing [RPC: GETRECEIVEDBYACCOUNT]\n" +printf "=====================================\n" + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getreceivedbyaccount\",\"account\":\"RMcHHn9RtkdtgVHiCxysrG8q2EQTYiJfRT\",\"includeempty\":\"2\"}" > /tmp/getreceivedbyaccount + +printf "\n" + +# call json_extract script to get the RPC results value +r_grba=$(~/tests/./json_extract /tmp/getreceivedbyaccount result) +err_grba=$(~/tests/./json_extract /tmp/getreceivedbyaccount error) + + + if [ "$r_grba" -eq 0 ] + then + printf "PASSED: GETRECEIVEDBYACCOUNT\n\n" + let passed+=1 + rm -f /tmp/getreceivedbyaccount + + else + printf "FAILED: (Returning Integer WILL IMPLEMENT LATER)\n" + printf "ERROR: %s:\n\n" "$err_grba" + let failed+=1 + fi + diff --git a/iguana/Kashi/gettransaction b/iguana/Kashi/gettransaction new file mode 100755 index 000000000..81ee8faf8 --- /dev/null +++ b/iguana/Kashi/gettransaction @@ -0,0 +1,15 @@ +#!/bin/bash +echo "" + +echo " + +The gettransaction RPC gets detailed information about an in-wallet transaction. + +Parameter #1—a transaction identifier (TXID) +Parameter #2—whether to include watch-only addresses in details and calculations +Result—a description of the transaction +" +echo "" + +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"gettransaction\",\"params\":[\"e3c08af74ca337ec632294c78c1deb461944e824f9272a280e4e750e70782714\"]}" +echo "" diff --git a/iguana/Kashi/gettxout b/iguana/Kashi/gettxout new file mode 100755 index 000000000..6718f25b8 --- /dev/null +++ b/iguana/Kashi/gettxout @@ -0,0 +1,11 @@ +#!/bin/bash +echo "" +echo "The gettxout RPC returns details about a transaction output. Only unspent transaction outputs (UTXOs) are guaranteed to be available. + +Parameter #1—the TXID of the output to get +Parameter #2—the output index number (vout) of the output to get +Parameter #3—whether to display unconfirmed outputs from the memory " +echo "" + +curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"gettxout\",\"params\":[\"51ae6e4cef61c9f496ab9df81800afacd1397bebafafb426b3c5eee1d069e84d\", 1]}" +echo "" diff --git a/iguana/Kashi/gettxoutsetinfo b/iguana/Kashi/gettxoutsetinfo new file mode 100755 index 000000000..6cecc742a --- /dev/null +++ b/iguana/Kashi/gettxoutsetinfo @@ -0,0 +1,3 @@ +#!/bin/bash + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"gettxoutsetinfo\"}" diff --git a/iguana/Kashi/getwalletinfo b/iguana/Kashi/getwalletinfo new file mode 100755 index 000000000..8f1ded377 --- /dev/null +++ b/iguana/Kashi/getwalletinfo @@ -0,0 +1,19 @@ +#!/bin/bash + +echo "" +echo " + +The getbalance RPC gets the balance in decimal bitcoins across all accounts or for a particular account. + +Parameter #1—an account name +Parameter #2—the minimum number of confirmations +Parameter #3—whether to include watch-only addresses +Result—the balance in bitcoins +" + +echo "" +echo "" + +#curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getbalance\",\"confirmations\":\"\",\"includeempty\":\"0\",\"watchonly\":\"0\"}" + +curl --url "http://127.0.0.1:7778" --data "{\"agents\":\"bitcoinrpc\",\"coin\":\"BTCD\",\"method\":\"getwalletinfo\",\"params\":[]}" diff --git a/iguana/Kashi/importprivkey b/iguana/Kashi/importprivkey new file mode 100755 index 000000000..265df88e8 --- /dev/null +++ b/iguana/Kashi/importprivkey @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"importprivkey\",\"params\":[\"UwoZ8tmhWth5bNacdL2YHiYv3mUZpoXhTjjFXdsm2Fhzft3fUDUF\"]}" diff --git a/iguana/Kashi/importprivkeyB b/iguana/Kashi/importprivkeyB new file mode 100755 index 000000000..fea5c86cc --- /dev/null +++ b/iguana/Kashi/importprivkeyB @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"importprivkey\",\"params\":[\"b81e824a58cefff953eb53e9743059d001be0f5cfeb7599fbdd6bd18dba6616c\"]}" diff --git a/iguana/Kashi/importprivkeyR b/iguana/Kashi/importprivkeyR new file mode 100755 index 000000000..e8a2551a1 --- /dev/null +++ b/iguana/Kashi/importprivkeyR @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"importprivkey\",\"params\":[\"522102c866c51b603e2d943774314b88aff1eb04aef3971fcf34503c8f07d27915bc1d2102e053cc9d98d9e157917ed74bcabeaf72006b1ecf019d148dd3eac06271b6bcf02102869ca05bf6b476bb8cb433e08846a67037b921062f49cd0f9f66087454e88abb53ae\"]}" diff --git a/iguana/Kashi/json_extract b/iguana/Kashi/json_extract new file mode 100755 index 000000000..f2c833a9d Binary files /dev/null and b/iguana/Kashi/json_extract differ diff --git a/iguana/Kashi/json_extract.c b/iguana/Kashi/json_extract.c new file mode 100755 index 000000000..60143e3a3 --- /dev/null +++ b/iguana/Kashi/json_extract.c @@ -0,0 +1,25 @@ +#include +#include +#include "../../includes/cJSON.h" +#include "../../crypto777/OS_portable.h" + +int32_t main(int32_t argc,char **argv) +{ + cJSON *filejson; char *fname,*filestr,*field; long filesize; + if ( argc > 2 ) + { + fname = argv[1]; + field = argv[2]; + if ( (filestr= OS_filestr(&filesize,fname)) != 0 ) + { + if ( (filejson= cJSON_Parse(filestr)) != 0 ) + { + if ( jstr(filejson,field) != 0 ) + printf("%s\n",jstr(filejson,field)); + free_json(filejson); + } else fprintf(stderr,"cant parse.(%s)\n",filestr); + free(filestr); + } else fprintf(stderr,"cant load (%s)\n",fname); + } else fprintf(stderr,"argc.%d fname.(%s) error\n",argc,argv[1]); +} + diff --git a/iguana/Kashi/json_extracta b/iguana/Kashi/json_extracta new file mode 100755 index 000000000..a76453978 Binary files /dev/null and b/iguana/Kashi/json_extracta differ diff --git a/iguana/Kashi/json_extracta.c b/iguana/Kashi/json_extracta.c new file mode 100644 index 000000000..1283f061d --- /dev/null +++ b/iguana/Kashi/json_extracta.c @@ -0,0 +1,25 @@ +#include +#include +#include "../../includes/cJSON.h" +#include "../../crypto777/OS_portable.h" + +int32_t main(int32_t argc,char **argv) +{ + cJSON *filejson; char *fname,*filestr,*field; long filesize; int32_t n; + if ( argc > 2 ) + { + fname = argv[1]; + field = argv[2]; + if ( (filestr= OS_filestr(&filesize,fname)) != 0 ) + { + if ( (filejson= cJSON_Parse(filestr)) != 0 ) + { + if ( jarray(&n,filejson,field) != 0 ) + printf("%s\n",jprint(jobj(filejson,field),0)); + free_json(filejson); + } else fprintf(stderr,"cant parse.(%s)\n",filestr); + free(filestr); + } else fprintf(stderr,"cant load (%s)\n",fname); + } else fprintf(stderr,"argc.%d fname.(%s) error\n",argc,argv[1]); +} + diff --git a/iguana/Kashi/json_extractd b/iguana/Kashi/json_extractd new file mode 100755 index 000000000..904e6e4e2 Binary files /dev/null and b/iguana/Kashi/json_extractd differ diff --git a/iguana/Kashi/json_extractd.c b/iguana/Kashi/json_extractd.c new file mode 100644 index 000000000..8c0cca0e1 --- /dev/null +++ b/iguana/Kashi/json_extractd.c @@ -0,0 +1,25 @@ +#include +#include +#include "../../includes/cJSON.h" +#include "../../crypto777/OS_portable.h" + +int32_t main(int32_t argc,char **argv) +{ + cJSON *filejson; char *fname,*filestr,*field; long filesize; + if ( argc > 2 ) + { + fname = argv[1]; + field = argv[2]; + if ( (filestr= OS_filestr(&filesize,fname)) != 0 ) + { + if ( (filejson= cJSON_Parse(filestr)) != 0 ) + { + if ( jobj(filejson,field) != 0 ) + printf("%.8f\n",jdouble(filejson,field)); + free_json(filejson); + } else fprintf(stderr,"cant parse.(%s)\n",filestr); + free(filestr); + } else fprintf(stderr,"cant load (%s)\n",fname); + } else fprintf(stderr,"argc.%d fname.(%s) error\n",argc,argv[1]); +} + diff --git a/iguana/Kashi/json_extracti b/iguana/Kashi/json_extracti new file mode 100755 index 000000000..2dc31c7f1 Binary files /dev/null and b/iguana/Kashi/json_extracti differ diff --git a/iguana/Kashi/json_extracti.c b/iguana/Kashi/json_extracti.c new file mode 100644 index 000000000..6b300e150 --- /dev/null +++ b/iguana/Kashi/json_extracti.c @@ -0,0 +1,25 @@ +#include +#include +#include "../../includes/cJSON.h" +#include "../../crypto777/OS_portable.h" + +int32_t main(int32_t argc,char **argv) +{ + cJSON *filejson; char *fname,*filestr,*field; long filesize; + if ( argc > 2 ) + { + fname = argv[1]; + field = argv[2]; + if ( (filestr= OS_filestr(&filesize,fname)) != 0 ) + { + if ( (filejson= cJSON_Parse(filestr)) != 0 ) + { + if ( jobj(filejson,field) != 0 ) + printf("%d\n",jint(filejson,field)); + free_json(filejson); + } else fprintf(stderr,"cant parse.(%s)\n",filestr); + free(filestr); + } else fprintf(stderr,"cant load (%s)\n",fname); + } else fprintf(stderr,"argc.%d fname.(%s) error\n",argc,argv[1]); +} + diff --git a/iguana/Kashi/jsoncmp b/iguana/Kashi/jsoncmp new file mode 100755 index 000000000..2a7843737 Binary files /dev/null and b/iguana/Kashi/jsoncmp differ diff --git a/iguana/Kashi/jsoncmp.c b/iguana/Kashi/jsoncmp.c new file mode 100755 index 000000000..9cc20c778 --- /dev/null +++ b/iguana/Kashi/jsoncmp.c @@ -0,0 +1,45 @@ +#include +#include +#include "../../includes/cJSON.h" +#include "../../crypto777/OS_portable.h" + +int32_t main(int32_t argc,char **argv) +{ + cJSON *argjson,*array,*filejson,*obj,*fobj; char *fname,*filestr,*fstr,*str,*field; int32_t i,n; long filesize; + if ( argc > 2 && (argjson= cJSON_Parse(argv[2])) != 0 ) + { + fname = argv[1]; + if ( (filestr= OS_filestr(&filesize,fname)) != 0 ) + { + if ( (filejson= cJSON_Parse(filestr)) != 0 ) + { + if ( (array= jarray(&n,argjson,"fields")) != 0 ) + { + for (i=0; ichild) != 0 ) + { + if ( (fobj= jobj(filejson,field)) != 0 ) + { + fstr = jprint(fobj,0); + str = jprint(obj,0); + if ( strcmp(fstr,str) != 0 ) + { + printf("{\"error\":\"field.(%s) in (%s) i.%d of n.%d mismatch (%s) != (%s)\"}\n",field,fname,i,n,fstr,str); + fprintf(stderr,"{\"error\":\"field.(%s) in (%s) i.%d of n.%d mismatch (%s) != (%s)\"}\n",field,fname,i,n,fstr,str); + } + else printf("{\"result\":\"MATCHED.[%s] (%s).(%s)\"}\n",fname,field,fstr); + free(str); + free(fstr); + } else fprintf(stderr,"cant find field.(%s) in (%s)\n",field,fname); + } else fprintf(stderr,"no fieldname array[%d]\n",i); + } + } else fprintf(stderr,"no fields array\n"); + free_json(filejson); + } else fprintf(stderr,"cant parse.(%s)\n",filestr); + free(filestr); + } else fprintf(stderr,"cant load (%s)\n",fname); + } else fprintf(stderr,"argc.%d fname.(%s) error\n",argc,argv[1]); +} + diff --git a/iguana/Kashi/listaccount_ALL b/iguana/Kashi/listaccount_ALL new file mode 100755 index 000000000..dd8c480f1 --- /dev/null +++ b/iguana/Kashi/listaccount_ALL @@ -0,0 +1,4 @@ +#!/bin/bash + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"listaccounts\",\"minconf\":\"0\",\"includewatchonly\":\"0\"}" +echo "" diff --git a/iguana/Kashi/listaddressgrouping b/iguana/Kashi/listaddressgrouping new file mode 100755 index 000000000..1052d0f79 --- /dev/null +++ b/iguana/Kashi/listaddressgrouping @@ -0,0 +1,5 @@ +#!/bin/bash + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"listaddressgroupings\"}" + + diff --git a/iguana/Kashi/listaddressgroupings b/iguana/Kashi/listaddressgroupings new file mode 100755 index 000000000..1052d0f79 --- /dev/null +++ b/iguana/Kashi/listaddressgroupings @@ -0,0 +1,5 @@ +#!/bin/bash + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"listaddressgroupings\"}" + + diff --git a/iguana/Kashi/listlockunspent b/iguana/Kashi/listlockunspent new file mode 100755 index 000000000..dbb443ecf --- /dev/null +++ b/iguana/Kashi/listlockunspent @@ -0,0 +1,3 @@ +#!/bin/bash + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"listlockunspent\"}" diff --git a/iguana/Kashi/listreceivedbyaccount b/iguana/Kashi/listreceivedbyaccount new file mode 100755 index 000000000..8392185cf --- /dev/null +++ b/iguana/Kashi/listreceivedbyaccount @@ -0,0 +1,3 @@ +#!/bin/bash + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"listreceivedbyaccount\",\"confirmations\":\"10\",\"includeempty\":\"1\",\"watchonly\":\"0\"}" diff --git a/iguana/Kashi/listreceivedbyaddress b/iguana/Kashi/listreceivedbyaddress new file mode 100755 index 000000000..1d4d9b3a5 --- /dev/null +++ b/iguana/Kashi/listreceivedbyaddress @@ -0,0 +1,17 @@ +#!/bin/bash + +echo "" +echo " + +The listreceivedbyaddress RPC lists the total number of bitcoins received by each address. + +Parameter #1—the minimum number of confirmations a transaction must have to be counted +Parameter #2—whether to include empty accounts +Parameter #3—whether to include watch-only addresses in results +Result—addresses, account names, balances, and minimum confirmations +" + +echo "" + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"listreceivedbyaddress\",\"minconf\":\"1\",\"includeempty\":\"1\",\"flag\":\"0\"}" +echo "" diff --git a/iguana/Kashi/listtransactions b/iguana/Kashi/listtransactions new file mode 100755 index 000000000..66183cd8d --- /dev/null +++ b/iguana/Kashi/listtransactions @@ -0,0 +1,7 @@ +#!/bin/bash + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"listtransactions\",\"account\":\"IGUANA\",\"count\":\"1\",\"skip\":\"0\",\"includewatchonly\":\"0\"}" + +echo "" + + diff --git a/iguana/Kashi/listunspent b/iguana/Kashi/listunspent new file mode 100755 index 000000000..b0203ae61 --- /dev/null +++ b/iguana/Kashi/listunspent @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"listunspent\",\"params\":[\"RQK4mc7ZySXtQ6EweC4r2fcCdBTvsZqDc6\"]}" diff --git a/iguana/Kashi/listunspent_WIA b/iguana/Kashi/listunspent_WIA new file mode 100755 index 000000000..0dbe0eb82 --- /dev/null +++ b/iguana/Kashi/listunspent_WIA @@ -0,0 +1,12 @@ +#!/bin/bash +echo "" +echo "The listunspent RPC returns an array of unspent transaction outputs belonging to this wallet" + +echo "" +echo "Dependencies:" +echo "Walletpassphrase" + + +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"listunspent\",\"params\":[\"185oP\"]}" + +echo "" diff --git a/iguana/Kashi/listunspent_WVA b/iguana/Kashi/listunspent_WVA new file mode 100755 index 000000000..791d39dc7 --- /dev/null +++ b/iguana/Kashi/listunspent_WVA @@ -0,0 +1,5 @@ +#!/bin/bash + +curl -s --url "http://127.0.0.1:7778" --data "{\"method\":\"listunspent\",\"params\":[\"RQCP1TcfevTQU35ZftPNx2TZpB9ZkSZQ3S\"]}" + +echo "" diff --git a/iguana/Kashi/lockunspent b/iguana/Kashi/lockunspent new file mode 100755 index 000000000..6f2072e25 --- /dev/null +++ b/iguana/Kashi/lockunspent @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"lockunspent\",\"flag\":\"1\",\"array\":\"e3c08af74ca337ec632294c78c1deb461944e824f9272a280e4e750e70782714\"}" diff --git a/iguana/Kashi/login b/iguana/Kashi/login new file mode 100755 index 000000000..bd706185e --- /dev/null +++ b/iguana/Kashi/login @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"SuperNET\",\"method\":\"login\",\"passphrase\":\"test\"}" diff --git a/iguana/Kashi/logout b/iguana/Kashi/logout new file mode 100755 index 000000000..a5836beba --- /dev/null +++ b/iguana/Kashi/logout @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"SuperNET\",\"method\":\"logout\"}" diff --git a/iguana/Kashi/make_jsoncmp b/iguana/Kashi/make_jsoncmp new file mode 100755 index 000000000..9e8b79ce8 --- /dev/null +++ b/iguana/Kashi/make_jsoncmp @@ -0,0 +1 @@ +gcc -o jsoncmp jsoncmp.c ../../agents/libcrypto777.a -pthread -lm diff --git a/iguana/Kashi/makekeypair b/iguana/Kashi/makekeypair new file mode 100755 index 000000000..acf03128c --- /dev/null +++ b/iguana/Kashi/makekeypair @@ -0,0 +1,3 @@ +#!/bin/bash + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"makekeypair\"}" diff --git a/iguana/Kashi/move b/iguana/Kashi/move new file mode 100755 index 000000000..5d6452542 --- /dev/null +++ b/iguana/Kashi/move @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"move\",\"fromaccount\":\"iguana\",\"toaccount\":\"iguana\",\"amount\":\"0.004\",\"minconf\":\"0\",\"comment\":\"moving\"}" diff --git a/iguana/Kashi/prv2pub b/iguana/Kashi/prv2pub new file mode 100755 index 000000000..579d5fd53 --- /dev/null +++ b/iguana/Kashi/prv2pub @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"SuperNET\",\"method\":\"priv2pub\",\"privkey\":\"1deb4ff7875c83563e7e3c5b9a427e9a7798bae9b69a78caca960295b8d837\",\"addrtype\":\"\"}" diff --git a/iguana/Kashi/prv2pub1 b/iguana/Kashi/prv2pub1 new file mode 100755 index 000000000..287109492 --- /dev/null +++ b/iguana/Kashi/prv2pub1 @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"SuperNET\",\"method\":\"priv2pub\",\"privkey\":\"6590e46b4f16cdca3a0516d84fd5ca29b24fa6a04006a9243d080daa1fc5b285\",\"addrtype\":\"\"}" diff --git a/iguana/Kashi/rates b/iguana/Kashi/rates new file mode 100755 index 000000000..74c8501c7 --- /dev/null +++ b/iguana/Kashi/rates @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"rates\",\"quotes\":[\"BTC/USD\", \"EUR/USD\", \"BTC/EUR\"]}" diff --git a/iguana/Kashi/repairwallet b/iguana/Kashi/repairwallet new file mode 100755 index 000000000..c3790559d --- /dev/null +++ b/iguana/Kashi/repairwallet @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"repairwallet\"}" diff --git a/iguana/Kashi/sendfrom b/iguana/Kashi/sendfrom new file mode 100755 index 000000000..42d1fb29e --- /dev/null +++ b/iguana/Kashi/sendfrom @@ -0,0 +1,11 @@ +#!/bin/bash + +echo "" +echo "The sendfrom RPC spends an amount from a local address to bitcoin address" +echo "" + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"sendfrom\",\"fromaccount\":\"change\",\"toaddress\":\"REX9Qs25nJjDkPSx65kt1FTpA9om14cnos\",\"amount\":\"0.00400000\",\"minconf\":\"1\",\"comment\":\"Test_transaction\",\"comment2\":\"sendingFrom change account\"}" +echo"" + + + diff --git a/iguana/Kashi/sendmany b/iguana/Kashi/sendmany new file mode 100755 index 000000000..2a57b1841 --- /dev/null +++ b/iguana/Kashi/sendmany @@ -0,0 +1,6 @@ +#!/bin/bash + +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"sendmany\", \"params\":[\"RVQV5spiARDTqfwBCxstWnMbrT6Q8mhRYz\", {\"RL1tyXPK5NzT1d4upgcHnujgG5v3xjLaYC\":0.04, \"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\":0.04}, 2]}" + + + diff --git a/iguana/Kashi/sendrawtransaction b/iguana/Kashi/sendrawtransaction new file mode 100755 index 000000000..c617b57a8 --- /dev/null +++ b/iguana/Kashi/sendrawtransaction @@ -0,0 +1,2 @@ +curl --url "http://127.0.0.1:14632" --user "user:rzDbtP9UDZEbPcn" --data "{\"method\":\"sendrawtransaction\",\"params\":[\"0100000095f4265701f6d17d847b7096cdd9b79e4df4b74aabb9ac34b7abd4f9fce19d761e97cca0e8000000006a47304402207ddad8357583b7b3707b3de1a2625b6054367c42a893edb10cd8fce4ea766895022079043096f5e278d131fafcc12d360c65f8cd4eaa81bc09ec709b5e34da7c0bdc012102d14a195654f536df6dfe5a38278d1b470d00f17de78eeb5ce9e9eea9edb2c212ffffffff0240420f00000000001976a91410acba3a841fae68aba4b5ff162714c493bcc04e88acd0300e00000000001976a914d8b8c039206af6cec82bca950f592801e62808cb88ac00000000\"]}" + diff --git a/iguana/Kashi/sendtoaddress b/iguana/Kashi/sendtoaddress new file mode 100755 index 000000000..3113f0b64 --- /dev/null +++ b/iguana/Kashi/sendtoaddress @@ -0,0 +1,2 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"sendtoaddress\",\"params\":[\"17outUgtsnLkguDuXm14tcQ7dMbdD8KZGK\", 0.4]}" + diff --git a/iguana/Kashi/sendtoaddress_WVA b/iguana/Kashi/sendtoaddress_WVA new file mode 100755 index 000000000..f4906aa94 --- /dev/null +++ b/iguana/Kashi/sendtoaddress_WVA @@ -0,0 +1,18 @@ +#!/bin/bash + +echo "" +echo "The sendtoaddress RPC spends an amount to a given address. + +Parameter #1—to address +Parameter #2—amount to spend" +echo "" +echo "Dependencies:" +echo "Walletpassphrase, Incase valid is locked" +echo "getaccountaddress, incase account and address don't exist already" +echo "" +echo "Scenario: Verify that amount is sent to given account" +echo "Results: Amount should be sent to the given account" +echo "" + +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"sendtoaddress\",\"params\":[\"RQbUDfuCitztPgJkG8edBU5dy59GD7WQqT\", 0.0004]}" +echo "" diff --git a/iguana/Kashi/setaccount b/iguana/Kashi/setaccount new file mode 100755 index 000000000..41edb3368 --- /dev/null +++ b/iguana/Kashi/setaccount @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"setaccount\",\"params\":[\"RQK4mc7ZySXtQ6EweC4r2fcCdBTvsZqDc6\", \"change\"]}" diff --git a/iguana/Kashi/setaccount_WIA b/iguana/Kashi/setaccount_WIA new file mode 100755 index 000000000..71a132efb --- /dev/null +++ b/iguana/Kashi/setaccount_WIA @@ -0,0 +1,14 @@ +#!/bin/bash + +echo "" +echo "The setaccount RPC put the specified address in the given account" +echo "" +echo "Dependencies:" +echo "Getnewaddress RPC, if you don't have an address already" +echo "Getaccountaddress RPC, if account doesn't exist already" +echo "" +echo "Scenario: Verify that ERROR is returned incase of invalid or empty account name" +echo "Result: Need address and account " +echo "" + +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"setaccount\",\"params\":[\"RW8oinV4TjRobRWNcNx2cjoexnGS5g8yh5\", \"\"]}" diff --git a/iguana/Kashi/setaccount_WVA b/iguana/Kashi/setaccount_WVA new file mode 100755 index 000000000..801e61b63 --- /dev/null +++ b/iguana/Kashi/setaccount_WVA @@ -0,0 +1,14 @@ +#!/bin/bash + +echo "" +echo "The setaccount RPC put the specified address in the given account" +echo "" +echo "Dependencies:" +echo "Getnewaddress RPC, if you don't have an address already" +echo "Getaccountaddress RPC, if account doesn't exist already" +echo "" +echo "Scenario: Verify that user is able to linked address with specified account" +echo "Result: Address should be linked to mentioned account" +echo "" + +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"setaccount\",\"params\":[\"RQK4mc7ZySXtQ6EweC4r2fcCdBTvsZqDc6\", \"IGUANA_CHANGE\"]}" diff --git a/iguana/Kashi/settx b/iguana/Kashi/settx new file mode 100755 index 000000000..e05cd9582 --- /dev/null +++ b/iguana/Kashi/settx @@ -0,0 +1 @@ +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"settxfee\",\"amount\":\"0.00002\"}" diff --git a/iguana/Kashi/signmessage b/iguana/Kashi/signmessage new file mode 100755 index 000000000..a14f984c2 --- /dev/null +++ b/iguana/Kashi/signmessage @@ -0,0 +1,12 @@ +#!/bin/bash + +echo 'Sign a Message with the Private Key of Given Address' +echo 'Parameter1: Address Corresponding to Private key to sign with' +echo 'Parameter2: Message To Sign' + +echo 'Return Signature for corresponding Message' + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"signmessage\",\"address\":\"REurKb7jWHJgE2WKMqvqiDdbFf6Tmd2CEX\",\"message\":\"testMessage\"}" +echo "" + + diff --git a/iguana/Kashi/signmessagewithwrongaddress b/iguana/Kashi/signmessagewithwrongaddress new file mode 100755 index 000000000..8a790c29d --- /dev/null +++ b/iguana/Kashi/signmessagewithwrongaddress @@ -0,0 +1,9 @@ +o 'Sign a Message with the Private Key of Given Address' +echo 'Parameter1: Address Corresponding to Private key to sign with' +echo 'Parameter2: Message To Sign' + +echo 'Return Signature for corresponding Message' + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"signmessage\",\"address\":\"REurKb7jWHJgE2WKMqvqiDdbFf6Tmd2C\",\"message\":\"testMessage\"}" + + diff --git a/iguana/Kashi/signrawtransaction b/iguana/Kashi/signrawtransaction new file mode 100755 index 000000000..02a68732d --- /dev/null +++ b/iguana/Kashi/signrawtransaction @@ -0,0 +1,2 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"signrawtransaction\",\"params\":[\"0100000095f4265701f6d17d847b7096cdd9b79e4df4b74aabb9ac34b7abd4f9fce19d761e97cca0e80000000000ffffffff0240420f00000000001976a91410acba3a841fae68aba4b5ff162714c493bcc04e88acd0300e00000000001976a914d8b8c039206af6cec82bca950f592801e62808cb88ac00000000\", [{\"txid\":\"e8a0cc971e769de1fcf9d4abb734acb9ab4ab7f44d9eb7d9cd96707b847dd1f6\",\"vout\":0,\"scriptPubKey\":\"2102d14a195654f536df6dfe5a38278d1b470d00f17de78eeb5ce9e9eea9edb2c212ac\"}], [\"UqvuZXEAVXDXJkL4j4Xq6qoMdeJfPF1aNsCzmzfZaQ1ZgBTwfmWn\"], \"ALL\"] }" + diff --git a/iguana/Kashi/signrawtransaction2 b/iguana/Kashi/signrawtransaction2 new file mode 100755 index 000000000..a25bf319e --- /dev/null +++ b/iguana/Kashi/signrawtransaction2 @@ -0,0 +1,2 @@ +curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTC\",\"method\":\"signrawtransaction\",\"params\":[\"01000000dc4f24570156bb006164173811be6647f68f9a46eab4322e6fdef816aeb3e71e419ca49bfe1800000000ffffffff01588c0200000000001976a914d8b8c039206af6cec82bca950f592801e62808cb88ac00000000\", [{\"txid\":\"fe9ba49c411ee7b3ae16f8de6f2e32b4ea469a8ff64766be113817646100bb56\",\"vout\":24}], [\"UqvuZXEAVXDXJkL4j4Xq6qoMdeJfPF1aNsCzmzfZaQ1ZgBTwfmWn\"], \"ALL\"] }" + diff --git a/iguana/Kashi/startBTCD b/iguana/Kashi/startBTCD new file mode 100755 index 000000000..9e655a9d7 --- /dev/null +++ b/iguana/Kashi/startBTCD @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"services\":0}" diff --git a/iguana/Kashi/startBTCD_p2p b/iguana/Kashi/startBTCD_p2p new file mode 100755 index 000000000..7737074e2 --- /dev/null +++ b/iguana/Kashi/startBTCD_p2p @@ -0,0 +1 @@ +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"services\":0,\"portp2p\":14631}" diff --git a/iguana/Kashi/start_btc_basliskMode b/iguana/Kashi/start_btc_basliskMode new file mode 100755 index 000000000..7bc26a7b1 --- /dev/null +++ b/iguana/Kashi/start_btc_basliskMode @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":5,\"poll\":1,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTC\",\"startpend\":8,\"endpend\":6,\"services\":129,\"maxpeers\":64,\"RELAY\":0,\"VALIDATE\":0,\"portp2p\":8333}" diff --git a/iguana/Kashi/start_btc_fullMode b/iguana/Kashi/start_btc_fullMode new file mode 100755 index 000000000..22b9218d4 --- /dev/null +++ b/iguana/Kashi/start_btc_fullMode @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":5,\"poll\":1,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTC\",\"startpend\":8,\"endpend\":6,\"services\":129,\"maxpeers\":64,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":8333}" diff --git a/iguana/Kashi/testing b/iguana/Kashi/testing new file mode 100755 index 000000000..d8726019c --- /dev/null +++ b/iguana/Kashi/testing @@ -0,0 +1,36 @@ +#!/bin/bash + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getaddressesbyaccount\",\"account\":\"IGUANA\"}" > /tmp/getaddressbyaccount +printf "\n" + +# call json_extract script to get the RPC status value +addr_gaba=$(~/tests/./json_extracta /tmp/getaddressbyaccount result) +err_gaba=$(~/tests/./json_extracta /tmp/getaddressbyaccount error) + +addrs=$(echo $addr_gaba | tr "[,]" "\n") + + +for iguana_addrs in $addrs +do + +addrs1=($(echo $iguana_addrs | tr -d '""')) + +printf "new address:%s\n" "$addrs1" + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getaccount\",\"address\":\"$addrs1\"}"> /tmp/getaccount +printf "\n" + +# call json_extract script to get the RPC status value +acc_ga=$(~/tests/./json_extract /tmp/getaccount account) +printf "ACCOUNT:%s\n" "$acc_ga" + + if [ "$acc_ga" == "IGUANA" ] + then + printf "PASSED:" + else + printf "FAILED:" + + fi +done + + diff --git a/iguana/Kashi/validateaddress b/iguana/Kashi/validateaddress new file mode 100755 index 000000000..dfadfd92b --- /dev/null +++ b/iguana/Kashi/validateaddress @@ -0,0 +1,7 @@ +#!/bin/bash +echo "" +echo "The validateaddress RPC accepts a block, verifies it is a valid addition to the block chain, and broadcasts it to the network. Extra parameters are ignored by Bitcoin Core but may be used by mining pools or other programs." + +echo"" + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"validateaddress\",\"address\":\"RKfr35KdFCvM5DrmVFPouszesqUWvL6vxd\"}" diff --git a/iguana/Kashi/validatepubkey b/iguana/Kashi/validatepubkey new file mode 100755 index 000000000..ea9f0079f --- /dev/null +++ b/iguana/Kashi/validatepubkey @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"validatepubkey\",\"pubkey\":\"026b49ef6a53346455a947c462bbb2a6af25d68ea08fcacb9c288dc7ca727937fe\"}" diff --git a/iguana/Kashi/validaterawtransaction b/iguana/Kashi/validaterawtransaction new file mode 100755 index 000000000..349689e26 --- /dev/null +++ b/iguana/Kashi/validaterawtransaction @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"validaterawtransaction\",\"params\":[\"e69031847ad70f3bea75fbc4e4952caa64bd8866e65369399a93e2bcdeeb48d6","signedtx":"01000000a7133a5701922b48e7f96adaaef034dc67ea0d35b622ab6f16a41a69a5f3a6dc0fd3ac00fd010000006b483045022100c6286b399f2e98e5d8afe1ec139e38dc0efb14b563d220c4bcad99dc6360d9fe022051aeee65e8fdda7cb995f88ff4501578a0169e13693bd685d3820ab5b0c8436001210377a998571f6beb441a567165d65a7cebd449234607637a816ce810cbd9cca5caffffffff02a0860100000000001976a91433589918e1417aa730082041b94dd444f5bf6f9788ace00d901d000000001976a914dcc39f9cfc5558b09fc7862535cafc98e5a4d63088ac00000000\"]}" diff --git a/iguana/Kashi/verifymessage b/iguana/Kashi/verifymessage new file mode 100755 index 000000000..86a37fd9c --- /dev/null +++ b/iguana/Kashi/verifymessage @@ -0,0 +1,2 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"signmessage\",\"params\":[\"testmessage\"]}" + diff --git a/iguana/Kashi/verifymessagewithsignature b/iguana/Kashi/verifymessagewithsignature new file mode 100755 index 000000000..8024edbaf --- /dev/null +++ b/iguana/Kashi/verifymessagewithsignature @@ -0,0 +1,11 @@ +#!/bin/bash +# +# VerifyMesage + +echo 'Bitcoin RPC : verifymessage' +echo 'Param1 : Address' +echo 'Param2 : Signature' +echo 'Param3 : Message' + +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"verifymessage\",\"address\":\"REurKb7jWHJgE2WKMqvqiDdbFf6Tmd2CEX\",\"sig\":\"HzVTJEsYyldwfZ1YQxCntxfPn4QidpPKkkVs7dwwqspLBopw0aYSFmac1RpD9hQD5m/cy55FJBGxbKkd+tscjOY=\",\"message\":\"testMessage\"}" +echo "" diff --git a/iguana/Kashi/walletlock b/iguana/Kashi/walletlock new file mode 100755 index 000000000..d9bd9a47f --- /dev/null +++ b/iguana/Kashi/walletlock @@ -0,0 +1 @@ +curl -s --url "http://127.0.0.1:7778" --data "{\"method\":\"walletlock\",\"params\":[]}" diff --git a/iguana/Kashi/walletpassphrase b/iguana/Kashi/walletpassphrase new file mode 100755 index 000000000..a54094cea --- /dev/null +++ b/iguana/Kashi/walletpassphrase @@ -0,0 +1,2 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"walletpassphrase\",\"password\":\"kashifali\",\"timeout\":300}" + diff --git a/iguana/Kashi/walletpassphraseChange b/iguana/Kashi/walletpassphraseChange new file mode 100755 index 000000000..5917cfab1 --- /dev/null +++ b/iguana/Kashi/walletpassphraseChange @@ -0,0 +1,5 @@ +#!/bin/bash + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"walletpassphrasechange\",\"oldpassword\":\"Admin123@\",\"newpassword\":\"Admin123456@\",\"oldpermanentfile\":\"\",\"permanentfile\":\"\"}" + + diff --git a/iguana/Kashi/walletpassphrase_WIP b/iguana/Kashi/walletpassphrase_WIP new file mode 100755 index 000000000..de1021166 --- /dev/null +++ b/iguana/Kashi/walletpassphrase_WIP @@ -0,0 +1,21 @@ +#!/bin/bash +clear +echo "" + +echo " +The walletpassphrase RPC stores the wallet decryption key in memory for the indicated number of seconds. +Issuing the walletpassphrase command while the wallet is already unlocked will set a new unlock time +that overrides the old one. + +Parameter #1—the passphrase +Parameter #2—the number of seconds to leave the wallet unlocked + +" +echo "" +echo " +Scenario: To Test walletpassphrase with invalid password +Result: ERORR: Passphrase not found in decrypted json" +echo "" +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"walletpassphrase\",\"password\":\"kashifali\",\"timeout\":300}" +echo "" + diff --git a/iguana/Kashi/walletpassphrase_WVP b/iguana/Kashi/walletpassphrase_WVP new file mode 100755 index 000000000..f0be9493d --- /dev/null +++ b/iguana/Kashi/walletpassphrase_WVP @@ -0,0 +1,4 @@ +#!/bin/bash + +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"walletpassphrase\",\"password\":\"Admin1234@\",\"timeout\":300}" + diff --git a/iguana/Kashi/wallett b/iguana/Kashi/wallett new file mode 100755 index 000000000..0691917e7 --- /dev/null +++ b/iguana/Kashi/wallett @@ -0,0 +1,2 @@ +curl -s --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"walletpassphrase\",\"password\":\"kashif!Ali123\",\"timeout\":300}" + diff --git a/iguana/Kashi/wif2prv b/iguana/Kashi/wif2prv new file mode 100755 index 000000000..07c60821d --- /dev/null +++ b/iguana/Kashi/wif2prv @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"SuperNET\",\"method\":\"wif2priv\",\"wif\":\"UvVucHx4ob6ttrG4PRcUxryHFbm7KXj3TzyTci8XHfcnSdQpbcCc\"}" diff --git a/iguana/Kashi/wif2prv1 b/iguana/Kashi/wif2prv1 new file mode 100755 index 000000000..5b333688f --- /dev/null +++ b/iguana/Kashi/wif2prv1 @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"SuperNET\",\"method\":\"wif2priv\",\"wif\":\"UsQyVEi7TZ8JJmzcmJijU98HUc55b2wdPcfmuWfZgE5e8tG5xeXz\"}"