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
A Python module and command-line utility for converting .ANS format ANSI art to HTML

ansipants A Python module and command-line utility for converting .ANS format ANSI art to HTML. Installation pip install ansipants Command-line usage

4 Oct 16, 2022
Convert markdown to HTML using the GitHub API and some additional tweaks with Python.

Convert markdown to HTML using the GitHub API and some additional tweaks with Python. Comes with full formula support and image compression.

phseiff 70 Dec 23, 2022
A python-based terminal application that displays current cryptocurrency prices

CryptoAssetPrices A python-based terminal application that displays current cryptocurrency prices. Covered Cryptocurrencies Bitcoin (BTC) Ethereum (ET

3 Apr 21, 2022
jrnl is a simple journal application for the command line.

jrnl To get help, submit an issue on Github. jrnl is a simple journal application for the command line. You can use it to easily create, search, and v

jrnl 5.7k Dec 31, 2022
A command-line tool to upload local files and pastebin pastes to your mega account, without signing in anywhere

A command-line tool to upload local files and pastebin pastes to your mega account, without signing in anywhere

ADI 4 Nov 17, 2022
uploadgram uses your Telegram account to upload files up to 2GiB, from the Terminal.

uploadgram uploadgram uses your Telegram account to upload files up to 2GiB, from the Terminal. Heavily inspired by the telegram-upload Installing: pi

Shrimadhav U K 97 Jan 06, 2023
Yts-cli-streamer - A CLI movie streaming client which works on yts.mx API written in python

YTSP It is a CLI movie streaming client which works on yts.mx API written in pyt

1 Feb 05, 2022
stonky is a simple command line dashboard for monitoring stocks.

stonky is a simple command line dashboard for monitoring stocks.

Jessy Williams 228 Dec 14, 2022
A simple script to make the operation of AltServer-Linux more easier with cli

A simple script to make the operation of AltServer-Linux more easier with cli

powen 23 Dec 13, 2022
Quickly open any path on your terminal window in your $EDITOR of choice!

Tmux fpp Plugin wrapper around Facebook PathPicker. Quickly open any path on your terminal window in your $EDITOR of choice! Demo Dependencies fpp - F

257 Dec 28, 2022
A command-line utility that, given a markdown file, checks whether all its links work.

A command-line utility written in Python that checks validity of links in a markdown file.

Teclado 2 Dec 08, 2021
Cthulhu is a simple python CLI application that streams torrents directly from 1337x.

Cthulhu is a simple python CLI application that facilitates the streaming of torrents directly from 1337x. It uses webtorrent to stream video

Raiyan 27 Dec 27, 2022
Command line client for Audience Insights

Dynamics 365 Audience Insights CLI The AuI CLI is a command line tool for Dynamics 365 Audience Insights. It is based on the customerinsights Python l

Microsoft 8 Jan 09, 2023
gcp-doctor - Diagnostics for Google Cloud Platform

gcp-doctor is a command-line diagnostics tool for GCP customers. It finds and helps to fix common issues in Google Cloud Platform projects. It is used to test projects against a wide range of best-pr

Google Cloud Platform 185 Dec 20, 2022
Python CLI vm manager for remote access of docker images via noVNC

vmman is a tool to quickly boot and view docker-based VMs running on a linux server through noVNC without ssh tunneling on another network.

UCSD Engineers for Exploration 1 Nov 29, 2021
Doing set operations on files considered as sets of lines

CLI tool that can be used to do set operations like union on files considering them as a set of lines. Notes It ignores all empty lines with whitespac

Partho 11 Sep 06, 2022
Simple command line tool for text to image generation using OpenAI's CLIP and Siren (Implicit neural representation network)

Simple command line tool for text to image generation using OpenAI's CLIP and Siren (Implicit neural representation network)

Phil Wang 4.4k Jan 09, 2023
A simple command line tool written in python to manage a to-do list

A simple command line tool written in python to manage a to-do list Dependencies: python Commands: todolist (-a | --add) [(-p | --priority)] [(-l | --

edwloef 0 Nov 02, 2021
A python library for parsing multiple types of config files, envvars & command line arguments that takes the headache out of setting app configurations.

parse_it A python library for parsing multiple types of config files, envvars and command line arguments that takes the headache out of setting app co

Naor Livne 97 Oct 22, 2022
AlienFX is a CLI and GUI utility to control the lighting effects of your Alienware computer.

AlienFX is a Linux utility to control the lighting effects of your Alienware computer. At present there is a CLI version (alienfx) and a gtk GUI versi

Stephen Harris 218 Dec 26, 2022