flora-dev-cli (fd-cli) is command line interface software to interact with flora blockchain.

Overview

Install

git clone https://github.com/Flora-Network/fd-cli.git
cd fd-cli
python3 -m venv venv
source venv/bin/activate
pip install -e . --extra-index-url https://pypi.chia.net/simple/

NFT 7/8 reward recovery

# Set env var to blockchain path.
export FD_CLI_BC_DB_PATH=$HOME/.flora/mainnet/db/blockchain_v1_mainnet.sqlite

# Set env var to wallet path.
# This must be the wallet that is associated with mnemonic from which NFT plot was created. (Usually your hot wallet)
# Replace <fingerprint> with your wallet fingerprint found at below path or by using "chia wallet show"
export FD_CLI_WT_DB_PATH=$HOME/.flora/mainnet/wallet/db/blockchain_wallet_v1_mainnet_<fingerprint>.sqlite

# Set env var to launcher id of NFT plot. Replace the below ID with output of "Launcher ID:" 
# Launcher ID: can be obtained using "chia plotnft show"
# Execute above command in Chia, as those values are the original NFT contract details, which do not exist in the forks
export LAUNCHER_HASH=aaa0cbae497933a6c029a3819759fe148829dfde0316cb0512ccad23edce6aaa

# Set env var to pool_contract_address. 
# Pool contract address: can be obtained using "chia plotnft show"
# Execute above command in Chia, as those values are the original NFT contract details, which do not exist in the forks
export POOL_CONTRACT_ADDRESS=xch13rht0xz4tpdqfq08e3dk20kewg9cjj3pw0wwjf7vay8whlxn7ppqapeqhz

fd-cli nft-recover \
  -l "$LAUNCHER_HASH" \
  -p "$POOL_CONTRACT_ADDRESS" \
  -nh 127.0.0.1 \
  -np 18755 \
  -ct $HOME/.flora/mainnet/config/ssl/full_node/private_full_node.crt \
  -ck $HOME/.flora/mainnet/config/ssl/full_node/private_full_node.key
  
# All coins that were mined +7 days ago WITH NFT PLOT should be spendable soon via wallet.

Powershell script for Windows

Prerequisites

Git for Windows: Git - download

Python for Windows: Python - download

Microsoft Visual C++ Redistributable Visual C++ Redistributable

Usage

Script can be executed without any parameters. You will be then prompted to provide LAUNCHER_HASH and POOL_CONTRACT_ADDRESS

Scrip also accepts various parameters. Please remember that you do not have to provide required parameters that have already a default value.

Parameter Description Type Default Required?
-LAUNCHER_HASH [your_launcher_id] Launcher ID of NFT that you want to recover. Can be obtained executing "chia plotnft show" in Chia string Empty Yes
-POOL_CONTRACT_ADDRESS [your_pool_contract_address] Pool contract address of NFT that you want to recover. Can be obtained executing "chia plotnft show" in Chia string Empty Yes
-fingerprint [wallet_fingerprint] Wallet fingerprint. If you have only one wallet, you do not need to provide this, as it will be found automatically string Empty No
-sleep [hours] If provided will run script in a infinite loop, repeating recovery in the provided interval Integer 0 No
-nettype [nettype] (mainnet or testnet) Part of the folder path where fork store its data (please remember that silicoin is using mainnet folder) string mainnet Yes
-blockchains [fork1], [fork2], [fork3]... If not provided will run recovery for flora. Array of strings, accepts multiple values separated by comma string array flora Yes

Usage examples

  • One time recovery of coins in Flora blockchain:

    ./flora_recovery.ps1 -POOL_CONTRACT_ADDRESS [your_pool_contract_address] -LAUNCHER_HASH [your_launcher_id]

  • One time recovery of coins in Flora blockchain when multiple wallet are available:

    ./flora_recovery.ps1 -POOL_CONTRACT_ADDRESS [your_pool_contract_address] -LAUNCHER_HASH [your_launcher_id] -fingerprint [wallet_fingerprint]

  • One time recovery of coins in Flora and Silicoin blockchains:

    ./flora_recovery.ps1 -POOL_CONTRACT_ADDRESS [your_pool_contract_address] -LAUNCHER_HASH [your_launcher_id] -blockchains flora, silicoin

  • Recovery of coins in Flora and Silicoin blockchains in a loop, executing the recovery every 24 hours:

    ./flora_recovery.ps1 -POOL_CONTRACT_ADDRESS [your_pool_contract_address] -LAUNCHER_HASH [your_launcher_id] -blockchains flora, silicoin -sleep 24

Install Español

https://github.com/Flora-Network/fd-cli/blob/master/README-ES.md

Install Italiano

https://github.com/Flora-Network/fd-cli/blob/master/README-IT.md

Comments
  • Recovery not compatible with all Forks

    Recovery not compatible with all Forks

    The recovery method is not compatible with all the forks.... E.g.:
    FLAX : image (Same incompatibility with : Flax, Spare, Chaingreen, Seno, Kale,... etc.)

    TAD throws a different, weird error: image ...continued... error: image

    For other forks it works just ok, e.g. Melati, Wheat or HDDCoin: image

    opened by PrEzi3 2
  • Coins found but not transfer to wallet

    Coins found but not transfer to wallet

    A new network transaction has been sent to recover a total of 87.500000000000 coins. A new network transaction has been sent to recover a total of 26.250000000000 coins.

    Sent transactions to recover a total of 113.750000000000 coins.

    As above, these coins are found but is split into 2 and not transfer to wallet, running again will show the same. Btw this is for cactus-blockchain, others are ok.

    opened by stanchiam 1
  • http error when trying to recover nft on some other forks.

    http error when trying to recover nft on some other forks.

    Tryed both python 3.7-3.8-3.9 debian 10, and from ubuntu 21, this is the returned error for some forks (works for flora & hddcoin), here is an example from greendoge :

        Coins eligible for recovery:
                hash:                     ***
                puzzle_hash:              33*************************************************************8
                amount:                   17500000000000
                timestamp:                1628989145
                --------
    	    # ... many recoverable coins
                --------
                hash:                     ***
                puzzle_hash:              33*************************************************************8
                amount:                   87500000000000
                timestamp:                1627693049
        An error occurred while sending the recovery transaction.
    Traceback (most recent call last):
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
        httplib_response = self._make_request(
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
        conn.request(method, url, **httplib_request_kw)
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
        super(HTTPConnection, self).request(method, url, body=body, headers=headers)
      File "/usr/lib/python3.8/http/client.py", line 1252, in request
        self._send_request(method, url, body, headers, encode_chunked)
      File "/usr/lib/python3.8/http/client.py", line 1298, in _send_request
        self.endheaders(body, encode_chunked=encode_chunked)
      File "/usr/lib/python3.8/http/client.py", line 1247, in endheaders
        self._send_output(message_body, encode_chunked=encode_chunked)
      File "/usr/lib/python3.8/http/client.py", line 1046, in _send_output
        self.send(chunk)
      File "/usr/lib/python3.8/http/client.py", line 968, in send
        self.sock.sendall(data)
      File "/usr/lib/python3.8/ssl.py", line 1204, in sendall
        v = self.send(byte_view[count:])
      File "/usr/lib/python3.8/ssl.py", line 1173, in send
        return self._sslobj.write(data)
    ConnectionResetError: [Errno 104] Connection reset by peer
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
        resp = conn.urlopen(
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
        retries = retries.increment(
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/urllib3/util/retry.py", line 532, in increment
        raise six.reraise(type(error), error, _stacktrace)
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise
        raise value.with_traceback(tb)
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
        httplib_response = self._make_request(
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
        conn.request(method, url, **httplib_request_kw)
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
        super(HTTPConnection, self).request(method, url, body=body, headers=headers)
      File "/usr/lib/python3.8/http/client.py", line 1252, in request
        self._send_request(method, url, body, headers, encode_chunked)
      File "/usr/lib/python3.8/http/client.py", line 1298, in _send_request
        self.endheaders(body, encode_chunked=encode_chunked)
      File "/usr/lib/python3.8/http/client.py", line 1247, in endheaders
        self._send_output(message_body, encode_chunked=encode_chunked)
      File "/usr/lib/python3.8/http/client.py", line 1046, in _send_output
        self.send(chunk)
      File "/usr/lib/python3.8/http/client.py", line 968, in send
        self.sock.sendall(data)
      File "/usr/lib/python3.8/ssl.py", line 1204, in sendall
        v = self.send(byte_view[count:])
      File "/usr/lib/python3.8/ssl.py", line 1173, in send
        return self._sslobj.write(data)
    urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/home/xxxxxxx/fd-cli/fd_cli/fd_cli_cmd_nft_recover.py", line 156, in fd_cli_cmd_nft_recover
        response = requests.post(
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/requests/api.py", line 117, in post
        return request('post', url, data=data, json=json, **kwargs)
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/requests/api.py", line 61, in request
        return session.request(method=method, url=url, **kwargs)
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
        resp = self.send(prep, **send_kwargs)
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
        r = adapter.send(request, **kwargs)
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/requests/adapters.py", line 498, in send
        raise ConnectionError(err, request=request)
    requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/home/xxxxxxx/fd-cli/venv/bin/fd-cli", line 33, in <module>
        sys.exit(load_entry_point('fd-cli', 'console_scripts', 'fd-cli')())
      File "/home/xxxxxxx/fd-cli/fd_cli/fd_cli.py", line 220, in main
        fd_cli()
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/click/core.py", line 829, in __call__
        return self.main(*args, **kwargs)
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/click/core.py", line 782, in main
        rv = self.invoke(ctx)
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/click/core.py", line 610, in invoke
        return callback(*args, **kwargs)
      File "/home/xxxxxxx/fd-cli/venv/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
        return f(get_current_context(), *args, **kwargs)
      File "/home/xxxxxxx/fd-cli/fd_cli/fd_cli.py", line 193, in fd_cli_nft_recover
        fd_cli_cmd_nft_recover(
      File "/home/xxxxxxx/fd-cli/fd_cli/fd_cli_cmd_nft_recover.py", line 179, in fd_cli_cmd_nft_recover
        fd_cli_print_raw(e, pre=pre)
      File "/home/xxxxxxx/fd-cli/fd_cli/fd_cli_print.py", line 15, in fd_cli_print_raw
        print(f'{" " * pre * 4}{value:{fill}s}')
    TypeError: unsupported format string passed to ConnectionError.__format__
    
    opened by ligams 1
  • "The term 'fd-cli' is not recognized"

    When I do this PS C:\Windows\system32> C:\Users\itisi\flora_recovery.ps1 -fingerprint *************** -LAUNCHER_HASH - ***************** POOL_CONTRACT_ADDRESS ************************ -blockchain sit

    I get this error

    "The term 'fd-cli' is not recognized"

    [03-28-22 02:23:43] Started the fd-cli recovery proces for sit fd-cli : The term 'fd-cli' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At C:\Users\itisi\flora_recovery.ps1:137 char:21

    • $fdcli_output = fd-cli nft-recover -l $LAUNCHER_HASH -p $POOL_CON ...
      
    •                 ~~~~~~
      
      • CategoryInfo : ObjectNotFound: (fd-cli:String) [], CommandNotFoundException
      • FullyQualifiedErrorId : CommandNotFoundException

    [03-28-22 02:23:43] [03-28-22 02:23:43] Finished the fd-cli recovery proces

    opened by itisieric 1
  • OperationalError: no such column: spent | with the upcoming v2 blockchain db format

    OperationalError: no such column: spent | with the upcoming v2 blockchain db format

    I use the fd-cli script on Ubuntu to do the 7/8 nft recovery on all my forks. This works fine so far for all forks except for bpx.

    With bpx I get an error message saying: "sqlite3.OperationalError: no such column: spent"

    It might have something to do with the new chia v2 database they use, all other forks use v1.

    Since chia will also officially switch to v2, it might make sense to adapt the fd-cli script accordingly.

    Thank you!


    Full error trace:

    Traceback (most recent call last): File "/home/am/fd-cli/venv/bin/fd-cli", line 33, in sys.exit(load_entry_point('fd-cli', 'console_scripts', 'fd-cli')()) File "/home/am/fd-cli/fd_cli/fd_cli.py", line 220, in main fd_cli() File "/home/am/fd-cli/venv/lib/python3.8/site-packages/click/core.py", line 829, in call return self.main(*args, **kwargs) File "/home/am/fd-cli/venv/lib/python3.8/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/home/am/fd-cli/venv/lib/python3.8/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/am/fd-cli/venv/lib/python3.8/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/am/fd-cli/venv/lib/python3.8/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/home/am/fd-cli/venv/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func return f(get_current_context(), *args, **kwargs) File "/home/am/fd-cli/fd_cli/fd_cli.py", line 193, in fd_cli_nft_recover fd_cli_cmd_nft_recover( File "/home/am/fd-cli/fd_cli/fd_cli_cmd_nft_recover.py", line 106, in fd_cli_cmd_nft_recover db_bc_cursor.execute( sqlite3.OperationalError: no such column: spent

    opened by ami911 2
  • Install problem

    Install problem

    Following the installation procedure on Linux I get during the last step:

    $pip install -e . --extra-index-url https://pypi.chia.net/simple/
    Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple, https://pypi.chia.net/simple/
    Obtaining file:///home/pi/fd-cli
    Collecting chia-blockchain~=1.2.3 (from fd-cli==0.0.1)
    Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https://pypi.chia.net/simple/chia-blockchain/
    
    good first issue 
    opened by jfikar 1
  •  The term 'source' is not recognized

    The term 'source' is not recognized

    Error executing the command: source venv/bin/activate

    I got the following error massage:

    source : The term 'source' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

    • source venv/bin/activate
    •   + CategoryInfo          : ObjectNotFound: (source:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
      
    opened by wrjmhb21 2
swarmexec executes command in swarm service

Swarmexec swarmexec executes command in swarm service Install pip install git+https://github.com/filimon43g/swarmexec.git Config In swarm_config.ini

Phil 2 Nov 23, 2021
Set of scripts & tools for converting between numbers and major system encoded words.

major-system-converter Set of scripts & tools for converting between numbers and major system encoded words. Uses phonetics instead of letters to conv

4 Aug 09, 2022
Automaton - python script to execute bash command based on changes in size of a file.

automaton python script to execute given command = everytime size of a given file changes,hence everytime a file is modified.(almost) download automa

asrar bhat 1 Jan 03, 2022
PyArmor is a command line tool used to obfuscate python scripts

PyArmor is a command line tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts.

Dashingsoft 2k Jan 07, 2023
A communist shell written in Python

kash A communist shell written in Python It doesn't support escapes, quotes, comment lines, |, &&, , or similar yet. If you need help, get it from

Çınar Yılmaz 1 Dec 10, 2021
A command line tool to create a graph representing your Ansible playbook tasks and roles

Ansible Playbook Grapher ansible-playbook-grapher is a command line tool to create a graph representing your Ansible playbook plays, tasks and roles.

Mohamed El Mouctar Haidara 424 Dec 20, 2022
A super simple terminal command shortener 🐟

pcmd A super simple terminal command shortener 🐟 Source code : https://github.com/j0fiN/pcmd Documentation : https://j0fin.github.io/pcmd About Durin

9 Mar 02, 2022
Juniper Command System is a Micro CLI Tool that allows you to manage your files, launch applications, as well as providing extra tools for OS Management.

Juniper Command System is a Micro CLI Tool that allows you to manage your files, launch applications, as well as providing extra tools for OS Management.

Juan Carlos Juárez 1 Feb 02, 2022
A simple cli utility for importing or exporting dashboard json definitions using the Grafana HTTP API.

P4CMD 🌴 A Python Perforce package that doesn't bring in any other packages to work. Relies on p4cli installed on the system. p4cmd The p4cmd module h

Beam Connectivity 31 Jan 06, 2023
ServX | Bash Command as a Service

ServX | Bash Command as a Service Screenshots Instructions for running Run python3 servx.py. COMPATIBILITY TESTED ON ARCHLINUX(x64) & DEBIAN(x64) ONLY

ARPSyndicate 2 Mar 11, 2022
Pequeno joguinho pra você rodar no seu terminal

JokenPython Pequeno joguinho pra você rodar no seu terminal Olá! Joguinho legal pra vc rodar no seu terminal!! (rode no terminal, pra melhor experienc

Scott 4 Nov 25, 2021
Python remote shell.

Python remote shell.

Steven 9 Oct 17, 2022
Chat with Rem in Terminal!

Chat with Rem in Terminal!

bariscodefx 1 Dec 19, 2021
ctree - command line christmas tree

ctree ctree - command line christmas tree It is small python script that prints a christmas tree in terminal. It is colourful and always gives you a d

15 Aug 15, 2022
Commandline Python app to Autodownload mediafire folders and files.

Commandline Python app to Autodownload mediafire folders and files.

Tharuk Renuja 3 May 12, 2022
Easily turn single threaded command line applications into a fast, multi-threaded application with CIDR and glob support.

Easily turn single threaded command line applications into a fast, multi-threaded application with CIDR and glob support.

Michael Skelton 1k Jan 07, 2023
🐾 Get the nftables counters easier to read

nft-stats Get the nftables counters easier to read It kind of hard to read the output of nft list ruleset so there is a small program parcising the ou

7 Oct 08, 2022
Dead simple CLI tool to try Python packages - It's never been easier! :package:

try - It's never been easier to try Python packages try is an easy-to-use cli tool to try out Python packages. Features Install specific package versi

Timo Furrer 659 Dec 28, 2022
Declarative CLIs with argparse and dataclasses

argparse_dataclass Declarative CLIs with argparse and dataclasses. Features Features marked with a ✓ are currently implemented; features marked with a

Mike DePalatis 29 Dec 06, 2022
A python program to detect your emotion and suggest a playlist.

mood_music A python program to detect your emotion and suggest a playlist. This program is written in python using opencv,FER() and tensorflow This pr

Aditya_Sai 1 Jan 02, 2022