brew install docker kubectl helm
You can do this with docker for mac by enabling kubernetes
Make sure to set docker for mac's resources for this demo. Ideally 8GB CPU, and 12GB of Memory.
class CarIssueFlow { | |
@InitiatingFlow | |
@StartableByRPC | |
class Initiator(var owningBank: Party, var holdingDealer: Party) : FlowLogic<SignedTransaction?>() { | |
@Suspendable | |
@Throws(FlowException::class) | |
override fun call(): SignedTransaction { | |
// find a notary for the transaction | |
val notary = serviceHub.networkMapCache.notaryIdentities[0] | |
// get a reference to the manufacturer node, the only node that can issue new cars |
class CarContract : Contract { | |
@Throws(IllegalArgumentException::class) | |
override fun verify(tx: LedgerTransaction) { | |
val (signers, _, value) = tx.commands.requireSingleCommand(Commands::class.java) | |
val inputs = tx.inputStates | |
val outputs = tx.outputStates | |
if (value is Commands.Issue) { | |
requireThat { | |
"Transaction must have no input states.".using(inputs.isEmpty()) | |
"Transaction must have exactly one output.".using(outputs.size == 1) |
@BelongsToContract(CarContract::class) | |
class CarState(private val owningBank: Party, | |
private val holdingDealer: Party, | |
private val manufacturer: Party, | |
private val vin: String, | |
private val licensePlateNumber: String, | |
private val make: String, | |
private val model: String, | |
private val dealershipLocation: String) : ContractState { | |
// Example Creating an account by using sub-flow (from inside a flow). | |
val accountInfo: StateAndRef<AccountInfo> = subFlow(CreateAccount("David's account")) |
node { | |
name "O=PartyA,L=London,C=GB" | |
p2pPort 10006 | |
rpcSettings { | |
address("localhost:10016") | |
adminAddress("localhost:10046") | |
} | |
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]] | |
} |
FROM corda/corda-zulu-java1.8-4.6 | |
# from https://github.com/corda/bank-in-a-box/blob/release/bankinabox/1.0/docker/corda-node/Dockerfile | |
USER "root" | |
## Add packages, clean cache, create dirs, create corda user and change ownership | |
RUN apt-get update && \ | |
apt-get install -y wget | |
## PostgreSQL JDBC |
brew install docker kubectl helm
You can do this with docker for mac by enabling kubernetes
Make sure to set docker for mac's resources for this demo. Ideally 8GB CPU, and 12GB of Memory.
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: admin-user | |
namespace: kubernetes-dashboard | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: admin-user |
Logger logger = LoggerFactory.getLogger("net.corda"); // note this logger's name is specified in the xml config | |
Party me = getOurIdentity(); | |
// we have an opportunity to log out the contents of the flow arguments. | |
ThreadContext.put("initiator", me.getName().toString()); | |
ThreadContext.put("target", target.getName().toString()); | |
// publish to the log with the additional context | |
logger.info("Initializing the transaction."); | |
// flush the threadContext of these additional properties | |
ThreadContext.removeAll(Arrays.asList("initiator", "target")); |
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Be aware that this is a configuration file for Apache log4j, | |
This example file will log json files but there are many other configurations | |
You can also use files such as ../sql.xml as well. | |
--> | |
<Configuration status="info"> | |
<Appenders> | |
<Console name="ConsoleJSONAppender" target="SYSTEM_OUT"> |