mirror of
https://github.com/corda/corda.git
synced 2024-12-20 05:28:21 +00:00
Cordformation now allows addresses to be used for non-database addresses. (#1917)
Cordformation now allows addresses to be used for non-database addresses.
This commit is contained in:
parent
f614557ae3
commit
dcaac91691
@ -254,9 +254,9 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
|
||||
}
|
||||
node {
|
||||
name "O=Bank B,OU=corda,L=London,C=GB"
|
||||
p2pPort 10007
|
||||
rpcPort 10008
|
||||
webPort 10009
|
||||
p2pAddress "localhost:10007"
|
||||
rpcAddress "localhost:10008"
|
||||
webAddress "localhost:10009"
|
||||
cordapps = []
|
||||
}
|
||||
}
|
||||
|
@ -41,11 +41,12 @@ notary node:
|
||||
cordapps = []
|
||||
rpcUsers = [[ user: "user1", "password": "test", "permissions": []]]
|
||||
}
|
||||
// Example of explicit addresses being used.
|
||||
node {
|
||||
name "CN=NodeC,O=NodeC,L=Paris,C=FR"
|
||||
p2pPort 10011
|
||||
rpcPort 10012
|
||||
webPort 10013
|
||||
p2pAddress "localhost:10011"
|
||||
rpcAddress "localhost:10012"
|
||||
webAddress "localhost:10013"
|
||||
cordapps = []
|
||||
rpcUsers = [[ user: "user1", "password": "test", "permissions": []]]
|
||||
}
|
||||
|
@ -58,7 +58,16 @@ public class CordformNode implements NodeDefinition {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Artemis P2P port for this node.
|
||||
* Get the artemis address for this node.
|
||||
*
|
||||
* @return This node's P2P address.
|
||||
*/
|
||||
public String getP2pAddress() {
|
||||
return config.getString("p2pAddress");
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Artemis P2P port for this node on localhost.
|
||||
*
|
||||
* @param p2pPort The Artemis messaging queue port.
|
||||
*/
|
||||
@ -67,7 +76,16 @@ public class CordformNode implements NodeDefinition {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Artemis RPC port for this node.
|
||||
* Set the Artemis P2P address for this node.
|
||||
*
|
||||
* @param p2pAddress The Artemis messaging queue host and port.
|
||||
*/
|
||||
public void p2pAddress(String p2pAddress) {
|
||||
config = config.withValue("p2pAddress", ConfigValueFactory.fromAnyRef(p2pAddress));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Artemis RPC port for this node on localhost.
|
||||
*
|
||||
* @param rpcPort The Artemis RPC queue port.
|
||||
*/
|
||||
@ -75,6 +93,15 @@ public class CordformNode implements NodeDefinition {
|
||||
config = config.withValue("rpcAddress", ConfigValueFactory.fromAnyRef(DEFAULT_HOST + ':' + rpcPort));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Artemis RPC address for this node.
|
||||
*
|
||||
* @param rpcAddress The Artemis RPC queue host and port.
|
||||
*/
|
||||
public void rpcAddress(String rpcAddress) {
|
||||
config = config.withValue("rpcAddress", ConfigValueFactory.fromAnyRef(rpcAddress));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the path to a file with optional properties, which are appended to the generated node.conf file.
|
||||
*
|
||||
|
@ -61,7 +61,7 @@ class Node(private val project: Project) : CordformNode() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the HTTP web server port for this node.
|
||||
* Set the HTTP web server port for this node. Will use localhost as the address.
|
||||
*
|
||||
* @param webPort The web port number for this node.
|
||||
*/
|
||||
@ -70,6 +70,16 @@ class Node(private val project: Project) : CordformNode() {
|
||||
ConfigValueFactory.fromAnyRef("$DEFAULT_HOST:$webPort"))
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the HTTP web server address and port for this node.
|
||||
*
|
||||
* @param webAddress The web address for this node.
|
||||
*/
|
||||
fun webAddress(webAddress: String) {
|
||||
config = config.withValue("webAddress",
|
||||
ConfigValueFactory.fromAnyRef(webAddress))
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the network map address for this node.
|
||||
*
|
||||
@ -107,15 +117,6 @@ class Node(private val project: Project) : CordformNode() {
|
||||
appendOptionalConfig()
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the artemis address for this node.
|
||||
*
|
||||
* @return This node's P2P address.
|
||||
*/
|
||||
fun getP2PAddress(): String {
|
||||
return config.getString("p2pAddress")
|
||||
}
|
||||
|
||||
internal fun rootDir(rootDir: Path) {
|
||||
if(name == null) {
|
||||
project.logger.error("Node has a null name - cannot create node")
|
||||
|
Loading…
Reference in New Issue
Block a user