Pages:
Author

Topic: How exactly does a cpu miner work? (Read 384 times)

legendary
Activity: 1512
Merit: 7340
Farewell, Leo
September 01, 2020, 05:04:28 PM
#22
I can't believe I'm still working on this.

Has anyone any idea why I have zero connections? Or how I can make 1 connection pointing on myself?

This is my debug.log: https://pastebin.com/raw/kEF2kRqj

This is my mitcoin.conf:
Code:
rpcuser=user
rpcpassword=password
server=1
daemon=1
listen=1
rpcallowip=127.0.0.1
rpcport=2332
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
August 26, 2020, 10:24:08 AM
#21
Okay, I sent you a private message.
sr. member
Activity: 1249
Merit: 297
August 26, 2020, 10:05:37 AM
#20
This is my brand new coin. I've never created one. It's my first one. So if I send you the files what exactly will you do? Will you open port 2332 and send me your IP address to connect?

If I want to be a seednode, do I need a port forward on port 2332?

And also what files? Those on .mitcoin or the mitcoin folder on desktop? I'll upload you both.

dotmitcoin.zip: https://mega.nz/file/9VokjaxB#rZyySNnfE4sYNPx1nU9JR7HXoDhIwzh3mxSAsRsR1nE
mitcoin.zip: https://mega.nz/file/hBgADC4J#f9N5CpJ9nb9VSgwdvy9sxiS7a96B0UxCDCKtLwKeQiE


Sorry i have taken so long, i could get it to run on Ubuntu 16.
Then tried Ubu18, and had to do a load of messing around (lib4.8, etc etc)
So finally got it working, but need your ip address, and you to leave the wallet open please
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
August 25, 2020, 10:37:58 AM
#19
This is my brand new coin. I've never created one. It's my first one. So if I send you the files what exactly will you do? Will you open port 2332 and send me your IP address to connect?

If I want to be a seednode, do I need a port forward on port 2332?

And also what files? Those on .mitcoin or the mitcoin folder on desktop? I'll upload you both.

dotmitcoin.zip: https://mega.nz/file/9VokjaxB#rZyySNnfE4sYNPx1nU9JR7HXoDhIwzh3mxSAsRsR1nE
mitcoin.zip: https://mega.nz/file/hBgADC4J#f9N5CpJ9nb9VSgwdvy9sxiS7a96B0UxCDCKtLwKeQiE
sr. member
Activity: 1249
Merit: 297
August 25, 2020, 10:27:19 AM
#18
It seems that I successfully mined 2 blocks. The problem is that I don't know the addresses. I've never seen them, but the coinbase reward went to them.





^ I only have that one address.

You're missing the point.
If the wallet has ZERO connections, the blocks don't count. There is no chain. They can never validate.
Like i say, you need a seednode or at least 1 other wallet.

Is this your brandnew coin, or an old one you have found?
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
August 25, 2020, 10:20:08 AM
#17
It seems that I successfully mined 2 blocks. The problem is that I don't know the addresses. I've never seen them, but the coinbase reward went to them.





^ I only have that one address.
sr. member
Activity: 1249
Merit: 297
August 25, 2020, 10:03:28 AM
#16
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
August 25, 2020, 07:59:47 AM
#15
No I don't have a config file, but I just created one. (mitcoin.conf)

The problem is that I can't see the port you're saying:



Edit: Is it one of these?

Code:
Options:
  -?                     This help message
  -conf=           Specify configuration file (default: mitcoin.conf)
  -pid=            Specify pid file (default: mitcoind.pid)
  -gen                   Generate coins (default: 0)
  -datadir=         Specify data directory
  -dbcache=           Set database cache size in megabytes (default: 25)
  -timeout=           Specify connection timeout in milliseconds (default: 5000)
  -proxy=       Connect through socks proxy
  -socks=             Select the version of socks proxy to use (4-5, default: 5)
  -tor=         Use proxy to reach tor hidden services (default: same as -proxy)
  -dns                   Allow DNS lookups for -addnode, -seednode and -connect
  -port=           Listen for connections on (default: 2333 or testnet: 12333)
  -maxconnections=    Maintain at most connections to peers (default: 125)
  -addnode=          Add a node to connect to and attempt to keep the connection open
  -connect=          Connect only to the specified node(s)
  -seednode=         Connect to a node to retrieve peer addresses, and disconnect
  -externalip=       Specify your own public address
  -onlynet=         Only connect to nodes in network (IPv4, IPv6 or Tor)
  -discover              Discover own IP address (default: 1 when listening and no -externalip)
  -checkpoints           Only accept block chain matching built-in checkpoints (default: 1)
  -listen                Accept connections from outside (default: 1 if no -proxy or -connect)
  -bind=           Bind to given address and always listen on it. Use [host]:port notation for IPv6
  -dnsseed               Find peers using DNS lookup (default: 1 unless -connect)
  -banscore=          Threshold for disconnecting misbehaving peers (default: 100)
  -bantime=           Number of seconds to keep misbehaving peers from reconnecting (default: 86400)
  -maxreceivebuffer=  Maximum per-connection receive buffer, *1000 bytes (default: 5000)
  -maxsendbuffer=     Maximum per-connection send buffer, *1000 bytes (default: 1000)
  -bloomfilters          Allow peers to set bloom filters (default: 1)
  -upnp                  Use UPnP to map the listening port (default: 1 when listening)
  -paytxfee=        Fee per KB to add to transactions you send
  -mininput=        When creating transactions, ignore inputs with value less than this (default: 0.0001)
  -server                Accept command line and JSON-RPC commands
  -testnet               Use the test network
  -debug                 Output extra debugging information. Implies all other -debug* options
  -debugnet              Output extra network debugging information
  -logtimestamps         Prepend debug output with timestamp (default: 1)
  -shrinkdebugfile       Shrink debug.log file on client startup (default: 1 when no -debug)
  -printtoconsole        Send trace/debug info to console instead of debug.log file
  -rpcuser=        Username for JSON-RPC connections
  -rpcpassword=      Password for JSON-RPC connections
  -rpcport=        Listen for JSON-RPC connections on (default: 2332 or testnet: 12332)
  -rpcallowip=       Allow JSON-RPC connections from specified IP address
  -rpcthreads=        Set the number of threads to service RPC calls (default: 4)
  -blocknotify=     Execute command when the best block changes (%s in cmd is replaced by block hash)
  -walletnotify=    Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)
  -spendzeroconfchange   Spend unconfirmed change when sending transactions (default: 1)
  -alertnotify=     Execute command when a relevant alert is received (%s in cmd is replaced by message)
  -upgradewallet         Upgrade wallet to latest format
  -keypool=           Set key pool size to (default: 100)
  -rescan                Rescan the block chain for missing wallet transactions
  -salvagewallet         Attempt to recover private keys from a corrupt wallet.dat
  -checkblocks=       How many blocks to check at startup (default: 288, 0 = all)
  -checklevel=        How thorough the block verification is (0-4, default: 3)
  -txindex               Maintain a full transaction index (default: 0)
  -loadblock=      Imports blocks from external blk000??.dat file
  -maxorphantx=       Keep at most unconnectable transactions in memory (default: 25)
  -reindex               Rebuild block chain index from current blk000??.dat files
  -par=               Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)

Block creation options:
  -blockminsize=      Set minimum block size in bytes (default: 0)
  -blockmaxsize=      Set maximum block size in bytes (default: 250000)
  -blockprioritysize= Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)

SSL options: (see the Mitcoin Wiki for SSL setup instructions)
  -rpcssl                                  Use OpenSSL (https) for JSON-RPC connections
  -rpcsslcertificatechainfile=  Server certificate file (default: server.cert)
  -rpcsslprivatekeyfile=         Server private key (default: server.pem)
  -rpcsslciphers=                 Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)

UI options:
  -lang=           Set language, for example "de_DE" (default: system locale)
  -min                   Start minimized
  -splash                Show splash screen on startup (default: 1)

2nd Edit: Okay, I set port=2332. This is my mitcoin.conf:
Code:
rpcuser=user
rpcpassword=password
server=1
daemon=1
listen=1
rpcallowip=127.0.0.1
rpcport=2332

3rd Edit: Shouldn't this be something else?


Output of cpuminer:


sr. member
Activity: 1249
Merit: 297
August 25, 2020, 04:36:42 AM
#14
How to know if it's running?



Your wallet is connecting to any nodes, so thats your first problem.

Once you have a node / seednode i can help you.

you need a .conf file, i'm guessing you know where that goes?
it needs to contain
rpcuser=user (any username)
rpcpassword=password (any password)
server=1
daemon=1
listen=1
rpcallowip=127.0.0.1
rpcport=5555 (any port, but best to goto wallet, HELP, SHOW commands, and the default rpc port will be listed)

Then you need to start the wallet with ./mycoin - server

If it can't find the correct .conf, in the correct location, it usually shows you what it should be called, and where it expects to find it....

./minerd --algo=scrypt --url=http://127.0.0.1t:5555 -u user -p password --coinbase-addr=TDuGXYumssr2Xw2utvXyEYNCdFtTj5XguV -t 4

I have used "scrypt" because you said it was based on"litecoin", you need to use tha wallet to create a new receive address....give it a name of solo, then if you eventually make a pool, you can see what comes from where.
technically you can just use the first address, but i always find that creating a new one works...no idea why.

If that fails, drop me a DM, i can try your wallet on my PC and see if i can get you going.

J
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
August 23, 2020, 06:07:36 AM
#13
How to know if it's running?

legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
August 23, 2020, 06:01:48 AM
#12
It seems that I'm not connected to localhost:2333, how can I verify or just know what is my RPC?
Is your node running?
If no, you need to run it together with the mining software.

What are you using, the GUI or CLI?
If it's the GUI, you might need to add server=1 to your config file to enable RPC outside of the GUI's console.
(that's based from Bitcoin Core's behavior)
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
August 23, 2020, 05:29:44 AM
#11
Um, I don't think the posters above actually read the topic.  Tongue You don't have to open your firewall because the communication is done within your LAN.

Anyways, you need to add your RPC username and password. You have to configure your client's config file, the bitcoin.conf equivalent. That's the reason for the connection being refused.

What username:password? Do i choose them?

Edit: If you mean the ubuntu's username and password then the answer is that nothing happens:

My command:
Code:
./minerd --algo=sha256d --url=http://localhost:2333 --userpass=angelo:MYPASSWORD --coinbase-addr=TDuGXYumssr2Xw2utvXyEYNCdFtTj5XguV

Output:
Code:
[2020-08-23 13:54:27] 2 miner threads started, using 'sha256d' algorithm.
[2020-08-23 13:54:27] Binding thread 0 to cpu 0
[2020-08-23 13:54:27] Binding thread 1 to cpu 1
[2020-08-23 13:54:27] HTTP request failed: Failed to connect to localhost port 2333: Connection refused
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
August 23, 2020, 05:28:39 AM
#10
Um, I don't think the posters above actually read the topic.  Tongue You don't have to open your firewall because the communication is done within your LAN.

Anyways, you need to add your RPC username and password. You have to configure your client's config file, the bitcoin.conf equivalent. That's the reason for the connection being refused.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
August 23, 2020, 04:49:48 AM
#9
But I am on ...  linux. Not windows.

(Except if there's a config file on cpuminer folder.)
member
Activity: 132
Merit: 10
August 23, 2020, 04:47:32 AM
#8


It seems that I'm not connected to localhost:2333, how can I verify or just know what is my RPC?

Hello in config file:

rpcuser=yourusername
rpcpassword=yourpassword
rpcallowip=127.0.0.1
server=1
rcpport=47950

Restart your wallet

mining.bat

minerd.exe -a algo -o http://127.0.0.1:47950 -u -p
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
August 23, 2020, 04:33:56 AM
#7
It seems that I'm not connected to localhost:2333, how can I verify or just know what is my RPC?
I think you must unlocked that tcp (local host connection) first.
Try these following steps (and for security purpose) as root :
Code:
ufw status
if result "inactive", then type :
Code:
ufw enable
then type "Y".
Then type :
Code:
ufw allow 2333/tcp

then try restart your cpuminer

On ufw enable I get:
Code:
Firewall is active and enabled on system startup

On ufw allow 2333/tcp I get:
Code:
Skipping adding existing rule
Skipping adding existing rule (v6)

But still when I run the ./minerd command I get:
Code:
[2020-08-23 12:33:10] HTTP request failed: Failed to connect to localhost port 2333: Connection refused
[2020-08-23 12:33:10] json_rpc_call failed, retry after 30 seconds
hero member
Activity: 994
Merit: 593
aka JAGEND.
August 23, 2020, 04:04:54 AM
#6
It seems that I'm not connected to localhost:2333, how can I verify or just know what is my RPC?
I think you must unlocked that tcp (local host connection) first.
Try these following steps (and for security purpose) as root :
Code:
ufw status
if result "inactive", then type :
Code:
ufw enable
then type "Y".
Then type :
Code:
ufw allow 2333/tcp

then try restart your cpuminer



legendary
Activity: 1512
Merit: 7340
Farewell, Leo
August 23, 2020, 03:50:05 AM
#5


It seems that I'm not connected to localhost:2333, how can I verify or just know what is my RPC?
hero member
Activity: 994
Merit: 593
aka JAGEND.
August 23, 2020, 03:35:04 AM
#4
I hope you have a strong CPU when you want to do solo mining. If not, perhaps you can use this pool for your solo mining.

http://blockmasters.co/site/get-started
https://bitcointalksearch.org/topic/blockmastersco-130-coins-us-eu-as-35-scrypt-coins-doge-payouts-2362982

legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
August 22, 2020, 10:23:22 PM
#3
If the node is in the same machine as the miner and the sample above doesn't work, try to use localhost and the port (your blockchain's), as the 'mining server'.
Code:
--url=http://localhost:port
Pages:
Jump to: