Skip to content

Instantly share code, notes, and snippets.

@Taylor123
Created April 3, 2024 14:59
Show Gist options
  • Save Taylor123/073c9080b78dd18b5cde2344604d2db9 to your computer and use it in GitHub Desktop.
Save Taylor123/073c9080b78dd18b5cde2344604d2db9 to your computer and use it in GitHub Desktop.
forever mine ORE
#!/bin/bash
while true
do
echo "Running"
ore --rpc "$1" --keypair "$2" --priority-fee 1000 mine --threads 4
echo "Exited"
done
@palinko91
Copy link

Or for Windows bat:

@echo off
echo Ore mining started...
:restart
ore --rpc %RPC_URL% --keypair %KEYPAIR_PATH% --priority-fee 1000 mine --threads 4
echo Ore miner restarts in 2 sec
timeout /t 2 /nobreak > nul
goto :restart

@github-plus
Copy link

how to use the file in windows,thank you

@MahmoudMohajer
Copy link

how to store keypair in text file? I mean can you show us an example.
and how much Sol is required to have in the wallet?

@Taylor123
Copy link
Author

Taylor123 commented Apr 4, 2024

how to store keypair in text file? I mean can you show us an example. and how much Sol is required to have in the wallet?

you could create a new keypair file as mentioned in the solana docs: https://docs.solanalabs.com/cli/wallets/paper

Sol required depends on how long you would expect it to run. 0.03 is more than enough to get started, but might need to be topped up at some point.

@0xNotAvailable
Copy link

Hello! I'm getting a "Transaction failed" error and there haven't been any successful transactions. What can be wrong?

@aboutmydreams
Copy link

Hello! I'm getting a "Transaction failed" error and there haven't been any successful transactions. What can be wrong?

same problem

@Aheesh
Copy link

Aheesh commented Apr 4, 2024

Transaction did not land thread 'main' panicked at /home/an/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ore-cli-0.4.2/src/register.rs:27:14: Transaction failed: Error { request: None, kind: Custom("Max retries") }

@Th3Ya0vi
Copy link

Th3Ya0vi commented Apr 4, 2024

This is what i did auto start right away

#!/bin/sh #start mining ore auto restart when miner times out while true; do ore --rpc https://api.mainnet-beta.solana.com --keypair ~/.config/solana/id.json --priority-fee 1000 mine --threads 6 echo "stopped. restarting" sleep 1 done

@Banksy-said-hi
Copy link

This is what i did auto start right away

#!/bin/sh #start mining ore auto restart when miner times out while true; do ore --rpc https://api.mainnet-beta.solana.com --keypair ~/.config/solana/id.json --priority-fee 1000 mine --threads 6 echo "stopped. restarting" sleep 1 done

Did it work?

@shadowzoom
Copy link

How to use it in macos?

@hogyzen12
Copy link

If you plan to use the above script on windows - install wsl2 so it will work.

for MACos it should work if you save it as a .sh file and make executable.

You can copy paste the code into chatgpt, ask it to modify it for whichever OS you are using, and then ask it to explain the steps you should take.

before running make sure you ahve solana cli installed and have created a keypair - and are passing this key in. It will need to have SOL funded in it to work and send TXs.

some steps/advice for different OS below:

UNIX
Prepare the Script:
Save your script to a file, for example, mine.sh.
Make the script executable by running chmod +x mine.sh in the terminal.
Run the Script: Execute the script by navigating to the directory where your script is located and running ./mine.sh followed by any required arguments.

MAC
Prepare and Run the Script: As with Unix/Linux, save your script to a file, make it executable (chmod +x mine.sh), and run it with ./mine.sh plus any necessary arguments.

Windows/WSL2
To run Bash scripts on Windows, you'll use the Windows Subsystem for Linux (WSL2).

Install WSL2: Follow the instructions on the official Microsoft documentation to install WSL2: https://docs.microsoft.com/en-us/windows/wsl/install
....
then same as unix to run it

@d3f4ultt
Copy link

d3f4ultt commented Apr 7, 2024

keep getting an error with my ore-cli about AccountNotFound then lists an unknown pubkey. Ive configured my solana-cli to my generated keypair.json, funded the wallet, i pass the same keypair.json when running ore but dont see any options to init or register the Account as a recognized miner. one of my miners seems to be functioning correctly while the other is erroring alot. Here is a backtrace print, any ideas what is going on here if one is working but not the other? How do i init and register my keypair.json?

2e2SPCbz7dsTov8afEzZGj9xCJuZSWcNC9JWyRYiQjBff4dmx2d2sCeBbW1oBPzVWwMruTGaZPtpFeCUxSoPeW6p
Confirms: [None, None, None, None, None]
Confirms: [None, None, None, None, None]
Confirms: [None, None, None, None, None]
Confirms: [None, None, None, None, None]
Transaction did not land
Sending on bus 6 (0.236760255 ORE)
Attempt: 0
4seiVy7VrJmnf9bdVYXW6USYGMVcyJB1U2U2tJznb7jYn49i27J39a6v4SxHEbgvdZ5Nq4n8qmQvFs2v9MapPduv
Confirms: [None]
Confirms: [None]
Confirms: [None]
Confirms: [None]
Transaction did not land
Attempt: 1
3K54ex7r1r3mCGasMYmo9ntjzdSn2xMzjenwrpFWg1LyNE3oXnyt54QeRUMUhJMSbaH9EuxGnSx4JXm83eXfmiY2
debug2: channel 0: window 999347 sent adjust 49229
Confirms: [None, None]
Confirms: [None, None]
Confirms: [None, None]
Confirms: [None, None]
Transaction did not land
root@CNC:~/oreminer# RUST_BACKTRACE=full ore rewards
thread 'main' panicked at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ore-cli-0.4.8/src/utils.rs:28:10:
Failed to get miner account: Error { request: None, kind: RpcError(ForUser("AccountNotFound: pubkey=BS5M1Ws7FG2ZvJe5wzD5TPEUkCEPFt6W5aKvMpi2o8hZ")) }
stack backtrace:
   0:     0x55be02536026 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9cca0343d66d16a8
   1:     0x55be0255f020 - core::fmt::write::h4311bce0ee536615
   2:     0x55be025331df - std::io::Write::write_fmt::h0685c51539d0a0cd
   3:     0x55be02535e04 - std::sys_common::backtrace::print::h2fb8f70628a241ed
   4:     0x55be025374d7 - std::panicking::default_hook::{{closure}}::h05093fe2e3ef454d
   5:     0x55be02537239 - std::panicking::default_hook::h5ac38aa38e0086d2
   6:     0x55be02537968 - std::panicking::rust_panic_with_hook::hed79743dc8b4b969
   7:     0x55be02537842 - std::panicking::begin_panic_handler::{{closure}}::ha437b5d58f431abf
   8:     0x55be02536526 - std::sys_common::backtrace::__rust_end_short_backtrace::hd98e82d5b39ec859
   9:     0x55be02537594 - rust_begin_unwind
  10:     0x55be020c5b65 - core::panicking::panic_fmt::hc69c4d258fe11477
  11:     0x55be020c60b3 - core::result::unwrap_failed::hff299ec748d62aab
  12:     0x55be0211e943 - ore::utils::get_proof::{{closure}}::hba1ffbb0c300f4fe
  13:     0x55be0211f479 - ore::main::{{closure}}::h475c6e77185465a7
  14:     0x55be02119279 - tokio::runtime::park::CachedParkThread::block_on::h04e559b5c70f1025
  15:     0x55be0216f33a - tokio::runtime::context::runtime::enter_runtime::hf12487f782127fe1
  16:     0x55be021698ee - tokio::runtime::runtime::Runtime::block_on::hd045065fe5bfd5b6
  17:     0x55be0218ddd9 - ore::main::hf8a6713f7a7c6780
  18:     0x55be02171253 - std::sys_common::backtrace::__rust_begin_short_backtrace::hcd99e29c4ad0920e
  19:     0x55be0219beb9 - std::rt::lang_start::{{closure}}::h9a6d368e30d2b947
  20:     0x55be0252dfa1 - std::rt::lang_start_internal::hdaf8b62dc8f7de54
  21:     0x55be0218dea5 - main
  22:     0x7f84906ddd90 - <unknown>
  23:     0x7f84906dde40 - __libc_start_main
  24:     0x55be020c63b5 - _start
  25:                0x0 - <unknown>

@hogyzen12
Copy link

buy some ore and send it to yout wallet - in turn it will create the account needed. Even something like 0.01 ORE should do that

@bashar1988
Copy link

can you please write the claim code for wsl2 iam using
ore --rpc (my rpc) --keypair ~/.config/solana/id.json --priority-fee 30000000 claim
but no sucsses

@netdost
Copy link

netdost commented Apr 9, 2024

#!/bin/sh #start mining ore auto restart when miner times out while true; do ore --rpc https://api.mainnet-beta.solana.com --keypair ~/.config/solana/id.json --priority-fee 1000 mine --threads 6 echo "stopped. restarting" sleep 1 done

Did this work? I am getting below error when i try to run the above as is. Maybe some other steps are required
/bin/sh: 0: Can't open #start mining ore auto restart when miner times out while true; do ore --rpc https://api.mainnet-beta.solana.com --keypair ~/.config/solana/id.json --priority-fee 1000 mine --threads 4 echo "stopped. restarting" sleep 1 done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment