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
Owner
null
A command-line based, minimal torrent streaming client made using Python and Webtorrent-cli. Stream your favorite shows straight from the command line.

A command-line based, minimal torrent streaming client made using Python and Webtorrent-cli. Installation pip install -r requirements.txt It use

Jonardon Hazarika 17 Dec 11, 2022
This is a Command Line program to interact with your NFTs, Cryptocurrencies etc

This is a Command Line program to interact with your NFTs, Cryptocurrencies etc. via the ThirdWeb Platform. This is just a fun little project that I made to be able to connect to blockchains and Web3 from the command line.

Arpan Pandey 5 Oct 2, 2022
A supercharged AWS command line interface (CLI).

SAWS Motivation AWS CLI Although the AWS CLI is a great resource to manage your AWS-powered services, it's tough to remember usage of: 70+ top-level c

Donne Martin 5.1k Jan 5, 2023
Microsoft Azure CLI - Azure Command-Line Interface

A great cloud needs great tools; we're excited to introduce Azure CLI, our next generation multi-platform command line experience for Azure.

Microsoft Azure 3.4k Dec 30, 2022
moviepy-cli: Command line interface for MoviePy.

Moviepy-cli is designed to apply several video editing in a single command with Moviepy as an alternative to Video-cli.

Kentaro Wada 23 Jun 29, 2022
Quo is a Python based toolkit for writing Command-Line Interface(CLI) applications.

Quo is a Python based toolkit for writing Command-Line Interface(CLI) applications. Quo is making headway towards composing speedy and orderly CLI applications while forestalling any disappointments brought about by the failure to execute a CLI API. Simple to code, easy to learn, and does not come with needless baggage.

Secretum Inc. 16 Oct 15, 2022
Program Command Line Interface (CLI) Sederhana: Pemesanan Nasi Goreng Hekel

Program ini merupakan aplikasi yang berjalan di dalam command line (terminal). Program ini menggunakan built-in library python yaitu argparse yang dapat menerima parameter saat program ini dijalankan melalui terminal atau CLI.

Habib Abdurrasyid 5 Nov 19, 2021
RSS reader client for CLI (Command Line Interface),

rReader is RSS reader client for CLI(Command Line Interface)

Lee JunHaeng 10 Dec 24, 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
MsfMania is a command line tool developed in Python that is designed to bypass antivirus software on Windows and Linux/Mac in the future

MsfMania MsfMania is a command line tool developed in Python that is designed to bypass antivirus software on Windows and Linux/Mac in the future. Sum

null 446 Dec 21, 2022
Bonjour Software pypahe is a Python Package Helper command-line tool.

pypahe Bonjour Software pypahe is a Python Package Helper command-line tool. Requirements Docker runtime Usage print the latest available version of a

Bonjour Software 0 Aug 10, 2021
Command line interface for testing internet bandwidth using speedtest.net

speedtest-cli Command line interface for testing internet bandwidth using speedtest.net Versions speedtest-cli works with Python 2.4-3.7 Installation

Matt Martz 12.4k Jan 8, 2023
Universal Command Line Interface for Amazon Web Services

This package provides a unified command line interface to Amazon Web Services.

Amazon Web Services 13.3k Jan 7, 2023
command line interface to manage VALORANT skins

A PROPER RELEASE IS COMING SOON, IF YOU KNOW HOW TO USE PYTHON YOU CAN USE IT NOW! valorant skin manager command line interface simple command line in

colinh 131 Dec 25, 2022
A command line interface to buy things in stregsystemet

Stregsystemet-CLI This repository is the Stregsystemet CLI, to buy things in Stregsystemet, at AAU. Use of this cli-tool is at your own risk and there

F-klubben 14 Oct 18, 2022
Command line interface for unasync

CLI for unasync Command line interface for unasync Getting started Install Run the following command to install the package with pip: pip install unas

Leynier Gutiérrez González 3 Apr 4, 2022
Rover is a command line interface application that allows through browse through mission data, images, metadata from the NASA Official Website

?? rover Rover is a command line interface application that allows through browse through mission data, images, metadata from the NASA Official Websit

Saketha Ramanjam 4 Jan 19, 2022
bsp_tool provides a Command Line Interface for analysing .bsp files

bsp_tool Python library for analysing .bsp files bsp_tool provides a Command Line Interface for analysing .bsp files Current development is focused on

Jared Ketterer 64 Dec 28, 2022
Investing library and command-line interface inspired by the Bogleheads philosophy

Lakshmi (Screenshot of the lak command in action) Background This project is inspired by Bogleheads forum. Bogleheads focus on a simple but powerful p

Sarvjeet Singh 108 Dec 26, 2022