decred / dcrd Goto Github PK
View Code? Open in Web Editor NEWDecred daemon in Go (golang).
Home Page: https://decred.org
License: ISC License
Decred daemon in Go (golang).
Home Page: https://decred.org
License: ISC License
As the title indicates, the new getcoinsupply
RPC command is returning a JSON object instead of a numeric value which is inconsistent with every other command:
$ dcrctl --testnet getcoinsupply
{
"coinsupply": 41607334358723
}
Compare that to:
$ dcrctl --testnet getnetworkhashps
786150989
$ dcrctl --testnet getblockcount
13464
$ dcrctl --testnet getconnectioncount
8
$ dcrctl --testnet getcurrentnet
118030347
Sending the string " - " causes the terminal to hang irreversibly by sending EOF through stdin.
The block construction loop is supposed to pop transactions from the priority queue and assumes those transactions are in the correct dependency order. This results in errors like the one below being displayed in MINR=trace.
15:45:56 2016-04-14 [TRC] MINR: Skipping tx 0c071761a917bb15f16746bb7f3baa54f4efa238 aa541e7dd818e0d08852f557 due to error in CheckTransactionInputs: transaction 0c07176 1a917bb15f16746bb7f3baa54f4efa238aa541e7dd818e0d08852f557 tried to double spend coin s from transaction 74fa7f0a125f638c5578a761fbd9013e473067ef36c4d03bb222a964d22d1d2f
The mempool is checking votes based on current height rather than the height which they vote on.
20:02:33 2016-01-26 [ERR] WLLT: Cannot handle chain server voting notification WinningTickets: -22: TX rejected: tried to spend sstx output from transaction f528f433379046136b03b51c103b872a80342047ad1b9d2c5e5de14afbb8729 from height 1231 at height 1240 before required ticket maturity of 16+1 blocks
Because votes are chain specific, an exception should be made to evaluate them from the perspective of the chain they vote on.
In the instance that a block has 3+ no votes, that means the previous block's entire subsidy needs to be subtracted from the coin supply due to invalidation.
Since the chain is new and there is only roughly 2 TH/s hash power securing the network, I think it's important to get an initial checkpoint in place with the next release to prevent the ability to rewrite history before that point once more hash power shows up.
bug report from Skarsol in #decred: I can predict, +-1 block (usually exactly) when my transaction will be confirmed. It's also no respecting the fees. I can get confirmations (regularly) with .001 fee while a manually sent .07 will never confirm.
Fees don't appear to effect priority and sstx confirmations are some how predictive?
sendtoaddress Dxxx2 1.25
-32603: insufficient funds: transaction requires 1.4 Coin input (1.25 Coin output + 0.15 Coin fee) but only 1.30419483 Coin spendable
"balance": 95.77621107
getblocktemplate fails when generating new work from an old block found in the blockchain in the absence of a cached template. This is caused by a bad declaration in mining.go.
fees: []int64{0}, sigOpCounts: []int64{0},
This can be fixed by calculating the fees and sigop number for these transactions.
According to decred.org:
Free and Open-Source Software
Where is the source code for dcrd?
Probably ought to update sample-dcrctl.conf to talk about dcrctl not dcrd ;-)
I'd like to implement some security measures and check the "unlocked until" value on a regular basis of the daemon but it seems this field is unused - it always returns "0", no matter how long I unlock the wallet.
Can I start mining? If so how do I start mining decred?
Is it possible for the mining code to wait for more of the votes instead of releasing the block right away? The miners dont get full reward without including the tickets, so the incentive is already there. Is it technically possible for a miner to wait for the additional votes. Not sure if their found block would still be valid or if the hash becomes modified with more votes added.
I would like to start new dcrd nodes and have a way to prevent the full blockchain synchronization.
For this purpose, I intend to use the existing addBlock utility and a bootstrap file to load the blockchain in the dcrd database.
I don't find it in documentation, is there already a way to generate or export a boostrap.dat file from a running dcrd node ?
Myagui from #decred reports that an automatically purchased stake ticket has gone missing.
204aef600d8148f202bd87b8a388f8063f77ccbf133632af02983b3b02de6f1d
It returns no information for getrawtransaction on their local dcrd and I was also unable to see it on mine.
They have attempted multiple restarts, but the tx remains in their listtransactions.
Appears that an address related to that tx is also causing issues for insight:
https://mainnet.decred.org/address/DsiMartDhqV8BRDSkgA7gAY8FbazgX5djrX
That could be related to the MIA tx
Daemon currently allows the mempool to accept double spent votes for very old blocks or blocks that are not known. This behaviour should be corrected to prevent unlikely DoS attacks from a stakeholder with a large number of votes. The fix should reject votes for blocks greater than coinbase maturity blocks before the tip. It should be considered if the blockchain should query HaveBlock to make sure that the block exists. The proper solution would be a new wire message that includes a proof of work with the vote (block header) to prevent spam.
When running as a service the main function exits the app, obviously there was some intended behavior here but for the life of me can not figure out why? This causes the service controller the toss an error instead of just allowing it to run.
https://forum.decred.org/threads/dcrd-wont-start-closes-right-away-with-error.1260/
$ ./linux-amd64/dcrctl --testnet --wallet getbalance
46.00001001
$ ./linux-amd64/dcrctl --testnet --wallet getinfo | grep balance
"balance": 0,
The RPC listen interface documentation here is using the Bitcoin ports as examples instead of the Decred ports. This should be remedied.
Many people cannot purchase PoS tickets because it ignores the account you specify and tries to use default. Also looks like the move command is broken.
C:\Program Files\Decred>dcrctl -u -P --wallet purchaseticket CodyF86 2
-4: not enough to purchase sstx
C:\Program Files\Decred>dcrctl -u -P --wallet listaccounts
{
"CodyF86": 30.50512524,
"default": 0,
"imported": 0
}
C:\Program Files\Decred>dcrctl -u -P --wallet move CodyF86 default 10
-1: Request unsupported by dcrwallet
Would really like to participate in PoS without having to send coins to the default account address and loss on basically a 3/4-way transaction fee.
Signatures sign H(prefixHash || witnessHash), but prefixHash never changes for sigHashAll. The Copy() call in calcSignatureHash can then be easily avoided if the transaction hash is simply reused and the transaction witness, or the hash of the referenced pkScript in this case, calculated on the fly.
Is it possible to add the support for Decred coin using blake256 algo.
dcrctl --terminal currently saves an empty line in the history when they are entered. This is problematic because when hitting the up arrow to go to the history, nothing appears. Empty lines should be omitted from the scroll back history.
The sample-dcrd.conf
file says the following:
; Specify the interfaces for the RPC server listen on. One listen address per
; line. NOTE: The default port is modified by some options such as 'testnet',
; so it is recommended to not specify a port and allow a proper default to be
; chosen unless you have a specific reason to do otherwise.
; All interfaces on default port (this is the default):
; rpclisten=
This was fixed upstream by commit btcsuite/btcd@22c8551. It should probably be cherry-picked.
The stop command appears to exit before the ticket database has been written to disk, forcing a resync on the next startup.
'getrawmempool false blah' will return all. Should return an error instead.
The priority queue that were just merged miss the edge conditions when the fee is the same and the priority is inverted and would result in a false positive failure in that case.
They should be updated to test the edge conditions as I've done in the upstream btcd here: btcsuite/btcd#667
I'm mining with cgminer, this error popped up on the log.
First "Block submitted via getwork has no matching template for merkle root", then "Failed to create new block template: not enough voters: internal error" with a reorganize in the middle. Not sure if these are related or not.
Jan 31 02:26:15 pepinaco1 dcrd[945]: 02:26:15 2016-01-31 [INF] BMGR: Processed 1 block in the last 26.88s (1 transaction, height 3737, 2016-01-31 02:25:37 +0100 CET)
Jan 31 02:28:18 pepinaco1 dcrd[945]: 02:28:18 2016-01-31 [INF] BMGR: Processed 1 block in the last 2m2.95s (1 transaction, height 3738, 2016-01-31 02:26:49 +0100 CET)
Jan 31 02:29:39 pepinaco1 dcrd[945]: 02:29:39 2016-01-31 [INF] RPCS: Block submitted via getwork accepted: 000000000022a240d29d0dcdb3ac11b8b49c9d9581f75ee3e6ea5f61d1c8e716
Jan 31 02:30:27 pepinaco1 dcrd[945]: 02:30:27 2016-01-31 [INF] RPCS: Block submitted via getwork accepted: 0000000000155c965b75bc9f9d117dae44a31653cbb09df876ff6c9efdd5bc50
Jan 31 02:30:27 pepinaco1 dcrd[945]: 02:30:27 2016-01-31 [INF] CHAN: FORK: Block 0000000000528d5c7e2c1f605534ec4e1875b24fb9daff815e444a86455c825d (height 3740) forks the chain at height 3739/block 000000000022a240d29d0dcdb3ac11b8b49c9d9581f75ee3e6ea5f61d1c8e716, but does not cause a reorganize
Jan 31 02:30:27 pepinaco1 dcrd[945]: 02:30:27 2016-01-31 [INF] BMGR: Processed 1 block in the last 2m9.5s (1 transaction, height 3740, 2016-01-31 02:28:50 +0100 CET)
Jan 31 02:30:28 pepinaco1 dcrd[945]: 02:30:28 2016-01-31 [ERR] RPCS: Block submitted via getwork has no matching template for merkle root 4a72dfb61c5804661a633f1adbe10fb9249b6441e9fb536e664e7abbfd06f64c
Jan 31 02:30:29 pepinaco1 dcrd[945]: 02:30:29 2016-01-31 [INF] CHAN: REORGANIZE: Chain forks at 000000000022a240d29d0dcdb3ac11b8b49c9d9581f75ee3e6ea5f61d1c8e716, height 3739
Jan 31 02:30:30 pepinaco1 dcrd[945]: 02:30:29 2016-01-31 [INF] CHAN: REORGANIZE: Old best chain head was 0000000000155c965b75bc9f9d117dae44a31653cbb09df876ff6c9efdd5bc50, height 3740
Jan 31 02:30:30 pepinaco1 dcrd[945]: 02:30:29 2016-01-31 [INF] CHAN: REORGANIZE: New best chain head is 0000000000528d5c7e2c1f605534ec4e1875b24fb9daff815e444a86455c825d, height 3740
Jan 31 02:30:30 pepinaco1 dcrd[945]: 02:30:30 2016-01-31 [ERR] RPCS: Failed to create new block template: not enough voters: internal error
Jan 31 02:31:22 pepinaco1 dcrd[945]: 02:31:22 2016-01-31 [INF] BMGR: Processed 1 block in the last 54.51s (1 transaction, height 3741, 2016-01-31 02:29:49 +0100 CET)
Jan 31 02:32:23 pepinaco1 dcrd[945]: 02:32:23 2016-01-31 [INF] BMGR: Processed 1 block in the last 1m1.49s (1 transaction, height 3742, 2016-01-31 02:33:09 +0100 CET)
Jan 31 02:34:14 pepinaco1 dcrd[945]: 02:34:14 2016-01-31 [INF] BMGR: Processed 1 block in the last 1m50.52s (1 transaction, height 3743, 2016-01-31 02:32:47 +0100 CET)
Jan 31 02:36:28 pepinaco1 dcrd[945]: 02:36:28 2016-01-31 [INF] BMGR: Processed 1 block in the last 2m14.47s (1 transaction, height 3744, 2016-01-31 02:34:17 +0100 CET)
Jan 31 02:40:49 pepinaco1 dcrd[945]: 02:40:49 2016-01-31 [INF] BMGR: Processed 1 block in the last 4m21.01s (2 transactions, height 3745, 2016-01-31 02:39:17 +0100 CET)
Since 0.0.5 "listtransactions" not only lists transactions in reverse order, no, it now also lists transactions in totally random order.
As a quick fix I've had to read the results into an array and i'm sorting this array using the "blocktime" field.
when in the --terminal mode
adding to this, Home and End do not work either for getting to the beginning and end of the line.
It seems like this is by design but isn't "the Unix way":
// HelpFlag adds a default Help Options group to the parser containing
// -h and --help options. When either -h or --help is specified on the
// command line, the parser will return the special error of type
// ErrHelp. When PrintErrors is also specified, then the help message
// will also be automatically printed to os.Stderr.
Running dcrd --help
outputs to standard error which prevents immediate parsing of the Help output through another program such as less
or grep
. The work around is to forward standard error output to standard out but this is annoying and deviates from normal behavior of other Unix programs. Proposed change is to have the Help Flag output to standard out.
Also mentioned by others in IRC.
As in btcsuite/btcd#329
Please sort transactions by time
With the new arrival of btcwallet's new gRPC server, the associated documentation needs to be updated to properly refer to various things ie bitcoin --> decred, update ports etc.
When using the --datadir
switch with dcrd
, the expectation is that the rpc.cert/.key files will be accessed from there, where the block db is also located. However, rpc.cert ends up in the default location $LOCALAPPDATA\Dcrd\rpc.cert
(or wherever depending on OS depending on dcrutil.AppDataDir()
).
This is not consistent with the behavior of dcrwallet
, where the cert/key files are read and written to according to the --datadir
argument:
https://github.com/decred/dcrwallet/blob/master/config.go#L358
There is no similar logic for dcrd. The folder is always dcrutil.AppDataDir("dcrd", false)
, the default.
It would be great if GUIs could create wallet's from a simple command line command. At this moment it is almost impossible to create wallets from anything but the command line, because stdio emulation won't work when asked for passwords.
I'm starting to have issues with the getwork call not giving valid results, the log is then full of this:
10:20:11 2016-02-24 [ERR] MINR: failed to check template: Error in stake consensus: The number of SSGen tx in block e789dce2d7d74e8bcb9a02766c5de563e80d0b48991eec15cb610564f1224f6f was not the 4 voters expected from the header!
10:20:11 2016-02-24 [ERR] RPCS: Failed to create new block template: Error in stake consensus: The number of SSGen tx in block e789dce2d7d74e8bcb9a02766c5de563e80d0b48991eec15cb610564f1224f6f was not the 4 voters expected from the header!
10:20:11 2016-02-24 [ERR] MINR: failed to check template: Error in stake consensus: The number of SSGen tx in block e789dce2d7d74e8bcb9a02766c5de563e80d0b48991eec15cb610564f1224f6f was not the 4 voters expected from the header!
10:20:11 2016-02-24 [ERR] RPCS: Failed to create new block template: Error in stake consensus: The number of SSGen tx in block e789dce2d7d74e8bcb9a02766c5de563e80d0b48991eec15cb610564f1224f6f was not the 4 voters expected from the header!
10:20:11 2016-02-24 [ERR] MINR: failed to check template: Error in stake consensus: The number of SSGen tx in block e789dce2d7d74e8bcb9a02766c5de563e80d0b48991eec15cb610564f1224f6f was not the 4 voters expected from the header!
10:20:11 2016-02-24 [ERR] RPCS: Failed to create new block template: Error in stake consensus: The number of SSGen tx in block e789dce2d7d74e8bcb9a02766c5de563e80d0b48991eec15cb610564f1224f6f was not the 4 voters expected from the header!
10:20:11 2016-02-24 [ERR] MINR: failed to check template: Error in stake consensus: The number of SSGen tx in block e789dce2d7d74e8bcb9a02766c5de563e80d0b48991eec15cb610564f1224f6f was not the 4 voters expected from the header!
10:20:11 2016-02-24 [ERR] RPCS: Failed to create new block template: Error in stake consensus: The number of SSGen tx in block e789dce2d7d74e8bcb9a02766c5de563e80d0b48991eec15cb610564f1224f6f was not the 4 voters expected from the header!
10:20:11 2016-02-24 [ERR] MINR: failed to check template: Error in stake consensus: The number of SSGen tx in block e789dce2d7d74e8bcb9a02766c5de563e80d0b48991eec15cb610564f1224f6f was not the 4 voters expected from the header!
10:20:11 2016-02-24 [ERR] RPCS: Failed to create new block template: Error in stake consensus: The number of SSGen tx in block e789dce2d7d74e8bcb9a02766c5de563e80d0b48991eec15cb610564f1224f6f was not the 4 voters expected from the header!
10:20:11 2016-02-24 [ERR] MINR: failed to check template: Error in stake consensus: The number of SSGen tx in block e789dce2d7d74e8bcb9a02766c5de563e80d0b48991eec15cb610564f1224f6f was not the 4 voters expected from the header!
10:20:11 2016-02-24 [ERR] RPCS: Failed to create new block template: Error in stake consensus: The number of SSGen tx in block e789dce2d7d74e8bcb9a02766c5de563e80d0b48991eec15cb610564f1224f6f was not the 4 voters expected from the header!
10:20:11 2016-02-24 [ERR] MINR: failed to check template: Error in stake consensus: The number of SSGen tx in block e789dce2d7d74e8bcb9a02766c5de563e80d0b48991eec15cb610564f1224f6f was not the 4 voters expected from the header!
10:20:11 2016-02-24 [ERR] RPCS: Failed to create new block template: Error in stake consensus: The number of SSGen tx in block e789dce2d7d74e8bcb9a02766c5de563e80d0b48991eec15cb610564f1224f6f was not the 4 voters expected from the header!
10:20:11 2016-02-24 [ERR] MINR: failed to check template: Error in stake consensus: The number of SSGen tx in block e789dce2d7d74e8bcb9a02766c5de563e80d0b48991eec15cb610564f1224f6f was not the 4 voters expected from the header!
10:20:11 2016-02-24 [ERR] RPCS: Failed to create new block template: Error in stake consensus: The number of SSGen tx in block e789dce2d7d74e8bcb9a02766c5de563e80d0b48991eec15cb610564f1224f6f was not the 4 voters expected from the header!
10:20:12 2016-02-24 [ERR] MINR: failed to check template: Error in stake consensus: The number of SSGen tx in block e789dce2d7d74e8bcb9a02766c5de563e80d0b48991eec15cb610564f1224f6f was not the 4 voters expected from the header!
10:20:12 2016-02-24 [ERR] RPCS: Failed to create new block template: Error in stake consensus: The number of SSGen tx in block e789dce2d7d74e8bcb9a02766c5de563e80d0b48991eec15cb610564f1224f6f was not the 4 voters expected from the header!
10:20:12 2016-02-24 [ERR] MINR: failed to check template: Error in stake consensus: The number of SSGen tx in block 80e2b2090715798b59966f0a9410e131f8dfc29922b0869837d8a2e4a33e9c04 was not the 4 voters expected from the header!
10:20:12 2016-02-24 [ERR] RPCS: Failed to create new block template: Error in stake consensus: The number of SSGen tx in block 80e2b2090715798b59966f0a9410e131f8dfc29922b0869837d8a2e4a33e9c04 was not the 4 voters expected from the header!
10:20:12 2016-02-24 [ERR] MINR: failed to check template: Error in stake consensus: The number of SSGen tx in block 80e2b2090715798b59966f0a9410e131f8dfc29922b0869837d8a2e4a33e9c04 was not the 4 voters expected from the header!
10:20:12 2016-02-24 [ERR] RPCS: Failed to create new block template: Error in stake consensus: The number of SSGen tx in block 80e2b2090715798b59966f0a9410e131f8dfc29922b0869837d8a2e4a33e9c04 was not the 4 voters expected from the header!
It catches up eventually after a few seconds and then getwork is returning valid data again - in the time between my mining pool is literally in "zombie mode" because there is no valid work to work on..
OP_SSTXCHANGE tagged outputs should be spendable in chains. In wallet, if the ticket has failed to enter a block, the user will not see the change tagged funds in their wallet.
The current option menu shows,
[h]elp print this message
[l]ist list all available commands
[p]rotect toggle protected mode (for passwords)
[q]uit/ctrl+d exit
Id like to have this option:
[c]lear clear history of commands
As the title indicates, wallet commands should be added to the rpcAskWallet
map in dcrd so it provides a more helpful message to the user if they end up issuing the request to the chain server instead of the wallet server.
$ dcrctl getstakeinfo
-32601: Method not found
Compare that to:
$ dcrctl getbalance
-1: This implementation does not implement wallet commands
getseed from the wallet is showing a strange error:
$ ./dcrctl --wallet -u HAHAHAHA -P NOTAPASS --notls getseed
-4: manager is locked
That looks like an error message is being cut off...
The --terminal option special cases a few commands, including help. This can cause issues when trying to send a help request to a dcrd or dcrwallet RPC server.
It doesn't prevent all usage. If you use help methodname
then the RPC is performed. The RPC is also performed if there is any trailing whitespace after the help. However, typing in just help
won't perform the RPC.
Running this command
dcrctl -u user -P password --terminal
The plain text password is displayed.
The genesis block output doesn't parse correctly, but this is not an error. It should continue rather than throw an error if it encounters an unparseable script.
13:58:09 2016-02-09 [ERR] ADXR: Error converting tx e7dfbceac9fccd6025c70a1dfa9302b3e7b5aa22fa51c98a69164ad403d60a2c: script conversion error 13:58:09 2016-02-09 [ERR] BMGR: AddrIndexManager error: Unable to index transactions of block: script conversion error
There is an issue on Mac OSX where it fails to parse the localhost IPv6 because it has a zone ID in it.
21:02:12 2016-02-09 [ERR] DCRD: Unable to start server on [:9108]: 'fe80::1%lo0' is not a valid IP address
This was fixed in upstream btcd via btcsuite/btcd#538. That fix should be cherry-pick to dcrd to prevent this.
It would be great if the wallet and a miner could be running with the same dcrd instance.
dcrctl --terminal
currently doesn't work on Windows, because using "golang.org/x/crypto/ssh/terminal" (see terminal.go) to handle terminals has at least two problems:
I could rewrite the terminal code to use the liner package instead. I used it in another project and so far it seems to work just fine on Windows (including echo). It also gives the terminal mode more features (e.g., searchable history).
An alternative might be the readline package, but I have no experience with it. And a package inspired by linenoise hopefully will continue to be more minimal than a package inspired by GNU readline.
Any opinions?
{"result":null,"error":{"code":-4,"message":"Transactions are not yet grouped by account"},"id":1}
$ go install -v github.com/decred/dcrd/...
github.com/decred/dcrd/chaincfg
# github.com/decred/dcrd/chaincfg
src/github.com/decred/dcrd/chaincfg/genesis.go:9: imported and not used: "time"
src/github.com/decred/dcrd/chaincfg/genesis.go:11: imported and not used: "github.com/decred/dcrd/chaincfg/chainhash"
src/github.com/decred/dcrd/chaincfg/genesis.go:12: imported and not used: "github.com/decred/dcrd/wire"
src/github.com/decred/dcrd/chaincfg/params.go:9: imported and not used: "errors"
src/github.com/decred/dcrd/chaincfg/params.go:10: imported and not used: "math/big"
src/github.com/decred/dcrd/chaincfg/params.go:11: imported and not used: "time"
src/github.com/decred/dcrd/chaincfg/params.go:13: imported and not used: "github.com/decred/dcrd/chaincfg/chainhash"
src/github.com/decred/dcrd/chaincfg/params.go:14: imported and not used: "github.com/decred/dcrd/wire"
src/github.com/decred/dcrd/chaincfg/premine.go:10: undefined: TokenPayout
src/github.com/decred/dcrd/chaincfg/premine.go:3161: undefined: TokenPayout
src/github.com/decred/dcrd/chaincfg/premine.go:3161: too many errors
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.