diff --git a/README.md b/README.md index 79cfc7c09..5c885a80c 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,8 @@ To enable it, add **SendChangeToBack=1** in flo.conf (or) pass **-SendChangeToBa ### Added Multi-Wallet support for Linux : Multi-wallet support allows the user to run more than 1 wallet simultaneously. -The Multi-wallet executable file is located in **bin/Linux** +The Multi-wallet executable file is located in **tmp/** +Copy the executable(binary) file to the flo binary files To access multi-wallet run : ./multiWallet -create [walletName] diff --git a/bin/linux.tar.xz b/bin/linux.tar.xz deleted file mode 100644 index af32f8712..000000000 Binary files a/bin/linux.tar.xz and /dev/null differ diff --git a/bin/win_32-bit.zip b/bin/win_32-bit.zip deleted file mode 100644 index 63fde17ba..000000000 Binary files a/bin/win_32-bit.zip and /dev/null differ diff --git a/bin/win_64-bits.zip b/bin/win_64-bits.zip deleted file mode 100644 index 7375e3dbe..000000000 Binary files a/bin/win_64-bits.zip and /dev/null differ diff --git a/tmp/README.md b/tmp/README.md new file mode 100644 index 000000000..adadffc9a --- /dev/null +++ b/tmp/README.md @@ -0,0 +1,23 @@ +FLO Core MultiWallet + +This executable file is used to run more than 1 wallet at a same time + +Usage: + + ./multiWallet -create [walletName] + creates a wallet under 'walletName' if specified + else creates wallet with name 'floxxxxxx' + + ./multiWallet [option] + executes the command in wallet 'walletName' + +commands: + + flo-qt - open FLO Core Wallet + flo-cli - run cli commands + flod - run FLO daemon + +for more info on each commands use option -help (or) -? +./flo-qt -? +./flo-cli -? +./flod -? \ No newline at end of file diff --git a/tmp/multiWallet b/tmp/multiWallet new file mode 100644 index 000000000..b6c53f056 Binary files /dev/null and b/tmp/multiWallet differ diff --git a/tmp/multiWallet.py b/tmp/multiWallet.py new file mode 100644 index 000000000..674404458 --- /dev/null +++ b/tmp/multiWallet.py @@ -0,0 +1,81 @@ +import subprocess +import random +import sys +import os +import socket + + +def _start(): + + if(len(sys.argv)<2): + _help() + print('Error : too few parameters') + + elif(sys.argv[1] in ['-help','-?']): + _help() + + elif(sys.argv[1]=='-create'): + try: + foldername = sys.argv[2] + except: + rand = random.randint(1,999999) + foldername = 'flo'+str(rand) + print('Creating a new Wallet...') + try: + subprocess.call(['mkdir','-p',foldername]) + except Exception as e: + print('Wallet Creation Failed : '+str(e)) + exit(0) + print('Created wallet '+foldername) + print('To use wallet : '+sys.argv[0]+' '+foldername) + + elif(len(sys.argv)<3): + _help() + print('Error : too few parameters (command missing)') + + elif(sys.argv[2] in ['flo-qt','flo-cli','flod']): + + #use this for find ip n available port using socket instead of random port + localip=socket.gethostbyname(socket.gethostname()) + ''' + for p in range(0, 65535): + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: + if(!sock.connect_ex(('localhost', p))) + port = p + break; + ''' + #localip = '0.0.0.0' + port = str(random.randint(2000,10000)) + path=os.getcwd() + cmd = ['./'+sys.argv[2]] + ['-conf='+path+'/'+sys.argv[1]+'/flo.conf','-datadir='+sys.argv[1],'-bind='+localip+':'+port] + sys.argv[3:] + #print(cmd) + subprocess.run(cmd) + else: + _help() + print('Error : command '+sys.argv[2]+' not recognised') + +def _help(): + help_data=f""" +FLO Core MultiWallet + +Usage: + + {sys.argv[0]} -create [walletName] + creates a wallet under 'walletName' if specified + else creates wallet with name 'floxxxxxx' + + {sys.argv[0]} [option] + executes the command in wallet 'walletName' + +commands: + + flo-qt - open FLO Core Wallet + flo-cli - run cli commands + flod - run FLO daemon + +for more info on each commands use option -help (or) -? + +""" + print(help_data) + +_start() \ No newline at end of file