mirror of
https://github.com/corda/corda.git
synced 2025-01-14 16:59:52 +00:00
Disable Node Explorer and Database Viewer buttons until the node has launched and is responding to RPC.
This commit is contained in:
parent
37aa486bd7
commit
c734fbf8bb
@ -8,7 +8,7 @@ import net.corda.demobench.model.NodeConfig
|
||||
import net.corda.node.services.messaging.CordaRPCClient
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
class NodeRPC(config: NodeConfig, invoke: (CordaRPCOps) -> Unit): AutoCloseable {
|
||||
class NodeRPC(config: NodeConfig, start: () -> Unit, invoke: (CordaRPCOps) -> Unit): AutoCloseable {
|
||||
private val log = LoggerFactory.getLogger(NodeRPC::class.java)
|
||||
|
||||
companion object Data {
|
||||
@ -30,6 +30,7 @@ class NodeRPC(config: NodeConfig, invoke: (CordaRPCOps) -> Unit): AutoCloseable
|
||||
this.cancel()
|
||||
|
||||
log.info("Node '{}' is now ready.", config.legalName)
|
||||
start()
|
||||
|
||||
// Schedule a new task that will refresh the display once per second.
|
||||
timer.schedule(object: TimerTask() {
|
||||
|
@ -86,7 +86,12 @@ class NodeTerminalView : Fragment() {
|
||||
})
|
||||
}
|
||||
|
||||
fun launchRPC(config: NodeConfig) = NodeRPC(config, { ops ->
|
||||
fun enable() {
|
||||
launchExplorerButton.isDisable = false
|
||||
viewDatabaseButton.isDisable = false
|
||||
}
|
||||
|
||||
fun launchRPC(config: NodeConfig) = NodeRPC(config, start = { enable() }, invoke = { ops ->
|
||||
try {
|
||||
val verifiedTx = ops.verifiedTransactions()
|
||||
val statesInVault = ops.vaultAndUpdates()
|
||||
|
@ -25,8 +25,8 @@
|
||||
</children>
|
||||
</VBox>
|
||||
<Pane prefHeight="200.0" prefWidth="200.0" HBox.hgrow="ALWAYS" />
|
||||
<Button fx:id="viewDatabaseButton" mnemonicParsing="false" prefHeight="92.0" prefWidth="115.0" styleClass="big-button" text="View Database" textAlignment="CENTER" />
|
||||
<Button fx:id="launchExplorerButton" mnemonicParsing="false" prefHeight="92.0" prefWidth="115.0" styleClass="big-button" text="Launch Explorer" textAlignment="CENTER" />
|
||||
<Button fx:id="viewDatabaseButton" disable="true" mnemonicParsing="false" prefHeight="92.0" prefWidth="115.0" styleClass="big-button" text="View Database" textAlignment="CENTER" />
|
||||
<Button fx:id="launchExplorerButton" disable="true" mnemonicParsing="false" prefHeight="92.0" prefWidth="115.0" styleClass="big-button" text="Launch Explorer" textAlignment="CENTER" />
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
|
Loading…
Reference in New Issue
Block a user