Commit Graph

609 Commits

Author SHA1 Message Date
Andras Slemmer
298b35ba4f demo: Remove unnecessary 'participants' field from IRS demo fixture 2016-06-20 12:11:58 +01:00
Andras Slemmer
d8e0e8d548 test: Add JsonSupport testing using junit-quickcheck 2016-06-20 11:49:54 +01:00
Andras Slemmer
478fe6110b test: Fix IRS demo JSON fixture 2016-06-20 11:49:15 +01:00
Andrius Dagys
0a5b7ace35 Made TransactionBuilder abstract. Every transaction type now needs to implement and provide its own Builder. This is required since for specific types we need to run different logic when adding new items to the transaction. For example, when adding a new input state to a transaction of type NotaryChange we need to add all of the states participants to the signers list. 2016-06-17 15:05:35 +01:00
Andrius Dagys
70495a021e Introduce TransactionState, which wraps ContractState and holds the notary pointer.
Remove notary from ContractState.
Introduce TransactionType, which specifies custom validation logic for a transaction.
2016-06-17 15:05:35 +01:00
Ross Nicoll
a029e303a6 Switch trader demo to expect self-signed cash 2016-06-17 14:36:21 +01:00
Ross Nicoll
ad72f3e48f Add issuer to cash amounts
Add issuer of a cash when referring to amounts of cash (except for the very few cases where
the issuer is not important, such as when referring to aggregated totals across a set of
issuers). Replaces CommonCashState with TokenDefinition, as a more accurate reflection of
what the class represents.
2016-06-16 15:05:49 +01:00
Shams Asari
aa153be6f0 moved methods in ChildrenProgressTrackers into ProgressTracker 2016-06-14 16:42:42 +01:00
Clinton Alexander
6b886bde4a Nodes now need a setup step before running. 2016-06-14 16:07:29 +01:00
Clinton Alexander
86b5b7299a Moved node directory creation into the abstract node. 2016-06-13 15:30:26 +01:00
rick.parker
73cbab0084 Pull out Wallet observable into it's own branch
Review feedback

Review feedback

Apply feedback from previous PR

Apply feedback from previous PR

Apply feedback from previous PR

PR feedback

PR feedback

PR feedback
2016-06-10 17:16:56 +01:00
rick.parker
82abc69046 Pull out StateMachineManager observable into it's own branch
Review feedback

Review feedback

Review feedback
2016-06-10 13:10:56 +01:00
Clinton Alexander
28c6df2440 IRSDemo is now fixed. Merge conflict caused notary types to become mismatched. Merged the new file upload code from the irsdemotest branch. 2016-06-08 18:45:34 +01:00
Clinton Alexander
2b64ba1cc6 Fixed IRS demo success case for PUT requests. 2016-06-08 16:45:19 +01:00
Clinton Alexander
146f274dd0 Demo now requires the setup steps if the configuration is not default. Documentation updated to reflect these changes. 2016-06-08 16:31:58 +01:00
Clinton Alexander
7b2214e888 IRS Demo config is now able to be run in any order if default directory settings are present. 2016-06-08 16:31:58 +01:00
Clinton Alexander
8010836f14 Added setup steps to the IRSDemo to make steps more explicit and tidied up the handling of args. 2016-06-08 16:31:58 +01:00
Clinton Alexander
782d50958d IRS demo endpoints are now parameterised for the Trade and Demo modes. Documentation fixes. 2016-06-08 16:30:40 +01:00
Clinton Alexander
6b62f33c46 Corrected the currency mismatch in the example trade. 2016-06-08 16:30:40 +01:00
Clinton Alexander
9e32d62d0f Moved resource files for IRSDemo from scripts to resource directory. Removed errant semicolons. 2016-06-08 16:29:21 +01:00
Clinton Alexander
32a5d4173a IRS demo now requires no manual configuration. All functions made private. 2016-06-08 16:29:21 +01:00
Clinton Alexander
626e8489e8 Non-options arguments are handled correctly in IRS Demo 2016-06-08 16:29:21 +01:00
Clinton Alexander
8e9fc2d4c0 Updated help text and corrected argument handling in IRS demo. 2016-06-08 16:29:21 +01:00
Clinton Alexander
fad45eaa91 Updated documentation for the IRS demo. 2016-06-08 16:29:21 +01:00
Clinton Alexander
389a470400 Moved IRS demo date setting functionality to Kotlin code. Removed now redundant demo script. 2016-06-08 16:29:21 +01:00
Clinton Alexander
3d556c614f Moved IRS demo trade mode to the Kotlin demo code. 2016-06-08 16:29:21 +01:00
Clinton Alexander
639f97ff9c Rate uploading moved to IRSDemo.kt from irs-demo.sh 2016-06-08 16:29:21 +01:00
Clinton Alexander
9a619cc4ae IRS demo to now has roles for NodeA/NodeB and most options are now~ optional. NodeA can be run without the shell script. 2016-06-08 16:29:21 +01:00
Andrius Dagys
21f53a7d3e Revert "Revert "Merged in validating-notary (pull request #123)""
This reverts commit e64145991e.
2016-06-07 13:53:00 +01:00
Andrius Dagys
e64145991e Revert "Merged in validating-notary (pull request #123)"
This reverts commit d9f4e4da2e, reversing
changes made to 654dc3f60a.
2016-06-07 12:29:27 +01:00
Andrius Dagys
c45bc0df20 Split up Notary protocol into Client and Service parts. The Service protocol can be extended to provide additional transaction processing logic, e.g. validation.
Implemented a Simple and Validating Notary services.
2016-06-07 10:58:34 +01:00
Shams Asari
654dc3f60a Resuming from checkpoints now working - seller (but not buyer) in trader demo can be restarted 2016-06-06 17:49:40 +01:00
rick.parker
8122e35a8a Have ServiceHub entries implement SerializeAsToken so they are not copied into protocol checkpoints. 2016-06-06 16:55:46 +01:00
Ross Nicoll
fc62010da6 Move cash contract into its own package 2016-05-31 17:07:36 +01:00
Andrius Dagys
4a79600653 Trader demo fix: buyer now records completed transactions and doesn't attempt to reuse the same spent cash states. 2016-05-31 12:40:53 +01:00
rick.parker
0b2c16be67 Changes to packages after refactor 2016-05-24 11:48:04 +01:00
rick.parker
f8e610aa71 Re-apply changes 2016-05-24 09:41:00 +01:00
Matthew Nesbit
63a5fd1b9e Add com.r3corda to all namespaces. 2016-05-23 14:53:56 +01:00
Matthew Nesbit
a7c0296f6b Rename node.core to node.internal from Rick's suggestion not to use core outside of the core package. 2016-05-20 16:43:01 +01:00
Matthew Nesbit
f6f56797ce Refactor code into clear core, contracts and node namespaces. Move services into clear implementation and api sides. Push unit tests down to lowest level of dependency hierarchy possible. 2016-05-20 16:42:59 +01:00
Mike Hearn
5e70646bd2 Refactor the trader demo and add comments to make it easier to customise. 2016-05-18 19:10:49 +02:00
Andrius Dagys
e8ae3be38d TwoPartyDealProtocol fix: don't check Notary identity if the transaction has no inputs 2016-05-18 10:06:30 +01:00
Mike Hearn
e1f899647a Modify the trader demo so it doesn't need a shell script to start it anymore. Now all configuration is in the driver program. 2016-05-17 18:13:24 +02:00
Mike Hearn
69eef9a947 Temporarily disable the IRS simulation test due to it revealing an issue with the new verifyCorrectNotary code. 2016-05-17 18:09:26 +02:00
Mike Hearn
e475b146d9 Testing: add a unit test that runs the IRS simulation through to completion, to ensure some test coverage of TwoPartyDealProtocol until it's merged with TPTP. Fix an issue that was breaking the simulation. 2016-05-17 17:57:41 +02:00
Mike Hearn
f9920cbc28 Testing: expose a future from the Simulation.start method to let you find out when the simulation has finished (if it finishes at all).
Add a simple test that just forces the IRS simulation through to completion (no real checks on the output).
2016-05-17 17:57:40 +02:00
Matthew Nesbit
6bdbc7925b Fix IRS demo by allowing demos to optionally register JAX-RS classes on the node at construction time. 2016-05-14 19:26:20 +01:00
Matthew Nesbit
988e00099d Capture file moves to separate Node implementation code into its own gradle module and leave only demo code in top level src folders.
I have to temporarily break\disable the IRS demo to which has a circular dependency. Will fix next.
2016-05-14 17:57:41 +01:00
Matthew Nesbit
058ac986bd Move contracts base files to namespace to make api aspect clearer in includes.
Move Party to core.crypto as Party is closely aligned with the signing and used in code areas unrelated to the contract code.
2016-05-14 13:47:07 +01:00
Andrius Dagys
422d65cc54 Rearranging interfaces and implementations. Notary fix for the cash tests. 2016-05-13 16:34:25 +01:00
Andrius Dagys
0da604e33b Added another chapter on implementation and usage.
Modified TODO comment.
2016-05-13 16:17:50 +01:00
Andrius Dagys
324b2be06c Added a rendundant condition to a branch for readability 2016-05-13 16:17:50 +01:00
Andrius Dagys
2c422bebd3 Added noneOrSingle extension method, which returns a single element, null if no elements found and throws if more than one element found 2016-05-13 16:17:50 +01:00
Andrius Dagys
fa3f7e7fa6 Added a basic Notary service with protocol for signing transactions 2016-05-13 16:17:50 +01:00
Rick Parker
539e23a0b1 Merged in plt-141-moves-only-part-3 (pull request #93)
File and interface moves to core module for scheduler
2016-05-13 15:17:32 +01:00
Ross Nicoll
25e2c4bc4d Add issuance definition for cash contract
Add issuance definition for cash contract, as well as common interfaces to support later
extensions. The issuance definition encapsulates the core values for state objects when
issued, and essentially acts as the Ricardian contract for Corda states.
2016-05-13 14:55:12 +01:00
rick.parker
1ce8a64938 File and interface moves to core module 2016-05-13 14:03:28 +01:00
Rick Parker
3ee601360e Merged in plt-141-moves-only-part-2 (pull request #92)
File moves to core module and split of interfaces and implementations in preparation for further moves
2016-05-13 13:22:08 +01:00
Mike Hearn
81c698a260 Minor: fix some compiler warnings 2016-05-13 12:58:17 +02:00
rick.parker
6017179bc0 File moves to core module and split of interfaces and implementations in preparation for further moves 2016-05-13 11:35:45 +01:00
rick.parker
a18e7b06bf File moves to core module and split of interfaces and implementations in preparation for further moves 2016-05-13 10:07:44 +01:00
Shams Asari
4271693b85 peristing psm checkpoints to disk (one per file) 2016-05-10 16:26:07 +01:00
Richard Green
62e7dc583e Expanded the verify() function for the IRS Contract 2016-05-10 15:32:08 +01:00
Ross Nicoll
642b951bae Rename PartyReference to PartyAndReference 2016-05-09 17:55:37 +01:00
Ross Nicoll
2035a7ba54 Merged in rnicoll-cash-issue-only (pull request #83)
Require that a cash Issue command is the only command
2016-05-09 17:17:53 +01:00
Ross Nicoll
252eb141a7 Require that a cash Issue command is the only command
Require that a cash Issue command is the only cash command in a transaction.
Although no problems are anticipated with other commands being present, they
could theoretically confuse other verification tools.
2016-05-09 16:55:44 +01:00
Shams Asari
2e7b004eb5 logger name moved into protocol state machine 2016-05-09 15:32:30 +01:00
Shams Asari
66eec9c2b2 cleanup of use of messaging service 2016-05-06 10:10:39 +01:00
Ross Nicoll
e433663875 Correct TraderDemo after network map changes
Script to run TraderDemo now specified network map service rather than timestamper service.
TraderDemo now explicitly states the services it needs to run. Previously this was implied by whether a timestamper service was specified, and the code was not updated when that change was made.
2016-05-04 17:45:00 +01:00
Ross Nicoll
7a0300f024 Split internal/external services
This patch splits internal services (to be referred to as "subsystems") from
external services (retaining the label "services"). This makes it clear which
are components of the node for its own use (such as the identity subsystem,
network map cache, wallet, etc.) and which are exposed for other nodes to use.

Further work is needed on consistency in naming, this just introduces the basic
restructuring.
2016-04-28 13:15:14 +01:00
Ross Nicoll
e11ce06b87 Minor: Move service tests into code.node.services package 2016-04-28 09:39:04 +01:00
Ross Nicoll
147f8f37ce Enable network map service 2016-04-27 16:39:33 +01:00
Ross Nicoll
00a2088fa5 Add in-node network map service 2016-04-27 16:33:54 +01:00
Ross Nicoll
5134dd4bbc Add advertised services to AbstractNode and subclasses 2016-04-27 16:26:57 +01:00
Ross Nicoll
8a42da5362 Add network map service 2016-04-27 16:26:57 +01:00
Ross Nicoll
44054c47f8 Add InMemoryNetworkMapCache 2016-04-27 16:26:57 +01:00
Shams Asari
0575bcc959 Sending message to self no longer goes into continuous loop 2016-04-27 14:50:07 +01:00
Ross Nicoll
c8865c1b40 Remove deregisterIdentity()
Remove the ability to remove registered identities. Once registered, identities are part
of a permanent record (for example you would want to ensure parties to contracts cannot
"disappear" by removing themselves from the identity service).
2016-04-27 11:43:10 +01:00
Mike Hearn
f3ed5fc9cb Minor: rename SMM._stateMachines to remove underscore. 2016-04-25 18:13:34 +02:00
Mike Hearn
9904d5bb6e Address review comments from Shams.
Also, make ServiceAffinityExecutor subclass ThreadPoolExecutor instead of delegating to ScheduledThreadPoolExecutor. This fixes an issue with exception reporting.
2016-04-25 18:13:34 +02:00
Mike Hearn
e5a0a211da SMM: Better fiber scheduler that always schedules onto the SMM thread. 2016-04-25 16:43:46 +02:00
Mike Hearn
746aca8290 Thread safety and messaging bug fixes.
* Use the new AffinityExecutor code to fix some thread affinity issues where callbacks were running on the wrong threads. Add affinity assertions.
* Remove sleeps from UpdateBusinessDayProtocol.
* Remove a one-shot message handler before the callback is executed.
* Store un-routed messages in memory in ArtemisMessagingService to fix handler registration/message races. This is a temporary kludge until we use Artemis/MQ better.
2016-04-25 15:25:58 +02:00
Mike Hearn
63b8579669 Minor: print more logging in the IRS demo 2016-04-25 15:22:30 +02:00
Mike Hearn
1b3e919df7 Minor: print a bit more info in log lines 2016-04-25 15:22:10 +02:00
Mike Hearn
f6ef1c8071 Add AffinityExecutor: a tool for making it easier to perform thread assertions. 2016-04-25 14:50:28 +02:00
Ross Nicoll
d3011817ed Merged in rnicoll-identity-service (pull request #64)
Add InMemoryIdentityService
2016-04-21 17:57:47 +01:00
Ross Nicoll
b4513e8bec Add InMemoryIdentityService
Move FixedIdentityService to MockIdentityService under testing as it's specialised for use in tests.
Add a new InMemoryIdentityService replacing the fixed identity service in AbstractNode.
2016-04-21 17:10:43 +01:00
Mike Hearn
4c9e4ce637 SMM: Log uncaught top level fiber exceptions as something has changed about how they propagate out of Fiber.unpark 2016-04-21 13:13:52 +02:00
Mike Hearn
3ef6f18203 Merged in delete-unnecessary-service-ids (pull request #63)
Delete unnecessary service IDs. Only services exposed to the wider network need this type of identifier.
2016-04-20 17:36:50 +02:00
Mike Hearn
e88907dd41 Delete unnecessary service IDs. Only services exposed to the wider network need this type of identifier. 2016-04-20 15:28:59 +02:00
Ross Nicoll
9a17a1c144 Merged in rnicoll-test-in-memory-network (pull request #62)
Remove TestWithInMemoryNetwork
2016-04-20 13:37:35 +01:00
Ross Nicoll
78076ace3b Remove TestWithInMemoryNetwork
* Replace use of TestWithInMemoryNetwork by InMemoryMessagingTests with MockNetwork
* Replace use of TestWithInMemoryNetwork by TimestamperNodeServiceTest with MockNetwork
* Remove reference to TestWithInMemoryNetwork from TwoPartyTradeProtocolTests
2016-04-20 13:36:44 +01:00
Ross Nicoll
5ce7580470 Replace forced ID with ID
Replace the forced ID passed into MockNode with the actual ID. This ensures
mock nodes are aware of their ID as the MockNetwork sees it, essentially
always forcing ID to be overriden.
2016-04-20 13:36:44 +01:00
Mike Hearn
fcc36c472a Improve the contracts API and Cash contract a bit, and beef up the unit tests.
Better usage of generics in groupStates so the group exposes the grouping key that was used, this avoids constructs like `val issuer = outputs[0].deposit.party` which is a bit ugly.
2016-04-20 14:36:14 +02:00
Mike Hearn
804b8bdc6a Minor: Add a TODO about RecordingMap to ServiceHub 2016-04-20 14:28:39 +02:00
Mike Hearn
2de44a516f Switch Kryo serialisation to always include the class name, and avoid overhead from writing out SerializedBytes wrapper data.
This simplifies the serialisation code, reduces the use of inline functions, and ensures that running SerializedBytes<SuperClass>.deserialise() will correctly return SubClass if that's what it contained, efficiently.
2016-04-20 14:27:40 +02:00
Mike Hearn
6968a47a63 Fix a TODO in NodeWalletService by utilising ServiceHub.recordTransactions 2016-04-20 14:27:40 +02:00
Mike Hearn
bfa5e2091c Add a TODO referencing PLT-147 to NodeAttachmentService (randomise attachment JARs) 2016-04-20 14:27:40 +02:00
Mike Hearn
283d9a031c Minor: correct typo in api doc comment 2016-04-20 14:27:40 +02:00
Mike Hearn
77fd7941f9 Minor: remove a utility method that's used only once from WireTransaction 2016-04-20 14:27:40 +02:00
Mike Hearn
964f2b502e Minor: small cleanup in TwoPartyTradeProtocolTests, by using ServiceHub to record the fake transactions 2016-04-20 14:27:40 +02:00
Mike Hearn
70210f3ef9 Minor: rename some fields in Command to be consistent with AuthenticatedObject, just to simplify the next refactor 2016-04-20 14:27:40 +02:00
Mike Hearn
d9cfb5e1eb Minor: make LedgerTransaction implement the NamedByHash interface, for improved consistency 2016-04-20 14:27:40 +02:00
Mike Hearn
6c9222ad6a Minor: delete some unnecessary code from LedgerTransaction 2016-04-20 14:27:40 +02:00
Ross Nicoll
5d75a661b1 Merged in rnicoll-protocol-request-response (pull request #60)
Refactor common elements in node services
2016-04-19 17:58:55 +01:00
Ross Nicoll
8cdd57e4e0 Refactor common elements in node services 2016-04-19 17:57:04 +01:00
Andrius Dagys
03cab8ba09 IRS demo fixes 2016-04-19 16:00:10 +01:00
Mike Hearn
fcbe1210f7 Minor: delete a dead unit test class 2016-04-18 19:51:26 +02:00
Mike Hearn
800151b774 Merge branch 'master' into dynamic-loading 2016-04-18 17:56:31 +02:00
Mike Hearn
8bac8f42e5 Fix the trader demo, the move to include services in NodeInfo objects broke it. 2016-04-18 17:28:04 +02:00
Mike Hearn
531e4a85fe Tweak the attachment classloader tests so that they don't break if IntelliJ has put the 'contracts:isolated' module on the classpath. 2016-04-14 19:42:39 +02:00
Mike Hearn
e91c46f045 Rewrite the AttachmentsClassLoader to avoid temporary file copies and fix the overlap check.
Throw a specialised exception that lists missing exceptions during deserialisation, so the dependency resolution code can access it (coming up).
2016-04-14 17:55:49 +02:00
Mike Hearn
7e9cbaa36e Minor: ClassLoaderTests reformatting 2016-04-14 16:09:19 +02:00
Mike Hearn
13f334ceba Dynamic class loading: check in a contract jar as a test resource to ensure tests can run from IntelliJ.
Minor tweak to use val more than var in tests.
2016-04-13 19:54:25 +02:00
Mike Hearn
7a9f74ca79 Merge branch 'master' into dynamic-loading 2016-04-13 19:03:04 +02:00
Mike Hearn
fc133de902 Minor: small changes to progress tracking in the IRS protocols 2016-04-13 15:20:27 +02:00
Mike Hearn
24cc56334b Minor: bugfix to simulation code (bug introduced during merging) 2016-04-13 15:20:27 +02:00
Mike Hearn
745f6251a6 Minor: better error message when an attempt is made to project coordinates with bad extents 2016-04-13 15:20:25 +02:00
Andrius Dagys
9a8b3bd1ef Added interpolation functionality for the rates oracle. The oracle can be set up with different interpolation mechanisms, currently supported are: linear and cubic spline 2016-04-13 12:32:04 +01:00
Ross Nicoll
265948dcee Clean up code based on feedback from Mike
* Move advertisedServices parameter in NodeInfo up one in the parameter order
* Change ServiceType away from being an enum
* Tweaked wording around what a NodeInfo is
* Renamed LocationStructures to PhysicalLocationStructures
* Move generator outside of function parameters
2016-04-11 16:09:15 +01:00
sofusmortensen
d05e6bb6a4 Merge branch 'master' into dynamic-loading 2016-04-09 01:01:36 +02:00
sofusmortensen
6fe8107d27 Merge branch 'master' into dynamic-loading 2016-04-08 22:40:18 +02:00
Ross Nicoll
ca1db997ab Move node identity structures into core.node package
While node identity is used by services, it is not intrinsically part of services,
so moved it to the core.node package instead.
2016-04-08 15:19:56 +01:00
Ross Nicoll
81b2935285 Move MockNetworkMapCache to core.testing 2016-04-08 15:18:43 +01:00
Ross Nicoll
acee02f876 Add advertised services to NodeInfo 2016-04-08 15:15:54 +01:00
Mike Hearn
49d5fb33c4 Remove copyright headers from the files and put the text in the README instead, per feedback from Jacob and external counsel. 2016-04-08 11:46:07 +02:00
Mike Hearn
caf48b65c9 Run auto-formatter over the code. 2016-04-07 20:16:28 +02:00
Mike Hearn
931ce4a749 Minor: remove ugly bug workaround code now the issue has been fixed in Quasar upstream. 2016-04-07 20:03:46 +02:00
Mike Hearn
f3863ac5ef Minor: eliminate compiler warnings 2016-04-07 20:00:29 +02:00
Mike Hearn
1633ff1ef7 Add simulation classes, which build on top of the MockNetwork infrastructure but set up a group of nodes and performs scenarios between them. Currently there's a base class and two subclasses, one that does the trader demo scenario and one that does an IRS with fixings scenario. 2016-04-07 19:32:06 +02:00
Mike Hearn
a41524fc6a Add a reified inlined variant of WalletService.linearHeadsOfType 2016-04-07 19:32:06 +02:00
Mike Hearn
cd52ca21ce Minor: expose the rates oracle service (if the node provides one) as a property 2016-04-07 19:32:06 +02:00
Mike Hearn
10ee49d994 Minor: refactoring to reduce dependencies of the JSON object mapper. Clean up how mock identities are handled a little. This assists with the simulation code. 2016-04-07 19:32:06 +02:00
Mike Hearn
a2bd9f63a4 Move JSON objectmapper and serialiser code into a separate file. 2016-04-07 19:32:06 +02:00
Mike Hearn
a67267f562 Minor: add an SMM todo 2016-04-07 19:32:06 +02:00
Ross Nicoll
345738f7de Rename classes
Rename LegallyIdentifiableNode to NodeInfo, to represent that legally identifiable is not a single concept.

Rename NetworkMapService to NetworkMapCache, as the API exposed is suited to a local cache, not a remote service.
2016-04-07 15:33:13 +01:00
Rick Parker
34940c903b Merged in plt-17-api-server-merge5 (pull request #51)
IRS related protocols and scripts
2016-04-07 15:01:25 +01:00
rick.parker
55265e6115 IRS related protocols and scripts
Additional changes based on feedback

Additional changes based on feedback
2016-04-07 14:56:30 +01:00
Ross Nicoll
c1ebf45834 Merged in rnicoll-typos (pull request #46)
Minor: Fix typo ('amounnt' to 'amount')
2016-04-06 13:16:31 +01:00
sofusmortensen
9561013b65 Replaced class Kryo2 with extension method on Kryo 2016-04-05 01:02:54 +02:00
sofusmortensen
bba0a4a55d Fixed bug in Kryo.useClassLoader
Renamed to AttachmentsClassLoader + autoformat
Added unit test to validate exception being throw when deserializing WireTransaction without contract jar in attachments.
2016-04-05 00:34:46 +02:00
sofusmortensen
88a7406ec9 Merge branch 'master' into dynamic-loading 2016-04-03 13:59:36 +02:00
Mike Hearn
420ecf80a0 Minor: fix a typo in a variable name, spotted by Rick 2016-03-30 18:50:12 +02:00
Mike Hearn
3adfd02e31 Support injection of latency into the mock (simulated) network. 2016-03-30 18:50:12 +02:00
Mike Hearn
d1e62c27c4 Unit testing: minor refactoring of MockNetwork 2016-03-30 18:50:12 +02:00
Mike Hearn
d1b5ada423 Add a notion of physical location.
This will be useful for various things in future, such as approximating the nearest consensus service (approximate because physical distance doesn't always match network distance), visualisation, simulation, etc.

LegallyIdentifiableNode now lists a physical place for the node to be in (which might not be totally accurate one day if we have super distributed mega-nodes, but will do for now).

The config file allows the admin to specify their nearest city.

There is a city database that can map such names through to coordinates, when known.

There is support for Mercator projection.
2016-03-30 18:50:11 +02:00
Ross Nicoll
366860b2d8 Minor: Fix typo ('amounnt' to 'amount') 2016-03-30 16:13:33 +01:00
rick.parker
e122a57bf2 First working commit
First working commit

Formatting clean up

Revert All_tests.xml

Remove extra space

Feedback from code review
2016-03-30 15:04:08 +01:00
sofusmortensen
c0e2322414 Added comment on how to handle accidental gradle import in IDEA 2016-03-25 14:56:09 +01:00
sofusmortensen
58a509de63 Merge branch 'master' into dynamic-loading 2016-03-24 13:10:36 +00:00
sofusmortensen
e5dbf5d2a8 WireTransaction deserialization using AttachmentStorage 2016-03-24 12:06:41 +00:00
sofusmortensen
1344bfd6bb Replaced programRef in ContractState with a simple reference to contract 2016-03-23 17:51:14 +00:00
Mike Hearn
5b7fb86b6b Use TypeSafe Config library instead of Java properties files for the config file format. The default formats are compatible so this should not be disruptive. 2016-03-23 16:49:28 +00:00
rick.parker
9f7ae4c61d Basic JSON API with servertime call exposed at GET /api/servertime
Global Clock as part of ServiceHub to offer source of time in transactions, protocols, time stamping service etc (can be replace for demos and testing with a Clock that can be externally manipulated)

Edited with Mike's feedback

Edited with Mike's feedback
2016-03-23 09:34:45 +00:00
sofusmortensen
5d5bcbfb00 Merge branch 'master' into dynamic-loading 2016-03-22 13:37:33 +00:00
sofusmortensen
527b0f4817 Improved unit tests.
Cleaned up project structure a bit.
2016-03-22 12:15:47 +00:00
Richard Green
6c0e696107 Updated with new Tenor class that verifies string during construction.
Now uses new Tenor class for Interest Rate Oracle
2016-03-22 11:46:06 +00:00
Richard Green
d7d05a2f70 Merged in PLT-15-b (pull request #36)
Neater branch with IRS code.
2016-03-22 11:42:08 +00:00
Richard Green
a78c5b11d1 IRS Contract example 2016-03-22 11:36:40 +00:00
Mike Hearn
b1694e2d0d Move MockNode/InMemoryNetwork to the main sourceset, as these are useful not only for unit testing, but also simulation tools. 2016-03-22 10:54:35 +00:00
sofusmortensen
3675675277 Custom ClassLoader created from collection of attachments 2016-03-20 20:41:46 +01:00
Mike Hearn
7ef8397920 Use new Quasar API to skip serialisation of TLS slots. 2016-03-17 16:53:01 +01:00
Mike Hearn
3c4ce0a8fe Minor: fix a regression introduced by a bad merge that broke the rate fix demo 2016-03-17 13:07:19 +01:00
Richard Green
8ab5efe4a7 Quick fix for previous merge; missed fixing the tests for NodeInterestRates when the String.d function renamed to .bd 2016-03-15 18:42:59 +00:00
Vibhu Mohindra
11d14001cd Unified the various StorageService implementations. Made getMap() private. Made the nested tables into instance variables. Moved StorageServiceImpl out into its own file to avoid merge conflicts in the future. 2016-03-15 17:08:28 +00:00
Mike Hearn
77fd6071a1 Merged in jmx-mbeans (pull request #32)
Export various ledger stats via JMX
2016-03-11 18:27:12 +01:00
Mike Hearn
3533e87953 Take out the fake signing delay in the trader demo. 2016-03-11 18:12:18 +01:00
Mike Hearn
07eee0233f Export wallet balances via JMX. 2016-03-11 17:55:03 +01:00
Mike Hearn
28869ad85d Export attachment count via JMX 2016-03-11 17:26:17 +01:00
Mike Hearn
730b7949ea Export stats to JMX from the state machine manager. 2016-03-11 17:26:17 +01:00
Mike Hearn
139bf1e450 Minor: fix trader demo 2016-03-11 17:02:35 +01:00
Mike Hearn
87e8562675 Make Jolokia return data as application/json 2016-03-11 11:57:38 +01:00
Mike Hearn
c436841461 Restrict Jolokia JMX access 2016-03-11 11:49:50 +01:00
Mike Hearn
fce799726f Minor: rename NetworkMap -> NetworkMapService for consistency 2016-03-11 11:49:50 +01:00
rick.parker
429ac589df Clean integration of Jersey & Jackson for JAX-RS support, with Config for setting up custom marshalling. No API classes configured by default
Enable Jersey monitoring JMX MBean

Updates based on Mike's feedback
2016-03-11 08:37:53 +00:00
Mike Hearn
a03352e6cd Export JMX statistics via JSON REST endpoints using Jolokia. 2016-03-09 15:53:32 +01:00
Mike Hearn
b2f9aa64d5 RatesFixProtocol: add progress tracking 2016-03-09 14:38:03 +01:00
Mike Hearn
4e15755883 RatesFixProtocol: add an empty, overridable beforeSigning method that lets you customise the logic of the protocol. 2016-03-09 14:08:37 +01:00
Mike Hearn
0f208d8b4d Check in a demo of how to get an interest rate fix from an oracle. 2016-03-08 17:31:35 +01:00
Mike Hearn
d63a3a8923 Minor: add a toString for the UnknownFix exception 2016-03-08 17:31:35 +01:00
Mike Hearn
6ac05c2edb Minor: don't check the file name in an upload if there isn't one 2016-03-08 17:31:35 +01:00
Mike Hearn
29e58ce3db Allow upload of interest rate fixes to the oracle over HTTP. 2016-03-08 17:31:35 +01:00
Mike Hearn
2b4a1eedc3 Generalise support for file uploads over HTTP to allow reuse of the upload servlet. 2016-03-08 17:29:56 +01:00
Mike Hearn
a7fec047ed Add an interest rates oracle.
Currently lacking the following useful things:
- Progress reporting
- Ability to upload new rates
- Demo app[s]
2016-03-08 17:29:56 +01:00
Mike Hearn
8d3c9643e9 Minor: Move TraderDemo to demos package 2016-03-08 17:29:23 +01:00
Mike Hearn
92a7363c83 Minor: add a couple more utilities for converting strings into the type safe endpoint address objects 2016-03-08 17:29:08 +01:00
Mike Hearn
5aaa6bd204 Minor: rename NodeAttachmentStorage -> NodeAttachmentService 2016-03-08 17:29:08 +01:00
Mike Hearn
ffcc0507c4 Return the hashes of newly uploaded attachments to the uploader. 2016-03-08 15:41:44 +01:00
Mike Hearn
5eda0e066e Minor: add a TODO about a little rpc framework to StateMachineManager 2016-03-08 15:19:44 +01:00
Mike Hearn
dc6ef73b6b Minor: more code motion ... TimestampingProtocol now split to top level class and moved to same location as the other protocols. Few other timestamping related classes reorganised. 2016-03-08 12:17:07 +01:00
Mike Hearn
2c4475b0d9 Minor: TimestamperNodeService -> NodeTimestamperService for consistency 2016-03-08 12:01:49 +01:00
Mike Hearn
8d041a6b1a Minor: yet another small move 2016-03-08 11:12:45 +01:00
Mike Hearn
bf3aed11e7 Minor: another small move 2016-03-08 11:10:31 +01:00
Mike Hearn
e9fddbc709 Reorganise the file hierarchy a bit. 2016-03-08 11:06:16 +01:00
Mike Hearn
d26b06c35c Allow download of attachments, and files within attachments, over HTTP. 2016-03-04 15:56:25 +01:00
Mike Hearn
6cb86ab840 Plumb attachments through to the contract verify functions (no contract uses them yet).
The right way to do this is probably to put the contracts onto the classpath before execution of the contract. However, this interacts closely with the sandboxing work, which isn't yet started, so for now this will do.
2016-03-02 15:35:46 +01:00
Mike Hearn
1123c28f02 Make the trader demo attach a PDF to the commercial paper self-issuance and then scan for it on the buyer side, print out the path on the filesystem where the PDF can be found. 2016-03-02 15:08:55 +01:00
Mike Hearn
8d906c703d Support auto-expansion of attachment jars on disk. 2016-03-02 14:51:42 +01:00
Mike Hearn
f0fa9e3097 Resolve and insert attachments to the local store when resolving transactions. Attachments aren't yet exposed to contract code. 2016-03-02 14:51:42 +01:00
Mike Hearn
7f5eb5bf2f Minor: make TwoPartyTradeProtocolTests use the new MockNode infrastructure 2016-03-02 14:51:42 +01:00
Mike Hearn
dc0925840a Make AbstractNode more customisable and upgrade the MockNode implementation. 2016-03-02 14:51:42 +01:00
Mike Hearn
1bd63c030c Minor: delete dead test-related code from Services.kt 2016-03-01 15:20:03 +01:00
Mike Hearn
3f19842632 Minor: logging, two more utility methods. 2016-03-01 15:13:43 +01:00
Mike Hearn
1330f33aba First pass trivial wallet: basic tracking of relevant states. 2016-02-29 22:14:25 +01:00
Mike Hearn
e2deea598e Minor: tweak the mock key management service a bit. 2016-02-29 22:06:18 +01:00
Mike Hearn
49b20df6cd Minor: add a couple of utilities to BriefLogFormatter to help cut down on unit test log spew. 2016-02-29 22:06:18 +01:00
Mike Hearn
620116b01b Minor: use UNIX config for JimFS, to fix unit test build on Windows. 2016-02-29 19:05:06 +01:00
Mike Hearn
48b2e561b7 Minor: make NodeAttachmentStorage open streams lazily to avoid resource leaks and to make checking for attachment existence fast. 2016-02-29 19:05:06 +01:00
Mike Hearn
a6835c4c04 Add unit tests for attachment fetch. 2016-02-29 19:05:06 +01:00
Mike Hearn
cb52ff09b8 Add a mock Node implementation to simplify unit testing. 2016-02-29 19:05:06 +01:00
Mike Hearn
5bd8a3408b Minor: rename InMemoryNetwork/Node to talk more about messaging, to deconflict with the new mock node (which ties together all the various node services). 2016-02-29 19:05:06 +01:00
Mike Hearn
6bdfbb2a4f Refactor Node into AbstractNode+Node, to make it easier to introduce a MockNode for unit testing purposes. 2016-02-29 19:05:06 +01:00
Mike Hearn
37f1de8a4d Refactor FetchTransactionsProtocol into FetchDataProtocol and add support for fetching attachments. 2016-02-29 19:05:05 +01:00
Mike Hearn
0224bca1a9 Add a simple file backed attachment store, with tests. 2016-02-29 19:04:41 +01:00
Mike Hearn
0064f7c254 Minor: add a unit testing utility to unwrap exceptions to their root cause. 2016-02-26 15:47:12 +01:00
Mike Hearn
c3f86f6557 Integrate a simple progress tracking system into the protocol framework.
The progress tracker API lets you model a tree of steps, along the same structure as protocols and subprotocols. Each step has an (optionally changing) label, and thus progress trackers can be arranged in a tree. Updates to the progress at each level flow up the tree via an RxJava observable (I guess we will use this more in future).

A simple console renderer is provided that uses ANSI escapes and Emoji to show animated progress through a protocol.

The trader demo is enhanced to use this framework, when run outside of Gradle.
2016-02-24 12:58:37 +01:00
Mike Hearn
c35d7794d8 Minor: make BriefLogFormatter.initVerbose take a set of flags saying what logging to activate vs silence. 2016-02-23 18:28:06 +01:00
Mike Hearn
9de104df7b Refactor the protocol framework out into separate files. 2016-02-23 18:28:06 +01:00
Richard Green
bc8962b0dc Minor: Moved JavaCommercialPaper.java from src/main... to contracts/src/main 2016-02-23 14:14:01 +00:00
Mike Hearn
adda2bbe6b Minor: move ExcessivelyLargeTransactionGraph exception into the right place 2016-02-18 17:29:44 +01:00
Mike Hearn
1243ca2066 Trading: in the two party trade protocol, check that the proposed transaction is contract-valid, and that the missing signatures are what is expected. 2016-02-17 18:38:24 +01:00
Mike Hearn
cd28733360 Major: Separate out the dep resolution protocol into a couple of sub protocols and use on both sides of the trade.
* Dependency resolution/checking is now working on both sides of the two party trading protocol.
* The commercial paper contract was changed to check timestamping authority identities by name instead of key.
* The trader demo has been rewritten to use the protocol framework, which simplifies the code.
2016-02-17 18:11:37 +01:00
Mike Hearn
eb47d8af4d Minor: Unit testing: allow a subset of transactions in a group to be signed. 2016-02-17 17:19:37 +01:00
Mike Hearn
bdadaffbc0 Minor: Logging of how many transactions were validated in TransactionGroup.verify() 2016-02-17 17:19:37 +01:00
Mike Hearn
58e84fbeca Minor: Unit testing: InMemoryNetwork.Node.stop, running = false after thread shutdown not before. 2016-02-17 17:19:36 +01:00
Mike Hearn
55989a8e92 Minor: add logging to the RecordingMap unit test utility 2016-02-17 17:19:36 +01:00
Mike Hearn
b2b51183b8 Minor: logging - allow multiple package specs to be passed to BriefLogFormatter.initVerbose() 2016-02-17 17:19:36 +01:00
Mike Hearn
299e1af15e Protocol frameworks: separate the fiber object from the logic object to make it easier to compose subprotocols together. 2016-02-17 17:19:36 +01:00
Mike Hearn
dc520392b8 Protocol framework: tweak error handling a bit and add unit test for it. 2016-02-17 17:19:36 +01:00
Mike Hearn
df4d926bca First pass at implementing dependency resolution and checking in the two-party trade protocol.
This commit is incomplete: only the seller side currently checks. The code will be refactored out into subprotocols in further commits.

Note that timeouts are currently unhandled.
2016-02-17 17:19:36 +01:00
Mike Hearn
f92455442d Minor: Unit testing: don't always require a lambda when running the network synchronously. 2016-02-17 17:19:36 +01:00
Mike Hearn
ed72e9b997 Unit tests: fix a couple of threading issues for async unit tests that use the in memory network 2016-02-16 17:39:08 +01:00
Mike Hearn
de4427c240 Minor: add a few utilities for working with listenable futures 2016-02-16 17:39:02 +01:00
Mike Hearn
8c72f68736 Minor: fix a minor merge issue that broke pretty output in the trader demo 2016-02-16 17:17:15 +01:00
Sofus Mortensen
994abb3edb Added new project core.
Project Contracts depends only on core.
2016-02-16 17:14:17 +01:00
Mike Hearn
a01746a04b Minor: use DummyTimestampingAuthority key/identity in the InMemoryNetwork 2016-02-12 16:50:44 +01:00
Mike Hearn
b7fd0ce0ed Minor: move InMemoryNetwork to tests directory 2016-02-12 16:47:45 +01:00
Mike Hearn
9f4897f7c4 Simplifies two-party trade protocol to return SignedTransaction instead of a pair of other forms. 2016-02-12 15:49:18 +01:00
Mike Hearn
6deef5b598 Minor: rename SignedWireTransaction to just SignedTransaction 2016-02-12 15:47:23 +01:00
Mike Hearn
a42d7e64ef Minor: add a TODO to Kryo.kt about lazy properties. 2016-02-12 15:41:36 +01:00
Mike Hearn
ea18e239d9 Testing: rework TransactionGroupDSL to work with WireTransactions instead of LedgerTransactions and simplify original hash/serialised bits tracking. 2016-02-12 15:41:22 +01:00
Mike Hearn
fc000ec03c Testing: more utilities on Transaction and TransactionGroupForTest to help with testing signed transactions. 2016-02-12 14:55:11 +01:00
Mike Hearn
5b473be79c Minor: fix test breakage under Gradle due to some horrible stuff Gradle does with injecting things into our environment. 2016-02-10 17:59:28 +01:00
Mike Hearn
ae6309a113 Minor: make SecureHash c'tor private so it's not possible to instantiate directly. 2016-02-10 17:59:28 +01:00
Mike Hearn
31964f8695 Introduce ContractFactory to replace Map<SecureHash, Contract>. It allows for lazy loading of contracts. 2016-02-10 17:59:28 +01:00
Mike Hearn
2ccbd5db3e Minor: code cleanup on ArtemisMessagingService.
- Use fixes in Kotlin 1.0 RC to clean up property access a bit (fewer set* calls)
- Note that we currently won't notice if Artemis throws an exception during startup, as it happens async. There is a fix to Artemis pending.
2016-02-10 17:59:28 +01:00
Mike Hearn
d98a3871da Refactor the 2-party trading protocol
- Fix a security bug/TODO by having seller send back the signatures rather than a full blown transaction (which would allow a malicious seller to try and confuse the buyer by sending back a completely different TX to the one he proposed)
- Introduce an UntrustworthyData<T> wrapper as an (inefficient) form of taint tracking, to make it harder to forget that data has come from an untrustworthy source and may be malicious.
- Split the giant {Buyer, Seller}.call() methods into a set of smaller methods that make it easier to unit test various kinds of failure/skip bits in tests that aren't needed.
2016-02-10 17:59:28 +01:00
Mike Hearn
28daae5bd4 Minor: in CashTests make editIssuedBy into an infix fun with a space in the name, like owned by.
Makes the code read a bit more like English.
2016-02-10 16:30:21 +01:00
Mike Hearn
bd8d056466 Minor: remove duplicated copyright header from CashTests.kt 2016-02-10 16:30:21 +01:00
Mike Hearn
52172c5f95 Minor: in TraderDemo comments point to docsite instead of duplicating 2016-02-10 16:30:21 +01:00