1 2017-02-09 01:19:01 <bsm117532> My bitcoin node is having trouble with a testnet fork that happened at height 1086627. Does anyone know a good place to find info about forks (especially long ones) that happened on testnet and may be wreaking havoc with my code?
2 2017-02-09 06:46:57 <wumpus> I doubt testnet forks are documented anywhere
3 2017-02-09 06:47:45 <wumpus> testnet (in contrast to mainnnet) is not usually considered something to watch closely and chronicle about
4 2017-02-09 10:00:34 <TZander> bsm117532: did you consider using the regtest network for testing?
5 2017-02-09 10:01:12 <TZander> bsm117532: I stopped using testnet a long time ago, its too unpredictable to use for testing.
6 2017-02-09 10:01:40 <TZander> unpredictable in a way that isn't realistic, like 1000 block reorgs :)
7 2017-02-09 12:14:15 <RxMcDonald> anyone using QT as ide?
8 2017-02-09 12:15:57 <RxMcDonald> which is the logger header?
9 2017-02-09 14:05:11 <TZander> RxMcDonald: I use QtCreator yes
10 2017-02-09 14:05:24 <TZander> logger is util.h
11 2017-02-09 14:06:08 <RxMcDonald> TZander: oh, thanks
12 2017-02-09 14:16:36 <RxMcDonald> TZander: can you use QT for developing the whole thing or you need another editor for editing the files under /src etc?
13 2017-02-09 14:18:29 <wumpus> you can use qt creator for editing the whole thing, an editor is an editor, you'll need to add files to a project specific to that program, probably, and figure out how to set up building
14 2017-02-09 14:19:17 <RxMcDonald> Yeah but followed the instructions in the readme and it says it can't find some files, i.e. just left the file selection when importing
15 2017-02-09 14:21:07 <wumpus> you should be able to add all the .cpp and .h files
16 2017-02-09 14:24:09 <RxMcDonald> wumpus: from the parent directory?
17 2017-02-09 14:25:03 <RxMcDonald> files are in the /src folder, and the qt project is inside of it
18 2017-02-09 14:30:24 <RxMcDonald> nvm
19 2017-02-09 14:32:17 <RxMcDonald> now it says QT can't find boost
20 2017-02-09 14:33:17 <RxMcDonald> also including util.h and it can't find Logprintf("...
21 2017-02-09 14:39:35 <RxMcDonald> alright fixed that I guess
22 2017-02-09 15:28:47 <TZander> RxMcDonald: I have a perl script that generates a couple of .pro files which I then open in the project.
23 2017-02-09 15:29:17 <TZander> The only thing I need to do manually is remove their 'run qmake' line in the build settings. Which you only have to do once on opening.
24 2017-02-09 15:29:59 <TZander> so, yeah, I edit and use auto complete and all that goodness. Compile and run it in a debugger. All from within the app.
25 2017-02-09 16:01:18 <RxMcDonald> nice TZander, that's what I'm loooking for, I'm going to keep at it later when I get home
26 2017-02-09 17:02:29 <sanket1729> Hey!
27 2017-02-09 17:02:53 <sanket1729> Would this be the place where I can discuss non-formulated rough ideas?
28 2017-02-09 17:12:17 <bsm117532> TZander: can't really test with regtest when multiple clients are involved...
29 2017-02-09 19:45:12 <TZander> bsm117532: why not? Did you manage to connect them to each other?
30 2017-02-09 19:46:58 <bsm117532> Honestly I never have figured out regtest mode. You can connect multiple regtest instances?
31 2017-02-09 19:47:37 <arubi> this is how bitcoin tests are done :)
32 2017-02-09 19:47:58 <TZander> sure, regtest is the same software, just using a different set of parameters so you can mine with practically no difficulty.
33 2017-02-09 19:47:59 <arubi> well, maybe not with it being python, but very similar I guess
34 2017-02-09 19:48:53 <TZander> essentially you pass a set of paramters to each instance. Each is given a unique port number to listen on and you can then connect them.
35 2017-02-09 19:49:11 <arubi> bsm117532, you can set them at IPs 127.10.0.{1..10}, each to his own ip, that way you don't have to mess with ports and such
36 2017-02-09 19:49:57 <arubi> keep a .conf file for each node, set 'uacomment=reg{1..10}' for each, and bind to an IP in the range
37 2017-02-09 19:50:37 <bsm117532> Hmmm... I might just have to do that. I'm concerned about testnet reorgs during our beta test. And unfortunately I can't run on mainnet because I need segwit...
38 2017-02-09 19:50:43 <arubi> call bitcoind\-cli with the different .confs, you can alias reg{1..10}-cli to say reg1-cli -conf=$HOME/.bitcoin/reg1.conf
39 2017-02-09 19:50:53 <TZander> bsm117532: http://pastebin.com/2dyNMFtS
40 2017-02-09 19:51:58 <arubi> protip: set datadirs to /dev/shm/..., ultra fast regtest stuff
41 2017-02-09 19:55:02 <bsm117532> Hmmm...hmmm...is there any problem with having a long-running regtest network? (up to months...)
42 2017-02-09 19:55:37 <arubi> no :)
43 2017-02-09 19:56:18 <bsm117532> Hmmmm....hhhhmmmmm....
44 2017-02-09 19:56:48 <bsm117532> TZander, arubi thanks guys
45 2017-02-09 19:57:26 <arubi> cheers, just a small detail, blocks 751 and onwards activate new rules, so before that you have "old bitcoin"
46 2017-02-09 19:57:52 <arubi> (things might be activated at different blocks before though, not sure)
47 2017-02-09 19:59:21 <bsm117532> Yeah I need to figure out which soft forks have been deployed. Obviously I need the regtest to have SPV activated...
48 2017-02-09 19:59:29 <bsm117532> err...segwit rather.
49 2017-02-09 19:59:43 <arubi> that's 751 last time I actually checked
50 2017-02-09 19:59:52 <bsm117532> Ok, will investigate...
51 2017-02-09 20:00:07 <arubi> right now I have an init script that mines 751, then sends 100 to a second node for "stuff"
52 2017-02-09 20:00:58 <arubi> so I don't have a ton of outputs on a work node. block halving is very quick, I think every 50 blocks so by the time you mined 751 you have most of it :)
53 2017-02-09 20:01:47 <arubi> er, reward halving.
54 2017-02-09 20:25:18 <bsm117532> How can I get regtest mode to simulate mining over time, instead of immediately generating blocks?
55 2017-02-09 20:26:10 <achow101> bsm117532: write a script that just loops through sleep ten minutes and then mine a block
56 2017-02-09 20:26:35 <bsm117532> That was my first idea...that' really the best way to do it?
57 2017-02-09 20:27:43 <achow101> I don't think you can configure core to change the difficulty for regtest, so I think that's the best way to do it
58 2017-02-09 20:28:21 <achow101> you could change the regtest difficulty but you would have to change the source and compile
59 2017-02-09 20:28:29 <bsm117532> Well it's wasteful to make it *actually* mine...doing it on a timer would be better...
60 2017-02-09 20:28:35 <arubi> generate sha256 from /dev/urandom and only 'generate 1' when diff is good :)
61 2017-02-09 20:28:41 <arubi> s/target
62 2017-02-09 20:28:52 <arubi> ah well
63 2017-02-09 20:30:35 <arubi> why does the timing matter though? blocks could also be seconds apart. maybe you could set 'blocknotify='regtest-cli generate 1' for perfect timing :)
64 2017-02-09 20:30:44 <arubi> set it on a mainnet node that is
65 2017-02-09 20:32:04 <bsm117532> And now we're going to exercise whether my frankenstien of python-bitcoinlib, bcoin, and bitcoin core can all talk to each other in regtest mode...
66 2017-02-09 20:37:08 <bsm117532> arubi: that's hilarious. Also I just might do that... blocknotify='sleep 600; bitcoin-cli -regtest generate 1'
67 2017-02-09 20:38:45 <arubi> 'blocknotify='sleep $(possion); bitcoin-cli -regtest generate 1' :)
68 2017-02-09 20:41:47 <bsm117532> what's $(poisson)? Also it's a geometric distribution, not poisson IIRC...
69 2017-02-09 20:44:17 <arubi> guess so, I guess it's just the number of the blocks mined in a duration, not the actual time between them if you wanna "wait it out". $(possion) is just a mock function to return the time to sleep :)
70 2017-02-09 21:15:27 <bsm117532> I was just wondering if you had such a function...written in bash... :-P
71 2017-02-09 21:22:15 <arubi> haha, unfortunately not that one. I have a mainnet node so if I wanted 1:1 timing I'd set 'blocknotify="regtest-cli generate 1" in my mainnet.conf, and if I really wanted to control the timing I'd try to interface with SetMockTime() from util.h :)
72 2017-02-09 21:24:45 <arubi> probably only moderately difficult to trace the 'genrate #' call and change 'curtime' to something else
73 2017-02-09 21:26:22 <arubi> ah it's called utiltime.h now