regolith-labs / ore-cli

Command line interface for ORE cryptocurrency mining.
919 stars 443 forks source link

UI Work to improve clarity of mining process #65

Closed pmcochrane closed 1 month ago

pmcochrane commented 2 months ago

This is my first effort into rust programming so go easy. Spent a few days working on trying to clarify the logging & output for the miner process. The original version was particularly verbose and caused lots of scrolling (particularly when the network is congested).

Main changes in this pull request:

I realise that this logging may be too late but hopefully they may be a pointer for the next version of the client.

pmcochrane commented 2 months ago

Here is an example of one mining pass when the network is congested:

-------------------------------------------------------------------------------
2024-04-12 18:16:06 Starting Miner 1.....
2024-04-12 18:16:06 RPC: https://quaint-proud-dew.solana-mainnet.quiknode.pro/XXXXXXXXXXXXXXXXXXXXXXXXX/
2024-04-12 18:16:06 ore-cli: /home/paul/ore-cli/target/release/ore
2024-04-12 18:16:06 Initial SOL Price:  $165.28
2024-04-12 18:16:06 Initial ORE Price:  $131.2
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Mining Pass 1
-------------------------------------------------------------------------------
Wallet:                 8P8cvM6pBSNnr3mV43TDHUAt7H85qQYuM6Ge7H8oV77E
RPC_URL:                https://quaint-proud-dew.solana-mainnet.quiknode.pro/XXXXXXXXXXXXXXXXX/
Initial SOL Price:      $165.28
Initial ORE Price:      $131.20
SOL Balance:            0.042823706     $7.08   Used: 0.000000000       $0.00
ORE Balance:            0.024401467     $3.20
ORE Claimable:          0.003724750     $0.49
Session Rewards:        0.000000000     $0.00   (succeeded 0 times)
Reward Rate:            0.000046928     $0.01

Mining for a valid hash...
1112my4AwPcd98tAw5FVS1yzvhfzYo8M2j82ZH7w3ZJP

Submitting hash for validation...
-------------------------------------------------------------------------------
Submit Hash 1:  Sending on bus 3 (0.14417736 ORE) priority_fee: 500011  [Sim 1] TX ID: 4PcUK2mxu9wotYR3oAs5tuF3ELqojtM6Bmqb6uTuHZtuSi2snUJqBz6SUn7dNecSktajfmZMTRHX7VZpaQwgSRFY
1/15:...[FAIL]  2/15:...[FAIL]  3/15:...[FAIL]  4/15:...[FAIL]  5/15:...[FAIL]  6/15:...[FAIL]  7/15:...[FAIL]  8/15:...[FAIL]  9/15:...[FAIL]  10/15:...[FAIL] 11/15:...[FAIL] 12/15:...[FAIL] 13/15:...[FAIL] 14/15:...[FAIL] 15/15:...[FAIL]
Submit Hash 1:  [ERROR] Failed to submit hash. Will retry on another bus...
-------------------------------------------------------------------------------
Submit Hash 2:  Sending on bus 0 (0.2127397 ORE) priority_fee: 500011   [Sim 1] TX ID: 64s7wTbanizNuF1obKdkvevVoh9FXn9dN28PfackRVaKf7e56AwGNeBuYWYkzEopLvUShTtvg5pAhJTUh8eZttY1
1/15:...[FAIL]  2/15:...[FAIL]  3/15:...[FAIL]  4/15:...[FAIL]  5/15:...[FAIL]  6/15:...[FAIL]  7/15:...[FAIL]  8/15:...[FAIL]  9/15:...[FAIL]  10/15:...[FAIL] 11/15:...[FAIL] 12/15:...[FAIL] 13/15:...[FAIL] 14/15:...[FAIL] 15/15:...[FAIL]
Submit Hash 2:  [ERROR] Failed to submit hash. Will retry on another bus...
-------------------------------------------------------------------------------
Submit Hash 3:  Sending on bus 2 (0.142445582 ORE) priority_fee: 500011 [Sim 1] TX ID: 5KWsToohG3Wf2eTrvL6MLcCa9Sq84wDNkajPKSszuBc4XwLLQeZ8R5NUEBt319ahmSX1v7Vks9ApARVMbA2cXQEa
1/15:...[FAIL]  2/15:...[FAIL]  3/15:...[FAIL]  4/15:...[FAIL]  5/15:...[FAIL]  6/15:...[FAIL]  7/15:...[FAIL]  8/15:...[FAIL]  9/15:...[FAIL]  10/15:...[FAIL] 11/15:...[FAIL] 12/15:...[FAIL] 13/15:...[FAIL] 14/15:...[FAIL] 15/15:...[FAIL]
Submit Hash 3:  [ERROR] Failed to submit hash. Will retry on another bus...
-------------------------------------------------------------------------------
Submit Hash 4:  Sending on bus 0 (0.200368011 ORE) priority_fee: 500011 [Sim 1] TX ID: 494Z6CSyPBmKxzLhrdctS5JVanr7Uu23LwNdzWrxBZuzJ5ke5fe3CP7CLaEVJFV71uDJr9QvdNpcxugsQzTBnsFt
1/15:...[FAIL]  2/15:...[FAIL]  3/15:...[FAIL]  4/15:..[SUCCESS]        Transaction landed!

Submit Hash 4:  [SUCCESS] Rewards available in wallet. TX ID: 494Z6CSyPBmKxzLhrdctS5JVanr7Uu23LwNdzWrxBZuzJ5ke5fe3CP7CLaEVJFV71uDJr9QvdNpcxugsQzTBnsFt
Submit Hash 4:  Time for pass execution: (hash)19s + (submit)508s = 528s for entire pass
pmcochrane commented 1 month ago

No longer required. This was v1