update
This commit is contained in:
parent
eb4a67dddb
commit
3b17810e63
BIN
FLO_appStore
BIN
FLO_appStore
Binary file not shown.
@ -53,7 +53,7 @@ def getJsonData(Dapps, lastTx):
|
|||||||
lastTx = 0
|
lastTx = 0
|
||||||
print(lastTx)
|
print(lastTx)
|
||||||
for i in range(lastTx,len(data['last_txs'])):
|
for i in range(lastTx,len(data['last_txs'])):
|
||||||
print(i)
|
#print(i)
|
||||||
if(data['last_txs'][i]['type']=='vin'):
|
if(data['last_txs'][i]['type']=='vin'):
|
||||||
content = readUnitFromBlockchain(data['last_txs'][i]['addresses'])
|
content = readUnitFromBlockchain(data['last_txs'][i]['addresses'])
|
||||||
#print(content)
|
#print(content)
|
||||||
|
|||||||
4
main.py
4
main.py
@ -70,7 +70,7 @@ def getJsonData(Dapps, lastTx):
|
|||||||
lastTx = 0
|
lastTx = 0
|
||||||
#print(lastTx)
|
#print(lastTx)
|
||||||
for i in range(lastTx,len(data['last_txs'])):
|
for i in range(lastTx,len(data['last_txs'])):
|
||||||
print(i)
|
#print(i)
|
||||||
if(data['last_txs'][i]['type']=='vin'):
|
if(data['last_txs'][i]['type']=='vin'):
|
||||||
content = readUnitFromBlockchain(data['last_txs'][i]['addresses'])
|
content = readUnitFromBlockchain(data['last_txs'][i]['addresses'])
|
||||||
#print(content)
|
#print(content)
|
||||||
@ -246,7 +246,7 @@ except:
|
|||||||
|
|
||||||
with open('Apps.json','w+') as F:
|
with open('Apps.json','w+') as F:
|
||||||
data = json.dumps({'Dapps':apps ,'lastTx':lastTx})
|
data = json.dumps({'Dapps':apps ,'lastTx':lastTx})
|
||||||
print(data)
|
#print(data)
|
||||||
F.write(data)
|
F.write(data)
|
||||||
|
|
||||||
root = Tk()
|
root = Tk()
|
||||||
|
|||||||
@ -44,7 +44,7 @@ def getJsonData():
|
|||||||
app = json.loads(content)
|
app = json.loads(content)
|
||||||
except :
|
except :
|
||||||
continue
|
continue
|
||||||
print(app)
|
#print(app)
|
||||||
if 'Dapp' in app.keys():
|
if 'Dapp' in app.keys():
|
||||||
Dapps = Dappend(Dapps,app['Dapp'])
|
Dapps = Dappend(Dapps,app['Dapp'])
|
||||||
#print(Dapps)
|
#print(Dapps)
|
||||||
|
|||||||
12
test.py
12
test.py
@ -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)
|
|
||||||
58
xsend_floData.py
Normal file
58
xsend_floData.py
Normal file
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user