1 2018-03-26 02:36:48 <full-noder___> noob here. Apologies in advance.
2 2018-03-26 02:37:11 <full-noder___> Any way of going about learning how to develop apps besides running a full node?
3 2018-03-26 02:37:12 <Randolf> full-noder___: I reject your apology. There's no need to apologize for being new at something.
4 2018-03-26 02:40:13 <full-noder___> Going through the mastering bitcoin book. Chapter 3 indicates, for people interested in developing bitcoin software, you should be running your own node.
5 2018-03-26 02:40:42 <Randolf> That's a good book.
6 2018-03-26 02:41:29 <Randolf> You can also learn by getting involved in the development community, even if only watching: https://www.github.com/bitcoin/
7 2018-03-26 02:43:21 <full-noder___> Thought there might a work around for the "should be running your own node" part.
8 2018-03-26 02:43:43 <full-noder___> Thanks Randolf!
9 2018-03-26 02:43:44 <Randolf> Well, you could query Electrum or something like that.
10 2018-03-26 02:44:00 <Randolf> You could also use TestNet instead.
11 2018-03-26 02:45:27 <full-noder___> Ah okay. I'll look into that. Thanks a ton!
12 2018-03-26 02:45:45 <Randolf> You're welcome.
13 2018-03-26 02:46:02 <Randolf> You can also ask about getting into TestNet on the #bitcoin channel.
14 2018-03-26 03:41:28 <kallewoof> full-noder___: Regtest is great for trying things out. It's your own local blockchain.
15 2018-03-26 07:38:09 <FraJah> moinings
16 2018-03-26 11:06:13 <codablock> Hello. I'm currently trying to figure out where in the Bitcoin code wallet transactions are being periodically re-broadcasted. I found multiple mentions in Github issues/pull-requests that state that this is being done, for example in https://github.com/bitcoin/bitcoin/pull/9290. I'm however unable to figure where/when this is happening. The only thing I found is the re-broadcasting on startup.
17 2018-03-26 11:10:49 <codablock> I'm looking for this because I stumbled upon the problem of too-long-chain transactions being added to the wallet without being added to the mempool (issue #10004). I understand that this can be avoided with "-walletrejectlongchains=1", but this is not meant for non-test code...so it doesn't feel correct to use (and recommend) this.
18 2018-03-26 11:11:26 <codablock> And as I read multiple times in different places that wallet transactions are being re-broadcasted, I'd expect the problem to be "not that bad" as the re-broadcasting should try to re-add the TXs to the mempool...but that seems to never happen.
19 2018-03-26 17:14:34 <ProfMac> Is there a procedure to take the hex value returned by getrawtransaction and turn it into a CBlockTemplate?
20 2018-03-26 17:16:04 <quitobro> hello people, does anyone know if itââ¬â¢s possible to run 2 bitcoin nodes - one mainnet, one on testnet? was thinking if i run one in a virtual machine, and one on my main laptop OS, that i could pull it offââ¬Â¦
21 2018-03-26 17:16:29 <quitobro> i want to develop/test a bitcoin implementation + Lightning implementation locally, but have mainnet activities so need to run a mainnet node
22 2018-03-26 17:21:22 <ProfMac> I run two nodes in the same VM. Just use the -datadir= command line parameter, and set the ports to different values in the bitcoin.conf files in each directory. In my case, I also control a few more things so that my 2 nodes are quarantined.
23 2018-03-26 17:26:06 <quitobro> ProfMac: cheers :)
24 2018-03-26 18:09:26 <quitobro> ProfMac: so you just start the two processes by pointing them to different `data_dir` locations?
25 2018-03-26 18:09:32 <quitobro> and maintain separate bitcoin.conf files for each?
26 2018-03-26 18:11:47 <arubi> you don't need different datadirs since the testnet files will be in a ./testnet subdir of the datadir. it helps to maintain two bitcoin.conf files though because you'd probably want more adventurous settings for testnet
27 2018-03-26 18:46:24 <fullstep> Is it safe to assume that private keys encoded as WIF strings will always be either 51 or 52 characters long, depending on whether it is compressed or not?
28 2018-03-26 18:58:10 <arubi> if the version byte is not zero then it'll have constant length
29 2018-03-26 18:59:44 <arubi> I think.. now I'm doubting myself
30 2018-03-26 19:16:53 <fullstep> As far as I know a private key in WIF format doesn't have a version byte. Only a network byte (test or prod) and a compression flag( zero or 1).
31 2018-03-26 19:18:14 <fullstep> It seems to be the presence of the compresion flag, which is optional, that changes the length of the WIF string.
32 2018-03-26 19:18:19 <arubi> that's what I mean by version byte - it being testnet or mainnet. both aren't 0x00, but if it were then you could get different length
33 2018-03-26 19:20:11 <arubi> I'm almost positive that the byte not being 0x00 makes the base58 encoding be constant length. I'm trying to find a counter example but can't
34 2018-03-26 19:23:07 <ProfMac> quitobro, "bitcoin -datadir=$HOME/.bitcoin-A" and "bitcoin -datadir=$HOME/.bitcoin-1"
35 2018-03-26 19:27:51 <ProfMac> The two directories have different copies of bitcoin.conf, they may have, e.g. port=7333, rpcport=7332 in A, and port=8333, rpcport=8332 in 1. You will need to have something like -connect=localhost:8333 on one command line.
36 2018-03-26 19:31:42 <arubi> I find it's better to just rpcbind them to different localhost addresses. ie mainnet on 127.0.0.1 and testnet on 127.1.0.1 . this way you can run multiple nodes of the same network easily (I run 4 regtest nodes for example)
37 2018-03-26 19:32:00 <arubi> but to each their own :)
38 2018-03-26 19:33:46 <arubi> it's less of an issue when they're different networks since by design for testnet it'll be 18333 and 18332, but if you run multiple on the same net then it matters
39 2018-03-26 19:35:21 <ProfMac> I'm running IPv6 when possible, and I thought I had trouble using the same ports with different addresses running in the same VM.
40 2018-03-26 19:35:28 <quitobro> arubi: so when you run testnet nodes, do you specify both `ââ¬âtesnet` as well as `ââ¬âconf=/path/to/testnet/config.cfg`?
41 2018-03-26 19:35:41 <arubi> I just specify testnet=1 in the .conf itself
42 2018-03-26 19:35:52 <quitobro> and point tesetnet processes to the testnet conf file?
43 2018-03-26 19:35:56 <ProfMac> And again, I'm answering a slightly different question, of running two otherwise identical nodes, not testnet & regularnet.
44 2018-03-26 19:36:13 <quitobro> ProfMac: roger that
45 2018-03-26 19:36:20 <arubi> yes, I have testnet-cli, mainnet-cli, regtest-cli.. all point to .sh scripts that have the -conf in them
46 2018-03-26 19:36:46 <quitobro> arubi: and a `testnetd` to start the daemon or something?
47 2018-03-26 19:36:52 <arubi> exactly
48 2018-03-26 19:37:01 <arubi> testnetd also has the -conf
49 2018-03-26 19:37:15 <arubi> testnet-tx has a -testnet in it since it doesn't have a -conf flag
50 2018-03-26 19:39:08 <arubi> and a final "$@" in each of the .sh's so I can pass arguments on the command line
51 2018-03-26 19:41:00 <ProfMac> I also ended up putting ~/.bitcoin/<portnumber> as a family of subdirectories.
52 2018-03-26 19:41:28 <arubi> I just dump them all in ~/.bitcoin/ , testnet.conf, mainnet.conf... etc :)
53 2018-03-26 19:42:32 <ProfMac> I am usually running a couple of instances in a quarantine-net, so I keep the directories separate.
54 2018-03-26 19:43:40 <ProfMac> lol. "He's not mining with a full blockchain."
55 2018-03-26 19:43:59 <arubi> never needed the full chain anyway :P
56 2018-03-26 19:44:18 <arubi> but there are pools who don't validate. sad
57 2018-03-26 19:44:40 <ProfMac> I ran a bunch of statistics on the 1st 10,008 blocks.
58 2018-03-26 19:45:31 <arubi> anything interesting?
59 2018-03-26 19:46:20 <arubi> well I guess it's all interesting, but anything out of the ordinary?
60 2018-03-26 19:47:31 <ProfMac> Yep. The difficulty was pegged at 1.0 even though the times were not dead on. I was plotting MedianPrevTime, and there is an Interval (what a block of 2016 is actually called in the code) where the hashrate differed. There are 5 or 6 places where hashing stopped for 6 hours to a day or so.
61 2018-03-26 19:47:57 <ProfMac> And interesting to me, it fit almost exactly to a Poisson distribution.
62 2018-03-26 19:48:15 <arubi> I guess that means that nobody was gaming it then?
63 2018-03-26 19:48:34 <ProfMac> It had the "feel" of authentic lab data.
64 2018-03-26 19:49:08 <arubi> but wouldn't you expect a poisson distribution even now if there are no games?
65 2018-03-26 19:49:53 <ProfMac> No, a superposition of Poissons, for each hash rate. Beyond my pay grade to interpret.
66 2018-03-26 19:50:31 <arubi> hm
67 2018-03-26 19:50:59 <ProfMac> Actually, "truncated Poissons" since the slow miners don't get to express the long running blocks.
68 2018-03-26 19:51:38 <arubi> what do you mean?
69 2018-03-26 19:52:03 <arubi> diff hasn't changed in those 10k blocks, so if you had 0.001 of the hashrate, you got 0.001 of the blocks right?
70 2018-03-26 19:52:39 <arubi> (I'm assuming no new hashrate entered so your share didn't change in that time)
71 2018-03-26 19:52:52 <ProfMac> if there are 2 miners, running at hashrate 1MH/s and 10 MH/s, you only see the 1st block found, not both blocks found.
72 2018-03-26 19:53:20 <ProfMac> But it is a race that throws away the longer blocks from the sample.
73 2018-03-26 19:53:34 <arubi> but the 1mh/s miner will get 1/10 of blocks, it's not a race
74 2018-03-26 19:54:10 <arubi> a race means that the faster miner would win every time. hashing means you'll just get your share over a long enough timeline
75 2018-03-26 19:54:20 <ProfMac> https://plus.google.com/u/0/photos/115426745065196075335/album/6519521612516431713/6519521612265200578?authkey=CK2wi7Gd3uaRwwE
76 2018-03-26 19:56:48 <arubi> I'm confused by these graphs, but that's just me being stupid :)
77 2018-03-26 19:57:01 <ProfMac> You will get your share, but the distribution is not a nice poisson. That shows up very soon after the 10,008th block.
78 2018-03-26 19:57:59 <ProfMac> The top-right one is the most straightforward. It is the elapsed time from MedianPrevTime to the current block time.
79 2018-03-26 19:58:40 <arubi> did you check for changes in the software's behavior for including the blocktime in the header?
80 2018-03-26 19:59:03 <arubi> I mean, I guess it didn't change much in 10k blocks, but maybe it was behaving differently?
81 2018-03-26 19:59:57 <ProfMac> I did not. I assume I could look at the git log and surmise which version was running. But I followed a different path for my project.
82 2018-03-26 20:00:28 <ProfMac> That blue section just before block 2,000 jumps out at me.
83 2018-03-26 20:00:52 <arubi> worth to look at the first 70 days of logs I guess
84 2018-03-26 20:01:24 <ProfMac> Oh, and the actual blocktime was closer to 720 seconds than 600.
85 2018-03-26 20:01:42 <arubi> yea that probably the reason diff stayed at 1
86 2018-03-26 20:01:51 <ProfMac> Well, I'm off to an errand.
87 2018-03-26 20:01:55 <arubi> o/
88 2018-03-26 20:03:43 <ProfMac> ah, yeah.
89 2018-03-26 20:12:06 <dbackeus> I'm learning the bitcoin procol by implementing it from scratch in Crystal. I have version acking handshake working but somehow when I send "getblocks" or "getheaders" the remote just stops sending any data, any ideas for what might cause it or how to troubleshoot?
90 2018-03-26 20:13:42 <arubi> dbackeus, you need to send a specific message first before any other communication with a peer
91 2018-03-26 20:13:53 <arubi> I'm sure there's a bip.. I forget what it was
92 2018-03-26 20:14:09 <arubi> dbackeus, oh, https://en.bitcoin.it/wiki/Protocol_documentation#version
93 2018-03-26 20:14:51 <dbackeus> "I have version acking handshake working" - that is I send version and get verack back, then remote sends me version and I send verack back
94 2018-03-26 20:15:00 <dbackeus> so that's all good as far as I know
95 2018-03-26 20:15:05 <arubi> what's the version you're sending?
96 2018-03-26 20:15:20 <dbackeus> then I get a bunch of other messages from remote and he starts streaming inv messages, however he just stops when I send "getblocks" or "getheaders"
97 2018-03-26 20:15:37 <quitobro> is there a way to make the `bitcoind` command fail loudly if you pass it a conf=/path/to/file/that/does/not/exist/ ?
98 2018-03-26 20:15:39 <dbackeus> I also have "ping" vs "pong" implemented so that seems to work ok
99 2018-03-26 20:16:11 <quitobro> not super clear what behavior is happening currently; i just get a message about needing to restart w/ `-reindex`...
100 2018-03-26 20:16:31 <arubi> quitobro, `if [[ ! -r /path/to/bitcoin.conf ]]; then echo 'NOOOO!!'; fi` :P ?
101 2018-03-26 20:17:04 <arubi> dbackeus, so, which version are you sending to the peer?
102 2018-03-26 20:18:22 <dbackeus> arubi I'm sending 70015
103 2018-03-26 20:19:02 <arubi> oh, that looks fine. I don't know.
104 2018-03-26 20:19:54 <dbackeus> could the getheaders/getblocks message have content that leaves the peer unable to respond causing it to just ignore?
105 2018-03-26 20:20:42 <dbackeus> I don't see why that would stop it from keep up streaming inv messages though...
106 2018-03-26 20:21:03 <arubi> not sure.
107 2018-03-26 20:21:21 <arubi> afk
108 2018-03-26 23:05:56 <sword_smith> I don't get why the network byte of P2SH addresses can be 0x05 and the P2SH addresses can start with '3' when the base58-encoding of 0x05 is '6'. What am I missing?