mirror of
https://github.com/corda/corda.git
synced 2025-01-14 08:49:47 +00:00
Merge commit '29ccd4d' into os-merge-050318
This commit is contained in:
commit
596edcc2ae
@ -3054,28 +3054,30 @@ public static final class net.corda.core.serialization.SingletonSerializationTok
|
|||||||
public String toString()
|
public String toString()
|
||||||
##
|
##
|
||||||
@net.corda.core.DoNotImplement public final class net.corda.core.transactions.ContractUpgradeLedgerTransaction extends net.corda.core.transactions.FullTransaction implements net.corda.core.transactions.TransactionWithSignatures
|
@net.corda.core.DoNotImplement public final class net.corda.core.transactions.ContractUpgradeLedgerTransaction extends net.corda.core.transactions.FullTransaction implements net.corda.core.transactions.TransactionWithSignatures
|
||||||
public <init>(List, net.corda.core.identity.Party, net.corda.core.contracts.ContractAttachment, net.corda.core.contracts.ContractAttachment, net.corda.core.crypto.SecureHash, net.corda.core.contracts.PrivacySalt, List, net.corda.core.node.NetworkParameters)
|
public <init>(List, net.corda.core.identity.Party, net.corda.core.contracts.Attachment, String, net.corda.core.contracts.Attachment, net.corda.core.crypto.SecureHash, net.corda.core.contracts.PrivacySalt, List, net.corda.core.node.NetworkParameters)
|
||||||
public void checkSignaturesAreValid()
|
public void checkSignaturesAreValid()
|
||||||
@org.jetbrains.annotations.NotNull public final List component1()
|
@org.jetbrains.annotations.NotNull public final List component1()
|
||||||
@org.jetbrains.annotations.NotNull public final net.corda.core.identity.Party component2()
|
@org.jetbrains.annotations.NotNull public final net.corda.core.identity.Party component2()
|
||||||
@org.jetbrains.annotations.NotNull public final net.corda.core.contracts.ContractAttachment component3()
|
@org.jetbrains.annotations.NotNull public final net.corda.core.contracts.Attachment component3()
|
||||||
@org.jetbrains.annotations.NotNull public final net.corda.core.contracts.ContractAttachment component4()
|
@org.jetbrains.annotations.NotNull public final String component4()
|
||||||
@org.jetbrains.annotations.NotNull public final net.corda.core.crypto.SecureHash component5()
|
@org.jetbrains.annotations.NotNull public final net.corda.core.contracts.Attachment component5()
|
||||||
@org.jetbrains.annotations.NotNull public final net.corda.core.contracts.PrivacySalt component6()
|
@org.jetbrains.annotations.NotNull public final net.corda.core.crypto.SecureHash component6()
|
||||||
@org.jetbrains.annotations.NotNull public final List component7()
|
@org.jetbrains.annotations.NotNull public final net.corda.core.contracts.PrivacySalt component7()
|
||||||
@org.jetbrains.annotations.NotNull public final net.corda.core.transactions.ContractUpgradeLedgerTransaction copy(List, net.corda.core.identity.Party, net.corda.core.contracts.ContractAttachment, net.corda.core.contracts.ContractAttachment, net.corda.core.crypto.SecureHash, net.corda.core.contracts.PrivacySalt, List, net.corda.core.node.NetworkParameters)
|
@org.jetbrains.annotations.NotNull public final List component8()
|
||||||
|
@org.jetbrains.annotations.NotNull public final net.corda.core.transactions.ContractUpgradeLedgerTransaction copy(List, net.corda.core.identity.Party, net.corda.core.contracts.Attachment, String, net.corda.core.contracts.Attachment, net.corda.core.crypto.SecureHash, net.corda.core.contracts.PrivacySalt, List, net.corda.core.node.NetworkParameters)
|
||||||
public boolean equals(Object)
|
public boolean equals(Object)
|
||||||
@org.jetbrains.annotations.NotNull public net.corda.core.crypto.SecureHash getId()
|
@org.jetbrains.annotations.NotNull public net.corda.core.crypto.SecureHash getId()
|
||||||
@org.jetbrains.annotations.NotNull public List getInputs()
|
@org.jetbrains.annotations.NotNull public List getInputs()
|
||||||
@org.jetbrains.annotations.NotNull public List getKeyDescriptions(Set)
|
@org.jetbrains.annotations.NotNull public List getKeyDescriptions(Set)
|
||||||
@org.jetbrains.annotations.NotNull public final net.corda.core.contracts.ContractAttachment getLegacyContractAttachment()
|
@org.jetbrains.annotations.NotNull public final net.corda.core.contracts.Attachment getLegacyContractAttachment()
|
||||||
@org.jetbrains.annotations.NotNull public Set getMissingSigners()
|
@org.jetbrains.annotations.NotNull public Set getMissingSigners()
|
||||||
@org.jetbrains.annotations.NotNull public net.corda.core.identity.Party getNotary()
|
@org.jetbrains.annotations.NotNull public net.corda.core.identity.Party getNotary()
|
||||||
@org.jetbrains.annotations.NotNull public List getOutputs()
|
@org.jetbrains.annotations.NotNull public List getOutputs()
|
||||||
@org.jetbrains.annotations.NotNull public final net.corda.core.contracts.PrivacySalt getPrivacySalt()
|
@org.jetbrains.annotations.NotNull public final net.corda.core.contracts.PrivacySalt getPrivacySalt()
|
||||||
@org.jetbrains.annotations.NotNull public Set getRequiredSigningKeys()
|
@org.jetbrains.annotations.NotNull public Set getRequiredSigningKeys()
|
||||||
@org.jetbrains.annotations.NotNull public List getSigs()
|
@org.jetbrains.annotations.NotNull public List getSigs()
|
||||||
@org.jetbrains.annotations.NotNull public final net.corda.core.contracts.ContractAttachment getUpgradedContractAttachment()
|
@org.jetbrains.annotations.NotNull public final String getUpgradeContractClassName()
|
||||||
|
@org.jetbrains.annotations.NotNull public final net.corda.core.contracts.Attachment getUpgradedContractAttachment()
|
||||||
public int hashCode()
|
public int hashCode()
|
||||||
public String toString()
|
public String toString()
|
||||||
public void verifyRequiredSignatures()
|
public void verifyRequiredSignatures()
|
||||||
|
4
.idea/compiler.xml
generated
4
.idea/compiler.xml
generated
@ -24,6 +24,8 @@
|
|||||||
<module name="capsule-hsm-cert-generator_test" target="1.8" />
|
<module name="capsule-hsm-cert-generator_test" target="1.8" />
|
||||||
<module name="capsule-hsm_main" target="1.8" />
|
<module name="capsule-hsm_main" target="1.8" />
|
||||||
<module name="capsule-hsm_test" target="1.8" />
|
<module name="capsule-hsm_test" target="1.8" />
|
||||||
|
<module name="canonicalizer_main" target="1.8" />
|
||||||
|
<module name="canonicalizer_test" target="1.8" />
|
||||||
<module name="client_main" target="1.8" />
|
<module name="client_main" target="1.8" />
|
||||||
<module name="client_test" target="1.8" />
|
<module name="client_test" target="1.8" />
|
||||||
<module name="confidential-identities_main" target="1.8" />
|
<module name="confidential-identities_main" target="1.8" />
|
||||||
@ -171,4 +173,4 @@
|
|||||||
<component name="JavacSettings">
|
<component name="JavacSettings">
|
||||||
<option name="ADDITIONAL_OPTIONS_STRING" value="-parameters" />
|
<option name="ADDITIONAL_OPTIONS_STRING" value="-parameters" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
|
@ -72,6 +72,7 @@ buildscript {
|
|||||||
ext.liquibase_version = '3.5.3'
|
ext.liquibase_version = '3.5.3'
|
||||||
ext.shadow_version = '2.0.2'
|
ext.shadow_version = '2.0.2'
|
||||||
ext.hikari_version = '2.5.1'
|
ext.hikari_version = '2.5.1'
|
||||||
|
ext.artifactory_contextUrl = 'https://ci-artifactory.corda.r3cev.com/artifactory'
|
||||||
ext.snake_yaml_version = constants.getProperty('snakeYamlVersion')
|
ext.snake_yaml_version = constants.getProperty('snakeYamlVersion')
|
||||||
ext.docker_compose_rule_version = '0.33.0'
|
ext.docker_compose_rule_version = '0.33.0'
|
||||||
ext.selenium_version = '3.8.1'
|
ext.selenium_version = '3.8.1'
|
||||||
@ -90,6 +91,9 @@ buildscript {
|
|||||||
maven {
|
maven {
|
||||||
url 'https://dl.bintray.com/kotlin/kotlin-eap/'
|
url 'https://dl.bintray.com/kotlin/kotlin-eap/'
|
||||||
}
|
}
|
||||||
|
maven {
|
||||||
|
url "$artifactory_contextUrl/corda-releases"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
@ -221,6 +225,7 @@ allprojects {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
jcenter()
|
jcenter()
|
||||||
maven { url 'https://jitpack.io' }
|
maven { url 'https://jitpack.io' }
|
||||||
|
maven { url "$artifactory_contextUrl/corda-releases" } // cordform-common
|
||||||
maven {
|
maven {
|
||||||
// For integrationTest task when running against Oracle database the JDBC driver is in Oracle Maven repository with login access only,
|
// For integrationTest task when running against Oracle database the JDBC driver is in Oracle Maven repository with login access only,
|
||||||
// setup an account on https://login.oracle.com/oaam_server/login.do
|
// setup an account on https://login.oracle.com/oaam_server/login.do
|
||||||
@ -347,7 +352,7 @@ task buildCordappDependenciesZip(type: Zip) {
|
|||||||
|
|
||||||
artifactory {
|
artifactory {
|
||||||
publish {
|
publish {
|
||||||
contextUrl = 'https://ci-artifactory.corda.r3cev.com/artifactory'
|
contextUrl = artifactory_contextUrl
|
||||||
repository {
|
repository {
|
||||||
repoKey = 'enterprise-dev'
|
repoKey = 'enterprise-dev'
|
||||||
username = 'teamcity'
|
username = 'teamcity'
|
||||||
|
@ -47,7 +47,6 @@ public class StandaloneCordaRPCJavaClientTest {
|
|||||||
port.getAndIncrement(),
|
port.getAndIncrement(),
|
||||||
port.getAndIncrement(),
|
port.getAndIncrement(),
|
||||||
port.getAndIncrement(),
|
port.getAndIncrement(),
|
||||||
port.getAndIncrement(),
|
|
||||||
true,
|
true,
|
||||||
Collections.singletonList(rpcUser),
|
Collections.singletonList(rpcUser),
|
||||||
true,
|
true,
|
||||||
|
@ -61,7 +61,6 @@ class StandaloneCordaRPClientTest {
|
|||||||
p2pPort = port.andIncrement,
|
p2pPort = port.andIncrement,
|
||||||
rpcPort = port.andIncrement,
|
rpcPort = port.andIncrement,
|
||||||
rpcAdminPort = port.andIncrement,
|
rpcAdminPort = port.andIncrement,
|
||||||
webPort = port.andIncrement,
|
|
||||||
isNotary = true,
|
isNotary = true,
|
||||||
users = listOf(user)
|
users = listOf(user)
|
||||||
)
|
)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
gradlePluginsVersion=4.0.4
|
gradlePluginsVersion=4.0.5
|
||||||
kotlinVersion=1.2.20
|
kotlinVersion=1.2.20
|
||||||
platformVersion=4
|
platformVersion=4
|
||||||
guavaVersion=21.0
|
guavaVersion=21.0
|
||||||
|
@ -48,7 +48,6 @@ data class ContractUpgradeWireTransaction(
|
|||||||
/** Resolves input states and contract attachments, and builds a ContractUpgradeLedgerTransaction. */
|
/** Resolves input states and contract attachments, and builds a ContractUpgradeLedgerTransaction. */
|
||||||
fun resolve(services: ServicesForResolution, sigs: List<TransactionSignature>): ContractUpgradeLedgerTransaction {
|
fun resolve(services: ServicesForResolution, sigs: List<TransactionSignature>): ContractUpgradeLedgerTransaction {
|
||||||
val resolvedInputs = services.loadStates(inputs.toSet()).toList()
|
val resolvedInputs = services.loadStates(inputs.toSet()).toList()
|
||||||
val legacyContractClassName = resolvedInputs.first().state.contract
|
|
||||||
val legacyContractAttachment = services.attachments.openAttachment(legacyContractAttachmentId)
|
val legacyContractAttachment = services.attachments.openAttachment(legacyContractAttachmentId)
|
||||||
?: throw AttachmentResolutionException(legacyContractAttachmentId)
|
?: throw AttachmentResolutionException(legacyContractAttachmentId)
|
||||||
val upgradedContractAttachment = services.attachments.openAttachment(upgradedContractAttachmentId)
|
val upgradedContractAttachment = services.attachments.openAttachment(upgradedContractAttachmentId)
|
||||||
@ -56,8 +55,9 @@ data class ContractUpgradeWireTransaction(
|
|||||||
return ContractUpgradeLedgerTransaction(
|
return ContractUpgradeLedgerTransaction(
|
||||||
resolvedInputs,
|
resolvedInputs,
|
||||||
notary,
|
notary,
|
||||||
ContractAttachment(legacyContractAttachment, legacyContractClassName),
|
legacyContractAttachment,
|
||||||
ContractAttachment(upgradedContractAttachment, upgradeContractClassName),
|
upgradeContractClassName,
|
||||||
|
upgradedContractAttachment,
|
||||||
id,
|
id,
|
||||||
privacySalt,
|
privacySalt,
|
||||||
sigs,
|
sigs,
|
||||||
@ -102,40 +102,47 @@ data class ContractUpgradeFilteredTransaction(
|
|||||||
data class ContractUpgradeLedgerTransaction(
|
data class ContractUpgradeLedgerTransaction(
|
||||||
override val inputs: List<StateAndRef<ContractState>>,
|
override val inputs: List<StateAndRef<ContractState>>,
|
||||||
override val notary: Party,
|
override val notary: Party,
|
||||||
val legacyContractAttachment: ContractAttachment,
|
val legacyContractAttachment: Attachment,
|
||||||
val upgradedContractAttachment: ContractAttachment,
|
val upgradeContractClassName: ContractClassName,
|
||||||
|
val upgradedContractAttachment: Attachment,
|
||||||
override val id: SecureHash,
|
override val id: SecureHash,
|
||||||
val privacySalt: PrivacySalt,
|
val privacySalt: PrivacySalt,
|
||||||
override val sigs: List<TransactionSignature>,
|
override val sigs: List<TransactionSignature>,
|
||||||
private val networkParameters: NetworkParameters
|
private val networkParameters: NetworkParameters
|
||||||
) : FullTransaction(), TransactionWithSignatures {
|
) : FullTransaction(), TransactionWithSignatures {
|
||||||
|
/** The legacy contract class name is determined by the first input state. */
|
||||||
|
private val legacyContractClassName = inputs.first().state.contract
|
||||||
private val upgradedContract: UpgradedContract<ContractState, *> = loadUpgradedContract()
|
private val upgradedContract: UpgradedContract<ContractState, *> = loadUpgradedContract()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
// TODO: relax this constraint once upgrading encumbered states is supported
|
// TODO: relax this constraint once upgrading encumbered states is supported.
|
||||||
check(inputs.all { it.state.contract == legacyContractAttachment.contract }) {
|
check(inputs.all { it.state.contract == legacyContractClassName }) {
|
||||||
"All input states must point to the legacy contract"
|
"All input states must point to the legacy contract"
|
||||||
}
|
}
|
||||||
check(inputs.all { it.state.constraint.isSatisfiedBy(legacyContractAttachment) }) {
|
check(upgradedContract.legacyContract == legacyContractClassName) {
|
||||||
"Legacy contract constraint does not satisfy the constraint of the input states"
|
|
||||||
}
|
|
||||||
verifyLegacyContractConstraint()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun verifyLegacyContractConstraint() {
|
|
||||||
check(upgradedContract.legacyContract == legacyContractAttachment.contract) {
|
|
||||||
"Outputs' contract must be an upgraded version of the inputs' contract"
|
"Outputs' contract must be an upgraded version of the inputs' contract"
|
||||||
}
|
}
|
||||||
val attachmentWithContext = AttachmentWithContext(
|
verifyConstraints()
|
||||||
legacyContractAttachment,
|
}
|
||||||
|
|
||||||
|
private fun verifyConstraints() {
|
||||||
|
val attachmentForConstraintVerification = AttachmentWithContext(
|
||||||
|
legacyContractAttachment as? ContractAttachment
|
||||||
|
?: ContractAttachment(legacyContractAttachment, legacyContractClassName),
|
||||||
upgradedContract.legacyContract,
|
upgradedContract.legacyContract,
|
||||||
networkParameters.whitelistedContractImplementations
|
networkParameters.whitelistedContractImplementations
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// TODO: exclude encumbrance states from this check
|
||||||
|
check(inputs.all { it.state.constraint.isSatisfiedBy(attachmentForConstraintVerification) }) {
|
||||||
|
"Legacy contract constraint does not satisfy the constraint of the input states"
|
||||||
|
}
|
||||||
|
|
||||||
val constraintCheck = if (upgradedContract is UpgradedContractWithLegacyConstraint) {
|
val constraintCheck = if (upgradedContract is UpgradedContractWithLegacyConstraint) {
|
||||||
upgradedContract.legacyContractConstraint.isSatisfiedBy(attachmentWithContext)
|
upgradedContract.legacyContractConstraint.isSatisfiedBy(attachmentForConstraintVerification)
|
||||||
} else {
|
} else {
|
||||||
// If legacy constraint not specified, defaulting to WhitelistedByZoneAttachmentConstraint
|
// If legacy constraint not specified, defaulting to WhitelistedByZoneAttachmentConstraint
|
||||||
WhitelistedByZoneAttachmentConstraint.isSatisfiedBy(attachmentWithContext)
|
WhitelistedByZoneAttachmentConstraint.isSatisfiedBy(attachmentForConstraintVerification)
|
||||||
}
|
}
|
||||||
check(constraintCheck) {
|
check(constraintCheck) {
|
||||||
"Legacy contract does not satisfy the upgraded contract's constraint"
|
"Legacy contract does not satisfy the upgraded contract's constraint"
|
||||||
@ -158,7 +165,7 @@ data class ContractUpgradeLedgerTransaction(
|
|||||||
// TODO: re-map encumbrance pointers
|
// TODO: re-map encumbrance pointers
|
||||||
input.state.copy(
|
input.state.copy(
|
||||||
data = upgradedState,
|
data = upgradedState,
|
||||||
contract = upgradedContractAttachment.contract,
|
contract = upgradeContractClassName,
|
||||||
constraint = outputConstraint
|
constraint = outputConstraint
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -175,7 +182,7 @@ data class ContractUpgradeLedgerTransaction(
|
|||||||
private fun loadUpgradedContract(): UpgradedContract<ContractState, *> {
|
private fun loadUpgradedContract(): UpgradedContract<ContractState, *> {
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
return this::class.java.classLoader
|
return this::class.java.classLoader
|
||||||
.loadClass(upgradedContractAttachment.contract)
|
.loadClass(upgradeContractClassName)
|
||||||
.asSubclass(Contract::class.java)
|
.asSubclass(Contract::class.java)
|
||||||
.getConstructor()
|
.getConstructor()
|
||||||
.newInstance() as UpgradedContract<ContractState, *>
|
.newInstance() as UpgradedContract<ContractState, *>
|
||||||
|
@ -38,7 +38,6 @@ class NodeVersioningTest {
|
|||||||
p2pPort = port.andIncrement,
|
p2pPort = port.andIncrement,
|
||||||
rpcPort = port.andIncrement,
|
rpcPort = port.andIncrement,
|
||||||
rpcAdminPort = port.andIncrement,
|
rpcAdminPort = port.andIncrement,
|
||||||
webPort = port.andIncrement,
|
|
||||||
isNotary = false,
|
isNotary = false,
|
||||||
users = listOf(user)
|
users = listOf(user)
|
||||||
)
|
)
|
||||||
|
@ -34,7 +34,6 @@ class CordappSmokeTest {
|
|||||||
p2pPort = port.andIncrement,
|
p2pPort = port.andIncrement,
|
||||||
rpcPort = port.andIncrement,
|
rpcPort = port.andIncrement,
|
||||||
rpcAdminPort = port.andIncrement,
|
rpcAdminPort = port.andIncrement,
|
||||||
webPort = port.andIncrement,
|
|
||||||
isNotary = false,
|
isNotary = false,
|
||||||
users = listOf(user)
|
users = listOf(user)
|
||||||
)
|
)
|
||||||
|
@ -58,9 +58,10 @@ signed ``NodeInfo`` object that the network map service vends. These are automat
|
|||||||
be used to supplement or replace the HTTP network map. If the same node is advertised through both mechanisms then the
|
be used to supplement or replace the HTTP network map. If the same node is advertised through both mechanisms then the
|
||||||
latest one is taken.
|
latest one is taken.
|
||||||
|
|
||||||
On startup the node generates its own signed node info file, filename of the format ``nodeInfo-${hash}``. To create a simple
|
On startup the node generates its own signed node info file, filename of the format ``nodeInfo-${hash}``. It can also be
|
||||||
network without the HTTP network map service then simply place this file in the ``additional-node-infos`` directory
|
generated using the ``--just-generate-node-info`` command line flag without starting the node. To create a simple network
|
||||||
of every node that's part of this network. For example, a simple way to do this is to use rsync.
|
without the HTTP network map service simply place this file in the ``additional-node-infos`` directory of every node that's
|
||||||
|
part of this network. For example, a simple way to do this is to use rsync.
|
||||||
|
|
||||||
Usually, test networks have a structure that is known ahead of time. For the creation of such networks we provide a
|
Usually, test networks have a structure that is known ahead of time. For the creation of such networks we provide a
|
||||||
``network-bootstrapper`` tool. This tool pre-generates node configuration directories if given the IP addresses/domain
|
``network-bootstrapper`` tool. This tool pre-generates node configuration directories if given the IP addresses/domain
|
||||||
@ -98,13 +99,20 @@ The current set of network parameters:
|
|||||||
|
|
||||||
:minimumPlatformVersion: The minimum platform version that the nodes must be running. Any node which is below this will
|
:minimumPlatformVersion: The minimum platform version that the nodes must be running. Any node which is below this will
|
||||||
not start.
|
not start.
|
||||||
|
|
||||||
:notaries: List of identity and validation type (either validating or non-validating) of the notaries which are permitted
|
:notaries: List of identity and validation type (either validating or non-validating) of the notaries which are permitted
|
||||||
in the compatibility zone.
|
in the compatibility zone.
|
||||||
:maxMessageSize: Maximum allowed size in bytes of an individual message sent over the wire. Note that attachments are
|
|
||||||
|
:maxMessageSize: (This is currently ignored. However, it will be wired up in a future release.)
|
||||||
|
|
||||||
|
.. TODO Replace the above with this once wired: Maximum allowed size in bytes of an individual message sent over the wire. Note that attachments are
|
||||||
a special case and may be fragmented for streaming transfer, however, an individual transaction or flow message
|
a special case and may be fragmented for streaming transfer, however, an individual transaction or flow message
|
||||||
may not be larger than this value.
|
may not be larger than this value.
|
||||||
|
|
||||||
:maxTransactionSize: Maximum allowed size in bytes of a transaction. This is the size of the transaction object and its attachments.
|
:maxTransactionSize: Maximum allowed size in bytes of a transaction. This is the size of the transaction object and its attachments.
|
||||||
|
|
||||||
:modifiedTime: The time when the network parameters were last modified by the compatibility zone operator.
|
:modifiedTime: The time when the network parameters were last modified by the compatibility zone operator.
|
||||||
|
|
||||||
:epoch: Version number of the network parameters. Starting from 1, this will always increment whenever any of the
|
:epoch: Version number of the network parameters. Starting from 1, this will always increment whenever any of the
|
||||||
parameters change.
|
parameters change.
|
||||||
:whitelistedContractImplementations: List of whitelisted versions of contract code.
|
:whitelistedContractImplementations: List of whitelisted versions of contract code.
|
||||||
|
@ -93,6 +93,9 @@ open class Node(configuration: NodeConfiguration,
|
|||||||
CordappLoader.createDefaultWithTestPackages(configuration, scanPackages.split(scanPackagesSeparator))
|
CordappLoader.createDefaultWithTestPackages(configuration, scanPackages.split(scanPackagesSeparator))
|
||||||
} ?: CordappLoader.createDefault(configuration.baseDirectory)
|
} ?: CordappLoader.createDefault(configuration.baseDirectory)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO Wire up maxMessageSize
|
||||||
|
const val MAX_FILE_SIZE = 10485760
|
||||||
}
|
}
|
||||||
|
|
||||||
override val log: Logger get() = staticLog
|
override val log: Logger get() = staticLog
|
||||||
@ -166,7 +169,7 @@ open class Node(configuration: NodeConfiguration,
|
|||||||
startLocalRpcBroker(networkParameters)
|
startLocalRpcBroker(networkParameters)
|
||||||
}
|
}
|
||||||
val advertisedAddress = info.addresses[0]
|
val advertisedAddress = info.addresses[0]
|
||||||
bridgeControlListener = BridgeControlListener(configuration, serverAddress, networkParameters.maxMessageSize)
|
bridgeControlListener = BridgeControlListener(configuration, serverAddress, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE)
|
||||||
|
|
||||||
printBasicNodeInfo("Advertised P2P messaging addresses", info.addresses.joinToString())
|
printBasicNodeInfo("Advertised P2P messaging addresses", info.addresses.joinToString())
|
||||||
|
|
||||||
@ -174,10 +177,10 @@ open class Node(configuration: NodeConfiguration,
|
|||||||
rpcThreadPoolSize = configuration.enterpriseConfiguration.tuning.rpcThreadPoolSize
|
rpcThreadPoolSize = configuration.enterpriseConfiguration.tuning.rpcThreadPoolSize
|
||||||
)
|
)
|
||||||
rpcServerAddresses?.let {
|
rpcServerAddresses?.let {
|
||||||
rpcMessagingClient = RPCMessagingClient(configuration.rpcOptions.sslConfig, it.admin, networkParameters.maxMessageSize, rpcServerConfiguration)
|
rpcMessagingClient = RPCMessagingClient(configuration.rpcOptions.sslConfig, it.admin, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE, rpcServerConfiguration)
|
||||||
}
|
}
|
||||||
verifierMessagingClient = when (configuration.verifierType) {
|
verifierMessagingClient = when (configuration.verifierType) {
|
||||||
VerifierType.OutOfProcess -> VerifierMessagingClient(configuration, serverAddress, services.monitoringService.metrics, networkParameters.maxMessageSize)
|
VerifierType.OutOfProcess -> VerifierMessagingClient(configuration, serverAddress, services.monitoringService.metrics, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE)
|
||||||
VerifierType.InMemory -> null
|
VerifierType.InMemory -> null
|
||||||
}
|
}
|
||||||
require(info.legalIdentities.size in 1..2) { "Currently nodes must have a primary address and optionally one serviced address" }
|
require(info.legalIdentities.size in 1..2) { "Currently nodes must have a primary address and optionally one serviced address" }
|
||||||
@ -193,7 +196,7 @@ open class Node(configuration: NodeConfiguration,
|
|||||||
services.networkMapCache,
|
services.networkMapCache,
|
||||||
services.monitoringService.metrics,
|
services.monitoringService.metrics,
|
||||||
advertisedAddress,
|
advertisedAddress,
|
||||||
networkParameters.maxMessageSize,
|
/*networkParameters.maxMessageSize*/MAX_FILE_SIZE,
|
||||||
nodeProperties.flowsDrainingMode::isEnabled,
|
nodeProperties.flowsDrainingMode::isEnabled,
|
||||||
nodeProperties.flowsDrainingMode.values)
|
nodeProperties.flowsDrainingMode.values)
|
||||||
}
|
}
|
||||||
@ -205,24 +208,9 @@ open class Node(configuration: NodeConfiguration,
|
|||||||
val rpcBrokerDirectory: Path = baseDirectory / "brokers" / "rpc"
|
val rpcBrokerDirectory: Path = baseDirectory / "brokers" / "rpc"
|
||||||
with(rpcOptions) {
|
with(rpcOptions) {
|
||||||
rpcBroker = if (useSsl) {
|
rpcBroker = if (useSsl) {
|
||||||
ArtemisRpcBroker.withSsl(
|
ArtemisRpcBroker.withSsl(this.address!!, sslConfig, securityManager, certificateChainCheckPolicies, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE, jmxMonitoringHttpPort != null, rpcBrokerDirectory)
|
||||||
this.address!!,
|
|
||||||
sslConfig,
|
|
||||||
securityManager,
|
|
||||||
certificateChainCheckPolicies,
|
|
||||||
networkParameters.maxMessageSize,
|
|
||||||
jmxMonitoringHttpPort != null,
|
|
||||||
rpcBrokerDirectory)
|
|
||||||
} else {
|
} else {
|
||||||
ArtemisRpcBroker.withoutSsl(
|
ArtemisRpcBroker.withoutSsl(this.address!!, adminAddress!!, sslConfig, securityManager, certificateChainCheckPolicies, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE, jmxMonitoringHttpPort != null, rpcBrokerDirectory)
|
||||||
this.address!!,
|
|
||||||
adminAddress!!,
|
|
||||||
sslConfig,
|
|
||||||
securityManager,
|
|
||||||
certificateChainCheckPolicies,
|
|
||||||
networkParameters.maxMessageSize,
|
|
||||||
jmxMonitoringHttpPort != null,
|
|
||||||
rpcBrokerDirectory)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rpcBroker!!.addresses
|
return rpcBroker!!.addresses
|
||||||
@ -232,7 +220,7 @@ open class Node(configuration: NodeConfiguration,
|
|||||||
|
|
||||||
private fun makeLocalMessageBroker(networkParameters: NetworkParameters): NetworkHostAndPort {
|
private fun makeLocalMessageBroker(networkParameters: NetworkParameters): NetworkHostAndPort {
|
||||||
with(configuration) {
|
with(configuration) {
|
||||||
messageBroker = ArtemisMessagingServer(this, p2pAddress.port, networkParameters.maxMessageSize)
|
messageBroker = ArtemisMessagingServer(this, p2pAddress.port, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE)
|
||||||
return NetworkHostAndPort("localhost", p2pAddress.port)
|
return NetworkHostAndPort("localhost", p2pAddress.port)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,6 @@ class NodeConfig(
|
|||||||
val p2pPort: Int,
|
val p2pPort: Int,
|
||||||
val rpcPort: Int,
|
val rpcPort: Int,
|
||||||
val rpcAdminPort: Int,
|
val rpcAdminPort: Int,
|
||||||
val webPort: Int,
|
|
||||||
val isNotary: Boolean,
|
val isNotary: Boolean,
|
||||||
val users: List<User>,
|
val users: List<User>,
|
||||||
val runMigration: Boolean = true,
|
val runMigration: Boolean = true,
|
||||||
@ -34,7 +33,6 @@ class NodeConfig(
|
|||||||
val config = empty()
|
val config = empty()
|
||||||
.withValue("myLegalName", valueFor(legalName.toString()))
|
.withValue("myLegalName", valueFor(legalName.toString()))
|
||||||
.withValue("p2pAddress", addressValueFor(p2pPort))
|
.withValue("p2pAddress", addressValueFor(p2pPort))
|
||||||
.withValue("webAddress", addressValueFor(webPort))
|
|
||||||
.withValue("rpcSettings", empty()
|
.withValue("rpcSettings", empty()
|
||||||
.withValue("address", addressValueFor(rpcPort))
|
.withValue("address", addressValueFor(rpcPort))
|
||||||
.withValue("adminAddress", addressValueFor(rpcAdminPort))
|
.withValue("adminAddress", addressValueFor(rpcAdminPort))
|
||||||
|
Loading…
Reference in New Issue
Block a user