roasbeef / btcd Goto Github PK
View Code? Open in Web Editor NEWThis project forked from btcsuite/btcd
An alternative full node bitcoin implementation written in Go (golang)
License: ISC License
This project forked from btcsuite/btcd
An alternative full node bitcoin implementation written in Go (golang)
License: ISC License
After the glide install
I tried go install
and go build
, they both failed with:
./server.go:1388: undefined: time.Until
Are any dependencies missing?
Edit: I'm running go version go1.6.2 linux/amd64
if that matters.
I run btcd --simnet --txindex --rpcuser=kek --rpcpass=kek
which should create a default btcd.conf, as I understand from the installation instructions. However, when I run btcctl --simnet --rpcuser=kek --rpcpass=kek getinfo
after that, I get the following error:
Error creating a default config file: open /home/ubuntu/.btcd/btcd.conf: no such file or directory
the output is:
{
"version": 120000,
"protocolversion": 70002,
"blocks": 0,
"timeoffset": 0,
"connections": 0,
"proxy": "",
"difficulty": 1,
"testnet": false,
"relayfee": 0.00001,
"errors": ""
}
What am I supposed to make out of this? Is this an issue?
Yesterday I noticed btcd stalled for two and half hours, I had to manually restart it. Now looking at the log screen I saw the timeline had a gap that showed btcd stalled for about 4 hours before progressed again. Here's my log:
2018-05-07 00:56:52.947 [INF] SYNC: Lost peer 107.189.42.203:8333 (outbound)
2018-05-07 00:56:53.615 [INF] SYNC: New valid peer 119.28.187.169:8333 (outbound) (/Satoshi:0.16.0/)
2018-05-07 05:03:12.740 [ERR] PEER: Can't read message from 209.159.151.144:8333 (outbound): read tcp 195.181.243.196:55570->209.159.151.144:8333: read: connection reset by peer
2018-05-07 05:03:12.740 [INF] SYNC: Lost peer 209.159.151.144:8333 (outbound)
2018-05-07 05:03:23.252 [INF] SYNC: New valid peer [2001:0:4137:9e76:4d7:37bd:bbc4:bf8]:8333 (outbound) (/Satoshi:0.15.1/)```
EDIT: It's hanging again right now...
2018-05-07 07:27:09.808 [INF] SYNC: Syncing to block height 521602 from peer [2a00:1a48:7810:101:be76:4eff:fe08:c774]:8333
2018-05-07 07:27:09.808 [INF] SYNC: Downloading headers for blocks 355822 to 382320 from peer [2a00:1a48:7810:101:be76:4eff:fe08:c774]:8333
2018-05-07 07:27:13.815 [INF] SYNC: Verified downloaded block header against checkpoint at height 382320/hash 00000000000000000a8dc6ed5b133d0eb2fd6af56203e4159789b092defd8ab2
2018-05-07 07:27:13.816 [INF] SYNC: Received 26499 block headers: Fetching blocks
2018-05-07 07:27:39.886 [INF] SYNC: New valid peer [2001:718:ff01:2:0:93ff:fefb:fdf8]:8333 (outbound) (/Satoshi:0.12.1(bitcore)/)
Hello all ,
Can you point me to a valid windows msi file ...
It seems to be missing from the releases.
glide install
[INFO] --> Fetching golang.org/x/crypto
[WARN] Unable to checkout golang.org/x/crypto
[ERROR] Update failed for golang.org/x/crypto: Cannot detect VCS
[ERROR] Failed to install: Cannot detect VCS
Tried on ubuntu 16.04 with go 1.10, any idea on how to solve this? Can't install btcd at the moment
I'm syncing btcd on Ubuntu 18.04 LTS 4.15.0-20-generic.
I'm using the command ~$ go/bin/btcd --testnet --txindex
I see btcd crashing repeatedly with the following errors:
2018-05-15 21:38:52.345 [ERR] SYNC: Failed to process block 0000000000000789d01477f37ef86ffec951d0ca2192d761a5068878610e8649: failed to open ldb transaction: leveldb/table: corruption on data-block (pos=1827711): checksum mismatch, want=0x15ca319f got=0x4df6a1cc [file=094552.ldb] panic: failed to open ldb transaction: leveldb/table: corruption on data-block (pos=1827711): checksum mismatch, want=0x15ca319f got=0x4df6a1cc [file=094552.ldb]
2018-05-15 21:45:18.267 [ERR] SYNC: Failed to process block 00000000000cae5e5b78982e6eb20532ce3bdf41f4df1580f628d9c9c03b9844: failed to open ldb transaction: leveldb/table: corruption on data-block (pos=1827711): checksum mismatch, want=0x15ca319f got=0x4df6a1cc [file=094552.ldb] panic: failed to open ldb transaction: leveldb/table: corruption on data-block (pos=1827711): checksum mismatch, want=0x15ca319f got=0x4df6a1cc [file=094552.ldb]
2018-05-15 21:52:53.502 [ERR] SYNC: Failed to process block 00000000000003805e0815351d0181e6495047379b2748f8f6697c2b8ea512a7: failed to open ldb transaction: leveldb/table: corruption on data-block (pos=1827711): checksum mismatch, want=0x15ca319f got=0x4df6a1cc [file=094552.ldb] panic: failed to open ldb transaction: leveldb/table: corruption on data-block (pos=1827711): checksum mismatch, want=0x15ca319f got=0x4df6a1cc [file=094552.ldb]
2018-05-15 21:58:41.809 [ERR] SYNC: Failed to process block 0000000000000789d01477f37ef86ffec951d0ca2192d761a5068878610e8649: failed to open ldb transaction: leveldb/table: corruption on data-block (pos=1827711): checksum mismatch, want=0x15ca319f got=0x4df6a1cc [file=094552.ldb] panic: failed to open ldb transaction: leveldb/table: corruption on data-block (pos=1827711): checksum mismatch, want=0x15ca319f got=0x4df6a1cc [file=094552.ldb]
Also part of the error log:
goroutine 39 [running]: github.com/roasbeef/btcd/netsync.(*SyncManager).handleBlockMsg(0xc4200f04d0, 0xc43e261960) /home/loysan/go/src/github.com/roasbeef/btcd/netsync/manager.go:584 +0x1430 github.com/roasbeef/btcd/netsync.(*SyncManager).blockHandler(0xc4200f04d0) /home/loysan/go/src/github.com/roasbeef/btcd/netsync/manager.go:1152 +0x548 created by github.com/roasbeef/btcd/netsync.(*SyncManager).Start /home/loysan/go/src/github.com/roasbeef/btcd/netsync/manager.go:1374 +0xe3
Hey @Roasbeef , Would like to recommend Musig2 for BFT based consensus?
Hello!
Would you consider moving this repository to lightningnetwork/lnd and advertise it as an officially maintained fork?
This would probably attract a portion of the btcsuite/btcd community.
If you are a member of the lightningnetwork github page, you should be able to transfer the repository and GitHub will automatically setup a redirect. This means that go get github.com/Roasbeef/btcd
will still work as long as you don't re-create a Roasbeef/btcd repository. Then you can start modifying the import paths, but there will be no rush to do so.
Example of a repository that was renamed and is still go-get-able at the old address:
Quite a few tutorials still point to this fork as being necessary to run lnd
, is that still true?
Would be awesome if you could direct people back to main btcd
if it's no longer the case.
Thanks!
While following the instructions, i get the following error while running btcd testnet.
btcd --testnet --txindex --rpcuser=cbarraford --rpcpass=<password> 2 ↵ 02:16 12:17:43
2018-07-04 12:18:33.074 [INF] BTCD: Version 0.12.0-beta
2018-07-04 12:18:33.075 [INF] BTCD: Loading block database from '/Users/cbarraford/Library/Application Support/Btcd/data/testnet/blocks_ffldb'
2018-07-04 12:18:33.107 [INF] BCDB: Detected unclean shutdown - Repairing...
2018-07-04 12:18:33.109 [INF] BCDB: Database sync complete
2018-07-04 12:18:33.109 [INF] BTCD: Block database loaded
2018-07-04 12:18:33.117 [INF] INDX: Transaction index is enabled
2018-07-04 12:18:33.117 [INF] INDX: cf index is enabled
2018-07-04 12:18:33.117 [INF] CHAN: Loading block index. This might take a while...
2018-07-04 12:19:31.147 [INF] CHAN: Chain state (height 1126006, hash 0000000000032fb64bbd363ad62c9c8819187956ce851b755b3de8c39e2b8812, totaltx 13928880, work 671665688970348490798)
2018-07-04 12:19:31.157 [INF] RPCS: RPC server listening on 127.0.0.1:18334
2018-07-04 12:19:31.157 [INF] RPCS: RPC server listening on [::1]:18334
2018-07-04 12:19:31.157 [INF] RPCS: RPC server listening on [fe80::1%lo0]:18334
2018-07-04 12:19:31.178 [INF] AMGR: Loaded 3262 addresses from file '/Users/cbarraford/Library/Application Support/Btcd/data/testnet/peers.json'
2018-07-04 12:19:31.179 [INF] CMGR: Server listening on [::]:18333
2018-07-04 12:19:31.180 [INF] CMGR: Server listening on 0.0.0.0:18333
2018-07-04 12:19:31.185 [INF] CMGR: 36 addresses found from DNS seed testnet-seed.bitcoin.jonasschnelli.ch
2018-07-04 12:19:31.185 [INF] CMGR: 38 addresses found from DNS seed seed.tbtc.petertodd.org
2018-07-04 12:19:31.266 [INF] CMGR: 3 addresses found from DNS seed testnet-seed.bluematt.me
2018-07-04 12:19:31.511 [INF] SYNC: New valid peer 93.190.142.127:18333 (outbound) (/Satoshi:0.15.0/)
2018-07-04 12:19:31.511 [INF] SYNC: Syncing to block height 1350093 from peer 93.190.142.127:18333
2018-07-04 12:19:31.528 [INF] SYNC: New valid peer 34.252.91.57:18333 (outbound) (/Satoshi:0.16.0/)
2018-07-04 12:19:31.563 [INF] SYNC: New valid peer 217.16.185.175:18333 (outbound) (/Satoshi:0.15.0.1/)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x60 pc=0x1383503]
goroutine 53 [running]:
github.com/roasbeef/btcd/database/ffldb.rollbackOnPanic(0xc4292a41b0)
/Users/cbarraford/go/src/github.com/roasbeef/btcd/database/ffldb/db.go:1889 +0x77
panic(0x159cae0, 0x1ab1040)
/usr/local/Cellar/go/1.10.3/libexec/src/runtime/panic.go:502 +0x229
github.com/roasbeef/btcd/blockchain/indexers.dbStoreFilterIdxEntry(0x17fdd00, 0xc4292a41b0, 0x1a81d90, 0x10, 0x10, 0xc43942bb00, 0xc4396fe360, 0x20, 0x20, 0x0, ...)
/Users/cbarraford/go/src/github.com/roasbeef/btcd/blockchain/indexers/cfindex.go:71 +0xb3
github.com/roasbeef/btcd/blockchain/indexers.storeFilter(0x17fdd00, 0xc4292a41b0, 0xc42b8b64d0, 0xc4325a5ef0, 0x0, 0x24, 0xc42e243170)
/Users/cbarraford/go/src/github.com/roasbeef/btcd/blockchain/indexers/cfindex.go:171 +0x2b1
github.com/roasbeef/btcd/blockchain/indexers.(*CfIndex).ConnectBlock(0xc42013c820, 0x17fdd00, 0xc4292a41b0, 0xc42b8b64d0, 0xc431204cc0, 0xc439329d00, 0x112e76)
/Users/cbarraford/go/src/github.com/roasbeef/btcd/blockchain/indexers/cfindex.go:212 +0x76
github.com/roasbeef/btcd/blockchain/indexers.dbIndexConnectBlock(0x17fdd00, 0xc4292a41b0, 0x17fb900, 0xc42013c820, 0xc42b8b64d0, 0xc431204cc0, 0x0, 0x0)
/Users/cbarraford/go/src/github.com/roasbeef/btcd/blockchain/indexers/manager.go:87 +0x128
github.com/roasbeef/btcd/blockchain/indexers.(*Manager).ConnectBlock(0xc420144690, 0x17fdd00, 0xc4292a41b0, 0xc42b8b64d0, 0xc431204cc0, 0xc1, 0x0)
/Users/cbarraford/go/src/github.com/roasbeef/btcd/blockchain/indexers/manager.go:535 +0xa0
github.com/roasbeef/btcd/blockchain.(*BlockChain).connectBlock.func1(0x17fdd00, 0xc4292a41b0, 0xc4292a41b0, 0x0)
/Users/cbarraford/go/src/github.com/roasbeef/btcd/blockchain/chain.go:647 +0x1d6
github.com/roasbeef/btcd/database/ffldb.(*db).Update(0xc4201362c0, 0xc438cba640, 0x0, 0x0)
/Users/cbarraford/go/src/github.com/roasbeef/btcd/database/ffldb/db.go:1946 +0x9b
github.com/roasbeef/btcd/blockchain.(*BlockChain).connectBlock(0xc420067380, 0xc42bfce230, 0xc42b8b64d0, 0xc431204cc0, 0xc4202e6a00, 0xc1, 0xc1, 0x0, 0x3d00000000000003)
/Users/cbarraford/go/src/github.com/roasbeef/btcd/blockchain/chain.go:614 +0x2f8
github.com/roasbeef/btcd/blockchain.(*BlockChain).connectBestChain(0xc420067380, 0xc42bfce230, 0xc42b8b64d0, 0xc400000000, 0x0, 0x0, 0xc4329fbad8)
/Users/cbarraford/go/src/github.com/roasbeef/btcd/blockchain/chain.go:1072 +0x1de
github.com/roasbeef/btcd/blockchain.(*BlockChain).maybeAcceptBlock(0xc420067380, 0xc42b8b64d0, 0x0, 0x0, 0x0, 0x1ac5a20)
/Users/cbarraford/go/src/github.com/roasbeef/btcd/blockchain/accept.go:78 +0x21b
github.com/roasbeef/btcd/blockchain.(*BlockChain).ProcessBlock(0xc420067380, 0xc42b8b64d0, 0xc400000000, 0xc432b90000, 0x0, 0x0)
/Users/cbarraford/go/src/github.com/roasbeef/btcd/blockchain/process.go:228 +0x2b5
github.com/roasbeef/btcd/netsync.(*SyncManager).handleBlockMsg(0xc42016a370, 0xc42e45d200)
/Users/cbarraford/go/src/github.com/roasbeef/btcd/netsync/manager.go:569 +0x205
github.com/roasbeef/btcd/netsync.(*SyncManager).blockHandler(0xc42016a370)
/Users/cbarraford/go/src/github.com/roasbeef/btcd/netsync/manager.go:1152 +0x548
created by github.com/roasbeef/btcd/netsync.(*SyncManager).Start
/Users/cbarraford/go/src/github.com/roasbeef/btcd/netsync/manager.go:1374 +0xe3
When I try to start btcd
, I get following output:
2018-03-18 12:48:51.356 [INF] BTCD: Version 0.12.0-beta
2018-03-18 12:48:51.368 [INF] BTCD: Loading block database from '/crypto/btc-data/testnet/blocks_ffldb'
2018-03-18 12:48:51.425 [INF] BTCD: Block database loaded
2018-03-18 12:48:51.428 [INF] INDX: cf index is enabled
2018-03-18 12:48:51.429 [INF] CHAN: Loading block index. This might take a while...
2018-03-18 12:48:51.567 [INF] BTCD: Gracefully shutting down the database...
2018-03-18 12:48:51.567 [INF] BTCD: Shutdown complete
panic: runtime error: slice bounds out of range [recovered]
panic: runtime error: slice bounds out of range
goroutine 1 [running]:
github.com/roasbeef/btcd/database/ffldb.rollbackOnPanic(0xc4201c4240)
/home/mike/projects/go/src/github.com/roasbeef/btcd/database/ffldb/db.go:1889 +0x77
panic(0x99e4e0, 0xeb00e0)
/usr/local/go/src/runtime/panic.go:505 +0x229
github.com/roasbeef/btcd/database/ffldb.(*transaction).FetchBlockHeader(0xc4201c4240, 0xc4200226c0, 0x89a0650, 0x20, 0xc420022280, 0xc4200200e0, 0xc4200226c0)
/home/mike/projects/go/src/github.com/roasbeef/btcd/database/ffldb/db.go:1278 +0x2bc
github.com/roasbeef/btcd/blockchain.dbFetchHeaderByHash(0xbff0a0, 0xc4201c4240, 0xc4200226c0, 0xc4200226c0, 0x0, 0x0)
/home/mike/projects/go/src/github.com/roasbeef/btcd/blockchain/chainio.go:1231 +0x3f
github.com/roasbeef/btcd/blockchain.dbFetchHeaderByHeight(0xbff0a0, 0xc4201c4240, 0x0, 0xc421938000, 0x13a933, 0x13a933)
/home/mike/projects/go/src/github.com/roasbeef/btcd/blockchain/chainio.go:1253 +0x8f
github.com/roasbeef/btcd/blockchain.(*BlockChain).initChainState.func1(0xbff0a0, 0xc4201c4240, 0xc4201c4240, 0x0)
/home/mike/projects/go/src/github.com/roasbeef/btcd/blockchain/chainio.go:1159 +0x37d
github.com/roasbeef/btcd/database/ffldb.(*db).View(0xc4200aa440, 0xc4204ea340, 0x0, 0x0)
/home/mike/projects/go/src/github.com/roasbeef/btcd/database/ffldb/db.go:1912 +0x9b
github.com/roasbeef/btcd/blockchain.(*BlockChain).initChainState(0xc4204d1200, 0xc4204d1200, 0xc42022f728)
/home/mike/projects/go/src/github.com/roasbeef/btcd/blockchain/chainio.go:1134 +0x99
github.com/roasbeef/btcd/blockchain.New(0xc4201f8310, 0xc4201f8310, 0xb, 0x0)
/home/mike/projects/go/src/github.com/roasbeef/btcd/blockchain/chain.go:1600 +0x528
main.newServer(0xc420097350, 0x1, 0x1, 0xbfbb40, 0xc4200aa440, 0xeb9300, 0xc42008c120, 0xc4204ea680, 0xc4204ea660, 0xc4200970c0)
/home/mike/projects/go/src/github.com/roasbeef/btcd/server.go:2412 +0x8d9
main.btcdMain(0x0, 0x0, 0x0)
/home/mike/projects/go/src/github.com/roasbeef/btcd/btcd.go:148 +0x686
main.main()
/home/mike/projects/go/src/github.com/roasbeef/btcd/btcd.go:330 +0xd0
When I use btcd
from btcsuite
, I don't get this error and node starts normally.
go version go1.10 linux/amd64
Background
I'm trying to setup LND for mainnet. For that I setup a btcd server. By mistake I used btcsuite/btcd to download the blockchain.
To use it with LND I setup roasbeef/btcd using the data directory created by btcsuite/btcd. I was expected that it will work without any problem.
However, when I start roasbeef/btcd it fails with the following:
2018-04-07 23:19:36.566 [INF] BTCD: Version 0.12.0-beta
2018-04-07 23:19:36.602 [INF] BTCD: Loading block database from '/Users/admin/Library/Application Support/Btcd/data/mainnet/blocks_ffldb'
2018-04-07 23:19:37.366 [INF] BTCD: Block database loaded
2018-04-07 23:19:37.376 [INF] INDX: cf index is enabled
2018-04-07 23:19:37.377 [INF] CHAN: Loading block index. This might take a while...
2018-04-07 23:19:37.486 [INF] BTCD: Gracefully shutting down the database...
2018-04-07 23:19:37.487 [INF] BTCD: Shutdown complete
panic: runtime error: slice bounds out of range [recovered]
panic: runtime error: slice bounds out of range
goroutine 1 [running]:
github.com/roasbeef/btcd/database/ffldb.rollbackOnPanic(0xc4201b4120)
/Users/admin/gocode/src/github.com/roasbeef/btcd/database/ffldb/db.go:1889 +0x77
panic(0x159e840, 0x1ab3070)
/usr/local/Cellar/go/1.10/libexec/src/runtime/panic.go:505 +0x229
github.com/roasbeef/btcd/database/ffldb.(*transaction).FetchBlockHeader(0xc4201b4120, 0xc420150160, 0x373a7f0, 0x20, 0xc420150140, 0xc420154080, 0xc420150160)
/Users/admin/gocode/src/github.com/roasbeef/btcd/database/ffldb/db.go:1278 +0x2bc
github.com/roasbeef/btcd/blockchain.dbFetchHeaderByHash(0x17ff6c0, 0xc4201b4120, 0xc420150160, 0xc420150160, 0x0, 0x0)
/Users/admin/gocode/src/github.com/roasbeef/btcd/blockchain/chainio.go:1231 +0x3f
github.com/roasbeef/btcd/blockchain.dbFetchHeaderByHeight(0x17ff6c0, 0xc4201b4120, 0x0, 0xc422470000, 0x7e3c9, 0x7e3c9)
/Users/admin/gocode/src/github.com/roasbeef/btcd/blockchain/chainio.go:1253 +0x8f
github.com/roasbeef/btcd/blockchain.(*BlockChain).initChainState.func1(0x17ff6c0, 0xc4201b4120, 0xc4201b4120, 0x0)
/Users/admin/gocode/src/github.com/roasbeef/btcd/blockchain/chainio.go:1159 +0x37d
github.com/roasbeef/btcd/database/ffldb.(*db).View(0xc42002e700, 0xc42015e220, 0x0, 0x0)
/Users/admin/gocode/src/github.com/roasbeef/btcd/database/ffldb/db.go:1912 +0x9b
github.com/roasbeef/btcd/blockchain.(*BlockChain).initChainState(0xc4204f4f00, 0xc4204f4f00, 0xc420571728)
/Users/admin/gocode/src/github.com/roasbeef/btcd/blockchain/chainio.go:1134 +0x99
github.com/roasbeef/btcd/blockchain.New(0xc42050a310, 0xc42050a310, 0x12, 0x0)
/Users/admin/gocode/src/github.com/roasbeef/btcd/blockchain/chain.go:1600 +0x528
main.newServer(0xc42014a190, 0x1, 0x1, 0x17fc0e0, 0xc42002e700, 0x1abbd20, 0xc42009a120, 0xc42015e600, 0xc42015e5e0, 0xc420152650)
/Users/admin/gocode/src/github.com/roasbeef/btcd/server.go:2412 +0x8d9
main.btcdMain(0x0, 0x0, 0x0)
/Users/admin/gocode/src/github.com/roasbeef/btcd/btcd.go:148 +0x686
main.main()
/Users/admin/gocode/src/github.com/roasbeef/btcd/btcd.go:330 +0xd0
Process finished with exit code 2
Your environment
Running on Darwin admins-MacBook-Pro-2.local 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
btcd version 0.12.0-beta
Steps to reproduce
Very easy for me to reproduce. Just start btcd.
If I use btcsuite/btcd it will start successfully.
Expected behaviour
Should start without errors
Actual behaviour
See above.
From debugging:
When loading block index at chainio.go
calling dbFetchHeaderByHeight with height=0 (first block)
getting correct has for height =0
calling dbFetchHeaderByHash with hash
calling FetchBlockHeader with hash
calling fetchBlockRow with hash
getting a blockrow from hash table using the Hash
returned blockrow has length of 12 which is causing a failure at db.go:1278
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.