Commit Graph

143 Commits

Author SHA1 Message Date
JoeGruff
7ffe6244ad rpcserver: Add handlers test
Add a new file and a test for the rpcserver funcion
handleCreateRawTransaction.

Change createrawsstx documentation to use address instead of desaddr.
Add that map to the help message.

Change createrawssrtx documentation to show that it accepts only one
input in documentation and part of the help message.
2020-02-12 02:28:29 -06:00
JoeGruff
a3e7aacbbe rpcserver: Refactor and update documentation
For createrawsstx explicitly state that all values are in atoms in help
messages and the documentation.

For createrawssrtx explicitly state that all values are in coins in help
messages and the documentation. Remove range loop for only one input.

For createrawtransaction explicitly state that all values are in coins in
help messages and the documentation. Move conversion to atoms above the
check for max amount and check after converting from coins.

Remove bad white spaces from JSON api documentation.
2020-02-12 02:28:29 -06:00
Matheus Degiovani
45bc0ba4a6 multi: Introduce regentemplate command
This adds the regentemplate comand to the node, which asks it to
regenerate is block template.

The node now maintains a background template generator, with various
timeouts to enable efficient generation of block templates in a
production setting.

However, external users might want to force a new template to be
generated after new regular transactions have been received but before
the regular regen timeout (currently 30 seconds) has elapsed. This is
true specially for external simnet tests that publish transactions and
rely on them being mined shortly after the node receives them.

The most flexible solution found was to add a new regentemplate command
which rpc clients can issue to force a node to regenerate the latest
template with any new transactions.
2019-11-04 11:43:12 -06:00
Donald Adu-Poku
51059750e8 multi: add gettxoutsetinfo JSON-RPC. 2019-10-29 11:00:40 -05:00
Dave Collins
fb9b966075
multi: Add tpl update reason to work ntfns.
This updates the new RPC websocket work notification that is sent when a
new template is generated and a websocket client requests updated via
notifywork to include the reason the template was generated.

In order to accomplish this, it modifies the background template
generator subscription notifications, the RPC websockets notification
manager, and the JSON-RPC work notification to include the reason and
updates all of the intermediate plumbing code accordingly.

It also updates the JSON-RPC documentation to include the new field and
enumerate the supported reasons.
2019-10-14 14:32:24 -05:00
Donald Adu-Poku
cc3374f308 multi: add notifywork rpc. 2019-10-12 19:45:55 -05:00
Dave Collins
6102e008bf
multi: Implement getcfilterv2 JSON-RPC.
This implements a new getcfilterv2 JSON-RPC and updates the JSON-RPC API
documentation accordingly.
2019-10-12 12:06:03 -05:00
Dave Collins
eb3fa80a66
docs: Update for secp256k1 v2 module. 2019-10-08 10:14:16 -05:00
Donald Adu-Poku
13ee7e50f1 docs: document module breaking changes process.
This adds a section outlining the process to follow
going forward with regards to making breaking changes
to modules.
2019-09-11 11:28:59 -05:00
Jamie Holdstock
2f0c4ecada docs: Link to btc whitepaper on decred.org
We already host the whitepaper on decred.org, so no need to link to
bitcoin.org.
2019-09-08 07:52:56 -05:00
Donald Adu-Poku
baac7efb44 multi: update limited user rpcs. 2019-09-03 10:41:52 -05:00
Donald Adu-Poku
b8864c39dc multi: update rpc documentation.
This adds missing documentation for rpcs
and orders them alphabetically.
2019-09-02 11:01:38 -05:00
Aaron Campbell
8be96a8729 multi: Correct typos.
Correct typos found by reading code, ispell, and creative grepping.
2019-08-22 10:20:03 -05:00
Aaron Campbell
03678bb754 multi: Correct typos.
Correct typos found by reading code and creative grepping.
2019-08-16 17:37:58 -05:00
Donald Adu-Poku
b69302960f multi: add getnetworkinfo rpc. 2019-08-14 15:21:01 -05:00
Dave Collins
25c14e046a
main: Update to use all new major module versions.
This updates all code in the main module to use the latest major modules
versions to pull in the latest updates.

A more general high level overview of the changes is provided below,
however, there is one semantic change worth calling out independently.

The verifymessage RPC will now return an error when provided with
an address that is not for the current active network and the RPC server
version has been bumped accordingly.

Previously, it would return false which indicated the signature is
invalid, even when the provided signature was actually valid for the
other network.  Said behavior was not really incorrect since the
address, signature, and message combination is in fact invalid for the
current active network, however, that result could be somewhat
misleading since a false result could easily be interpreted to mean the
signature is actually invalid altogether which is distinct from the case
of the address being for a different network.  Therefore, it is
preferable to explicitly return an error in the case of an address on
the wrong network to cleanly separate these cases.

The following is a high level overview of the changes:

- Replace all calls to removed blockchain merkle root, pow, subsidy, and
  coinbase funcs with their standalone module equivalents
  - Introduce a new local func named calcTxTreeMerkleRoot that accepts
    dcrutil.Tx as before and defers to the new standalone func
- Update block locator handling to match the new signature required by
  the peer/v2 module
  - Introduce a new local func named chainBlockLocatorToHashes which
    performs the necessary conversion
- Update all references to old v1 chaincfg params global instances to
  use the new v2 functions
- Modify all cases that parse addresses to provide the now required
  current network params
  - Include address params with the wsClientFilter
- Replace removed v1 chaincfg constants with local constants
- Create subsidy cache during server init and pass it to the relevant
  subsystems
  - blockManagerConfig
  - BlkTmplGenerator
  - rpcServer
  - VotingWallet
- Update mining code that creates the block one coinbase transaction to
  create the output scripts as defined in the v2 params
- Replace old v2 dcrjson constant references with new types module
- Fix various comment typos
- Update fees module to use the latest major module versions and bump it v2
2019-08-13 11:22:37 -05:00
Dave Collins
e54dde10e9
docs: Update for mempool v3 module. 2019-08-12 19:54:31 -05:00
Dave Collins
e523e05b9b
docs: Update for peer v2 module. 2019-08-12 15:52:52 -05:00
Dave Collins
9f926baa61
docs: Update for connmgr v2 module. 2019-08-12 15:36:53 -05:00
Dave Collins
ab6f316821
docs: Update for mining v2 module. 2019-08-12 15:06:41 -05:00
Dave Collins
5564a0aff8
docs: Update for blockchain v2 module. 2019-08-08 13:10:22 -05:00
Dave Collins
18a2a68b8c
blockchain/standalone: Prepare v1.0.0.
This updates the documentation for the new blockchain/standalone module
along with main module dependencies to ensure it is tested as well as
uses the latest version of the code as the new module is integrated.

It also serves as a base for blockchain/stake/v1.0.0.

The new modules has the following direct dependencies:

- github.com/decred/dcrd/chaincfg/chainhash@v1.0.1
- github.com/decred/dcrd/wire@v1.2.0
2019-08-06 23:24:31 -05:00
Dave Collins
e6bd4b1c97
docs: Update for rpcclient v4 module. 2019-07-30 12:56:44 -05:00
Dave Collins
051fa9f424
docs: Update for blockchain/stake v2 module. 2019-07-28 14:47:25 -05:00
Dave Collins
99d7b179a3
docs: Update for database v2 module.
This updates the docs/README.md file, module hierarchy graphviz, and
module hierarchy diagram to reflect the new module version
2019-07-22 19:53:52 -05:00
Dave Collins
5e7afe5b08
docs: Update for rpcclient v3 module. 2019-07-22 13:34:11 -05:00
Dave Collins
0035880ac7
docs: Update for dcrjson/v3 module. 2019-07-22 13:29:31 -05:00
Dave Collins
6a3c1fea49
docs: Update for txscript v2 module. 2019-06-24 15:13:40 -05:00
Dave Collins
a0b84e4005
docs: Update for dcrutil v2 module. 2019-06-19 12:09:20 -05:00
David Hill
893aa30dce multi: Use https links where available. 2019-06-18 14:20:06 -05:00
Dave Collins
6bb0838e84
docs: Update for dcrec/edwards v2 module.
This updates the docs/README.md file, module hierarchy graphviz, and
module hierarchy diagram to reflect the new module version.
2019-06-14 11:34:48 -05:00
Dave Collins
67ace6e117
docs: Update for chaincfg v2 module.
This updates the docs/README.md file, module hierarchy graphviz, and
module hierarchy diagram to reflect the new module version
2019-06-12 20:14:35 -05:00
Dave Collins
c1cf192f03
docs: Update for hdkeychain v2 module.
This updates the docs/README.md file, module hierarchy graphviz, and
module hierarchy diagram to reflect the new module version
2019-03-29 11:40:35 -05:00
Jamie Holdstock
9a2e8e5067 docs: allowHighFees arg has been implemented.
Update the RPC docs which state that the allowHighFees argument of
sendrawtransaction is not implemented.
2019-03-20 09:55:37 -05:00
Jamie Holdstock
598bd32a11 docs: move json rpc docs to mediawiki. 2019-03-19 17:33:38 +00:00
Dave Collins
334820db6d
docs: Update for lru module.
This updates the docs/README.md file, module hierarchy graphviz, and
module hierarchy diagram to reflect the new lru module.
2019-03-18 10:08:29 -05:00
Jamie Holdstock
9a5161ce9e rpcserver: Add difficultyratio to getblockchaininfo.
Add DifficultyRatio to GetBlockChainInfoResult, and bump the minor rpc
version accordingly. This is to maintain consistency with GetDifficulty
RPC. Also deprecate the existing Difficuly field in
GetBlockChainInfoResult, to be removed in a future major version bump.
2019-03-11 00:44:17 -05:00
Jamie Holdstock
9ea5bd3bb3 docs: fix formatting in json rpc doc.
Removes an unnecessary line from the `getblockheader` table in json_rpc_api.md which prevents it from displaying correctly.
2019-03-07 19:49:43 -06:00
Dave Collins
6f106adf57
docs: Update for mempool v2 module.
This updates the docs/README.md file, module hierarchy graphviz, and
module hierarchy diagram to reflect the new module version
2019-02-14 18:52:48 -06:00
Dave Collins
895020ac5e
docs: Update for rpcclient v2 module.
This updates the docs/README.md file, module hierarchy graphviz, and
module hierarchy diagram to reflect the new module version
2019-02-14 11:44:01 -06:00
Dave Collins
9265b40510
docs: Update for dcrjson v2 module.
This updates the docs/README.md file, module hierarchy graphviz, and
module hierarchy diagram to reflect the new module version.
2019-02-13 19:23:38 -06:00
Dave Collins
176ee29497
docs: Update for fees package.
This updates the docs/README.md file, module hierarchy graphviz, and
module hierarchy diagram to include the recently added fees package.
2018-12-07 22:59:23 -06:00
Dave Collins
6d647094ee
multi: Return total chain work in RPC results.
This modifies the getblock and getblockheader RPC results to include the
total number of hashes expected to produce the chain up to the requested
block in hex and updates the JSON-RPC API documentation accordingly.
2018-10-16 11:30:58 -05:00
Dave Collins
3a2bdcc332
multi: Cleanup getblock and getblockheader RPCs.
This modifies the getblock and getblockheader RPC results to be a little
more consistent in their ordering, to include the extra data field in
the getblockheader results, and to update the JSON-RPC API documentation
for both to match reality.  The documentation was missing several fields
and had some typos.
2018-10-16 11:24:46 -05:00
Dave Collins
81c76dcb78
multi: Break blockchain dependency on dcrjson.
This modifies the ChainTips function in blockchain to return the results
using a type defined in the blockchain package itself instead of
directly returning a dcrjson type.  This is preferable since nothing
else in the module depends on dcrjson and therefore allows the
dependency on the dcrjson module to be broken.

It also updates the RPC server that makes use of the function to perform
the necessary conversions.

Finally, the associated module hierarchy documentation is updated to
properly remove the no longer required dependency.

It should be noted that this is a breaking change to the API and thus
will need a v2 major version bump of the blockchain module to be
published before the changes can be externally consumed.
2018-10-10 16:44:20 -05:00
Dave Collins
0d3bbd2513
docs: Use unix line ending in mod hierarchy gv.
This converts the module hierarchy graphviz file to use unix line
endings so it is consistent with the rest of the code in the repository.
2018-10-10 13:12:31 -05:00
Donald Adu-Poku
1ec04c40a2 multi: Add getblockchaininfo rpc. 2018-10-09 18:28:17 -05:00
Dave Collins
79da9e6617
docs: Use relative versions in contrib checklist. 2018-09-13 15:15:15 -05:00
Dave Collins
817373d9d7
docs: Revamp main README.md and update docs.
This revamps the main README.md file in an attempt to provide a more
user-friendly introduction to the software and why someone would want to
run it and also updates the docs/README.md to remove some sections that
do not apply to Decred and update some others to reflect reality.

It also adds minimum recommended specifications for dcrd to the main
README.md and updates the build instruction for module-aware builds and
the recent changes the run_test.sh script.

Finally, it updates the contact information to point to the
decred.org/community page.
2018-09-12 15:11:03 -05:00
Dave Collins
5db19ddcab
multi: Include additional fields on RPC tx results.
This modifies the results provided by the getrawtransaction and
searchrawtransactions RPCs to make them consistent with each other.

In particular, it adds the transaction expiry, block height, and block
index fields to the searchrawtransactions result and ensures that both
omit the block height when it is zero so that it is not included in the
results for mempool transactions.

Since populating the block index requires additional details to be
stored to the transaction index to efficiently provide, only the
infrastructure is added and the value is left as the default for now,
which means it will be omitted and therefore not change the visible
behavior.

Finally, it also updates the RPC server help to provide consistent
descriptions for the fields and also updates the JSON-RPC documentation.
2018-09-10 09:18:01 -05:00