Commit graph

3531 commits

Author SHA1 Message Date
Dave Collins
267cf94edc Correct typo in example log statement. 2014-05-11 13:30:25 -05:00
Dave Collins
e230b54427 Correct FutureGetBestBlockResult.Receive type.
Also correct the error message while here.
2014-05-11 02:35:07 -05:00
Dave Collins
c24be8b7bf Add reply parser for GetBestBlockCmd. 2014-05-11 02:32:24 -05:00
Dave Collins
5b376b3b5e Expose getcurrentnet and getbestblock to HTTP POST.
This commit makes the getcurrentnet and getbestblock RPCs available to
clients making HTTP POST requests.

Closes #127.
2014-05-11 02:21:27 -05:00
Dave Collins
e2ba50eee1 Fix a couple of typos in README.md. 2014-05-10 15:48:14 -05:00
Dave Collins
0fc9504da4 Improve overview in doc.go. 2014-05-10 02:50:19 -05:00
Dave Collins
9bb16e208d Update README.md.
This commit adds a description, status, and major features to the README.
2014-05-10 02:48:11 -05:00
Dave Collins
a35c1e8ede Auto recreate notification state on reconnect.
This commit adds logic to track all registered notifications that have
been registered by the client in a notification state when the default
automatic reconnect is enabled.

The notification state is then used to reregister for all previously
registered notifications on reconnect.  This allows the caller to
continue receiving notifications across reconnect cycles.
2014-05-10 02:15:09 -05:00
Dave Collins
7cc356d4c7 Convert CreateRawTransaction to higher-level types.
Closes #2.
2014-05-09 21:24:25 -05:00
Dave Collins
f666eddf75 Add README.md for bitcoincorehttp example.
Also, change the port in the example to the mainnet RPC port.
2014-05-09 21:09:51 -05:00
Dave Collins
315d85fa4e Add README.md for btcdwebsockets example. 2014-05-09 21:05:01 -05:00
Dave Collins
9b0d311826 Update README.md. 2014-05-09 20:48:05 -05:00
Dave Collins
f54e05c8fe Initial package overview documentation. 2014-05-09 20:12:47 -05:00
Dave Collins
8700eeaeb6 Convert to use gorilla websockets package.
Also, since the new package exposes more connection related error
information, add a new ErrInvalidEndpoint which is returned if the
specified enpoint does not appear to be a valid websocket provider and
only return the ErrInvalidAuth error when HTTP authorization failure
status codes are detected.

Closes #1.
2014-05-09 19:57:58 -05:00
Josh Rickmar
2e126ef597 Rename ListUnspentResult, use correct integer types. 2014-05-09 15:53:50 -05:00
Dave Collins
4921282646 Add example descriptions to README.md. 2014-05-09 01:35:27 -05:00
Dave Collins
2f84189676 Add godoc reference badge to README.md. 2014-05-09 01:26:37 -05:00
Dave Collins
73ecb412e9 Add support for TravisCI.
Also add TravisCI build status badge to README.md.
2014-05-09 01:16:47 -05:00
Dave Collins
eb82f35aac Improve btcdwebsockets example.
Since the example illustrates callbacks for the OnBlockConnected and
OnBlockDisconnected callbacks, also register for the notifications with
NotifyBlocks.

While here, document the fact that most of the callbacks require
registration.
2014-05-09 00:45:09 -05:00
Dave Collins
6a325f4c6a Improve getwork interaction with regtest mode.
Ordinarily, getwork will return an error if btcd is not connected to any
other peers.  This commit relaxes that requirement when running in
regression test mode since it is useful for development purposes.

While here, also improve check which returns an error from getwork is not
current to exclude the check when the best chain height is zero since the
code never believes it is current when at height 0.
2014-05-08 19:47:50 -05:00
Dave Collins
80f9a8e5e2 Fix FutureWalletPassphraseChange.Receive comment. 2014-05-08 13:12:56 -05:00
Dave Collins
2fc983ece1 Finish the comment on the Disconnect function. 2014-05-08 13:10:09 -05:00
Dave Collins
6825e68c59 Use uint64 for the request ID instead of int64.
There is no reason for the request ID to be signed.  Pointed out by
@jrick.
2014-05-08 13:05:31 -05:00
Dave Collins
a4978ba4c8 Add tests for the new MsgReject message.
This commit adds a full suite tests for the new reject message added in
protocol version 70002 to bring the overall test coverage of btcwire back
up to 100%.

Closes #9.
2014-05-08 00:17:11 -05:00
Dave Collins
f38e5854c1 Bump protocol version to 70002. 2014-05-08 00:17:11 -05:00
Dave Collins
c2a1444a88 Add new reject command.
This commit adds the new reject protocol message added to recent versions
of the reference implementation.  This message is intended to be used in
response to messages from a remote peer when it is rejected for some
reason such as blocks being rejected due to not conforming to the chain
rules, transactions double spending inputs, and version messages sent
after they're already sent.

This is work toward issue #9.
2014-05-08 00:17:05 -05:00
Dave Collins
f8ec476691 Complete BIP0037 support started by dhill.
- Correct MsgFilterLoad max payload
- Enforce max flag bytes per merkle block
- Improve and finish tests to include testing all error paths
- Add fast paths for BloomUpdateType
- Convert all byte fields to use read/writeVarBytes
- Style and consistency updates
- README.md and doc.go updates

Closes #12.
2014-05-07 23:57:55 -05:00
David Hill
cf754d09bf Initial implementation of BIP0037.
Implement filteradd, filterclear, filterload, and merkleblock.
2014-05-07 23:41:39 -05:00
Dave Collins
a98f5ca38e Cleanup a few nitpicks with recent alert additions.
- Group the new read/writeVarBytes functions together to be consistent
  with the existing code
- Modify the comments on the new read/writeVarBytes to be a little more
  descriptive and consistent with existing code
- Use "test payload" for field name in the tests for the
  read/writeVarBytes functions which is more accurate
- Remove reserved param from NewAlert since there is no point is having
  the caller deal with a reserved param
- Various comment tweaks for clarity and consistency
- Use camel case for fuction params for consistency
- Move the NewAlert and NewAlertFromPayload functions after the receiver
  definitions for code layout consistency

Closes #11.
2014-05-07 19:41:04 -05:00
Dave Collins
47e65634a7 Use btcd pver instead of wire pver in RPC encoding.
Along the same lines as the previous commit, the RPCs that return
serialized data structures should use the max protocol version btcd
supports as opposed to the maximum protocol version etcwire supports.
2014-05-07 11:33:32 -05:00
Dave Collins
01183c4eca Update for recent notifyspent changes.
Closes #2.
2014-05-07 11:23:48 -05:00
Dave Collins
7c552136bc Move Disconnected next to Disconnect func. 2014-05-07 11:23:35 -05:00
Dave Collins
1122a8a9cb Remove leftover testing sleep. 2014-05-07 11:23:27 -05:00
Dave Collins
2f7cb64652 Add CONTRIBUTORS file. 2014-05-07 11:23:16 -05:00
GeertJohan
0cc22e1134 Make btcrpcclient use the new and consistent reply types. 2014-05-07 11:23:00 -05:00
Dave Collins
831d0aeb90 Add support for getwork submit. 2014-05-07 11:22:38 -05:00
Dave Collins
fa7f670160 Add link to examples in README.md. 2014-05-07 11:22:12 -05:00
Dave Collins
43ca7c0f3c Add a couple of examples. 2014-05-07 11:21:36 -05:00
Dave Collins
cf409a8d79 Disconnect client on shutdown. 2014-05-07 11:19:30 -05:00
Dave Collins
e3f130ade5 Initial commit. 2014-05-07 11:14:39 -05:00
Dave Collins
fd025a7368 Use btcd pver instead of wire pver in getinfo RPC.
The getinfo RPC should return the max protocol version btcd supports as
opposed to the maximum protocol version btcwire supports.  Currently they
are both the same value, so there is no issue.  However, they will not
always be the same.
2014-05-07 10:30:58 -05:00
Owain G. Ainsworth
6e2ba386dd Add an entypoint to sign and verify a transaction input.
This handles merging in of previous scripts, also. Add tests for the important
paths. ok @davecgh
2014-05-07 16:05:55 +01:00
Josh Rickmar
e12673df11 Switch notifyspent to take an array of outpoints.
This allows a wallet process to request spent notifications for many
outpoints at once, rather than creating separate requests for each.
2014-05-06 10:49:46 -05:00
Josh Rickmar
a20fd1ab2c Modify notifyspent handler to take multiple outpoints. 2014-05-06 08:30:36 -05:00
Dave Collins
b993af04b9 Correct misspelled contributor name. 2014-05-05 22:15:37 -05:00
Dave Collins
67abae0dbf Add CONTRIBUTORS file.
Since the github contributors list only lasts for a period of time, it's
better to also maintain a contributors list in the repository rather than
solely relying on github.
2014-05-05 18:29:31 -05:00
GeertJohan
9965019da0 Return pointers to structs
Update doc.go to use proper btcjson result type

Return pointers to structs

Update doc.go to use proper btcjson result type
2014-05-05 17:18:22 -04:00
Javed Khan
bdec7f8abb Implemented alert message serialize/deserialize
* Introduced common methods readVarBytes, writeVarBytes.
* Added type Alert which knows how to deserialize
the serialized payload and also serialize itself back.
* Updated MsgAlert BtcEncode/BtcDecode methods to handle the
new Alert.
* Sane limits are placed on variable length fields like SetCancel
and SetSubVer
2014-05-05 23:12:28 +05:30
John C. Vernaleo
a5169bd880 Remove extraneous character that got added to comment. 2014-05-05 09:08:45 -04:00
Geert-Johan Riemer
94451d7a9c Changed strings.Contains(?, "{") to bytes.IndexOf(?, '{')>-1 2014-05-05 13:28:48 +02:00