Compare commits
10 Commits
8ecf10feaf
...
06ebd81725
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06ebd81725 | ||
|
|
f3e8b9068e | ||
|
|
8f0d650886 | ||
|
|
30d7edace9 | ||
|
|
dc68908e9d | ||
|
|
56423f2696 | ||
|
|
88508469e4 | ||
|
|
f95912d97e | ||
|
|
17278fa66c | ||
|
|
0e970765d0 |
BIN
FLO_appStore
BIN
FLO_appStore
Binary file not shown.
21
README.md
21
README.md
@ -27,18 +27,29 @@ 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/sairajzero/FLO-appStore/)
|
||||
1. Clone/download this repository. (https://github.com/ranchimall/FLO-appStore/)
|
||||
2. Run the binary file (FLO_appStore)
|
||||
|
||||
./FLO_appStore
|
||||
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.
|
||||

|
||||
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.
|
||||

|
||||
4. Once installed the same popup window will have extra buttons to open/remove dapp.
|
||||

|
||||
5. Click on open app to open the Dapp
|
||||

|
||||
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.
|
||||

|
||||
6. User can also search for any dapp in flostore using Search bar feature.
|
||||

|
||||
7. For navigating to other pages in Flostore,use Next/Prev Buttons.
|
||||
|
||||
## Other Infos
|
||||
|
||||
|
||||
@ -10,10 +10,10 @@ def searchDict(dicArr,key,val):
|
||||
return -1
|
||||
|
||||
def readUnitFromBlockchain(txid):
|
||||
rawtx = subprocess.check_output(["flo-cli","--testnet", "getrawtransaction", str(txid)])
|
||||
rawtx = subprocess.check_output(["flo-cli", "getrawtransaction", str(txid)])
|
||||
rawtx = str(rawtx)
|
||||
rawtx = rawtx[2:-3]
|
||||
tx = subprocess.check_output(["flo-cli","--testnet", "decoderawtransaction", str(rawtx)])
|
||||
tx = subprocess.check_output(["flo-cli", "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://testnet.florincoin.info/ext/getaddress/"+JsonAddress)
|
||||
r = requests.get("https://www.florincoin.info/ext/getaddress/"+JsonAddress)
|
||||
data = json.loads(r.content)
|
||||
#print(data)
|
||||
Dapps = []
|
||||
@ -73,11 +73,10 @@ 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 = '+floData)
|
||||
print('\nfloData :\n'+floData)
|
||||
|
||||
|
||||
8
main.py
8
main.py
@ -11,7 +11,7 @@ import socket
|
||||
import requests
|
||||
import hashlib
|
||||
|
||||
JsonAddresses = ["oXa7t72t3CgnR11ycxVfdupz55eucHufHj","oYcLBQZkgj9taQ5Zj6ziu8eqMREhyAPCcT","oYtGSrrfLvurYLKouZw3E7AyNuM8ZushbC"]
|
||||
JsonAddresses = ["FT9qkvuWXWBDRhHd42tDr5nMYFSx7bEhV7","FBcRbCxwChjTdgVewGMPBDDEFXzPcc7GAH","FC6CRkRCeJEKEGF2r1SFppPD5DXfVe1zWq"]
|
||||
|
||||
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","--testnet", "getrawtransaction", str(txid)])
|
||||
rawtx = subprocess.check_output(["flo-cli", "getrawtransaction", str(txid)])
|
||||
rawtx = str(rawtx)
|
||||
rawtx = rawtx[2:-3]
|
||||
tx = subprocess.check_output(["flo-cli","--testnet", "decoderawtransaction", str(rawtx)])
|
||||
tx = subprocess.check_output(["flo-cli", "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://testnet.florincoin.info/ext/getaddress/"+JsonAddress)
|
||||
r = requests.get("https://www.florincoin.info/ext/getaddress/"+JsonAddress)
|
||||
data = json.loads(r.content)
|
||||
except:
|
||||
isConnected()
|
||||
|
||||
BIN
screenshots/App-Store.png
Normal file
BIN
screenshots/App-Store.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 78 KiB |
BIN
screenshots/appHome.png
Normal file
BIN
screenshots/appHome.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 112 KiB |
BIN
screenshots/browserApp.png
Normal file
BIN
screenshots/browserApp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 461 KiB |
BIN
screenshots/downloadApp.png
Normal file
BIN
screenshots/downloadApp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 79 KiB |
BIN
screenshots/openApp.png
Normal file
BIN
screenshots/openApp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 83 KiB |
BIN
screenshots/searchApp.png
Normal file
BIN
screenshots/searchApp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
@ -1,89 +0,0 @@
|
||||
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)
|
||||
Loading…
Reference in New Issue
Block a user