corda

Error when running Corda flow tests from IntelliJ

风流意气都作罢 提交于 2019-11-30 09:29:43
When I run Corda flow tests from IntelliJ, the tests fail with the following errors: QUASAR WARNING: Quasar Java Agent isn't running. If you're using another instrumentation method you can ignore this message; otherwise, please refer to the Getting Started section in the Quasar documentation. and java.lang.IllegalStateException: Missing the '-javaagent' JVM argument. Make sure you run the tests with the Quasar java agent attached to your JVM. See https://docs.corda.net/troubleshooting.html - 'Fiber classes not instrumented' for more details. How can I fix this? Corda flows need to be

Exchanging Corda cash states for traditional cash

隐身守侯 提交于 2019-11-29 23:23:01
问题 Suppose you're representing cash on the Corda ledger using cash states. How does a network participant exchange their cash states for traditional cash? 回答1: Firstly, we need to explain how cash states are created on the ledger initially. The mechanism is for an issuing bank to set aside a cash deposit in the traditional banking system, and issue itself cash states of an equal amount and currency on the ledger using a Cash.Issue transaction. The issued cash states can then be transferred

Querying nested collections in LinearState states

喜夏-厌秋 提交于 2019-11-29 11:14:34
Do we have a pattern for queryable persistent collections nested within a state? class ALinearState(val items: List<Item>) : LinearState data class Item(name: String, ...) For a given ALinearState , alpha we wish to store versions for the same UniqueIdentifier . Each version will have a discrete set of items . We want to be able to query a table for items that match a filter, then recover the set states of alpha that match the filtered items . Is there a way of achieving this? Thanks. You can represent you Contract States using any form of JPA/Hibernate model definition. For example: object

7个值得关注的Java区块链项目【2019】

一曲冷凌霜 提交于 2019-11-29 09:39:18
如果你是一个对区块链感兴趣的Java工程师,那么除了阅读书籍或博客之外,更好的学习方法是亲自动手,深入了解以下7个最流行的Java区块链项目。 1、Corda Corda可能是Java开发人员进入区块链世界的最自然的出发点。Corda是一个JVM项目,它建立在很多流行且广泛使用的开源项目之上,例如Apache Artemis、Hibernate、Apache Shiro、Jackson以及关系型数据库。Corda受到了比特币的启发,但是它包含了业务流程、消息以及其他企业应用中的熟悉的概念。 项目链接: https://github.com/corda/corda Github Star:3002 2、Pantheon Pantheon是一个Java版本的完整的以太坊节点实现,创建这个项目的出发点就是吸引Java生态中的开发者进入区块链世界。 项目链接: https://github.com/PegaSysEng/pantheon Github Star:393 3、Bitcoinj Bitcoinj是最流行的比特币协议的Java实现。如果你希望直接从比特币开始你的区块链开发,这就是你应该深入的项目。 项目链接: https://github.com/bitcoinj/bitcoinj Github Star:3405 在线教程: Java比特币开发详解 — 汇智网 4、Web3j

Using PostgreSQL instead of H2 as the Corda node's database

扶醉桌前 提交于 2019-11-29 02:44:25
I would like to use PostgreSQL instead of H2 as the database for my node. Is using PostgreSQL for Corda nodes possible? How would I configure my node to use a PostgreSQL database? Joel Both Corda 2 and Corda 3 allow the use of PostgreSQL 9.6, using PostgreSQL JDBC Driver 42.1.4. Note that this is an experimental community contribution, and is currently untested. Here is an example node configuration block for PostgreSQL: dataSourceProperties = { dataSourceClassName = "org.postgresql.ds.PGSimpleDataSource" dataSource.url = "jdbc:postgresql://[HOST]:[PORT]/postgres" dataSource.user = [USER]

Corda Data Tampering Issue

不问归期 提交于 2019-11-29 00:27:44
Background : We learned that corda is not tamper-proof but tamper-evident. So, if one of the node manipulated a state directly in the database, other nodes will be able to detect and flag it if that state was used in subsequent transactions. However, our test results were not as per our expectation. Corda did not flag the state that was tampered and in fact it recorded the new state with tampered data in all participant nodes. Prerequisites : Comment Out Contract Validations: We commented contract code to check if the data tampering is detected in Corda without the check being explicitly done

How to provide a CorDapp with custom config in Corda?

▼魔方 西西 提交于 2019-11-28 11:48:50
I need to communicate with external system inside Corda flow so there should be a way to deliver some configuration (e.g. username and password for external API). It may be .properties or .yaml file for example. Is there a best practice how to do that? Maybe even sample? Corda 3 doesn't have built-in support for providing arbitrary configuration files to nodes. Support for this will be added in Corda 4 using CorDapp configuration files: https://docs.corda.net/head/cordapp-build-systems.html#cordapp-configuration-files . In the meantime, you can place a local file within the node directory and

NODE_PROPERTIES table in database

不羁的心 提交于 2019-11-28 11:20:49
问题 What is the purpose of NODE_PROPERTIES table in the database and how do we get this table populated with key value pairs and how do we query? And how do we query data in other NODE tables like NODE_INFOS, NODE_NAMED_IDENTITIES , NODE_INFO_HOSTS? Is there any service level function available in CordaRPCClient to do that? We would like to store some extra properties for each node 回答1: The NODE_PROPERTIES table is used for internal purposes to store information that doesn't justify having its

Querying nested collections in LinearState states

点点圈 提交于 2019-11-28 04:47:54
问题 Do we have a pattern for queryable persistent collections nested within a state? class ALinearState(val items: List<Item>) : LinearState data class Item(name: String, ...) For a given ALinearState , alpha we wish to store versions for the same UniqueIdentifier . Each version will have a discrete set of items . We want to be able to query a table for items that match a filter, then recover the set states of alpha that match the filtered items . Is there a way of achieving this? Thanks. 回答1:

Making asynchronous HTTP calls from flows

强颜欢笑 提交于 2019-11-28 02:18:23
问题 In Corda, how can I make an asynchronous HTTP request from within a flow? Is there an API to suspend a flow while awaiting the response to the HTTP call, or a way to provide a callback? 回答1: Corda doesn't currently provide a mechanism for making an asynchronous HTTP request and then either suspending the flow while awaiting a response, or providing a callback that will be called when the response is received. Instead, it is recommended that you make the HTTP request before initiating the flow