Compare commits

..

No commits in common. "06ebd81725de8cc4ae89c9ae3122fa915e5d5851" and "8ecf10feaf12f29e88ac3ce21ca74a8bcad30d3a" have entirely different histories.

11 changed files with 103 additions and 24 deletions

Binary file not shown.

View File

@ -27,29 +27,18 @@ A button for each app (with icon and app name) is generated for each app.The app
## Requirements
1. Linux operating system(working on a cross platform version).
2. git (to install git):
sudo apt-get install git
3. Internet
4. Flo Wallet(Running)
## Usage
1. Clone/download this repository. (https://github.com/ranchimall/FLO-appStore/)
1. Clone/download this repository. (https://github.com/sairajzero/FLO-appStore/)
2. Run the binary file (FLO_appStore)
./FLO_appStore
![Screenshot](screenshots/App-Store.png)
3. For installing an dapp,user needs to click on respective app.A popup window will open which ask user to download the dapp if not previously installed.
![Screenshot](screenshots/downloadApp.png)
4. Once installed the same popup window will have extra buttons to open/remove dapp.
![Screenshot](screenshots/openApp.png)
5. Click on open app to open the Dapp
![Screenshot](screenshots/appHome.png)
6. Updates for dapps are checked everytime when user is connected to Internet.Click on dapp which user want to update,if any updates are available,update button will automatically be displayed in the popup window.
7. For browser apps, open browser button will be shown instead of download/open buttons. Click on it to open the webpage in browser.
![Screenshot](screenshots/browserApp.png)
6. User can also search for any dapp in flostore using Search bar feature.
![Screenshot](screenshots/searchApp.png)
7. For navigating to other pages in Flostore,use Next/Prev Buttons.
3. For installing an dapp,user needs to click on respective app.A popup window will open which ask user to download the dapp if not previously installed.Once installed the same popup window will have extra buttons to open/remove dapp.
4. Updates for dapps are checked everytime when user is connected to Internet.Click on dapp which user want to update,if any updates are available,update button will automatically be displayed in the popup window.
5. User can also search for any dapp in flostore using Search bar feature.
6. For navigating to other pages in Flostore,use Next/Prev Buttons.
## Other Infos

View File

@ -10,10 +10,10 @@ def searchDict(dicArr,key,val):
return -1
def readUnitFromBlockchain(txid):
rawtx = subprocess.check_output(["flo-cli", "getrawtransaction", str(txid)])
rawtx = subprocess.check_output(["flo-cli","--testnet", "getrawtransaction", str(txid)])
rawtx = str(rawtx)
rawtx = rawtx[2:-3]
tx = subprocess.check_output(["flo-cli", "decoderawtransaction", str(rawtx)])
tx = subprocess.check_output(["flo-cli","--testnet", "decoderawtransaction", str(rawtx)])
content = json.loads(tx)
text = content['floData']
return str(text)
@ -27,7 +27,7 @@ def Dappend(Dapps,app):
return Dapps
def getJsonData(JsonAddress):
r = requests.get("https://www.florincoin.info/ext/getaddress/"+JsonAddress)
r = requests.get("https://testnet.florincoin.info/ext/getaddress/"+JsonAddress)
data = json.loads(r.content)
#print(data)
Dapps = []
@ -73,10 +73,11 @@ else:
appData['location'] = 'apps/'+input('Enter Repository name \t: ') +'/'
appData['exec'] = input('Enter execution cmd (eg. ./binary) \t: ')
print(appData)
apps = Dappend(apps ,appData)
#print(apps)
apphash = findHash(str(apps))
floData = json.dumps({'Dapp':appData ,'hash':apphash})
print('\nfloData :\n'+floData)
print('\nfloData = '+floData)

View File

@ -11,7 +11,7 @@ import socket
import requests
import hashlib
JsonAddresses = ["FT9qkvuWXWBDRhHd42tDr5nMYFSx7bEhV7","FBcRbCxwChjTdgVewGMPBDDEFXzPcc7GAH","FC6CRkRCeJEKEGF2r1SFppPD5DXfVe1zWq"]
JsonAddresses = ["oXa7t72t3CgnR11ycxVfdupz55eucHufHj","oYcLBQZkgj9taQ5Zj6ziu8eqMREhyAPCcT","oYtGSrrfLvurYLKouZw3E7AyNuM8ZushbC"]
def searchDict(dicArr,key,val):
for i in range(len(dicArr)):
@ -32,10 +32,10 @@ def isConnected():
return False
def readUnitFromBlockchain(txid):
rawtx = subprocess.check_output(["flo-cli", "getrawtransaction", str(txid)])
rawtx = subprocess.check_output(["flo-cli","--testnet", "getrawtransaction", str(txid)])
rawtx = str(rawtx)
rawtx = rawtx[2:-3]
tx = subprocess.check_output(["flo-cli", "decoderawtransaction", str(rawtx)])
tx = subprocess.check_output(["flo-cli","--testnet", "decoderawtransaction", str(rawtx)])
content = json.loads(tx)
text = content['floData']
return str(text)
@ -64,7 +64,7 @@ def verifyHash(localHash,txid):
def getJsonData(Dapps, lastTx,JsonAddress):
try:
r = requests.get("https://www.florincoin.info/ext/getaddress/"+JsonAddress)
r = requests.get("https://testnet.florincoin.info/ext/getaddress/"+JsonAddress)
data = json.loads(r.content)
except:
isConnected()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 461 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

89
send_floData.py Normal file
View File

@ -0,0 +1,89 @@
import subprocess
import json
import random
import requests
import hashlib
JsonAddress = 'oXa7t72t3CgnR11ycxVfdupz55eucHufHj'
toAddress = 'oXa7t72t3CgnR11ycxVfdupz55eucHufHj'
tempAcc = str(random.randint(100000,999999))
amt = '0.01'
def searchDict(dicArr,key,val):
for i in range(len(dicArr)):
if(dicArr[i][key]==val):
return i
return -1
def readUnitFromBlockchain(txid):
rawtx = subprocess.check_output(["flo-cli","--testnet", "getrawtransaction", str(txid)])
rawtx = str(rawtx)
rawtx = rawtx[2:-3]
tx = subprocess.check_output(["flo-cli","--testnet", "decoderawtransaction", str(rawtx)])
content = json.loads(tx)
text = content['floData']
return str(text)
def Dappend(Dapps,app):
i = searchDict(Dapps,'id',app['id'])
if (i!=-1):
del(Dapps[i])
if ('remove' not in app.keys()):
Dapps = Dapps + [app]
return Dapps
def getJsonData():
r = requests.get("https://testnet.florincoin.info/ext/getaddress/"+JsonAddress)
data = json.loads(r.content)
#print(data)
Dapps = []
for i in range(len(data['last_txs'])):
if(data['last_txs'][i]['type']=='vin'):
content = readUnitFromBlockchain(data['last_txs'][i]['addresses'])
try:
app = json.loads(content)
except :
continue
#print(app)
if 'Dapp' in app.keys():
Dapps = Dappend(Dapps,app['Dapp'])
#print(Dapps)
return Dapps
def findHash(data):
result = hashlib.sha1(data.encode())
return str(result.hexdigest())
apps = getJsonData()
print(apps)
print("Enter floData :")
lines = []
while True:
line = input()
if line:
lines.append(line)
else:
break
appData = ' '.join(lines)
try:
appData=json.loads(appData)
except:
print('Unable to parse JSON : '+appData)
exit(0)
print(appData)
apps = Dappend(apps , appData)
print(apps)
apphash = findHash(str(apps))
floData = json.dumps({'Dapp':appData ,'hash':apphash})
print('floData = '+floData)
process = subprocess.Popen(['flo-cli','-testnet','getaccount',JsonAddress], stdout=subprocess.PIPE)
account = process.communicate()[0].decode().strip()
process = subprocess.Popen(['flo-cli','-testnet','setaccount',JsonAddress,tempAcc], stdout=subprocess.PIPE)
process = subprocess.Popen(['flo-cli','-testnet','sendfrom',tempAcc,toAddress,amt,'6','','',floData], stdout=subprocess.PIPE)
txid = process.communicate()[0].decode()
print('txid : '+txid)
process = subprocess.Popen(['flo-cli','-testnet','setaccount',JsonAddress,account], stdout=subprocess.PIPE)