Commit Graph

346 Commits

Author SHA1 Message Date
Ross Nicoll
ad8ffca0b4 Add CommitTransactionProtocol
Add new protocol which manages the entire process of taking a signed transaction ready
for notarisation, through notarisation and onto recording it both locally and informing
remote nodes.

This protocol also optionally can include the ClientToServiceCommand which triggered a transaction
being created, to give the remote nodes context on why a change occurred (i.e. "You are being sent
£100")
2016-08-25 16:30:39 +01:00
Matthew Nesbit
089ba2cb69 Only NetworkMapServer addresses can be publicly manufactured. Use identity publick key as addressing, with only bridges using the HostAndPort information
Fixup after rebase and fix issue with checking previous deployment of bridges

Correct comments on ArtemisMessagingClient constructor

Fixup rates fix demo

Get rid of when statements

Make NetworkMapCache send modify as well as add//remove events. Make inboxes for nodes persistent.

Suppress warnings

Fix message acknowledgement so that it actually consumes messages properly.

Change queueName to SimpleString to stop lots of wasted conversions

Get rid of spurious import

Tidy up and add comments

Update to include comments on PR

Remove unnecessary import
2016-08-25 15:56:50 +01:00
Ross Nicoll
59d3cbdece Add documentation around Commodity and CommodityContract 2016-08-23 17:40:45 +01:00
Ross Nicoll
03e120d04b Add default values for ifMatched/ifNotMatched/requiredCommands 2016-08-23 11:23:47 +01:00
Matthew Nesbit
413060aa6d Don't use single line style for verify 2016-08-19 12:05:32 +01:00
Matthew Nesbit
696b9741dd Remove ClashingThreads exception by tightening up unique id on LinearState to be a secure random value, with constraints that it cannot be duplicated. Also, rename to linearId rather than the confusing thread.
Try providing a helper interface to encourage enforcing LinearState rules

Fixup after rebase

Change to using Clauses for verifying LinearState standard properties

Fix whitespace change

Tidy up ClauseVerifier after PR comments

Change from SecureHash to a TradeIdentifier class

Change TradeIdentifier to UniqueIdentifier
2016-08-19 11:52:16 +01:00
Clinton Alexander
43625308fa Merged in clint-immutable-kryo-serialisers (pull request #274)
Added immatuable serialisers to Kyro.
2016-08-17 14:50:33 +01:00
Ross Nicoll
a9ec3c253e Merged in rnicoll-notify-tx (pull request #282)
Add observable for transactions being stored
2016-08-16 14:50:55 +01:00
Mike Hearn
a451000623 Merged in mike-fix-artemis-threading (pull request #276)
Messaging layer improvements
2016-08-12 19:07:54 +02:00
Mike Hearn
3d391ec8c2 Add unit tests for the resolve transactions protocol 2016-08-12 17:14:54 +02:00
Mike Hearn
709fe096b3 Minor: add a rootCause property to Throwable 2016-08-12 17:13:41 +02:00
Mike Hearn
b8dc755926 Minor: a couple of small usability improvements to TransactionBuilder 2016-08-12 17:13:41 +02:00
Mike Hearn
c60c333ba9 Minor: add a utility to OpaqueBytes 2016-08-12 17:13:41 +02:00
Ross Nicoll
a3d37a4d00 Require notary to be explicitely stated on each transaction 2016-08-12 15:51:04 +01:00
Ross Nicoll
a2dff5488f Add debugging information in case of missing signatures 2016-08-12 13:51:34 +01:00
Ross Nicoll
17ae349f4d Remove support for timestamp commands 2016-08-12 13:51:34 +01:00
Ross Nicoll
f0aa5a30d4 Deprecate existing timestamp infrastructure 2016-08-12 13:51:34 +01:00
Ross Nicoll
8346c58d4c Add observable for transactions being stored
Add observable for transactions being stored, so the UI can show transactions as they're received, rather than being
limited to the summarised version available from the wallet service.
2016-08-12 11:58:17 +01:00
Ross Nicoll
162d19deeb Change how clause verification is called
Change away from extending ClauseVerifier for contracts which support clauses, and explicitely call
clause verification code in the verify() function. This should make the flow of control easier to understand.
2016-08-11 15:39:11 +01:00
Mike Hearn
ac81d2aa32 Messaging layer improvements:
- Fix thread safety issues in ArtemisMessagingClient. The Artemis API isn't thread safe, but that isn't well documented and it will happily invoke callbacks in parallel.
- Add discussion of how we tackle threading currently in the codebase and make a few other improvements.
- Add a shutdown hook so we stop properly when the user presses ctrl-c
2016-08-11 14:16:05 +02:00
Clinton Alexander
10035860eb Added immatuable serialisers to Kyro. 2016-08-10 16:17:14 +01:00
Clinton Alexander
9fb8061ba4 Replaced array with list to fix comparisons. 2016-08-10 11:10:38 +01:00
Andrius Dagys
8386100677 Remove BriefLogFormatter as the formatting is now handled by Log4j configuration. Introduce LogHelpers which now handles the custom log level setting for specific loggers. 2016-08-09 17:31:27 +01:00
rick.parker
d883b3f134 First working hand-rolled persistent wallet
First working Exposed-assisted persistent wallet

Cleaned up Exposed-based persistent wallet

Cleaned up warnings

Fixed up some generic types

Improved comments

Fix up TODO comment

Hikari and config integration

Fix existing tests

Clean up after looking at PR

Clean up commented out lines

Fix initialisation of IRS demo leaving database open

Fix up after rebase

Review feedback.  Main change is lazy wallet iteration.

Rebased and incorporated config changes.

Use standardised config loading.  Make wallet cash test use persistent wallet.

Added test to ensure wallet retains state in database across instance creation.

Tidy up whitespace and fix bug in test.
2016-08-09 16:41:32 +01:00
Mike Hearn
7357597501 Fix build. Delete a couple of dead parameters that escaped the last cleanup. 2016-08-09 16:25:35 +02:00
Mike Hearn
87047c8996 Minor: fix various inspector warnings and delete some dead code. 2016-08-09 11:55:40 +02:00
Mike Hearn
2bc77ae095 Minor: suppress bogus "cast never succeeds" compiler warning in whitelist manager unit test 2016-08-08 18:05:02 +02:00
Mike Hearn
da63ad57a4 Minor: run intellij "code cleanup" on all but javascript files. 2016-08-08 18:05:02 +02:00
Mike Hearn
8c00b5284d Merged in mike-ledgertx-refactoring (pull request #264)
Refactor the core transaction types
2016-08-08 18:02:32 +02:00
Mike Hearn
befff71252 Address review comments. 2016-08-08 11:44:59 +02:00
Matthew Nesbit
8e8a7ea60b Separate WhitelistTrustManager registration from object creation, so that adding entries to the whitelist doesn't cause partial registration errors. 2016-08-05 14:52:30 +01:00
Mike Hearn
1f94335850 Address review comments. 2016-08-05 15:38:29 +02:00
Mike Hearn
25f65a60c7 Address review comments. 2016-08-05 14:04:07 +02:00
Mike Hearn
d61356ca9e Don't let Kryo crawl into Rx subscriptions, and add a unit test to ensure this doesn't regress, as the rule is not intuitive. 2016-08-04 17:19:10 +02:00
Andras Slemmer
845f2bdd64 Merged in pubkey-base58-serialisation (pull request #257)
Pubkey base58 serialisation
2016-08-04 13:58:57 +01:00
Clinton Alexander
b640524bf3 Merged in clint-auto-identity (pull request #261)
Identity service now updates with the network map.
2016-08-04 13:29:54 +01:00
Andras Slemmer
4fb8a38122 core, node: Rename Stirng.toPublicKey to parsePublicKeyBase58 2016-08-04 12:14:40 +01:00
Andras Slemmer
a3cf85e778 core: Use toBase58String/toPublicKey in Kryo 2016-08-04 12:14:40 +01:00
Andras Slemmer
1cebae633d core: Add utilities for parsing/serialising pubkeys as base58 2016-08-04 12:14:40 +01:00
Mike Hearn
701fc853ad Refactor the core transaction types to improve clarity, simplify verification and prepare for sandboxing.
Changes include:
- LedgerTransaction is now much more central: it represents a fully resolved and looked-up tx, with the inputs available.
- TransactionGroup and TransactionForVerification are gone. There is a temporary TransactionForContract class for backwards
  compatibility but it will also be gone soon.
- ResolveTransactionsProtocol is simplified, and now commits a tx to the database as soon as it's determined to be valid.
- ServiceHub is now passed in more consistently to verification code, so we can use more services in future more easily e.g. a sandboxing service.
- A variety of APIs have been tweaked or documented better.
2016-08-04 13:05:50 +02:00
Mike Hearn
c2aee2d4e8 Minor: Replace MockServices with a new class that's in core instead of node, old class becomes MockServiceHubInternal. 2016-08-04 12:53:09 +02:00
Mike Hearn
1c3379f508 Testing: make the ledger DSL take a ServiceHub rather than individual services.
It defaults to a fresh UnitTestServices(). Also clear up a few other areas.
2016-08-04 12:52:02 +02:00
Mike Hearn
dd53acfb64 Testing: add a UnitTestServices class which implements ServiceHub. This is a lighter weight version of MockServices, and is intended to assist in the testing of core contract code, vs MockServices which can go on to be used only from the node module. 2016-08-04 12:52:01 +02:00
Clinton Alexander
b1c1b7f4b4 Review changes - merged two observables into one. 2016-08-03 16:49:37 +01:00
Clinton Alexander
72c4c2e5f7 Added comments. 2016-08-02 17:27:18 +01:00
Clinton Alexander
9ef1bf0355 Identity service now updates with the network map. 2016-08-02 17:08:46 +01:00
Ross Nicoll
9672168f64 Add DirectRequestMessage
Add DirectRequestMessage for addressing specific endpoints rather than parties.
2016-08-02 13:29:23 +01:00
Mike Hearn
5df1caf0ca Minor: couple of tiny reformattings. 2016-08-01 16:42:57 +02:00
Mike Hearn
daff65f220 Minor: add infix utilities for overflow checked arithmetic. 2016-08-01 16:42:57 +02:00
Mike Hearn
0662798b0f Introduce some new cryptographic utility functions
1. Function for converting raw entropy into an EDDSA key pair. This is useful for unit tests when you don't want a random key but would rather be able to identify it from the logs by eyesight, and will be useful later also when implementing deterministic key derivation.
2. Function that can format any collection of public keys using the bitcoin-style base58 form.
3. A dummy NullSignature object, again, useful for tests when you don't want to provide a real signature.

Then set a handful of dummy unit testing keys to predictable/fixed values.
2016-08-01 16:42:56 +02:00