Commit graph

148 commits

Author SHA1 Message Date
David Hill
b532860477 sync with btcjson changes to getrawtransaction.
ok oga@
2014-01-29 21:21:58 -05:00
Owain G. Ainsworth
82fca37eae implement the getinfo rpc command.
This contains some wallet inforamtion, but bitcoind if wallet is
disabled returns just the non wallet information. we do the same.
2014-01-29 18:31:33 +00:00
David Hill
112525bd7a cleanup sendfrom and sendmany 2014-01-27 21:31:33 -05:00
David Hill
6c9a206709 add keypoolrefill to btcctl 2014-01-27 21:11:59 -05:00
David Hill
34849a181c add listaccounts to btcctl 2014-01-27 21:05:27 -05:00
Owain G. Ainsworth
5cef5bc05c add support for listsinceblock to btcctl 2014-01-27 23:22:09 +00:00
David Hill
2697a0a9ea add settxfee to btcctl 2014-01-27 16:31:48 -05:00
David Hill
c0d6180685 add sendmany to btcctl 2014-01-27 15:57:44 -05:00
David Hill
b354015426 add sendfrom to btcctl 2014-01-27 15:19:39 -05:00
David Hill
a5e5903caf add walletlock to btcctl 2014-01-27 13:44:31 -05:00
Josh Rickmar
36e5aa8e92 Add walletpassphrasechange support to btcctl. 2014-01-27 13:39:01 -05:00
David Hill
ffe767c679 add getaddressesbyaccount to btcctl 2014-01-27 13:32:36 -05:00
David Hill
82552e4465 add walletpassphrase to btcctl 2014-01-27 12:49:54 -05:00
David Hill
221352586b add getnewaddress to btcctl 2014-01-27 12:35:20 -05:00
Dave Collins
fea4109eb2 Add getaddednodeinfo support to btcctl. 2014-01-25 22:50:34 -06:00
David Hill
5736dc05ae add getwork support to btcctl 2014-01-23 15:57:15 -05:00
David Hill
109ca258af sort commands and fix typos 2014-01-23 14:21:41 -05:00
David Hill
136aa95446 add getblocktemplate support to btcctl. 2014-01-23 13:44:28 -05:00
Owain G. Ainsworth
9cb5190ac2 add support for the ping rpc command.
And the pingtime and pingwait fields of getpeerinfo.
2014-01-22 16:21:08 +00:00
Owain G. Ainsworth
1487a352da add basic support for the help rpc command. 2014-01-22 16:20:38 +00:00
David Hill
871481ce1b Implement submitblock.
Closes #61.
2014-01-15 15:07:43 -06:00
Dave Collins
6222b1d8cc Rework and Improve addblock utility.
The addblock utility was originally written as a quick debug tool during
initial development to populate blocks into the database.  However, now
that it has been designated as the standard way to import bootstrap.dat
(and indeed block data files in general), it was lacking a few features
such as properly checking against the chain rules and known good
checkpoints.

This commit reworks and improves the utility in several ways:

- Imported blocks are now checked against the chain rules including
  checkpoints to ensure they match the known good chain
- The utility now properly shuts down after processing all blocks
- Attempting to import orphan blocks (blocks which build off a block you
  don't yet have in the database) returns an error
- Blocks that are already known are now skipped instead of causing an
  error which means you can stop and restart the import mid-way through
  without issues or start it after you've already downloaded a
  portion of the chain
- The block height is no longer assumed to start at 0 which means input
  files that start later in the chain will work properly so long as you
  already have the chain at least up to the point of the block just before
  the first one in the input file
- Improved error handling and reporting
- How often the progress display is shown is now configurable
- Statistics about how many blocks were processed, imported, and already
  known are now displayed after the input file has been fully processed

This resolves comments made in #60.
2014-01-14 01:18:52 -06:00
Dave Collins
d8ec5bd33c Prepare for release 0.5.0. 2014-01-13 17:47:21 -06:00
Josh Rickmar
427fb3cd94 gencerts: Print error lowercased for consistency. 2014-01-10 17:57:14 -05:00
Josh Rickmar
aec17304a0 Add standalone gencerts utility to create RPC TLS certificates. 2014-01-10 16:59:54 -05:00
Dave Collins
f93c8a4af1 Don't display btcctl getconnectioncount as float. 2014-01-09 12:17:26 -06:00
Dave Collins
af0750dd76 Don't display getblockccount from btcctl as float. 2014-01-09 12:15:46 -06:00
Marco Peereboom
371dfdd76a Kill last sqlite3 bits.
This was driving me insane when building with -a -v and it slowed down
the process dramatically.

ok davec
2014-01-09 10:26:17 -06:00
Marco Peereboom
96ded50f6b Dont write pprof info in addblock.
dont write pprof info in addblock  (ok drahn); and make progress a little
more silent
2014-01-07 16:06:29 -06:00
Marco Peereboom
d00ccc0d3c Make limits into a pkg.
This is so that we can use the in other utils.

debated with davec
2014-01-07 16:06:12 -06:00
Josh Rickmar
8b5277e73a Add sendrawtransaction support to btcctl. 2014-01-06 11:50:02 -05:00
Dave Collins
4cb1500a0b Add decodescript support to btcctl. 2014-01-03 23:30:08 -06:00
Dave Collins
a8ff7fecb4 Add createrawtransaction support to btcctl. 2014-01-03 13:45:12 -06:00
Josh Rickmar
426db5ae21 Add getaccountaddress support to btcctl. 2013-12-31 13:11:01 -05:00
Josh Rickmar
bf7c5fa062 Fix a typo. 2013-12-30 16:32:25 -05:00
Josh Rickmar
13868e76ec Add getaccount support to btcctl. 2013-12-30 16:31:47 -05:00
Dave Collins
3bfeabb47a Improve btcctl verifychain usage.
Also, add a comment for makeVerifyChain while here.
2013-12-30 10:35:33 -06:00
Dave Collins
8477ef569a Update btcctl getblock for recent changes.
This commit allows btcctl to accept the optional verbosity parameters on
getblock.
2013-12-26 11:19:32 -06:00
Dave Collins
ca4cf29e49 Add a new function to btcctl for JSON display.
This commit adds a new function to btcctl that shows the results as
properly indented JSON instead of relying on spew and changes all of the
commands that used spew to the new function.  The output of btcctl
should be more user-facing than developer-facing.
2013-12-25 23:18:16 -06:00
Dave Collins
23ff70d682 Add gethashespersec command to btcctl. 2013-12-25 19:13:14 -06:00
Dave Collins
195ada0979 Add newline to previous print change. 2013-12-25 17:47:56 -06:00
Dave Collins
6be128a843 Display float values with btcctl with %f.
This commit modifies btcctl to show float values with %f instead of the
default %v.  This means the values will show similar to 1180923195.260000
instead of 1.18092319526e+09 (scientific notation).
2013-12-25 17:47:12 -06:00
Owain G. Ainsworth
7b304515d6 fix getrawtransaction verbose to be bool. 2013-12-16 18:14:51 +00:00
Owain G. Ainsworth
8aaad1e97b Add support for verbose in getrawmempool.
Closes #55.
2013-12-16 18:14:50 +00:00
Dave Collins
c34ab6a95e Remove sqlite3 import from addblock.
The sqlite3 db backend is deprecated, so this is no longer needed.  Also,
since sqlite3 is a cgo binding it doesn't cross compile nicely.
2013-12-12 13:37:46 -06:00
Dave Collins
bbc3c1cf7e Prepare for release 0.4.0. 2013-12-12 13:27:06 -06:00
David Hill
9e57a6c5be add --notls option to disable connecting with TLS
ok oga@
2013-11-26 20:13:31 -05:00
David Hill
295cc873f4 add getbalance 2013-11-26 17:05:33 -05:00
Josh Rickmar
de9176b94f Fix listtransactions optarg indexes. 2013-11-26 16:21:19 -05:00
Dave Collins
8e3ede441b Update for recent go-flags API changes. 2013-11-24 12:33:36 -06:00
Josh Rickmar
6f2b96b7e2 Fix help message for listtransactions. 2013-11-22 15:18:23 -05:00
Josh Rickmar
d00ca48475 Print listtransactions replies with go-spew. 2013-11-22 14:20:31 -05:00
Josh Rickmar
ef47455b05 Add listtransactions support to btcctl.
This is currently using the generic reply formater, and will likely be
switched out for a custom one later.
2013-11-22 13:13:39 -05:00
Dave Collins
daa5310e2f Add support for debuglevel RPC command.
Also include the supported subsystems in the error message if an invalid
subsystem is specified.

Closes #15.
2013-11-22 10:47:29 -06:00
Dave Collins
93c1f7d31b Update utilities to use new btclog as well. 2013-11-21 19:03:55 -06:00
Josh Rickmar
0bee8478a9 Fix optional arg handling for importprivkey. 2013-11-20 11:12:00 -05:00
Josh Rickmar
4a290162ee Add dumpprivkey to btcctl. 2013-11-19 22:36:25 -05:00
David Hill
0301690499 Create the home directory if it doesn't exist. 2013-11-19 22:21:50 -05:00
Dave Collins
9643cb6d23 Make golint happy with btcctl. 2013-11-19 20:35:49 -06:00
Dave Collins
b1ed5f75ca Add version to btcctl.
This commit adds version information to btcctl.  The plan is to keep
it in lock step with the btcd version.  It also updates the release script
so the version file is updated automatically with the btcd one.
2013-11-19 20:07:31 -06:00
Dave Collins
d18c34a628 Mask the password from btcctl usage. 2013-11-19 16:25:18 -06:00
Dave Collins
c2bec24f51 Improve btcctl config.
This commit improves the configuration for btcctl in several ways:

- Add the ability to specify a config file
- Add a default entry to the rpc cert to point to the location
  it will likely be in the btcd home directory
- Move the config bits into a separate file for easier maintenance
2013-11-19 14:53:22 -06:00
Dave Collins
04a2f66d64 Allow go-flags to generate help entry in btcctl. 2013-11-19 13:44:52 -06:00
Owain G. Ainsworth
75e577c82e RPC TLS Support.
All rpc sockets now listen using TLS by default, and this can not be
turned off. The keys (defauling to the datadirectory) may be provided by
--rpccert and --rpckey. If the keys do not exist we will generate a new
self-signed keypair with some sane defaults (hostname and all current
interface addresses).

Additionally add tls capability to btcctl so that it can still be used.
The certificate to use for verify can be provided on the commandline or
verification can be turned off (this leaves you susceptible to MITM
attacks)

Initial code from dhill (rpc tls support) and jrick (key generation),
cleanup, debugging and polishing from me.
2013-11-19 14:50:31 +00:00
Josh Rickmar
5ec4aaff09 Add importprivkey support to btcctl. 2013-11-18 14:51:31 -05:00
Dave Collins
e3eca752da Allow verbose param on btcctl getrawtransaction. 2013-11-14 12:19:20 -06:00
Owain G. Ainsworth
bb276b53aa Add support for the verifychain command.
So far we only do level 0 and level 1 checks (precense and basic
sanity). The checks done at higher levels in bitcoind are closely
coupled with their database layout.

arguably Closes #13
2013-11-12 22:57:26 +00:00
Dave Collins
dcf2994905 Add some missed imports in last commit. 2013-11-11 11:52:59 -06:00
Dave Collins
89eae6f590 Update utilities to use new btcutil.AppDataDir.
Closes #30.
2013-11-11 10:58:39 -06:00
Dave Collins
af311078b4 Correct btcctl getblockhash.
Also run gofmt while here.
2013-11-07 17:07:26 -06:00
John C. Vernaleo
b72f0c6474 Make peerinfo output match bitcoind a bit better.
Add long option for username in btcctl.
2013-11-04 16:25:13 -05:00
Owain G. Ainsworth
9f96e59392 Rough and ready cut over of btcctl to use the btcjson command api. 2013-10-29 16:42:11 +00:00
Dave Collins
9ded3fa2cf Generate usage from handler data in btcctl.
Rather than having to keep the usage in sync with the supported commands,
simply include the usage as a field in the command handlers map and
dynamically generate the usage from there.
2013-10-22 10:56:56 -05:00
Dave Collins
d4f980c71f Show usage on no params to btcctl. 2013-10-22 10:15:46 -05:00
Dave Collins
c55152ef7e Always return non-zero code from btcctl on error. 2013-10-22 10:01:13 -05:00
Dave Collins
629168b7ae Perform display handler check before issues RPC.
This commit modifies the command handler in btcctl to check the existence
of a display handler before issues an RPC command.  This prevents a round
trip to the server if there is no display handler.

Also, fix a couple of comments while here.
2013-10-22 00:40:17 -05:00
Dave Collins
4e5cd1a326 Allow nil conversion handlers in btcctl. 2013-10-21 23:03:11 -05:00
Dave Collins
2ea4239f5e Improve btcctl.
This commit significantly reworks btcctl to use a map based approach to
command handling.  This reduces the number of lines of code needed,
simplifies adding new commands, improves the error handling, and removes
several cases where unexpected data was not handled properly (it could
panic).

This commit also adds the ability to specify the optional parameter on
getrawtransaction.

Discussed with dhill@.
2013-10-21 22:58:47 -05:00
David Hill
27abb0eb3e add "addnode" to btcctl 2013-10-21 14:09:05 -04:00
David Hill
e1a02d71b3 add getpeerinfo to btcctl 2013-10-21 13:26:40 -04:00
David Hill
3130659cdf add getconnectioncount to btcctl 2013-10-21 12:59:07 -04:00
David Hill
ff20c420a2 add decoderawtransaction, getbestblockhash, getdifficulty, and
getrawmempool to btcctl.
2013-10-17 12:35:27 -04:00
David Hill
90fbae1781 give btcctl some options instead of using hardcoded values 2013-10-16 19:19:26 -04:00
Dave Collins
ae5810bc50 Change default RPC port to 8334 (18334 testnet).
This change paves the way for running btcwallet on the same system without
having to change any settings.  The well-known ports used by the
reference implementation (8332 mainnet, 18332 testnet) will be exposed by
the separate wallet process, which will in turn forward unknown requests
to btcd via websockets (on 8334/18334).  This allows the wallet process to
ultimately provide a unified interface that exposes the same RPC-JSON API
as the reference implementation will maintaining wallet and chain
separation.
2013-10-16 15:01:43 -05:00
David Hill
55b300b6c2 improve addblock 2013-10-10 14:05:54 -04:00
David Hill
8a2299c1e1 improve dropafter as with showblock 2013-10-10 13:58:11 -04:00
David Hill
2231e04e2b improve showblock by setting default datadir and requiring -s 2013-10-10 13:51:20 -04:00
David Hill
c4d7b2d2c6 Improve showblock options, add --testnet and change default db to leveldb
to match btcd
2013-10-10 13:42:21 -04:00
Josh Rickmar
486907c441 Add -testnet flag to showblock. 2013-10-10 13:22:55 -04:00
Dave Collins
c1f0d9b1ad Make leveldb the default db for findcheckpoint.
This mirrors the change in btcd.
2013-10-08 20:50:15 -05:00
David Hill
e8d73d83ef Add btcctl; currently a barebones utility to send commands
to btcd.
2013-10-08 21:18:49 -04:00
Dave Collins
67838afb20 Go fmt and comments. 2013-10-08 13:34:04 -05:00
Dave Collins
d4e006e515 Update findcheckpoint to support testnet and dbtype. 2013-10-07 20:53:25 -05:00
John C. Vernaleo
ff2c88e3b4 Fix an import path. 2013-10-07 10:06:15 -04:00
Dave Collins
689c699bc5 Add a new findcheckpoint utility.
This utility is useful to programatically identify checkpoint candidates
which a developer can then do a more in-depth analysis on to choose an
appropriate checkpoint.
2013-10-04 10:12:24 -05:00
Dave Collins
905715e830 Update LICENSE to ISC on new utils. 2013-10-04 10:11:38 -05:00
Dave Collins
fd4b63073f Go fmt new utils. 2013-10-04 10:09:15 -05:00
Dale Rahn
7659a134c9 Add new tool to rewind the database to a specific height or sha
Initial code for a block show/dump tool.

Initial code for a simple block inserter.
2013-10-04 09:33:56 -04:00