diff --git a/FLO_appStore b/FLO_appStore index 168f693..a0bcbbe 100755 Binary files a/FLO_appStore and b/FLO_appStore differ diff --git a/getJson.py b/getJson.py index 8a4fe16..100e192 100644 --- a/getJson.py +++ b/getJson.py @@ -53,7 +53,7 @@ def getJsonData(Dapps, lastTx): lastTx = 0 print(lastTx) for i in range(lastTx,len(data['last_txs'])): - print(i) + #print(i) if(data['last_txs'][i]['type']=='vin'): content = readUnitFromBlockchain(data['last_txs'][i]['addresses']) #print(content) diff --git a/main.py b/main.py index fd13065..f7135e1 100755 --- a/main.py +++ b/main.py @@ -70,7 +70,7 @@ def getJsonData(Dapps, lastTx): lastTx = 0 #print(lastTx) for i in range(lastTx,len(data['last_txs'])): - print(i) + #print(i) if(data['last_txs'][i]['type']=='vin'): content = readUnitFromBlockchain(data['last_txs'][i]['addresses']) #print(content) @@ -246,7 +246,7 @@ except: with open('Apps.json','w+') as F: data = json.dumps({'Dapps':apps ,'lastTx':lastTx}) - print(data) + #print(data) F.write(data) root = Tk() diff --git a/send_floData.py b/send_floData.py index 0e889ef..9db967a 100644 --- a/send_floData.py +++ b/send_floData.py @@ -44,7 +44,7 @@ def getJsonData(): app = json.loads(content) except : continue - print(app) + #print(app) if 'Dapp' in app.keys(): Dapps = Dappend(Dapps,app['Dapp']) #print(Dapps) diff --git a/test.py b/test.py deleted file mode 100644 index bb20097..0000000 --- a/test.py +++ /dev/null @@ -1,12 +0,0 @@ -def searchDict(dicArr,key,val): - for i in range(len(dicArr)): - if(dicArr[i][key]==val): - return i - return -1 - -d = [{'id': '1', 'name': 'Alexandria', 'icon': 'Icon/Alexandria.png', 'type': 'Webapp', 'url': 'https://alexandria.io/browser/'}, {'id': '2', 'name': 'AlternateLove', 'icon': 'Icon/AternaLove.png', 'type': 'Cmdline', 'location': 'apps/aternalove', 'exec': './auto-aterna-love.sh', 'github': 'https://github.com/metacoin/aternalove.git'}, {'id': '3', 'name': 'Caltech', 'icon': 'Icon/Caltech.png', 'type': 'Webapp', 'url': 'https://etdb.caltech.edu/browse'}, {'id': '4', 'name': 'Flotorizer', 'icon': 'Icon/Flotorizer.png', 'type': 'Webapp', 'url': 'http://flotorizer.net/'}, {'id': '5', 'name': 'Medici', 'icon': 'Icon/Medici.png', 'type': 'Webapp', 'url': 'https://www.mediciventures.com/'}, {'id': '6', 'name': 'FloSharedSecret', 'icon': 'Icon/SharedSecret.png', 'type': 'Gui', 'location': 'apps/FLO-shared-secret/', 'exec': './FLO_Secret', 'github': 'https://github.com/akhil2015/FLO-shared-secret.git'}, {'id': '7', 'name': 'FloRate', 'icon': 'Icon/Florate.png', 'type': 'Gui', 'location': 'apps/FloRate-Dapp/', 'exec': './Florate', 'github': 'https://github.com/Tarun047/FloRate-Dapp.git'}, {'id': '8', 'name': 'tZero', 'icon': 'Icon/tZero.png', 'type': 'Webapp', 'url': 'https://www.tzero.com/'}, {'id': '9', 'name': 'WorldMood', 'icon': 'Icon/WorldMood.png', 'type': 'Webapp', 'url': 'http://worldmood.io/'}, {'id': '10', 'name': 'Xcertify', 'icon': 'Icon/Xcertify.png', 'type': 'Cmdline', 'location': 'apps/Xcertify/', 'exec': './xcertify', 'github': 'https://github.com/akhil2015/Xcertify.git'}] -del(d[1]) -print(d) -i = searchDict(d,'id','4') -if(i!=-1): - print(i) diff --git a/xsend_floData.py b/xsend_floData.py new file mode 100644 index 0000000..452cb1f --- /dev/null +++ b/xsend_floData.py @@ -0,0 +1,58 @@ +import subprocess +import json + +address = 'oXa7t72t3CgnR11ycxVfdupz55eucHufHj' +toAddress = 'ocZXNtzpiUqBvzQorjAKmZ5MhXxGTLKeSH' + + +process = subprocess.Popen(['flo-cli','-testnet','listunspent','1','9999999','["'+address+'"]'], stdout=subprocess.PIPE) +unspent = json.loads(process.communicate()[0].decode()) + +print("Enter floData :") +lines = [] +while True: + line = input() + if line: + lines.append(line) + else: + break +floData = '\n'.join(lines) +try: + floData=str(json.loads(floData)) +except: + None +print('floData='+floData) + +print(len(unspent)) +for i in range(len(unspent)): + print('\n'+str(i)+':'+str(unspent[i]['amount'])) + if(unspent[i]['spendable'] and unspent[i]['amount']>0.01005): + txid = unspent[i]['txid'] + amount = unspent[i]['amount'] + print(txid) + print(amount) + + process = subprocess.Popen(['flo-cli','-testnet','createrawtransaction','[{"txid":"'+txid+'", "vout":0}]','{"'+toAddress+'":0.01, "'+address+'":'+str(round(amount-0.01005,7))+'}','0','false','"'+floData+'"'], stdout=subprocess.PIPE) + createHash = process.communicate()[0].decode().strip() + print(createHash) + + process = subprocess.Popen(['flo-cli','-testnet','signrawtransaction',createHash], stdout=subprocess.PIPE) + sign = json.loads(process.communicate()[0].decode()) + print(sign) + + if(not sign['complete']): + print("Failed to sign transaction : "+sign['errors'][0]['error']) + continue + + process = subprocess.Popen(['flo-cli','-testnet','sendrawtransaction',sign['hex']], stdout=subprocess.PIPE) + newtxid = str(process.communicate()[0].decode()) + print(newtxid) + if(newtxid): + break + + + + + + +