Commit Graph

89 Commits

Author SHA1 Message Date
Markus Richter
8deac318d0 docs: Fix links for internal packages.
dcrrpclient and dcrjson have been merged into dcrd.
Adjust links accordingly.
2018-03-09 16:16:58 +00:00
Markus Richter
cbc3c88533 docs: document how to use go test -coverprofile
Also some cleanups:

- Use proper punctuation.
- Use nicer link for Bitcoin white paper.
- Remove white spaces at the end of lines.
- Format paragraph.
2018-03-01 20:26:39 -06:00
Markus Richter
bca8d18cb1 docs: Remove carriage return.
Bite the bullet now and remove carriage return (`\r`) from all
documentation files to allow further edits without messy diffs.

No further changes have been made besides `sed -i 's/\r//g' docs/*`.
2018-03-01 20:14:55 -06:00
Markus Richter
1e42b8524d multi: Properly capitalize Decred.
Decred is inconsistencly capitalized in the code base,
change all occurences of decred to Decred.
2018-03-01 17:41:35 -06:00
Dave Collins
6573428e11
multi: Implement getchaintips JSON-RPC.
This implements the getchaintips JSON-RPC and updates the associated
JSON-RPC API documentation accordingly.

It should be noted that until the entire block index is loaded into
memory, the chain tips tracking currently only works with tips that have
been seen since the daemon was started.
2018-03-01 12:29:36 -06:00
Donald Adu-Poku
3603aeadb2 mempool: Add docs.go and flesh out README.md. 2018-02-21 12:27:31 +00:00
Donald Adu-Poku
a0438c81c3 rpcserver: add batched request support (json 2.0) 2018-02-13 17:12:08 -06:00
Markus Richter
239d4c84a3 docs: make example code compile
- wire.NewShaHashFromStr has been moved to chainhash.NewHashFromStr
- use mainnet port and genesis block hash
2018-01-17 16:29:07 -06:00
Markus Richter
ca60e4ae90 docs: rpcclient is now part of the main dcrd repo
Adjust links and  example code to reflect that.
Also update example output.
2018-01-17 16:29:07 -06:00
Donald Adu-Poku
bd8ff54a4b docs: Add fullblocktests entry and minor consistency updates 2017-12-31 12:25:01 +00:00
Josh Rickmar
6842aa006d Merge remaining dcrutil code into a dcrd package.
This merge commit adds the following code from the
github.com/decred/dcrutil package into a new
github.com/decred/dcrd/dcrutil package:

* Address handling
* Amount type
* AppDataDir func
* bitflags functions
* Block wrapper type
* Hash160 func
* Tx wrapper type
* WIF type

as well as all tests for this code.

The old github.com/decred/dcrutil/hdkeychain package has also been
merged and moved to github.com/decred/dcrd/dcrutil/hdkeychain.

dcrd packages have been updated to use the new packages and the dep
files have been updated for this change.
2017-10-11 22:06:36 -04:00
Donald Adu-Poku
f11fac8134 multi: update stakebase tx vin[0] structure.
modifications to the stakebase tx vin[0] required adding a stakebase
field to Vin and VinPrevOut structs as well as updating the
rpc documentation for the affected calls.
2017-09-23 03:24:55 -05:00
Donald Adu-Poku
a70d73e1db docs: update git commit messages section heading. 2017-09-19 18:27:01 -05:00
Donald Adu-Poku
8a40fb5bbf docs: crosscheck and update all rpc doc entries.
The following updates were done throughout and were made to make important
information in the docs stand out at a glance:

- updates to requests info
- stylistic changes to displaying params
- returns and their types

The extended methods section was also removed (entries are now listed as
standard methods) since that section only applied to upstream. A doc entry for
loadtxfilter was also added.
2017-09-11 01:46:49 -05:00
Donald Adu-Poku
3b8f09f752 docs: create entry for getstakeversions in rpcapi 2017-08-31 00:00:44 -05:00
Donald Adu-Poku
9ad88e3436 docs: rpcapi format update.
the updated format is easier to edit
and maintains the tabular presentation
of the original
2017-08-18 13:54:58 -05:00
Donald Adu-Poku
8c5a4ff140 docs: add commit prefix notes 2017-08-04 03:00:35 -05:00
Dave Collins
c50d43e3cb
rpcserver: Improve help text for getmininginfo.
This improves the help text for stakedifficulty field of the
getmininginfo RPC to clarify it is the value for the next block.

Also, update the JSON-RPC docs entry to include the field which should
have been done previously.
2017-07-18 21:13:39 -05:00
Dave Collins
e2b74d501c
multi: Update markdown files for GFM changes.
The github markdown interpreter has been changed such that it no longer
allows spaces in between the brackets and parenthesis of links and now
requires a newline in between anchors and other formatting.  This
updates all of the markdown files accordingly.

While here, it also corrects a couple of inconsistencies in some of the
README.md files and correct some previous merge conflicts.
2017-07-16 15:33:12 -05:00
John C. Vernaleo
e7b128a672 multi: Update markdown in README files to match change in github parser.
This borrows a lot from btcsuite/btcd 9918e2a56196fb6b1b2837a9e7fb84f3454098fd
2017-05-26 12:06:19 -04:00
David Hill
f54151cf18 docs: update json examples 2017-05-17 22:47:29 -04:00
Javed Khan
25c93e46e6 connmgr: Refactor connection management into pkg
This commit introduces package connmgr which contains connection
management related functionality.

The following is an overview of the features the package provides:

- Maintain fixed number of outbound connections
- Optional connect-only mode
- Retry persistent connections with increasing back-off
- Source peers from DNS seeds
- Use Tor to resolve DNS
- Dynamic ban scores
- Test coverage

In addition, btcd has been refactored to make use of the new package by
extending the connection manager to work with the server to source and
maintain peer connections. The following is a broad overview of the
changes to integrate the package:

- Simplify peer state by removing pending, retry peers
- Refactor to remove retries which are now handled by connmgr
- Use callback to add addresses sourced from the  DNS seed

Finally the following connection-related things have been improved as a
part of this refactor:

- Fixes 100% cpu usage when network is down
- Fixes issues with max peers
- Simplify outbound peer connections management
2017-03-21 19:42:19 -05:00
Dave Collins
26b74c431c
docs: Add chainhash to README.md
Upstream commit 4a5223266c.
2016-11-18 13:07:59 -06:00
Dave Collins
c162fbde71
multi: Upstream chainhash abstraction sync
Contains the following commits:

- 711f33450c
- b6b1e55d1e
  - Reverted because Travis is already at a more recent version
- bd4e64d1d4

Also, the merge commit contains the necessary decred-specific
alterations, converts all other references to sha to hash to keep with
the spirit of the merged commits, and various other cleanup intended to
bring the code bases more in line with one another.
2016-11-16 12:48:40 -06:00
Dave Collins
e90b0c967f
docs: Add mempool entry to developer tools section. 2016-10-23 20:47:05 -05:00
Dave Collins
b8df516b4b
docs: Add fullblocktests entry and make consistent. 2016-10-23 13:34:14 -05:00
Javed Khan
bff2ba70fd connmgr: Refactor connection management into pkg
This commit introduces package connmgr which contains connection
management related functionality.

The following is an overview of the features the package provides:

- Maintain fixed number of outbound connections
- Optional connect-only mode
- Retry persistent connections with increasing back-off
- Source peers from DNS seeds
- Use Tor to resolve DNS
- Dynamic ban scores
- Test coverage

In addition, btcd has been refactored to make use of the new package by
extending the connection manager to work with the server to source and
maintain peer connections. The following is a broad overview of the
changes to integrate the package:

- Simplify peer state by removing pending, retry peers
- Refactor to remove retries which are now handled by connmgr
- Use callback to add addresses sourced from the  DNS seed

Finally the following connection-related things have been improved as a
part of this refactor:

- Fixes 100% cpu usage when network is down (#129)
- Fixes issues with max peers (#577)
- Simplify outbound peer connections management
2016-10-22 01:11:57 -05:00
Dave Collins
f21410e47c
blockchain: Add block validation infrastructure.
This adds a full-blown testing infrastructure in order to test consensus
validation rules.  It is built around the idea of dynamically generating
full blocks that target specific rules linked together to form a block
chain.  In order to properly test the rules, each test instance starts
with a valid block that is then modified in the specific way needed to
test a specific rule.

Blocks which exercise following rules have been added for this initial
version.  These tests were largely ported from the original Java-based
'official' block acceptance tests as well as some additional tests
available in the Core python port.  It is expected that further tests
can be added over time as consensus rules change.

* Enough valid blocks to have a stable base of mature coinbases to spend
  for futher tests
* Basic forking and chain reorganization
* Double spends on forks
* Too much proof-of-work coinbase (extending main chain, in block that
  forces a reorg, and in a valid fork)
* Max and too many signature operations via various combinations of
  OP_CHECKSIG, OP_MULTISIG, OP_CHECKSIGVERIFY, and OP_MULTISIGVERIFY
* Too many and max signature operations with offending sigop after
  invalid data push
* Max and too many signature operations via pay-to-script-hash redeem
  scripts
* Attempt to spend tx created on a different fork
* Attempt to spend immature coinbase (on main chain and fork)
* Max size block and block that exceeds the max size
* Children of rejected blocks are either orphans or rejected
* Coinbase script too small and too large
* Max length coinbase script
* Attempt to spend tx in blocks that failed to connect
* Valid non-coinbase tx in place of coinbase
* Block with no transactions
* Invalid proof-of-work
* Block with a timestamp too far in the future
* Invalid merkle root
* Invalid proof-of-work limit (bits header field)
* Negative proof-of-work limit (bits header field)
* Two coinbase transactions
* Duplicate transactions
* Spend from transaction that does not exist
* Timestamp exactly at and one second after the median time
* Blocks with same hash via merkle root tricks
* Spend from transaction index that is out of range
* Transaction that spends more that its inputs provide
* Transaction with same hash as an existing tx that has not been
  fully spent (BIP0030)
* Non-final coinbase and non-coinbase txns
* Max size block with canonical encoding which exceeds max size with
  non-canonical encoding
* Spend from transaction earlier in same block
* Spend from transaction later in same block
* Double spend transaction from earlier in same block
* Coinbase that pays more than subsidy + fees
* Coinbase that includes subsidy + fees
* Invalid opcode in dead execution path
* Reorganization of txns with OP_RETURN outputs
* Spend of an OP_RETURN output
* Transaction with multiple OP_RETURN outputs
* Large max-sized block reorganization test (disabled by default since
  it takes a long time and a lot of memory to run)

Finally, the README.md files in the main and docs directories have been
updated to reflect the use of the new testing framework.
2016-10-17 12:16:53 -05:00
David Hill
05ab7141d3 travis: Add go 1.7 and drop go 1.5 support. (#740) 2016-08-18 11:06:26 -05:00
Janus Troelsen
4a5223266c docs: Add chainhash to README.md (#739) 2016-08-17 10:41:50 -05:00
Dave Collins
bd4e64d1d4 chainhash: Abstract hash logic to new package. (#729)
This is mostly a backport of some of the same modifications made in
Decred along with a few additional things cleaned up.  In particular,
this updates the code to make use of the new chainhash package.

Also, since this required API changes anyways and the hash algorithm is
no longer tied specifically to SHA, all other functions throughout the
code base which had "Sha" in their name have been changed to Hash so
they are not incorrectly implying the hash algorithm.

The following is an overview of the changes:

- Remove the wire.ShaHash type
- Update all references to wire.ShaHash to the new chainhash.Hash type
- Rename the following functions and update all references:
  - wire.BlockHeader.BlockSha -> BlockHash
  - wire.MsgBlock.BlockSha -> BlockHash
  - wire.MsgBlock.TxShas -> TxHashes
  - wire.MsgTx.TxSha -> TxHash
  - blockchain.ShaHashToBig -> HashToBig
  - peer.ShaFunc -> peer.HashFunc
- Rename all variables that included sha in their name to include hash
  instead
- Update for function name changes in other dependent packages such as
  btcutil
- Update copyright dates on all modified files
- Update glide.lock file to use the required version of btcutil
2016-08-08 14:04:33 -05:00
Dave Collins
8a9956da04 docs: Update READMEs with some current details.
Upstream commit 37938375dc.
2016-05-30 13:28:17 -05:00
Dave Collins
fe65e81af0 Apply various upstream comment fixes.
Contains the following upstream commits:
- 87182a2ddf
  - This commit does not apply to Decred so it has been reverted
- 89af747603
  - This commit has already been cherry picked and is a NOOP
- d0cdd53720
  - This commit has already been cherry picked and is a NOOP
- df20c1074c
- ff0c787237
- 6e133b58da
- 34a94b7d0b
- 14ccab80e7
2016-05-27 00:35:06 -05:00
Steven Roose
24e41c843b Update installation instructions using Glide (#698)
The main README.md file had newer installation that uses Glide, while these did not.
2016-05-21 17:30:26 -05:00
Dave Collins
19873768b6 dcrjson: Add optional locktime to createrawtransaction
Upstream commit 4b7206b54f
2016-05-20 22:08:14 -05:00
Dave Collins
756eff2fee peer: Refactor peer code into its own package.
Contains the following upstream commits:

- 00bddf7540
- 250228c32f
- f1bd2f8d6e
- cbbe3a8bbe
- aa03d68e1e

In addition to the normal required changes for syncing, the following
changes have been made in order to facilitate integration of the new
package into Decred:

- Removed check in PushRejectMsg against protocol version since all
  peers since the initial version support it
- Fixed leaked timer in `syncMiningStateAfterSync` function
- Add the Decred-specific OnGetMiningState and OnMiningState handlers to
  the new peer package
- Add handler for the new mining state messages to the 'serverPeer' type
  and register them
- Use the new constant for wire.InitialProtocolVersion in the reject
  message instead of hard coded number
- Remove logic specific to the regression network since Decred does not
  have it
2016-05-20 13:58:23 -05:00
Dave Collins
718f0f4942 Add reverse order option to searchrawtransactions rpc
Upstream commit 0190c349aa
2016-05-17 17:26:53 -05:00
Dave Collins
d5144c5026 Sync upstream through Sep 17, 2015. 2016-05-17 12:38:49 -05:00
cjepson
bee3c25021 Sync upstream through Aug 23, 2015
Requires dcrrpcclient#20.
2016-05-16 15:49:57 -04:00
Dave Collins
4b2f205c61 docs: Add info describing model commit messages. 2016-05-12 14:43:12 -05:00
David Hill
c53142d5d1 Implement getblockheader RPC. 2016-05-12 14:43:04 -05:00
Dave Collins
5f5bda7c82 docs: Correct JSON-RPC API overview return links.
This commit corrects the JSON-RPC API doc return to overview links for
the Websocket Extension Method Details section.
2016-05-11 13:39:40 -05:00
David Hill
83f42be247 Support getmempoolinfo. 2016-05-11 12:27:37 -05:00
Julian Yap
5c791721d6 Fix rpclisten and listen port references in documentation 2016-04-13 23:07:35 -10:00
Dave Collins
37938375dc docs: Update READMEs with current details.
This commit updates the main README.md and docs/README.md files to
replace the references to the now dead btcgui project with the
Windows-only Paymetheus project.

While here, it also updates some information to make it more current and
accurately describe the current status.
2016-03-11 14:53:15 -06:00
Jonathan Zeppettini
c0614fb151 Update configuring_tor.md
Replace Bitcoin with Decred,
2016-03-09 13:50:45 -05:00
cjepson
df701d8cdf Revert sync merge
The sync merge does not build and needs further testing. It is
being reverted.
2016-03-08 22:16:06 -05:00
Alex Yocom-Piatt
7e2c687295 Fix build/test errors from merge 2016-03-07 11:42:51 -06:00
Alex Yocom-Piatt
5b2b97e858 Sync to upstream 0280fa0264
Conflicts:
	blockchain/chain.go
	blockchain/checkpoints.go
	blockchain/difficulty.go
	blockchain/internal_test.go
	blockchain/txlookup.go
	blockchain/validate.go
	blockchain/validate_test.go
	blockmanager.go
	chaincfg/params.go
	cmd/dropafter/dropafter.go
	cpuminer.go
	database/db.go
	database/interface_test.go
	database/ldb/block.go
	database/ldb/insertremove_test.go
	database/ldb/leveldb.go
	database/ldb/operational_test.go
	database/ldb/tx.go
	database/memdb/memdb.go
	database/reorg_test.go
	dcrjson/walletsvrcmds.go
	docs/README.md
	docs/json_rpc_api.md
	mempool.go
	mining.go
	peer.go
	rpcserver.go
	rpcserverhelp.go
	rpcwebsocket.go
	sample-dcrd.conf
	txscript/consensus.go
	txscript/script_test.go
	txscript/sign.go
	txscript/standard.go
	wire/blockheader_test.go
	wire/msgtx_test.go
2016-03-07 11:35:24 -06:00
Jonathan Zeppettini
b237418c14 Update default_ports.md
Small correction, replaced Bitcoin with Decred.
2016-03-01 20:19:57 -05:00