# Conflicts: # client/rpc/src/integration-test/kotlin/net/corda/client/rpc/BlacklistKotlinClosureTest.kt # client/rpc/src/integration-test/kotlin/net/corda/client/rpc/RPCStabilityTests.kt # core/src/test/java/net/corda/core/flows/FlowsInJavaTest.java # docs/source/changelog.rst # docs/source/corda-configuration-file.rst # docs/source/upgrade-notes.rst # finance/src/test/kotlin/net/corda/finance/contracts/CommercialPaperTests.kt # finance/src/test/kotlin/net/corda/finance/contracts/asset/CashTests.kt # gradle/wrapper/gradle-wrapper.properties # node-api/src/main/kotlin/net/corda/nodeapi/internal/KeyStoreConfigHelpers.kt # node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/SetsSerializationTest.kt # node/src/integration-test/kotlin/net/corda/node/AuthDBTests.kt # node/src/integration-test/kotlin/net/corda/node/BootTests.kt # node/src/integration-test/kotlin/net/corda/node/NodeKeystoreCheckTest.kt # node/src/integration-test/kotlin/net/corda/node/NodePerformanceTests.kt # node/src/integration-test/kotlin/net/corda/node/SSHServerTest.kt # node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt # node/src/integration-test/kotlin/net/corda/node/services/BFTNotaryServiceTests.kt # node/src/integration-test/kotlin/net/corda/node/services/RaftNotaryServiceTests.kt # node/src/integration-test/kotlin/net/corda/node/services/network/NetworkMapTest.kt # node/src/integration-test/kotlin/net/corda/node/services/network/PersistentNetworkMapCacheTest.kt # node/src/integration-test/kotlin/net/corda/node/services/statemachine/FlowVersioningTest.kt # node/src/integration-test/kotlin/net/corda/node/utilities/registration/NodeRegistrationTest.kt # node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityTest.kt # node/src/integration-test/kotlin/net/corda/services/messaging/P2PMessagingTest.kt # node/src/integration-test/kotlin/net/corda/test/node/NodeStatePersistenceTests.kt # node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt # node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt # node/src/main/resources/reference.conf # node/src/test/java/net/corda/node/services/vault/VaultQueryJavaTests.java # node/src/test/kotlin/net/corda/node/CordaRPCOpsImplTest.kt # node/src/test/kotlin/net/corda/node/services/config/NodeConfigurationImplTest.kt # node/src/test/kotlin/net/corda/node/services/network/NetworkMapCacheTest.kt # node/src/test/kotlin/net/corda/node/services/persistence/DBCheckpointStorageTests.kt # samples/attachment-demo/src/integration-test/kotlin/net/corda/attachmentdemo/AttachmentDemoTest.kt # samples/network-visualiser/src/main/kotlin/net/corda/netmap/NetworkMapVisualiser.kt # samples/notary-demo/src/main/kotlin/net/corda/notarydemo/RaftNotaryCordform.kt # samples/simm-valuation-demo/src/integration-test/kotlin/net/corda/vega/SimmValuationTest.kt # testing/node-driver/src/integration-test/kotlin/net/corda/testing/driver/DriverTests.kt # testing/node-driver/src/main/kotlin/net/corda/testing/node/InMemoryMessagingNetwork.kt # testing/node-driver/src/main/kotlin/net/corda/testing/node/MockNode.kt # testing/node-driver/src/main/kotlin/net/corda/testing/node/MockServices.kt # testing/node-driver/src/main/kotlin/net/corda/testing/node/NodeTestUtils.kt # testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/NodeBasedTest.kt # testing/smoke-test-utils/src/main/kotlin/net/corda/smoketesting/NodeProcess.kt # testing/test-utils/src/main/kotlin/net/corda/testing/internal/TestNodeInfoBuilder.kt # tools/explorer/src/main/kotlin/net/corda/explorer/ExplorerSimulation.kt # verifier/src/integration-test/kotlin/net/corda/verifier/VerifierTests.kt # webserver/src/integration-test/kotlin/net/corda/webserver/WebserverDriverTests.kt
27 KiB
Upgrading a CorDapp to a new platform version
These notes provide instructions for upgrading your CorDapps from previous versions, starting with the upgrade from our first public Beta (Milestone 12 <changelog_m12>
), to V1.0 <changelog_v1>
.
General rules
Always remember to update the version identifiers in your project gradle file. For example, Corda V1.0 uses:
ext.corda_release_version = '1.0.0'
ext.corda_release_distribution = 'net.corda'
ext.corda_gradle_plugins_version = '1.0.0'
It may be necessary to update the version of major dependencies. Corda V1.0 uses:
ext.kotlin_version = '1.1.4'
ext.quasar_version = '0.7.9'
ext.junit_version = '4.12'
Please consult the relevant release notes of the release in question. If not specified, you may assume the versions you are currently using are still in force.
We also strongly recommend cross referencing with the changelog
to confirm changes.
V1.0 and V2.0 to R3 Corda V3.0 Developer Preview
Build
- Update the version identifiers in your project gradle file(s):
ext.corda_release_version = 'R3.CORDA-3.0.0-DEV-PREVIEW' // "CORDA-3.0.0-DEV-PREVIEW" (Open Source)
ext.corda_gradle_plugins_version = '3.0.3'
- Add a new release identifier to specify the R3 release of corda:
ext.corda_release_distribution = 'com.r3.corda' // "net.corda" for Corda (Open Source)
- Add an additional repository entry to point to the location of the R3 Corda distribution:
repositories {
maven {
credentials {
username "r3-corda-dev-preview"
password "XXXXX"
}
url 'https://ci-artifactory.corda.r3cev.com/artifactory/r3-corda-releases'
}
}
- Corda plugins have been modularised further so the following additional gradle entries are necessary:
dependencies {
classpath "net.corda.plugins:cordapp:$corda_gradle_plugins_version"
}
apply plugin: 'net.corda.plugins.cordapp'
The plugin needs to be applied in all gradle build files where there is a dependency on Corda using any of:
cordaCompile, cordaRuntime, cordapp
- Corda Gradle plugins require Gradle version 4.1 or above
- All gradle compile, test, and run-time dependencies (except gradle plugins) to Corda artifacts should now use the
corda_release_distribution
variable (was previously hardcoded to usenet.corda
):
dependencies {
// Corda integration dependencies
cordaCompile "$corda_release_distribution:corda-core:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-finance:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-jackson:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-rpc:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-node-api:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-webserver-impl:$corda_release_version"
cordaRuntime "$corda_release_distribution:corda:$corda_release_version"
cordaRuntime "$corda_release_distribution:corda-webserver:$corda_release_version"
testCompile "$corda_release_distribution:corda-node-driver:$corda_release_version"
}
- For existing contract ORM schemas that extend from CommonSchemaV1.LinearState or CommonSchemaV1.FungibleState, you will need to explicitly map the participants collection to a database table. Previously this mapping was done in the superclass, but that makes it impossible to properly configure the table name. The required change is to add the
override var participants: MutableSet<AbstractParty>? = null
field to your class, and add JPA mappings. For ex., see this example:
@Entity
@Table(name = "cash_states_v2",
"ccy_code_idx2", columnList = "ccy_code")))
indexes = arrayOf(Index(name = class PersistentCashState(
ElementCollection
@Column(name = "participants")
@name="cash_states_v2_participants", joinColumns = arrayOf(
@CollectionTable("output_index", referencedColumnName = "output_index"),
JoinColumn(name = "transaction_id", referencedColumnName = "transaction_id")))
JoinColumn(name = override var participants: MutableSet<AbstractParty>? = null,
Configuration
Applies to both gradle deployNodes tasks and/or corda node configuration (node.conf).
- Remove any references to
networkMap
.
networkMap "O=Agent,L=Dallas,C=US"
- Remove any references to
advertisedServices
(including notaries).
advertisedServices = ["corda.notary.validating"]
- Add an explicit notary definition in the Notary node configuration only:
notary = [validating : true]
For existing contract ORM schemas that extend from
CommonSchemaV1.LinearState
orCommonSchemaV1.FungibleState
, you will need to explicitly map theparticipants
collection to a database table. Previously this mapping was done in the superclass, but that makes it impossible to properly configure the table name. The required changes are to:- Add the
override var participants: MutableSet<AbstractParty>? = null
field to your class, and - Add JPA mappings
For example:
@Entity @Table(name = "cash_states_v2", "ccy_code_idx2", columnList = "ccy_code"))) indexes = arrayOf(Index(name = class PersistentCashState( ElementCollection @Column(name = "participants") @name="cash_states_v2_participants", joinColumns = arrayOf( @CollectionTable("output_index", referencedColumnName = "output_index"), JoinColumn(name = "transaction_id", referencedColumnName = "transaction_id"))) JoinColumn(name = override var participants: MutableSet<AbstractParty>? = null,
- Add the
Testing
Contract tests
You must now create a
MockServices
object.MockServices
provides a mock identity, key and storage service.MockServices
takes as its first argument a list of the CorDapp packages to scan:private val ledgerServices = MockServices(listOf("net.corda.examples.obligation", "net.corda.testing.contracts"))
MockServices
replaces the use ofsetCordappPackages
andunsetCordappPackages
.ledger
is now defined as aMockServices
method. This means that:ledger {
Becomes:
ledgerServices.ledger {
Within a mock ledger transaction,
ContractState
instances are passed toinput
andoutput
as objects rather than lambdas. For example:ledgerServices.ledger { transaction { input(OBLIGATION_CONTRACT_ID, DummyState()) output(OBLIGATION_CONTRACT_ID, oneDollarObligation) } }
Within a mock ledger transaction,
CommandData
instances are passed toinput
andoutput
as objects rather than lambdas, and the public keys must be passed as a list if there is more than one. For example:ledgerServices.ledger { transaction { command(alice.publicKey, ObligationContract.Commands.Issue()) command(listOf(alice.publicKey, bob.publicKey), ObligationContract.Commands.Issue()) } }
The predefined test identities (e.g.
ALICE
andMINI_CORP
) have been removed.You must now define the test identities explicitly. For example:
val alice = TestIdentity(CordaX500Name(organisation = "Alice", locality = "TestLand", country = "GB"))
TestIdentity
exposes methods to get thename
,keyPair
,publicKey
,party
andidentity
of the underlyingTestIdentity
Explicit invocation of transaction transformation (ie. using
TransactionBuilder
) requires serialization engine to be initialized. In unit test this can be achieved by using the following jUnit rule:@Rule @JvmField val testSerialization = SerializationEnvironmentRule()
Flow tests
The registration mechanism for CorDapps in
MockNetwork
unit tests has changed:* CorDapp registration is now done via the
cordappPackages
constructor parameter of MockNetwork. This parameter is a list ofString
values which should be the package names of the CorDapps containing the contract verification code you wish to load *TheunsetCordappPackages
method is now redundant and has been removedCreation of Notaries in
MockNetwork
unit tests has changed.Previously the API call
createNotaryNode(legalName = CordaX500ame(...))
would be used to create a notary:val notary = mockNetwork.createNotaryNode(legalName = CordaX500Name("Notary", "London", "UK"))
Notaries are now defined as part of
MockNetwork
creation usingnotarySpecs
, as in the following example:"Notary","London","UK")))) mockNetwork = MockNetwork(notarySpecs = listOf(MockNetwork.NotarySpec(CordaX500Name(
A notary is no longer specified when creating a standard node using the
createPartyNode
API call.Previously:
"Node", "Madrid", "ES")) mockNetwork.createPartyNode(notary.network.myAddress, CordaX500Name(
Becomes:
"Node", "Madrid", "ES")) mockNetwork.createPartyNode(CordaX500Name(
Utility node creation API method
createSomeNodes(...)
has been removed, and nodes must be created individually.Previously:
BasketOfNodes nodes = net.createSomeNodes(3); MockNetwork.getPartyNodes().get(0); nodeA = nodes.getPartyNodes().get(1); nodeB = nodes.getPartyNodes().get(2); nodeC = nodes.
Becomes:
createNode(new MockNodeParameters()); nodeA = net.createNode(new MockNodeParameters()); nodeB = net.createNode(new MockNodeParameters()); nodeC = net.List<StartedNode<MockNode>> nodes = Arrays.asList(nodeA, nodeB, nodeC);
Flow framework instantiation of a flow has a slight variation in start syntax:
Previously:
getServices().startFlow(flow).getResultFuture(); CordaFuture<SignedTransaction> future = nodeA.
Becomes:
startFlow(nodeA.getServices(), flow).getResultFuture(); CordaFuture<SignedTransaction> future =
StartedNodeServices.startFlow
must now be imported fromnet.corda.testing.node
Do not use
node.internals
to register flows:Previous code would often look as follows:
protected fun registerFlowsAndServices(node: StartedNode<MockNetwork.MockNode>) { val mockNode = node.internals class.java) mockNode.registerInitiatedFlow(MyCustomFlow:: }
Becomes:
protected fun registerFlowsAndServices(mockNode: StartedNode<MockNetwork.MockNode>) { class.java) mockNode.registerInitiatedFlow(MyCustomFlow:: }
Do not use
node.internals
to register Corda servicesPreviously:
node.internals.installCordaService(CustomService::class.java)
Becomes:
node.services.cordaService(CustomService::class.java)
Better yet, use node factory to organize both register flows and services, for example, create class as follows:
- class PrimesOracleNode(args: MockNodeArgs) : MockNetwork.MockNode(args) {
- override fun start() = super.start().apply {
registerInitiatedFlow(QueryHandler::class.java) registerInitiatedFlow(SignHandler::class.java) services.cordaService(net.corda.examples.oracle.service.service.Oracle::class.java)
}
and then pass it to
createNode
:val oracle = mockNet.createNode(MockNodeParameters(legalName = CordaX500Name("Oracle", "New York", "US")), ::PrimesOracleNode)
Node driver
User
has been moved fromnet.corda.nodeapi.User
tonet.corda.nodeapi.internal.config.User
Notaries are defined by passing a list of
NotarySpec
objects todriver
using thenotarySpecs
argument, instead of being defined manually in the driver block.notarySpecs
defaults to providing a single validating notaryThe
waitForAllNodesToFinish
function has been removed. It has been replaced with awaitForAllNodesToFinish
argument todriver
No longer specify advertised services to the
DriverDSL
when starting nodes:Previously:
driver {"Controller", "London", "GB"), advertisedServices = setOf(ServiceInfo(ValidatingNotaryService.type))) startNode(providedName = CordaX500Name(
Becomes:
driver {"Controller", "London", "GB")), startNode(providedName = CordaX500Name(
Finance
CASH_PROGRAM_ID
has been moved toCash.PROGRAM_ID
, whereCash
is defined in theimport net.corda.finance.contracts.asset
package
V1.0 to V2.0
You need to update the
corda_release_version
identifier in your project gradle file. The corda_gradle_plugins_version should remain at 1.0.0:ext.corda_release_version = '2.0.0' ext.corda_gradle_plugins_version = '1.0.0'
Public Beta (M12) to V1.0
From Milestone 14 <changelog_m14>
Build
MockNetwork has moved.
A new test driver module dependency needs to be including in your project:
corda-node-driver
. To continue using the mock network for testing, add the following entry to your gradle build file:testCompile "$corda_release_distribution:corda-node-driver:$corda_release_version"
Note
You may only need
testCompile "$corda_release_distribution:corda-test-utils:$corda_release_version"
if not using the Driver DSL
Configuration
CordaPluginRegistry
has been removed:- The one remaining configuration item
customizeSerialisation
, which defined a optional whitelist of types for use in object serialization, has been replaced with theSerializationWhitelist
interface which should be implemented to define a list of equivalent whitelisted classes - You will need to rename your services resource file. 'resources/META-INF/services/net.corda.core.node.CordaPluginRegistry' becomes 'resources/META-INF/services/net.corda.core.serialization.SerializationWhitelist'
MockNode.testPluginRegistries
was renamed toMockNode.testSerializationWhitelists
- In general, the
@CordaSerializable
annotation is the preferred method for whitelisting, as described inserialization
- The one remaining configuration item
Missing imports
Use IntelliJ's automatic imports feature to intelligently resolve the new imports:
Missing imports for contract types:
- CommercialPaper and Cash are now contained within the
finance
module, as are associated helpers functions. For example:
CommercialPaper and Cash are now contained within the
finance
module, as are associated helpers functions. For example:import net.corda.contracts.ICommercialPaperState
becomesimport net.corda.finance.contracts.ICommercialPaperState
import net.corda.contracts.asset.sumCashBy
becomesimport net.corda.finance.utils.sumCashBy
import net.corda.core.contracts.DOLLARS
becomesimport net.corda.finance.DOLLARS
import net.corda.core.contracts.issued by
becomesimport net.corda.finance.issued by
import net.corda.contracts.asset.Cash
becomesimport net.corda.finance.contracts.asset.Cash
- CommercialPaper and Cash are now contained within the
Missing imports for utility functions:
- Many common types and helper methods have been consolidated into
net.corda.core.utilities
package. For example:import net.corda.core.crypto.commonName
becomesimport net.corda.core.utilities.commonName
import net.corda.core.crypto.toBase58String
becomesimport net.corda.core.utilities.toBase58String
import net.corda.core.getOrThrow
becomesimport net.corda.core.utilities.getOrThrow
- Many common types and helper methods have been consolidated into
Missing flow imports:
- In general, all reusable library flows are contained within the core API
net.corda.core.flows
package - Financial domain library flows are contained within the finance module
net.corda.finance.flows
package - Other flows that have moved include
import net.corda.core.flows.ResolveTransactionsFlow
, which becomesimport net.corda.core.internal.ResolveTransactionsFlow
- In general, all reusable library flows are contained within the core API
Core data structures
- Missing
Contract
override:Contract.legalContractReference
has been removed, and replaced by the optional annotation@LegalProseReference(uri = "<URI>")
- Unresolved reference:
AuthenticatedObject
was renamed toCommandWithParties
- Overrides nothing:
LinearState.isRelevant
was removed. Whether a node stores aLinearState
in its vault depends on whether the node is one of the state'sparticipants
txBuilder.toLedgerTransaction
now requires aServiceHub
parameter. This is used by the new Contract Constraints functionality to validate and resolve attachments
Flow framework
FlowLogic
communication has been upgraded to use explicitFlowSession
instances to communicate between nodes:FlowLogic.send
/FlowLogic.receive
/FlowLogic.sendAndReceive
has been replaced byFlowSession.send
/FlowSession.receive
/FlowSession.sendAndReceive
. The replacement functions do not take a destination parameter, as this is defined implictly by the session used- Initiated flows now take in a
FlowSession
instead ofParty
in their constructor. If you need to access the counterparty identity, it is in thecounterparty
property of the flow session
FinalityFlow
now returns a singleSignedTransaction
, instead of aList<SignedTransaction>
TransactionKeyFlow
was renamed toSwapIdentitiesFlow
SwapIdentitiesFlow
must be imported from the confidential-identities packagenet.corda.confidential
Node services (ServiceHub)
- VaultQueryService: unresolved reference to
vaultQueryService
.- Replace all references to
<services>.vaultQueryService
with<services>.vaultService
- Previously there were two vault APIs. Now there is a single unified API with the same functions:
VaultService
.
- Replace all references to
FlowLogic.ourIdentity
has been introduced as a shortcut for retrieving our identity in a flowserviceHub.myInfo.legalIdentity
no longer existsgetAnyNotary
has been removed. UseserviceHub.networkMapCache.notaryIdentities[0]
insteadServiceHub.networkMapUpdates
is replaced byServiceHub.networkMapFeed
ServiceHub.partyFromX500Name
is replaced byServiceHub.wellKnownPartyFromX500Name
- A "well known" party is one that isn't anonymous. This change was motivated by the confidential identities work
RPC Client
- Missing API methods on the
CordaRPCOps
interface:verifiedTransactionsFeed
has been replaced byinternalVerifiedTransactionsFeed
verifiedTransactions
has been replaced byinternalVerifiedTransactionsSnapshot
- Accessing the
networkMapCache
viaservices.nodeInfo().legalIdentities
returns a list of identities. The first element in the list is the Party object referring to a node's single identity. - Accessing the
networkMapCache
viaservices.nodeInfo().legalIdentities
returns a list of identities- This change is in preparation for allowing a node to host multiple separate identities in the future
Testing
Please note that Clauses
have been removed completely as of V1.0. We will be revisiting this capability in a future release.
CorDapps must be explicitly registered in
MockNetwork
unit tests:This is done by calling
setCordappPackages
, an extension helper function in thenet.corda.testing
package, on the first line of your@Before
method. This takes a variable number ofString
arguments which should be the package names of the CorDapps containing the contract verification code you wish to load. You should unset CorDapp packages in your@After
method by usingunsetCordappPackages()
afterstopNodes()
.CorDapps must be explicitly registered in
DriverDSL
andRPCDriverDSL
integration tests:- You must register package names of the CorDapps containing the contract verification code you wish to load using the
extraCordappPackagesToScan: List<String>
constructor parameter of the driver DSL
- You must register package names of the CorDapps containing the contract verification code you wish to load using the
Finance
FungibleAsset
interface simplification:The following errors may be reported:
- override nothing (FungibleAsset):
move
- not a subtype of overridden FungibleAsset:
withNewOwner
- no longer need to override
override val contractHash: SecureHash? = null
- need to override
override val contract: Class<out Contract>? = null
- override nothing (FungibleAsset):
Miscellaneous
args[0].parseNetworkHostAndPort()
becomesNetworkHostAndPort.parse(args[0])
- There is no longer a
NodeInfo.advertisedServices
property- The concept of advertised services has been removed from Corda. This is because it was vaguely defined and real-world apps would not typically select random, unknown counterparties from the network map based on self-declared capabilities
- We will introduce a replacement for this functionality, business networks, in a future release
- For now, services should be retrieved by legal name using
NetworkMapCache.getNodeByLegalName
Gotchas
- Be sure to use the correct identity when issuing cash:
- The third parameter to
CashIssueFlow
should be the notary (and not the node identity)
- The third parameter to
From Milestone 13 <changelog_m13>
Core data structures
TransactionBuilder
changes:- Use convenience class
StateAndContract
instead ofTransactionBuilder.withItems
for passing around a state and its contract.
- Use convenience class
- Transaction builder DSL changes:
- now need to explicitly pass the ContractClassName into all inputs and outputs.
ContractClassName
refers to the class containing the “verifier” method.ContractClassName
is the name of theContract
subclass used to verify the transaction
- Contract verify method signature change:
override fun verify(tx: TransactionForContract)
becomesoverride fun verify(tx: LedgerTransaction)
- You no longer need to override
ContractState.contract
function
Node services (ServiceHub)
- ServiceHub API method changes:
services.networkMapUpdates().justSnapshot
becomesservices.networkMapSnapshot()
Configuration
- No longer need to define
CordaPluginRegistry
and configurerequiredSchemas
:- Custom contract schemas are automatically detected at startup time by class path scanning
- For testing purposes, use the
SchemaService
method to register new custom schemas (e.g.services.schemaService.registerCustomSchemas(setOf(YoSchemaV1))
)
Identity
- Party names are now
CordaX500Name
, notX500Name
:CordaX500Name
specifies a predefined set of mandatory (organisation, locality, country) and optional fields (common name, organisation unit, state) with validation checking- Use new builder
CordaX500Name.build(X500Name(target))
or explicitly define the X500Name parameters using theCordaX500Name
constructors
Testing
- MockNetwork testing:
- Mock nodes in node tests are now of type
StartedNode<MockNode>
, rather thanMockNode
MockNetwork
now returns aBasketOf(<StartedNode<MockNode>>)
- You must call internals on
StartedNode
to getMockNode
(e.g.a = nodes.partyNodes[0].internals
)
- Mock nodes in node tests are now of type
- Host and port changes:
- Use string helper function
parseNetworkHostAndPort
to parse a URL on startup (e.g.val hostAndPort = args[0].parseNetworkHostAndPort()
)
- Use string helper function
- Node driver parameter changes:
- The node driver parameters for starting a node have been reordered
- The node’s name needs to be given as an
CordaX500Name
, instead of usinggetX509Name
From Milestone 12 (First Public Beta) <changelog_m12>
Core data structures
- Transaction building:
- You no longer need to specify the type of a
TransactionBuilder
asTransactionType.General
TransactionType.General.Builder(notary)
becomesTransactionBuilder(notary)
- You no longer need to specify the type of a
Build
- Gradle dependency reference changes:
- Module names have changed to include
corda
in the artifacts' JAR names:
- Module names have changed to include
compile "$corda_release_distribution:core:$corda_release_version" -> compile "$corda_release_distribution:corda-core:$corda_release_version"
compile "$corda_release_distribution:finance:$corda_release_version" -> compile "$corda_release_distribution:corda-finance:$corda_release_version"
compile "$corda_release_distribution:jackson:$corda_release_version" -> compile "$corda_release_distribution:corda-jackson:$corda_release_version"
compile "$corda_release_distribution:node:$corda_release_version" -> compile "$corda_release_distribution:corda-node:$corda_release_version"
compile "$corda_release_distribution:rpc:$corda_release_version" -> compile "$corda_release_distribution:corda-rpc:$corda_release_version"
Node services (ServiceHub)
ServiceHub
API changes:services.networkMapUpdates
becomesservices.networkMapFeed
services.getCashBalances
becomes a helper method in the finance module contracts package (net.corda.finance.contracts.getCashBalances
)
Finance
Financial asset contracts (
Cash
,CommercialPaper
,Obligations
) are now a standalone CorDapp within thefinance
module:- You need to import them from their respective packages within the
finance
module (e.g.net.corda.finance.contracts.asset.Cash
) - You need to import the associated asset flows from their respective packages within
finance
module. For example:net.corda.finance.flows.CashIssueFlow
net.corda.finance.flows.CashIssueAndPaymentFlow
net.corda.finance.flows.CashExitFlow
This may require adjusting imports of Cash flow references and also of
StartFlow
permission ingradle.build
files. Associated flows (Cash*Flow
,TwoPartyTradeFlow
,TwoPartyDealFlow
) must now be imported from this package.- Adjust imports of Cash flow references
- Adjust the
StartFlow
permission ingradle.build
files - Adjust imports of the associated flows (
Cash*Flow
,TwoPartyTradeFlow
,TwoPartyDealFlow
)
- You need to import them from their respective packages within the