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
grungegirl is the hacker's drug encyclopedia. programmed in python for maximum modularity and ease of configuration.

grungegirl. cli-based drug search for girls. welcome. grungegirl is aiming to be the premier drug culture application. it is the hacker's encyclopedia

Eristava 10 Oct 02, 2022
The Prisma Cloud CLI is a command line interface for Prisma Cloud by Palo Alto Networks.

Prisma Cloud CLI The Prisma Cloud CLI is a command line interface for Prisma Cloud by Palo Alto Networks. Support This project has been developed by P

Palo Alto Networks 13 Oct 14, 2022
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
An open-source CLI tool for backing up RDS(PostgreSQL) Locally or to Amazon S3 bucket

An open-source CLI tool for backing up RDS(PostgreSQL) Locally or to Amazon S3 bucket

1 Oct 30, 2021
Modern line-oriented terminal emulator without support for TUIs.

Modern line-oriented terminal emulator without support for TUIs.

10 Jun 12, 2022
A simple reverse shell in python

RevShell A simple reverse shell in python Getting started First, start the server python server.py Finally, start the client (victim) python client.py

Lojacopsen 4 Apr 06, 2022
GoogleFormSpammer - A simple CLI script to spam Google Forms used by Crypto Wallet scammers to collect stolen data

GoogleFormSpammer - A simple CLI script to spam Google Forms used by Crypto Wallet scammers to collect stolen data

14 Dec 17, 2022
Fun project to generate The Matrix Code effect on you terminal.

Fun project to generate The Matrix Code effect on you terminal.

Henrique Bastos 11 Jul 13, 2022
Open-Source Python CLI package for copying DynamoDB tables and items in parallel batch processing + query natural & Global Secondary Indexes (GSIs)

Python Command-Line Interface Package to copy Dynamodb data in parallel batch processing + query natural & Global Secondary Indexes (GSIs).

1 Oct 31, 2021
A supercharged Git/GitHub command line interface (CLI)

A supercharged Git/GitHub command line interface (CLI).

Donne Martin 7.4k Jan 07, 2023
Unconventional ways to save an Image

Unexpected Image Saves Unconventional ways to save an image 😄 Have you ever been bored by the same old .png, .jpg, .jpeg, .gif and all other image ex

Eric Mendes 15 Nov 06, 2022
Stream comments, submissions from subreddits and users across reddit right in your terminal

reddit_from_terminal stream comments, submissions from subreddits and users across reddit right in your terminal Alert! : Can't watch media contents(p

Pritam Dhara 2 Dec 30, 2021
Task-manager-CLI with Priority Modification

Task-manager-CLI with Priority Modification The functions for the app have been written in task.py file. 1. Install Node.js This project requires Node

1 Jan 21, 2022
A simple web-based SSH client.

Kommander A simple web-based SSH client. It supports: entering SSH login details (including private key and custom ports) and connecting user authenti

KingWaffleIII 2 Jan 01, 2022
🎄 Advent of Code command-line tool.

🎄 advent-cli advent-cli is a command-line tool for interacting with Advent of Code, specifically geared toward writing solutions in Python. It can be

Christian Ferguson 6 Dec 01, 2022
A simple command line tool for changing the icons of folders or files on MacOS.

Mac OS File Icon Changer Description A small and simple script to quickly change large amounts or a few files and folders icons to easily customize th

Eroxl 3 Jan 02, 2023
Tncli - TON smart contract command line interface

Tncli TON smart contract command line interface State Not working, in active dev

Disintar IO 100 Dec 18, 2022
Random scripts and other bits for interacting with the SpaceX Starlink user terminal hardware

starlink-grpc-tools This repository has a handful of tools for interacting with the gRPC service implemented on the Starlink user terminal (AKA "the d

270 Dec 29, 2022
Simple Tool To Grab Like-Card Coupon

Simple Tool To Grab Like-Card Coupon

Soud 10 Jan 30, 2022
A command-line tool to flash python code to Codey Rocky without having to use the online mblock5 IDE.

What? A command-line tool to flash python code to Codey Rocky without having to use the online mblock5 IDE. Description This is a very low-effort proj

1 Dec 29, 2021