Bitcoin - Open source P2P money

Bitcoin Node Delayed Block Propagation

Hello all, my bitcoin node is experiencing extreme block propagation delays. On average 1 to 4 blocks behind what blockstream dot info shows. I'm also noticing that my node has also been unable to maintain connections very long with many other nodes as it used to.
Some notable items of the issue I’ve been seeing are:
- According to bitnodes dot io my node is only intermittently reachable.
- These symptoms / results have been persistent both from behind my router using IPV4 as well as directly connected to cable modem using IPV6 connected to the RJ45 port.
- I've done virus checks, reinstalled the WIFI card in device manager, disabled my anti-virus
- I've even downgraded bitcoin core to several versions thinking it may have been a bug that I didn't notice initially in the most recent release but no luck there either (down to V 18.x) with reboots in between.
- I've performed SCF /scannow (Windows 10 machine) and repaired some corrupted files
- uninstalled avast antivirus
- sidestepped the router and plugged directly into the cable modem
- Scanned laptop with windows defender after updating definitions.
I've had my node running for well over a year and a half and just noticed this issue this week (although it may have been going on for the last few weeks). I'm really starting to believe it's my ISP fighting bitcoin or maybe even something worse.
Either way I'm downloading another node on another machine and will test it to rule out my hardware on my machine that has been having the issue and hope to rule this out later today. In the meantime if any of you who are also running a node can confirm that you are receiving blocks at the normal speed it would be appreciated. Note that when doing so don’t just rely on the time stamp in the console view of the bitcon core info section! Be sure to test it by either using the GETBLOCKCOUNT command in the console and/or reviewing the historical log of your node to see what time your node actually received the updated tip (most recent block hash). The console window on my node shows the correct timestamps but the node itself isn’t receiving the blocks until sometimes 30+ minutes after they’re propagated to the network.
Thanks in advance for your feedback!
submitted by BitcoinCanSaveUsAll to Bitcoin [link] [comments]

Command line halving countdown

Dunno why but I did this :
A magnificent (as in very ugly) shell script that spits out the number of blocks remaining before lambomoon halving festival
#!/usbin/env bash LANG=en_us_8859_1 block_count=$(bitcoin-cli getblockcount) current_halving_index=$(($block_count / 210000)) if [ $current_halving_index -gt 33 ]; then current_halving_power=50000000000 else current_halving_power=$((2**$current_halving_index)) fi current_block_subsidy=$((5000000000/$current_halving_power)) next_halving_index=$((1 + $current_halving_index)) next_halving_height=$(($next_halving_index * 210000)) if [ $next_halving_index -gt 33 ]; then next_halving_power=50000000000 else next_halving_power=$((2**$next_halving_index)) fi next_block_subsidy=$((5000000000/$next_halving_power)) echo $(date) : $((($next_halving_height - $block_count) )) remaining blocks until halving number $next_halving_index echo At block $next_halving_height, maximum block subsidy will go from $current_block_subsidy satoshis to $next_block_subsidy satoshis 
Prints shit like this :
Wed Apr 29 15:37:47 CEST 2020 : 1844 remaining blocks until halving number 3 At block 630000, maximum block subsidy will go from 1250000000 satoshis to 625000000 satoshis 
You only need to run bitcoind and enjoy an ugly command line message telling you that you'll soon be as rich as a fucking Burger King only diet
submitted by Ralayax to Bitcoin [link] [comments]

My one-line halving countdown

Join the iso party for one here:
watch -n 15 'figlet -c $( expr 630000 - $( bitcoin-cli getblockcount ))' 
It's intense! (You'll need to be running your own node, so get on it now or you'll be late to the party).
submitted by FunctioningLurker to Bitcoin [link] [comments]

Vertnode - An automated solution for installing Vertcoin node(s) on Single Board Computers

Hello Vertcoin Community,
Eager to contribute to the Vertcoin Community I began creating step by step walkthrough guides on how to get a Vertcoin node up and running on a Raspberry Pi, Raspberry Pi Zero and Intel NUC. Along with information to get a Vertcoin node up and running was also optional steps to install p2pool-vtc.
I decided that while this step by step guide might be helpful to a few, a setup script may prove to be useful to a wider range of people. I have this script to a point where I think it may be productive to share with a bigger audience, for those who are brave and have this hardware sitting around or like to tinker with projects; I invite you to test this setup script if you are interested, if you run into errors any sort of verbose console output of the error proves to be extremely helpful in troubleshooting.
The script was designed to produce a “headless” server... meaning we will not be using a GUI to configure Vertcoin or check to see how things are running. In fact, once the server is set up, you will only interact with it using command line calls over SSH. The idea is to have this full node be simple, low-power, with optimized memory usage and something that “just runs” in your basement, closet, etc.
Why run a headless node on a Single Board Computer?
The idea is to have this full node be simple, low-power, with optimized memory usage and something that “just runs” in your basement, closet, etc.
Required: USB Flash Drive 6GB - 32GB
Please note that the script was designed for Single Board Computers first and looks for an accessible USB Flash Drive to use for storing the blockchain and swap file, as constant writing to a microSD can degrade the health of the microSD.
Supports

Hardware

All of the hardware listed above is hardware that I have personally tested / am testing on myself. The plan is to continue expanding my arsenal of single board computers and continue to add support for more hardware to ensure as much compatibility as possible.
Functionality
It is worth noting that LIT can be ran with multiple configurations, the ones displayed in the Post Installation Report reflect values that run LIT with the Vertcoin Mainnet. Please be aware that the Vertcoin Testnet chain has not been mined 100% of the time in the past, if you make transactions on the Vertcoin testnet that do not go through it is likely because the chain has stopped being mined.
BE CAREFUL WITH YOUR COINS, ONLY TEST WITH WHAT YOU ARE OKAY WITH LOSING IF YOU USE THE MAINNET.

Vertcoin Testnet Coins

https://tvtc.blkidx.org/faucet/
I've included some documentation on LIT I created which includes information I found to be useful: https://github.com/e-corp-sam-sepiol/vertnode/blob/mastedocs/lit.md
Please visit the mit-dci/lit github repository for the most up to date information on lit: https://github.com/mit-dci/lit

Vertnode | Automated Vertcoin Node Installation Script

https://github.com/e-corp-sam-sepiol/vertnode

Recommended: Use Etcher to install the chosen OS to your microSD card / USB flash drive.

If you intend on installing Ubuntu Server 16.04 to your Intel NUC please use Etcher to install the .iso to your USB flash drive.
https://etcher.io/
PLEASE NOTE THIS SCRIPT MAY GIVE AN ERROR. THIS IS THE NATURE OF TESTING. PLEASE REPORT YOUR ERRORS IF YOU WANT THEM TO BE FIXED/RESOLVED. THANK YOU FOR BETTERING THE DEVELOPMENT OF THIS SCRIPT.

Ubuntu Server 16.04 Setup Details

You can use different clients to ssh into your node. One option is using PuTTY or Git Bash on Windows which is included in the desktop version of Git. If you are using Linux you can simply open a new terminal window and ssh to the IP address of your node (hardware you intend installing the Vertcoin node on).
You will need to know the IP address of your node, this can be found on your router page.
ssh 192.168.1.5 -l pi For example, this command uses ssh to login to 192.168.1.5 using the -l login name of pi. The IP address of your node will likely be different for you, in this example I am logging into a Raspberry Pi which has a default login name of pi.
A brief list of commands that can be used to check on the Vertcoin node status:
vertcoin-cli getblockchaininfo | Grab information about your blockchain
vertcoin-cli getblockcount | Grab the current count of blocks on your node
vertcoin-cli getconnectioncount | Grab the current count of connections to your node. A number of connections larger than 8 means that you have incoming connections to your node. The default settings are to make 8 outgoing connections. If you want incoming connections please port forward your Raspberry Pi in your Router settings page.
vertcoin-cli getpeerinfo | Grab the information about the peers you have connected to / are connected to
vertcoin-cli getnettotals | Grab network data, how much downloaded/upload displayed in bytes
tail -f ~/.vertcoin/debug.log | Output the latest lines in the Vertcoin debug.log to see verbose information about the Vertcoin daemon (ctrl+c to stop)
Thank you to all who have helped me and inspired me thus far, @b17z, @jamesl22, @vertcoinmarketingteam, @canen, @flakfired, @etang600, @BDF, @tucker178, @Xer0
This work is dedicated to the users of Vertcoin, thank you for making this possible.
7/20/2018 Thank you @CommodoreAmiga for the incredibly generous tip <3
You can reach me @Sam Sepiol#3396 on the Vertcoin Discord, here on reddit or @ [email protected]
submitted by ecorp-sam-sepiol to vertcoin [link] [comments]

function return value undefined with node js

Hi guys,

I'm new in the javascript world and now I have a problem with a simple function that returns value because this value is not defined, but if I print the value in the function with console.log, the result is correct

My class with the function
const {createBitcoinRpc} = require('@carnesen/bitcoin-rpc'); module.exports = WrapperRPC; var bitcoinRpc; function WrapperRPC(rpcuser, rpcpassword) { this.rpcuser = rpcuser; this.rpcpassword = rpcpassword; this.rpcHref = 'http://' + this.rpcuser + ':' + this.rpcpassword + '@127.0.0.1:8332'; bitcoinRpc = createBitcoinRpc(this.rpcHref); //TODO settin this variable } WrapperRPC.prototype.getDimensionBlockchain = function(){ console.debug("the url is:" + this.rpcHref); bitcoinRpc("getblockcount").then(result => { console.debug("The result command is: " + result); this.result = result; return this.result; }).catch(exception => { console.error('exception generated: ' + exception) }) }; WrapperRPC.prototype.getHashBlock = function (heightBlock) { console.debug("Run command getblockhash"); bitcoinRpc('getblockhash', { height: heightBlock }).then(result => { console.debug("The result command is: " + result); this.result = result; return this.result; }).catch(exception => { console.error('exception generated: ' + exception) }); } 
My main
const express = require('express'); const app = express(); const port = 3000; const WrapperRPC = require('./model/WrapperRPCBitcoin'); var path = require('path'); app.get('/', function(req, res) { res.sendFile(path.join(__dirname + '/index.html')); console.log("try to run rpc"); let rpc = new WrapperRPC('vincent', 'vincent'); let numbarBlock = rpc.getDimensionBlockchain(); console.debug("height blockchain: " + numbarBlock); for(i = 0; i < numbarBlock; i++){ var hashBlock = rpc.getHashBlock(i); console.debug('Hash block ' + i + ' is: ' + hashBlock); } }); // Console will print the message app.listen(port, () => console.log(`Example app listening on port ${port} at the link http://localhost:${port}/`)); 
My log
Example app listening on port 3000 at the link http://localhost:3000/ try to run rpc the url is:http://vincent:[email protected]:8332 height blockchain: undefined The result command is: 586965 
The log is correct The result command is: 586965 but is printed after the height blockchain: undefined What happens in JavaScript?
submitted by crazyjoker96 to learnjavascript [link] [comments]

Step by step in staking Redd with Raspberry Pi 3

Before I start, I would like to pay complete credits to these two guys :)
https://www.reddcointalk.org/topic/2679/reddcoin-staking-via-ubuntu-mate-on-raspberry-pi-3-model-b-march-2018 (most of my steps, if not all, are from this link)
https://github.com/joroob/reddcoin/blob/mastedoc/build-arm.md
All the steps I am writing is ABSOLUTELY NECESSARY, please don't try to skip it because I did, and it doesn't work.
step 1: get a Raspberry Pi B https://www.raspberrypi.org/products/#buy-now-modal
step 2: make sure you get proper power supply 5v 2A - the Pi will mine, it will need sufficient power. Regular USB samsung charger will not work.
step 3: get proper micro SD card (SanDisk for example) 32Gb++
step 4: USB + Mouse keyboard
step 5: flash micro SD card with Ubuntu MATE
Download Ubuntu Mate image: https://ubuntu-mate.org/raspberry-pi/
Download Etcher: https://etcher.io
After finishing downloading, use Etcher to write/flash the image on micro SD card
After this, your SD card contains Ubuntu MATE OS.
step 6: Place SD Card into Raspberry Pi 3 and start it up. You should be able to see Ubuntu OS! Congrats!
step 7: Connect to wifi or internet cable (internet is better and faster)
step 8: OPTIONAL - turn off UI OS, so that things will work faster
Open XTerminal:
sudo systemctl disable lightdm.service (to turn UI off) 
in case you want to turn UI on again, run this:
sudo systemctl start lightdm.service (to turn UI on) 
step 9: install all dependencies
sudo apt-get update && sudo apt-get install git build-essential libqt4-dev libprotobuf-dev protobuf-compiler libtool autotools-dev autoconf libssl-dev libboost-all-dev wget pkg-config sudo add-apt-repository ppa:bitcoin/bitcoin sudo apt-get update sudo apt-get install db4.8 sudo apt-get install libminiupnpc-dev sudo apt-get install libqrencode-dev Reboot 
step 10: add additional RAM (sort of) in case the App need it, this is call "Create Swap file"
sudo fallocate -l 1G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile echo ‘/swapfile none swap sw 0 0’ | sudo tee -a /etc/fstab 
step 11: Build Berkeley Database
wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz tar xfvz db-4.8.30.NC.tar.gz cd db-4.8.30.NC cd build_unix ../dist/configure --enable-cxx make sudo make install 
step 11.5: Set BerkeleyDB path
export CPATH="/uslocal/BerkeleyDB.4.8/include" export LIBRARY_PATH="/uslocal/BerkeleyDB.4.8/lib" export LD_LIBRARY_PATH=/uslocal/BerkeleyDB.4.8/lib/ 
step 12: Build Reddcoin Wallet
---download source code ---- only source from joroob/reddcoin will work because some stweak was needed for ARM CPU
cd ~ git clone https://github.com/joroob/reddcoin.git 
---build reddcoin ----
cd reddcoin ./autogen.sh ./configure --with-gui=no --disable-tests cd src make sudo make install 
If you finish this, you are in a great position!!!
step 13: Create reddcoin configuration file
cd ~ mkdir .reddcoin && cd .reddcoin nano reddcoin.conf rpcuser=YOUR OWN USERNAME, YOU DONT NEED TO REMEMBER THIS, MAKE IT AS LONG AS YOU WANT rpcpassword=YOUR OWN PASS WORD, YOU DONT NEED TO REMEMBER THIS, MAKE IT AS LONG AS YOU WANT 
step 14: Use bootstrap
(At this point, you had a running reddcoin daemon, now you can start staking. But syncing the full chain takes long time.)
cd ~/.reddcoin wget https://github.com/reddcoin-project/reddcoin/releases/download/v2.0.1.2/bootstrap.dat.xz xz -d bootstrap.dat.xz 
step 15: start the reddcoin daemon service cd ~/reddcoin/src ./reddcoind -daemon
After this, you can test if the daemon is working, by perform this command: ./reddcoin-cli getblockcount
step 16: if your app is not able to sync, it is probably the firewall issue with OS, run this to allow port 45444 (used by Reddcoin) and redo step 15
sudo iptables -I INPUT 1 -i eth0 -p tcp --dport 45444 -j ACCEPT sudo iptables -A OUTPUT -p tcp --dport 45444 -j ACCEPT 
step 17: open BEER and enjoy! This is a MUST or the daemon will stop working! I am not kidding!
step 18: Actually, i forgot to mention you need to execute this command for the wallet to stake:
reddcoind walletpassphrase $yourpassword 9999999 true 
ADDITIONAL REMARKS:
From my PC: I am using putty to execute the command, winSCP to monitor the file location on raspberry.
Moving Red Coins out of exchange really a big move, start with normal wallet, don't start with this tutorial :) Ever since I move my coins out of exchange, I am free from all of the ups and downs! Really!
So guys and gals, Redd On!
UPDATE 18 Mar: my first stake has arrived after 6 days staking :)
In case you want to tip me: RaF3TeWqgTzAdnaZQffnsxS74dag13zsAY
Edit 1: Format stuff
Edit 2: Add step 18 to execute staking command.
Edit 3: In case you don't want to compile the source code, you can download my compile version here: https://github.com/hieplenet/reddcoin/releases/tag/v2.0.0.0 (but doing this, you should be aware of the risk of me changing source code for my benefit - I don't change any thing, but you should be cautious, this is the internet :) )
submitted by hieplenet to reddCoin [link] [comments]

Congrats with 100,000 blocks !

echo -n "Bitcoin Cash blocks: " && ~/bitcoin-abc-0.17.2/bin/bitcoin-cli getblockcount
echo -n "Litecoin blocks: " && ~/litecoin-0.16.0/bin/litecoin-cli getblockcount
echo -n "Dash blocks: " && ~/dashcore-0.12.3/bin/dash-cli getblockcount
echo -n "Zcoin blocks: " && ~/zcoin-0.13.6/bin/zcoin-cli getblockcount
----
Bitcoin Cash blocks: 543019
Litecoin blocks: 1472626
Dash blocks: 918885
Zcoin blocks: 100090
submitted by Technologov to zcoin [link] [comments]

Trying to salvage some coins from 2013. Core (bitcoin-qt.exe v0.8.1-beta on Windows 8.1) is taking weeks to DL the blockchain as expected but keeps crashing now. Can I upgrade to a newer version without losing what I've gotten already (about 75% complete)?

Currently there are 134305 blocks remaining. When I start it up it works pretty smoothly for a while but then slows down. I leave it running while I'm gone but the last several days when I've come back it has crashed and gives me an I/O error, and I have to hit OK then start it back up. It does appear to be further along when I start it back up but not by a whole lot. So this has really slowed my progress. It's reindexed about 75% though, and so I don't want to start over from the beginning.
The drive it is on has ~400gb of free space so that's not the issue. I have 8gb of memory, and the task manager says bitcoin is taking up about 500mb, but it's using 60-85% of my cpu at a time.
If I download a newer version of core, I can just copy/paste the old wallet.dat file, right? But wouldn't it have to start downloading the entire blockchain again from the beginning? If so, is there any quicker method?
While typing this, it crashed twice. It only runs for about 10 minutes.
The version I have doesn't have any settings I can change. I read that there's a db size limit you can change in later versions that could help. This one does have a "debug window" with a command line console but I don't really know what to do with it. Here is a list of available commands: 
addmultisigaddress <'["key","key"]'> [account]
addnode
backupwallet
createmultisig <'["key","key"]'>
createrawtransaction [{"txid":txid,"vout":n},...] {address:amount,...}
decoderawtransaction
dumpprivkey
encryptwallet
getaccount
getaccountaddress
getaddednodeinfo [node]
getaddressesbyaccount
getbalance [account] [minconf=1]
getblock
getblockcount
getblockhash
getblocktemplate [params]
getconnectioncount
getdifficulty
getgenerate
gethashespersec
getinfo
getmininginfo
getnewaddress [account]
getpeerinfo
getrawmempool
getrawtransaction [verbose=0]
getreceivedbyaccount [minconf=1]
getreceivedbyaddress [minconf=1]
gettransaction
gettxout [includemempool=true]
gettxoutsetinfo
getwork [data]
help [command]
importprivkey [label] [rescan=true]
keypoolrefill
listaccounts [minconf=1]
listaddressgroupings
listlockunspent
listreceivedbyaccount [minconf=1] [includeempty=false]
listreceivedbyaddress [minconf=1] [includeempty=false]
listsinceblock [blockhash] [target-confirmations]
listtransactions [account] [count=10] [from=0]
listunspent [minconf=1] [maxconf=9999999] ["address",...]
lockunspent unlock? [array-of-Objects]
move [minconf=1] [comment]
sendfrom [minconf=1] [comment] [comment-to]
sendmany {address:amount,...} [minconf=1] [comment]
sendrawtransaction
sendtoaddress [comment] [comment-to]
setaccount
setgenerate [genproclimit]
settxfee
signmessage
signrawtransaction [{"txid":txid,"vout":n,"scriptPubKey":hex,"redeemScript":hex},...] [,...] [sighashtype="ALL"]
stop
submitblock [optional-params-obj]
validateaddress
verifymessage

submitted by closer_to_the_flame to Bitcoin [link] [comments]

I wanted to benchmark bitcoin-core with the new libsecp256k1 to see the speedup myself. Here is a script for making a log

The script with documentation is here.
Here is the output file of my recent sync that took only 4 hours, 4 minutes, and 4 seconds.
This is a sample output:
head -n 16 bitcoin_bench_1453438402.log Linux hadron 3.16.0-57-generic #77~14.04.1-Ubuntu SMP Thu Dec 17 23:20:00 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux Time: 2016-21-01T23:53:22-0500 Unix Time 1453438402 Log File Name: bitcoin_bench_1453438402.log Recording: ./bitcoind -dbcache=6000 & timeout: 2 CurrentBlockheight 394395 dbcahce: 6000 bytes START TIME: 2016-21-01T23:53:22-0500 Executing ./bitcoin-cli getblockcount every 2 seconds blockcount: 0 Time: 2016-01-21T23:53:28 Unix Time (sec): 1453438408 blockcount: 64 Time: 2016-01-21T23:53:30 Unix Time (sec): 1453438410 blockcount: 208 Time: 2016-01-21T23:53:32 Unix Time (sec): 1453438412 blockcount: 320 Time: 2016-01-21T23:53:34 Unix Time (sec): 1453438414 blockcount: 400 Time: 2016-01-21T23:53:36 Unix Time (sec): 1453438416 
and the logfile continues this way, every N seconds (here N=2).
tail bitcoin_bench_1453438402.log blockcount: 200865 Time: 2016-01-22T00:11:28 Unix Time (sec): 1453439488 blockcount: 200901 Time: 2016-01-22T00:11:30 Unix Time (sec): 1453439490 blockcount: 200948 Time: 2016-01-22T00:11:32 Unix Time (sec): 1453439492 blockcount: 200955 Time: 2016-01-22T00:11:34 Unix Time (sec): 1453439494 blockcount: 201074 Time: 2016-01-22T00:11:36 Unix Time (sec): 1453439496 blockcount: 201145 Time: 2016-01-22T00:11:38 Unix Time (sec): 1453439498 blockcount: 201467 Time: 2016-01-22T00:11:40 Unix Time (sec): 1453439500 blockcount: 201537 Time: 2016-01-22T00:11:42 Unix Time (sec): 1453439502 blockcount: 201583 Time: 2016-01-22T00:11:44 Unix Time (sec): 1453439504 blockcount: 201619 Time: 2016-01-22T00:11:46 Unix Time (sec): 1453439506 
Using an [email protected], 20GB RAM
at t= +1 hour, we are at blockheight 283175 at t= +2 hours, we are at blockheight 338746 at t= +3 hours, we are at blockheight 371617 at t= +4 hours, we are at blockheight 393114 # almost synced ################################################# # Blockchain sync complete # ################################################# Terminal Unix Time: 1453453046 Start Time: 1453438402 Time Delta: 14644 seconds 4.067 hours 4 hours, 4 minutes, 4 seconds 
submitted by AltoidNerd to Bitcoin [link] [comments]

Running full node on Google Compute Engine. Now what?

Hi,
As an experiment I'm running bitcoind on Google Compute Engine. I can ssh to it and, for example, run
$ bitcoin-cli getblockcount 119149 
So I guess that means it's syncing. I tried to open port 8333 and if I run bitcoin-cli getpeerinfo, I get 9 results. Does that mean I successfully opened the port? Before I got my 9th peer, how could I have checked if bitcoind was correctly reachable?
What other fun things should I be checking?
bitcoin-cli is nice but a web interface might be nice as well. Is there something like that?
submitted by dskloet to Bitcoin [link] [comments]

BU pre-Cash node didn't see the fork. How can I switch chains?

After I switched my node's version to run BUcash-1.1.0.0, I checked the block count:
bitcoin-cli getblockcount 478781 
Soooo, that's not right. I then checked the forks:
bitcoin-cli getchaintips { "height": 478782, "hash": "0000000000000000002b71f94775d691b1d8a7555f8096040ea58272598aac59", "branchlen": 1, "status": "invalid" }, { "height": 478781, "hash": "000000000000000000c20baeecb453d05eb86e77f599867f025445de67abef93", "branchlen": 0, "status": "active" }, { "height": 478575, "hash": "00000000000000000013f40b18504029e9ab3cdff57b948f9e8dc6a7ea872ed2", "branchlen": 17, "status": "headers-only" }, { "height": 473586, "hash": "0000000000000000013b4569d28866fd10dbd45ed43725b9785bd8749c1f6c7f", "branchlen": 1, "status": "valid-fork" } 
And it doesn't look like the split was caught. I'm sure there's some way to fix this, but I'm not sure how. Now that BUcash-1.1.0.0 is installed, how can I switch to the correct chain?
submitted by SMACz42 to bitcoin_unlimited [link] [comments]

-reindex option doesn't fix a corrupted blockchain, it's downloading all over again.

This is a follow up to the corrupted blockchain problem described by me 5 days ago: https://www.reddit.com/BitcoinBeginners/comments/8zysbx/error_when_running_a_bitcoin_core_node_corruption/
As bitusher suggested, I ran:
./bitcoind.exe -reindex --datadir=G:\Bitcoin\Bitcoin_core\Bitcoin\blockchain 
Before that I had even tried the option -reindex-chainstate but it failed for some reason.
After about 8 hours, the reindex finished but it's downloading the blockchain all over again although I already have 200 GB of blockchain data. I can see this by running:
Bitcoin\daemon> .\bitcoin-cli.exe getblockcount 323136 (wait some minutes...) Bitcoin\daemon> .\bitcoin-cli.exe getblockcount 326069 
The point when it went from reindexing to downloading the blockchain all over again looks like this in debug.log:
2018-07-24 08:32:09 Reindexing block file blk01265.dat... 2018-07-24 08:33:57 Loaded 962 blocks from external file in 107945ms 2018-07-24 08:33:57 Reindexing finished 2018-07-24 08:33:57 Pre-allocating up to position 0x100000 in rev00000.dat 2018-07-24 08:33:58 UpdateTip: new best=00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048 height=1 version=0x00000001 log2_work=33.000022 tx=2 date='2009-01-09 02:54:25' progress=0.000000 cache=0.0MiB(1txo) 2018-07-24 08:33:58 UpdateTip: new best=000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd height=2 version=0x00000001 log2_work=33.584985 tx=3 date='2009-01-09 02:55:44' progress=0.000000 cache=0.0MiB(2txo) ... 2018-07-24 15:28:52 UpdateTip: new best=00000000000000000c84841e1450c8644dfe5a85528ae551f8862a688b55db61 height=331606 version=0x00000002 log2_work=81.568221 tx=52347394 date='2014-11-25 21:30:09' progress=0.149665 cache=2153.7MiB(16335495txo) 2018-07-24 15:28:52 Pre-allocating up to position 0x200000 in rev00200.dat 2018-07-24 15:28:53 UpdateTip: new best=0000000000000000103e002b3231dbee391cf38a2890e310b3e9ee3b785a172a height=331607 version=0x00000002 log2_work=81.568291 tx=52348058 date='2014-11-25 21:40:24' progress=0.149667 cache=2153.7MiB(16334996txo) 2018-07-24 15:28:53 UpdateTip: new best=00000000000000001ac7a4a8f8b910236cfbe1ec2343af4fbe9b8dd1691b7433 height=331608 version=0x00000002 log2_work=81.56836 tx=52348254 date='2014-11-25 21:42:35' progress=0.149667 cache=2153.6MiB(16334923txo) 2018-07-24 15:28:53 UpdateTip: new best=000000000000000006ecf1eb304f3edf56f8ebea62183f8ffbb37653433d196b height=331609 version=0x00000002 log2_work=81.56843 tx=52348821 date='2014-11-25 21:52:17' progress=0.149669 cache=2153.7MiB(16334989txo) 2018-07-24 15:28:53 UpdateTip: new best=00000000000000001864ff1e384b409d9c26745e3dc36a77cb3068959c6244f7 height=331610 version=0x00000002 log2_work=81.5685 tx=52349053 date='2014-11-25 21:55:54' progress=0.149670 cache=2153.7MiB(16335046txo) 2018-07-24 15:28:53 UpdateTip: new best=000000000000000019ff0a26dd1c684661a624f52a78185ba60ad63a464be92e height=331611 version=0x00000002 log2_work=81.568569 tx=52349229 date='2014-11-25 21:57:40' progress=0.149670 cache=2153.6MiB(16334946txo) 2018-07-24 15:28:54 UpdateTip: new best=00000000000000000775b876ee6d5ef4e74ec728d92ea37f249cf4183e8d8447 height=331612 version=0x00000002 log2_work=81.568639 tx=52350965 date='2014-11-25 22:27:56' progress=0.149675 cache=2153.7MiB(16335409txo) 2018-07-24 15:28:54 Pre-allocating up to position 0x1200000 in rev00199.dat 2018-07-24 15:28:54 UpdateTip: new best=000000000000000009547c69932fa9cc2a8d2c9f6449ef23db13da3f71ac8d40 height=331613 version=0x00000002 log2_work=81.568709 tx=52351547 date='2014-11-25 22:36:56' progress=0.149677 cache=2153.6MiB(16334933txo) 
I am feeling pretty frustrated because I can't run a simple bitcoin node every once in a while. Seems like every time I close bitcoind or bitcoin-qt the blockchain gets corrupted. I have found several people complaining about this problem online but I haven't found any definitive solution. Seems like avoiding windows is a good thing (I like to use the same blockchain folder that I store in an external hard drive in both windows and linux).
TLDR
1 - How to avoid getting a corrupted blockchain in both windows and linux and both bitcoin-qt and bitcoind?
2 - How to fix a corrupted blockchain quickly, if this is even possible. -reindex and -reindex-chainstate don't seem to work in my case.
If this doesn't get solved here, I am opening an issue in bitcoin's github.
submitted by johnturtle to BitcoinBeginners [link] [comments]

How to trustlessly verify current status of Segwit

Bitcoin is a trustless system. The motto is "Don't trust, verify!". In this spirit I wanted to be able to tell how many blocks among last 2016 are signalling Segwit support. So I wrote a simple bash script:
#!/bin/bash YES=0; NO=0 for i in $(seq $[$(bitcoin-cli getblockcount)-2015] $(bitcoin-cli getblockcount)); do bitcoin-cli getblock $(bitcoin-cli getblockhash $i)| grep '"version"' | sed -e 's/^.*: /obase=2;/' -e 's/,$//' | bc | grep -q '1.$' && YES=$[$YES+1] || NO=$[$NO+1] done echo "Supporting: $YES, opposing: $NO" 
You can run it on your full node to calculate current status. It takes some time, so be patient. Example output from my node:
Supporting: 11, opposing: 2005 
(As somebody already mentioned, Slushpool started to signal prematurely.)
The script just asks bitcoind how many blocks there are, then asks hash of each block with number from (inclusive range) and for each hash it asks for block, to get version. Version is converted to binary and then appropriate bit is grepped and counted.
If you ever see Supporting: 1916 (or more) at the end of retarget period, you know Segwit locked-in. It should even work on older clients, so you can activate manually. :)
Enjoy!
Update: as Totont01 pointed out, you have to count within retarget period.
submitted by kixunil to Bitcoin [link] [comments]

Chain Query [Alpha] - A web based interface to the Bitcoin API JSON-RPC

Originally planned on holding off on releasing this until all the API commands were integrated, but with the recent large increase in transaction volume, an Alpha release with what is ready seemed appropriate.
In particular estimatefee and getmempoolinfo are now publicly available through your browser, along with 25 other API commands.
Built for the average Joe to explore Bitcoin's core API and to serve as the foundation for PHP web applications to easily communicate with bitcoin core.
When all the Bitcoin Core 0.10.2 commands are complete the whole thing will be released on GitHub as open source.
So without further ado, http://ChainQuery.com/bitcoin-api
A couple quick explanations:
To see the size and # of unconfirmed transactions in the node's bitcoin mempool:
http://chainquery.com/bitcoin-api/getmempoolinfo
To estimate the fee required to have a transaction confirm within the next "X" blocks enter the number of blocks here:
http://chainquery.com/bitcoin-api/estimatefee
To see if your transaction is in the nodes current memory pool enter the transaction ID here (for a readable result select "decoded"):
http://chainquery.com/bitcoin-api/getrawtransaction
Currently supported commands (27):
I hope you like it so far, any questions or feedback are welcome and appreciated.
submitted by CoinCadence to Bitcoin [link] [comments]

Trouble seeing my balance with bitcoind after importing priv key, I'll tip whoever can help me out

Core is running on a linux server and when I call bitcoin-cli getblockcount I get the current block which is 466065.
I deposited to an address and I can see it in blockchain. I then import the private key via bitcoin-cli importprivkey XXXXXXXXXXXXXXXXXXXXXXXX '' false
I can see that there's bitcoin in that address through blockchain.info, so why doesn't my balance update? I was told that it was a derived address from a BIP32 key. What do I need to do to my server that it will update the balance??
submitted by Nephelophyte to btc [link] [comments]

BIP91 countdown one-liner

 cur=$(bitcoin-cli getblockcount) from_last=$((cur%336)) last=$((cur-from_last)) remaining=$((336-from_last)) next=$((cur+remaining)) bit1=$(grep UpdateTip ~/.bitcoin/debug.log | tail -n1000 | awk '{print $6, $7}' | sort | uniq | tail -n100 | grep 0x200000.2 | wc -l); echo 'LAST CUR REMAINING NEXT BIP141'; echo "$last $cur $remaining $next $bit1/100" 
submitted by bytevc to Bitcoin [link] [comments]

python-bitcoinlib-v0.5.0rc1 - OpenSSL crashes on OSX and Arch Linux should be fixed | Peter Todd | Sep 07 2015

Peter Todd on Sep 07 2015:
https://github.com/petertodd/python-bitcoinlib/tree/python-bitcoinlib-v0.5.0rc1
FWIW if you've been experienceing OpenSSL related crashes on OSX or Arch
Linux this release should fix your issues. I don't have any way of
testing this myself, so if I could get some confirmation that this new
release candidate fixes things that'd be really helpful!
Other release notes:
v0.5.0

Major fix: Fixed OpenSSL related crashes on OSX and Arch Linux. Big thanks to
everyone who helped fix this!
Breaking API changes:
New features:
Notable bugfixes:

'peter'[:-1]@petertodd.org
000000000000000010f9e95aff6454fedb9d0a4b92a4108e9449c507936f9f18
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 650 bytes
Desc: Digital signature
URL: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20150906/bb595f91/attachment.sig>
original: http://lists.linuxfoundation.org/pipermail/bitcoin-dev/2015-Septembe010950.html
submitted by dev_list_bot to bitcoin_devlist [link] [comments]

Help understanding raw transactions

I'm struggling a bit with understanding raw transactions. I understand from the Bitcoin wiki that the input(s) reference previous transactions as the source of funds. Then the outputs is how the source of funds is paid out. Typically if there are two outputs, it is because the entire input transaction must be spent and so one output is the payment and the second output is the remainder being paid back to self.
This all makes sense until I went to look at a ReddCoin transaction. I used getblockcount then getblockhash, then getblock to retrieve the latest confirmed block. Then looked at one of the transactions with getrawtransaction then decoderawtransaction.
Here is the transaction I looked at: ece8f2411a3c0193ee59b4e22ee6cab4e0f15e480e61bfad018fc0c4f76758b4
There is one input and two outputs. Both outputs are equal value and paid to the same wallet. The input transaction is a similar transaction where two outputs both paid to the same wallet but the value is double. The input of that transaction is the same again but with the value doubled.
I can't understand what the point of this transaction would be. Someone with a balance of x is sending a two payments to self of x/2. Then when that transaction is confirmed, each output is then used to make two more payments to self of x/2/2 and so on.
Can someone explain this to me? Is this related to staking?
submitted by CaptainCryptogram to reddCoin [link] [comments]

Simple Commands for your node

...and I mean really simple!
Hopefully any readers know basic linux commands like ls, cd, etc.
Find out how far your node has got with the blockchain
bitcoin-cli getblockcount bitcoinxt-cli getblockcount 
Subscribe to bitnode's incentive scheme:
curl -H "Accept: application/json; indent=4" -d "bitcoin_address={YOUR BITCOIN ADDRESS}" -d "url=http://{YOUR NODE'S IP ADDRESS}" https://bitnodes.21.co/api/v1/nodes/{YOUR NODE'S IP ADDRESS}-8333/ 
submitted by redditchampsys to bitcoin_nodes [link] [comments]

Installed bitcoin from git (howto included), but no connections

What I did:
$ sudo apt-get install libdb4.6++-dev libboost-all-dev $ git clone git://github.com/vinced/namecoin.git $ cd namecoin $ cd src $ make -f makefile.unix USE_UPNP= $ echo 'rpcuser=me' > $HOME/.namecoin/bitcoin.conf $ echo 'rpcpassword=foobar' >> $HOME/.namecoin/bitcoin.conf $ echo 'rpcport=9332' >> $HOME/.namecoin/bitcoin.conf $ ./namecoind & $ ./namecoind getblockcount 0 
However:
$ ./namecoind getinfo | grep connections "connections" : 0, 
What do? :)
submitted by pierenjan to Namecoin [link] [comments]

Help with a project importing data from another site

I'm trying to import the data for various currencies under the "available supply" section on coinmarketcap.com and display it on my own sites page (and have continuously update/fetch the latest data, as its constantly updating there).
What is the easiest way to do this?
Someone helped me previously doing it with bitcoin. This is the code he used:
var btcRequest = new XMLHttpRequest();
btcRequest.open('get', 'https://blockchain.info/q/getblockcount?cors=true');
btcRequest.onload = function() {
if (btcRequest.readyState !== 4) return;
However, I want to do this for other currencies there too, such as Dash, Dogecoin and Peercoin. How do I fetch the data from these sites? (which list the total number of coins, or blocks which can be used to calculate the # of coins): Dash here https://chainz.cryptoid.info/dash/ Dogecoin here http://dogechain.info/chain/Dogecoin Peercoin here: http://ppc.blockr.io/
Alternatively, can I just pull the data from under "available supply" from coinmarketcap.com directly? I dont know if its easier to get it from the sites above or from coinmarketcap.com, please advise which is the easiest way to do this as I do not know (please be as specific and detailed as possible if you would as I am a newbie).
Thanks in advance!
submitted by timeisnow77724 to learnprogramming [link] [comments]

Help with a project importing data from another site

I'm trying to import the data for various currencies under the "available supply" section on coinmarketcap.com and display it on my own sites page (and have continuously update/fetch the latest data, as its constantly updating there).
What is the easiest way to do this?
Someone helped me previously doing it with bitcoin. This is the code he used:
var btcRequest = new XMLHttpRequest();
btcRequest.open('get', 'https://blockchain.info/q/getblockcount?cors=true');
btcRequest.onload = function() {
if (btcRequest.readyState !== 4) return;
However, I want to do this for other currencies there too, such as Dash, Dogecoin and Peercoin. How do I fetch the data from these sites? (which list the total number of coins, or blocks which can be used to calculate the # of coins): Dash here https://chainz.cryptoid.info/dash/ Dogecoin here http://dogechain.info/chain/Dogecoin Peercoin here: http://ppc.blockr.io/
Alternatively, can I just pull the data from under "available supply" from coinmarketcap.com directly? I dont know if its easier to get it from the sites above or from coinmarketcap.com, please advise which is the easiest way to do this as I do not know (please be as specific and detailed as possible if you would as I am a newbie).
Thanks in advance!
submitted by timeisnow77724 to web_design [link] [comments]

Visualizing Bitcoin Blockchain Block Hashes 9. bitcoind Bitcoin Block Explorer - API 6. bitcoin-qt Do you REALLY understand Bitcoin Stale Blocks? Programmer explains.

The most popular and trusted block explorer and crypto transaction search engine. Getting Started¶. The site aims to provide the information you need to understand Bitcoin and start building Bitcoin-based applications. To make the best use of this documentation, make sure you’re running a node. For technical support, we recommend Bitcoin Stack Exchange.For errors or suggestions related to this documentation, please open an issue on GitHub. Buying crypto like Bitcoin and Ether is as easy as verifying your identity, adding a payment and clicking "Buy". Sign up for our Wallet today. Create Wallet. Trade Crypto at the Exchange. Integrated with the Blockchain Wallet, our Exchange is a one-stop shop where you can deposit funds and place trades seamlessly in minutes. Get Started . Dive Deeper. Buy Crypto. Bitcoin $ USD. Your Email ... Bitcoin is open-source; its design is public, nobody owns or controls Bitcoin and everyone can take part. Through many of its unique properties, Bitcoin allows exciting uses that could not be covered by any previous payment system. Fast peer-to-peer transactions. Worldwide payments. Low processing fees ChainQuery Bitcoin CLI Donate Jump to category: select category All Blockchain Control Generating Mining Network Raw Transactions Utility Wallet Zmq Deprecated getblockcount none

[index] [13932] [11759] [34452] [18503] [6949] [30548] [2846] [16443] [1685] [22578]

Visualizing Bitcoin Blockchain Block Hashes

BITCOIN $533,431 NEXT YEAR (Realistic), BTC Model Pantera, Ethereum 2.0 Flawed? Programmer explains - Duration: 56:38. Ivan on Tech 26,950 views. 56:38. BREAKING NEWS! Visa Patent PUBLISHED for ... #bitcoin #cryptocurrency #news #btc #ethereum #eth #cryptocurrency #litecoin #altcoin #altcoins #eos #forex #money #best #trading #bitcoinmining #invest #trader #cryptocurrencies #top #investing # ... Hi Youtube Viewers, Create Block.io Bitcoin Wallet & get 10USD Link: http://bit.ly/2l3Lnu6 Paytup Link: https://paytup.com/?rf=muthurmk Important Create your... Bitsuft Block explorer Restful-API. This video is unavailable. Watch Queue Queue New RPC commands: - getblockchaininfo - getblockcount - getpeerinfo - getconnectioncount - stop Linux terminal new stuff: watch * All other commands have been covered in previous videos www ...

#