Bitcoin Forum
November 10, 2024, 10:35:03 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to start mining in offline?  (Read 2244 times)
kzv (OP)
Legendary
*
Offline Offline

Activity: 1722
Merit: 1285

OpenTrade - Open Source Cryptocurrency Exchange


View Profile WWW
October 01, 2016, 05:04:21 AM
Merited by ABCbits (1)
 #1

Hello,

I'm testing blockchain technology and want to understand how bitcoind is start mining?

I run bitcoind in offline machine with "bintcoind -daemon -gen" and i waiting for him to begin mining new blockchain statred from Genesis block...
I waited a long time, but it does not generate a new chain!

So i tried "bintcoind -daemon -regtest" but it does not generate a blockchain too!

Why is this happening?

OpenTrade - Open Source Cryptocurrency Exchange
2112
Legendary
*
Offline Offline

Activity: 2128
Merit: 1073



View Profile
October 01, 2016, 05:28:40 AM
 #2

For the Bitcoin Core client to start mining it requires some minimal rudimentary peer to peer network. If I remember correctly the minimum is either 2 or 3 peers. You actually don't need the separate computers, the necessary peer to peer network can be created on a single computer by running multiple Bitcoin Core instances under multiple user accounts.

I don't remember the details, you'll have to experiment with starting multiple instances of Bitcoin Core with several flags: -connect=? , -port=? and -rpcport=? .

Edit: If I remember correctly such setup is not called "offline mining", it is called "testnet in a box", even if you aren't running testnet.

Also, research older versions of cgminer that still supported GPU mining of Bitcoin to use for your tests. GPU mining is much more power-efficient than CPU mining. With a mid-range laptop (couple of years ago, when GPU mining of Bitcoin was still a thing) you should be able to run all the required programs (multiple instances of Bitcoin Core and at least one instance of cgminer) on batteries and without spinning up the laptop's fan or having to suffer a hot laptop. Even if you work on a desktop and not on the laptop, the power savings and the fan noise reduction are really helpful for the developer.


Please comment, critique, criticize or ridicule BIP 2112: https://bitcointalk.org/index.php?topic=54382.0
Long-term mining prognosis: https://bitcointalk.org/index.php?topic=91101.0
kzv (OP)
Legendary
*
Offline Offline

Activity: 1722
Merit: 1285

OpenTrade - Open Source Cryptocurrency Exchange


View Profile WWW
October 01, 2016, 07:44:31 AM
 #3

I tried to start several bitcoind
Code:
#!/bin/bash
$HOME/bitcoin-0.13.0/src/bitcoind -regtest -server -listen -port=17591 -rpcuser=bitcoinrpc -rpcpassword=P -rpcport=16591 -datadir=$HOME/ForkTest/A/ -connect=localhost:17592 -pid=$HOME/ForkTest/A/.pid -daemon -debug
$HOME/bitcoin-0.13.0/src/bitcoind -regtest -server -listen -port=17592 -rpcuser=bitcoinrpc -rpcpassword=P -rpcport=16592 -datadir=$HOME/ForkTest/B/ -connect=localhost:17593 -pid=$HOME/ForkTest/B/.pid -daemon -debug
$HOME/bitcoin-0.13.0/src/bitcoind -regtest -server -listen -port=17593 -rpcuser=bitcoinrpc -rpcpassword=P -rpcport=16593 -datadir=$HOME/ForkTest/C/ -connect=localhost:17594 -pid=$HOME/ForkTest/C/.pid -daemon -debug
$HOME/bitcoin-0.13.0/src/bitcoind -regtest -server -listen -port=17594 -rpcuser=bitcoinrpc -rpcpassword=P -rpcport=16594 -datadir=$HOME/ForkTest/D/ -connect=localhost:17591 -pid=$HOME/ForkTest/C/.pid -daemon -debug

but the blockchain still does not start mining (((

OpenTrade - Open Source Cryptocurrency Exchange
2112
Legendary
*
Offline Offline

Activity: 2128
Merit: 1073



View Profile
October 01, 2016, 12:02:49 PM
 #4

Conceptually your ring of 4 peers looks correct and should be capable of mining. I don't know why it isn't working for you.

The only thing I can suggest is to search the net for the phase "testnet in a box". There are multiple pages describing exactly how they did it. Just retrace exactly their steps. I've done it multiple times, but my computers used for testing are in storage and I can't look at them now.

Please comment, critique, criticize or ridicule BIP 2112: https://bitcointalk.org/index.php?topic=54382.0
Long-term mining prognosis: https://bitcointalk.org/index.php?topic=91101.0
cr1776
Legendary
*
Offline Offline

Activity: 4214
Merit: 1313


View Profile
October 01, 2016, 12:41:50 PM
Merited by ABCbits (1)
 #5

I tried to start several bitcoind
Code:
#!/bin/bash
$HOME/bitcoin-0.13.0/src/bitcoind -regtest -server -listen -port=17591 -rpcuser=bitcoinrpc -rpcpassword=P -rpcport=16591 -datadir=$HOME/ForkTest/A/ -connect=localhost:17592 -pid=$HOME/ForkTest/A/.pid -daemon -debug
$HOME/bitcoin-0.13.0/src/bitcoind -regtest -server -listen -port=17592 -rpcuser=bitcoinrpc -rpcpassword=P -rpcport=16592 -datadir=$HOME/ForkTest/B/ -connect=localhost:17593 -pid=$HOME/ForkTest/B/.pid -daemon -debug
$HOME/bitcoin-0.13.0/src/bitcoind -regtest -server -listen -port=17593 -rpcuser=bitcoinrpc -rpcpassword=P -rpcport=16593 -datadir=$HOME/ForkTest/C/ -connect=localhost:17594 -pid=$HOME/ForkTest/C/.pid -daemon -debug
$HOME/bitcoin-0.13.0/src/bitcoind -regtest -server -listen -port=17594 -rpcuser=bitcoinrpc -rpcpassword=P -rpcport=16594 -datadir=$HOME/ForkTest/D/ -connect=localhost:17591 -pid=$HOME/ForkTest/C/.pid -daemon -debug

but the blockchain still does not start mining (((

Did you try the generate RPC call to mine a new block?  (setgenerate has been removed due to the internal miner being removed - see e.g. https://bitcoin.org/en/release/v0.13.0#removal-of-internal-miner )
cr1776
Legendary
*
Offline Offline

Activity: 4214
Merit: 1313


View Profile
October 01, 2016, 12:42:33 PM
 #6

since mining is a way to make small earning in the present time because mining is not more profitable work for mining hardware in the current time so i will suggest you to leave your idea of mining bitcoin . it is waste of time .

I guess you didn't bother to read the first message and just wanted to post in order to increase your ad campaign post count?  
kzv (OP)
Legendary
*
Offline Offline

Activity: 1722
Merit: 1285

OpenTrade - Open Source Cryptocurrency Exchange


View Profile WWW
October 02, 2016, 06:41:54 PM
 #7

I tried to start several bitcoind
Code:
#!/bin/bash
$HOME/bitcoin-0.13.0/src/bitcoind -regtest -server -listen -port=17591 -rpcuser=bitcoinrpc -rpcpassword=P -rpcport=16591 -datadir=$HOME/ForkTest/A/ -connect=localhost:17592 -pid=$HOME/ForkTest/A/.pid -daemon -debug
$HOME/bitcoin-0.13.0/src/bitcoind -regtest -server -listen -port=17592 -rpcuser=bitcoinrpc -rpcpassword=P -rpcport=16592 -datadir=$HOME/ForkTest/B/ -connect=localhost:17593 -pid=$HOME/ForkTest/B/.pid -daemon -debug
$HOME/bitcoin-0.13.0/src/bitcoind -regtest -server -listen -port=17593 -rpcuser=bitcoinrpc -rpcpassword=P -rpcport=16593 -datadir=$HOME/ForkTest/C/ -connect=localhost:17594 -pid=$HOME/ForkTest/C/.pid -daemon -debug
$HOME/bitcoin-0.13.0/src/bitcoind -regtest -server -listen -port=17594 -rpcuser=bitcoinrpc -rpcpassword=P -rpcport=16594 -datadir=$HOME/ForkTest/D/ -connect=localhost:17591 -pid=$HOME/ForkTest/C/.pid -daemon -debug

but the blockchain still does not start mining (((

Did you try the generate RPC call to mine a new block?  (setgenerate has been removed due to the internal miner being removed - see e.g. https://bitcoin.org/en/release/v0.13.0#removal-of-internal-miner )

Thank you very much!
I tried with version 0.12.0 and everything works as expected! Smiley

OpenTrade - Open Source Cryptocurrency Exchange
jonahmarieaton101
Member
**
Offline Offline

Activity: 112
Merit: 10


View Profile
October 07, 2016, 02:31:03 PM
 #8

Is it really possible to do mining in offline?
vino.gcs
Member
**
Offline Offline

Activity: 149
Merit: 11


View Profile
October 19, 2016, 12:11:46 PM
 #9

Is it really possible to do mining in offline?

Yes. It is possible, by implementing a private network of peers. Atleast it is off from internet. And you will never find the actual block if you mine on private network. You can have fun with playing on how crypto currency works. Tongue

Decoded
Legendary
*
Offline Offline

Activity: 1232
Merit: 1030


give me your cryptos


View Profile
October 21, 2016, 04:36:29 AM
 #10

Is it really possible to do mining in offline?

What OP is trying to do is not mining on the current chain offline, as this is impossible.

He wants to create his own blockchain offline. So it will be a network consisting of him and him only.

looking for a signature campaign, dm me for that
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!