Commit Graph

59 Commits

Author SHA1 Message Date
Josh Rickmar
c6f9474348 Expand ~ to correct home directory on all OSes.
This fixes the behavior of expanding ~ on Windows and macOS, as well
as adding support for ~otheruser to expand to the home directory of
otheruser.

Modify the default sample config to reflect the change in the meaning
of ~ on Windows, and the unintended meaning of ~ on macOS.  Include
defaults for all 3 of the major operating system classes since
uncommenting the default Unix option on macOS or Windows would change
the blockchain data directory to a non-default location.
2018-02-22 20:35:44 -06:00
Donald Adu-Poku
a0438c81c3 rpcserver: add batched request support (json 2.0) 2018-02-13 17:12:08 -06:00
Alex Yocom-Piatt
d4172fb0eb Bump for v1.1.2 2017-11-20 18:53:16 -06: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
Alex Yocom-Piatt
1500e972e2 Bump for v1.1.0 (#867) 2017-09-22 11:56:37 -05:00
Jean-Christophe Mincke
5115a422f0 multi: Error descriptions are in lower case.
Functions fmt.Error(), errors.New() are inspected.

Files under the dcrd/vendor directory are ignored.
2017-09-08 18:03:59 +02:00
Donald Adu-Poku
539fb844cc glide: use jessevdk/go-flags for consistency. 2017-08-30 19:08:18 -05:00
David Hill
aa2b50714e Bump for v1.0.8 (#832) 2017-08-24 16:15:38 -05:00
David Hill
a8469025e4 Bump for v1.0.7 2017-08-15 14:47:48 -05:00
John C. Vernaleo
384c024c66 dcrctl: Add --walletrpcserver option.
This option allows one to specify a different option for the wallet
rpc server it will connect to.  This is primarily meant to be used in
the config file so that a single dcrctl.conf may be used in the
situation where the wallet is on one host and dcrd is on another host.
2017-07-17 13:47:39 -04:00
John C. Vernaleo
0d406ffde8 Bump for v1.0.5 2017-06-20 16:47:02 -04:00
John C. Vernaleo
016915c33d Add -j/json option to dcrctl.
This option lets dcrctl print the raw json it both
sends and receives for commands.

Inspired by the similar option in dcrtime.
2017-06-15 09:37:23 -04:00
John C. Vernaleo
b90ee0c98a Bump for v1.0.3 2017-06-07 13:45:19 -04:00
John C. Vernaleo
5bed758f85 Bump for v1.0.1 2017-04-28 11:22:19 -05:00
John C. Vernaleo
5c3e0d6454 Bump for v1.0.0
Remove beta label
2017-04-26 13:26:02 -05:00
David Hill
7cb68f472a dcrctl: Be smarter about automatic configuration.
dcrctl does not require dcrd so it should not keep complaining about
it missing.  Just skip automatic configuration if dcrd's configuration
is missing, but still set it up in the future if one appears and dcrctl
is still lacking a configuration file.
2017-03-20 14:17:06 -04:00
John C. Vernaleo
f60aab08be Differentian dev and release in -V
By default, put 'dev' in the prerelease field.

For release builds we can add 'release' with the build scripts.

Update comment for current (post 1.5) usage on ldflags -X while there.
2017-02-20 09:24:36 -05:00
Josh Rickmar
33483abb2c dcrctl: Remove --terminal feature (#580)
The problem of securely prompting for secrets and not leaving secrets in shell
history can be solved in better ways, such as implementing a tool to read a
secret and write it back to standard output, allowing the secret to be piped to
dcrctl.  Luckily dcrctl already supports this feature!

No (official) tool exists so far, but the workflow would look like this:

  promptsecret | dcrctl --wallet walletpassphrase - 60

While here removing unneeded deps from the glide files, also throw in an
unrelated dcrrpcclient dep update.
2017-02-17 08:25:23 -05:00
John C. Vernaleo
4af97d2d70 Bump for v0.8.2 2017-02-15 14:27:36 -05:00
John C. Vernaleo
71e3acce1e Bump for v0.8.0 2017-02-13 14:48:52 -05:00
John C. Vernaleo
a4de235531 Bump for v0.7.0 2016-12-23 17:05:03 -05:00
David Hill
b26ffbdb1b Bump to v0.6.1 (#492) 2016-11-25 21:34:20 -06:00
John C. Vernaleo
3000ee0e6b Bump for v0.6.0 2016-11-04 07:42:06 -04:00
Jonathan Chappelow
e7dcfbc982 Output of --help/-h should go to os.Stdout rather than os.Stderr (#386)
Fixes #105
2016-11-03 12:42:04 -05:00
David Hill
2bae2c02de dcrctl: Set width to max in --terminal (#436)
Fixes #424
2016-11-03 10:17:57 -05:00
David Hill
d4860d75f0 dcrctl: fix output in --terminal mode (#416) 2016-10-11 10:54:59 -04:00
John C. Vernaleo
af40801d40 Bump for v0.5.0 2016-10-04 12:16:42 -04:00
Marco Peereboom
1c180c1106 Reconcile btcd and dcrd auto generated config file semantics
Fixes #316
2016-09-26 11:59:04 -05:00
John C. Vernaleo
1001c19da0 Do not error if dcrctl can't find dcrd.conf.
Closes #303
2016-09-08 13:21:48 -04:00
John C. Vernaleo
6c162def5f Bump for v0.4.0 (#336) 2016-09-01 13:30:12 -05:00
Dave Collins
b6d426241d blockchain: Rework to use new db interface.
This commit is the first stage of several that are planned to convert
the blockchain package into a concurrent safe package that will
ultimately allow support for multi-peer download and concurrent chain
processing.  The goal is to update btcd proper after each step so it can
take advantage of the enhancements as they are developed.

In addition to the aforementioned benefit, this staged approach has been
chosen since it is absolutely critical to maintain consensus.
Separating the changes into several stages makes it easier for reviewers
to logically follow what is happening and therefore helps prevent
consensus bugs.  Naturally there are significant automated tests to help
prevent consensus issues as well.

The main focus of this stage is to convert the blockchain package to use
the new database interface and implement the chain-related functionality
which it no longer handles.  It also aims to improve efficiency in
various areas by making use of the new database and chain capabilities.

The following is an overview of the chain changes:

- Update to use the new database interface
- Add chain-related functionality that the old database used to handle
  - Main chain structure and state
  - Transaction spend tracking
- Implement a new pruned unspent transaction output (utxo) set
  - Provides efficient direct access to the unspent transaction outputs
  - Uses a domain specific compression algorithm that understands the
    standard transaction scripts in order to significantly compress them
  - Removes reliance on the transaction index and paves the way toward
    eventually enabling block pruning
- Modify the New function to accept a Config struct instead of
  inidividual parameters
- Replace the old TxStore type with a new UtxoViewpoint type that makes
  use of the new pruned utxo set
- Convert code to treat the new UtxoViewpoint as a rolling view that is
  used between connects and disconnects to improve efficiency
- Make best chain state always set when the chain instance is created
  - Remove now unnecessary logic for dealing with unset best state
- Make all exported functions concurrent safe
  - Currently using a single chain state lock as it provides a straight
    forward and easy to review path forward however this can be improved
    with more fine grained locking
- Optimize various cases where full blocks were being loaded when only
  the header is needed to help reduce the I/O load
- Add the ability for callers to get a snapshot of the current best
  chain stats in a concurrent safe fashion
  - Does not block callers while new blocks are being processed
- Make error messages that reference transaction outputs consistently
  use <transaction hash>:<output index>
- Introduce a new AssertError type an convert internal consistency
  checks to use it
- Update tests and examples to reflect the changes
- Add a full suite of tests to ensure correct functionality of the new
  code

The following is an overview of the btcd changes:

- Update to use the new database and chain interfaces
- Temporarily remove all code related to the transaction index
- Temporarily remove all code related to the address index
- Convert all code that uses transaction stores to use the new utxo
  view
- Rework several calls that required the block manager for safe
  concurrency to use the chain package directly now that it is
  concurrent safe
- Change all calls to obtain the best hash to use the new best state
  snapshot capability from the chain package
- Remove workaround for limits on fetching height ranges since the new
  database interface no longer imposes them
- Correct the gettxout RPC handler to return the best chain hash as
  opposed the hash the txout was found in
- Optimize various RPC handlers:
  - Change several of the RPC handlers to use the new chain snapshot
    capability to avoid needlessly loading data
  - Update several handlers to use new functionality to avoid accessing
    the block manager so they are able to return the data without
    blocking when the server is busy processing blocks
  - Update non-verbose getblock to avoid deserialization and
    serialization overhead
  - Update getblockheader to request the block height directly from
    chain and only load the header
  - Update getdifficulty to use the new cached data from chain
  - Update getmininginfo to use the new cached data from chain
  - Update non-verbose getrawtransaction to avoid deserialization and
    serialization overhead
  - Update gettxout to use the new utxo store versus loading
    full transactions using the transaction index

The following is an overview of the utility changes:
- Update addblock to use the new database and chain interfaces
- Update findcheckpoint to use the new database and chain interfaces
- Remove the dropafter utility which is no longer supported

NOTE: The transaction index and address index will be reimplemented in
another commit.
2016-08-18 15:42:18 -04:00
John C. Vernaleo
864b4d34b9 Bump for v0.3.0 2016-08-10 15:11:49 -04:00
David Hill
9069906139 dcrctl: fix reading from stdin in terminal mode (#294)
Fixes #77
2016-08-03 16:19:54 -04:00
John C. Vernaleo
7716a500fd Bump version to v0.2.0 2016-07-22 11:22:12 -04:00
C Jepson
525770d48a Attempt to fix the broken paths in config autogen (#290)
The configuration autogenerator currently does not work well
and tries to read the sample file based on where the compiled
source's data directory was. This has been fixed so that dcrd
only checks the %PROGRAMFILES% directory on Windows where the
sample configuration file might be stored. Configuration
autogeneration has been disabled for toehr operating systems.
2016-07-20 13:17:20 -05:00
Alex Yocom-Piatt
b88cf9e80c Remove help fallthrough so help will get passed to RPC (#275)
Fixes #42
2016-07-20 11:47:01 -05:00
Dave Collins
67a1137109 Add automatic RPC configuration. (#287)
This commit is being cherry-picked from upstream btcd and has been
modified to integrate with dcrd by Dave Collins.
2016-07-15 14:09:42 -04:00
Alex Yocom-Piatt
9146525767 [dcrctl] Clear terminal history (#276)
Fixes #166 and Fixes #104
2016-07-08 11:09:53 -05:00
David Hill
fee17a1a76 Quit when the specified configuration is file not found. (#273)
Also, error on an invalid rpc certificate.
2016-06-27 14:00:48 -05:00
John C. Vernaleo
927932170b Bump for v0.1.6 2016-06-13 16:23:39 -04:00
Marco Peereboom
fa72e214db Don't create .dcrd willy-nilly.
This interferes with the installer when it tries to detect if the
required .dirs already exist or not.

Debated with jrick and ay-p.
2016-06-09 11:25:33 -05:00
John C. Vernaleo
b869593789 Bump for v0.1.5 2016-06-06 14:34:47 -04:00
John C. Vernaleo
f3e603aac0 Bump for v0.1.4 2016-05-25 12:05:45 -04:00
John C. Vernaleo
2aec09354a Bump for v0.1.3 2016-05-10 08:49:02 -04:00
John C. Vernaleo
f93cb9fd9f Bump for v0.1.2 2016-05-03 14:48:42 -04:00
John C. Vernaleo
4f8ad739a2 Bump for v0.1.1 2016-04-25 13:03:36 -04:00
John C. Vernaleo
a33985293b Bump for v0.1.0 (#123) 2016-04-18 16:33:44 -04:00
John C. Vernaleo
1517aaad07 Bump for v0.0.10 2016-04-05 15:47:29 -04:00
John C. Vernaleo
0ed0e815b0 Bump to v0.0.9 for release. 2016-04-01 12:56:01 -04:00
John C. Vernaleo
967952c7cb Bump for 0.0.8 2016-03-18 14:26:05 -04:00