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
MasterDuel Image Recognition Translation Command Line Tool

MasterDuelTranslate(Use Ygo Card DataBase,belong win32 window shot & image match)

PatchouliTC 77 Dec 01, 2022
kitty - the fast, feature-rich, cross-platform, GPU based terminal

kitty - the fast, feature-rich, cross-platform, GPU based terminal

Kovid Goyal 17.3k Jan 04, 2023
WA Terminal is a CLI application that allows us to login and send message with WhatsApp with a single command.

WA Terminal is a CLI application that allows us to login and send message with WhatsApp with a single command.

Aziz Fikri 15 Apr 15, 2022
A startpage configured aesthetically with terminal-esque link formatting

Terminal-y Startpage Setup Clone the repository, then make an unformatted.txt file following the specifications in example.txt. Run format.py Open ind

belkarx 13 May 01, 2022
Spotify Offline is a command line tool that allows one to download Spotify playlists in MP3 format.

Spotify Offline v0.0.2 listen to your favorite spotify songs, offline Overview Spotify Offline (spotifyoffline) is a command line tool that allows one

Aarush Gupta 1 Nov 28, 2021
Alacritty terminal used with Bash, Tmux, Vim, Mutt, Lynx, etc. and the many different additions added to each configuration file

Alacritty terminal used with Bash, Tmux, Vim, Mutt, Lynx, etc. and the many different additions added to each configuration file

Carter 19 Aug 24, 2022
Simple Python Library to display text with color in Python Terminal

pyTextColor v1.0 Introduction pyTextColor is a simple Python Library to display colorful outputs in Terminal, etc. Note: Your Terminal or any software

Siddhesh Chavan 1 Jan 23, 2022
Wik is use to get information about anything on the shell using Wikipedia.

WIK wik is a tool to view wikipedia pages from your terminal. It also let you search for any wikipedia up to date article on one query from your termi

Yash Singh 340 Dec 18, 2022
pls is a better ls for developers, pronounced /pliːz/ as in 'please'

pls is a better ls for developers. The "p" stands for ("pro" as in "professional"/"programmer") or "prettier". It works in a manner similar to ls, in

Dhruv Bhanushali 572 Dec 28, 2022
A basic molecule viewer written in Python, using curses; Thus, meant for linux terminals

asciiMOL A basic molecule viewer written in Python, using curses; Thus, meant for linux terminals. This is an alpha version, featuring: Opening defaul

Dominik Behrens 328 Dec 11, 2022
CryptoCo-py is a Python CLI application that uses CoinGecko API to allow the user to query cryptocurrency information by typing simple commands.

CryptoCo-py is a Python CLI application that uses CoinGecko API to allow the user to query cryptocurrency information by typing simple com

1 Jan 10, 2022
⌨ Toward a more useful keyboard

Toward a more useful keyboard Steve Losh's Modern Space Cadet is an inspiration. It opened my eyes to the fact that there's a more useful keyboard hid

Jason Rudolph 1.7k Jan 01, 2023
A handy command-line utility for generating and sending iCalendar events

A handy command-line utility for generating and sending iCalendar events This simple command-line utility is designed to generate an iCalendar event,

Baochun Li 17 Nov 21, 2022
CLI program that allows you to change your Alacritty config with one command without editing the config file.

Pycritty Change your alacritty config on the fly! Installation: pip install pycritty By default, only the program itself will be installed, but you ca

Antonio Sarosi 184 Jan 07, 2023
Output Analyzer for you terminal commands

Output analyzer (OZER) You can specify a few words inside config.yaml file and specify the color you want to be used. installing: Install command usin

Ehsan Shirzadi 1 Oct 21, 2021
CLI tool to show the current crypto balance

CryptoBoard The simple python CLI tool for one currency to show the current crypto balance yours purchases. That's all. Data source is from https://ww

John 2 Nov 18, 2021
Tools crack instagram + fb ayok dicoba keburu premium 😁

FITUR INSTALLASI [1] pkg update && pkg upgrade [2] pkg install git [3] pkg install python [4] pkg install python2 [5] pkg install nano [6]

Jeeck 1 Dec 11, 2021
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
Stephen's Obsessive Note-Storage Engine.

Latest Release · PyPi Package · Issues · Changelog · License # Get Sonse and tell it where your notes are... $ pip install sonse $ export SONSE="$HOME

Stephen Malone 23 Jun 10, 2022
pwy - A simple weather tool.

A simple weather tool. I made this as a way for me to learn Python, API, and PyPi packaging. Name changed from wwy to pwy.

Clint 105 Dec 31, 2022