how the previous block details comes in corda - corda

The vault contains data extracted from the ledger that is considered relevant to the node’s owner, stored in a relational model that can be easily queried and worked with.If both exists on same node, is it that the vault database is something that we have access to (vault data) and not the distributed ledger (but only by means of internal API for Corda).

You can think of the entire distributed ledger in Corda as being a combination of everyone's segmented view of the ledger. For example, if on a particular network, Node A and Node B were to transact, these two would each hold representations of the states involved in the transaction in each of their vaults.
If Node C and Node D were to also transact, likewise they would store the states relevant to their transaction. If the network were comprised entirely of just Nodes A, B, C and D then together all these states would form the entire distributed ledger with each node holding only the states relevant to them.
Each node can access their own segment of the distributed ledger by querying for data from their vault.

Related

DynamoDB What are coordinator nodes in context of replication?

So i was going through this paper :- http://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf
There in the part of replication they have mentioned that Each key k is assigned to a coordinator node. Is this coordinator node the actual physicial nodes in context of consistent hashing? Of are there some specific nodes out of physicial nodes assigned this task of being coordinator nodes.
Also they have mentioned that there are more than N nodes mentioned in preference list. However if a key is replicated to N-1 physicial nodes does this prefrence list has virtial nodes too?
I am little confused here
That 2007 paper covers "Dynamo", which is a database that came before the DynamoDB service. You can't read it to understand how DynamoDB works.
Here's a paper about DynamoDB, if you like reading conference papers instead of documentation: https://www.usenix.org/system/files/atc22-elhemali.pdf

Do check-pointed flows between two parties share an Id?

If a bilateral flow is kicked off between two parties, first checkpointed by Party A and then by Party B, do those flows share an Id?
e.g. - if I search through the checkpoints on both nodes, will I be able to match them?
As of Corda 4.1 the checkpoint on two nodes will be different. The id of the checkpoint is based on the id of the FlowStateMachine. This state machine is not shared between the two nodes and therefore will have a unique id on each node.
Here is how checkpoints are added to the node vault: https://github.com/corda/corda/blob/release/4.1/node/src/main/kotlin/net/corda/node/services/persistence/DBCheckpointStorage.kt#L42

How can I check whether a state is existed globally in Corda?

I have a state with a global ID. I want to check whether the state is already issued by other node before I issue the state.
Is there a way I can check the state on the whole chain or I have to notify all of the nodes about issuing new state?
Corda's privacy model means that there is no central "chain" that can be checked for an existing state with the same ID.
If you simply need a unique ID for your state, use something like UniqueIdentifier, ideally by implementing the LinearState interface (https://docs.corda.net/api-states.html#linearstate). UniqueIdentifier contains a 128-bit unique identifier. This is large enough to avoid collisions between all the LinearStates on the network, despite there being no centralised repository of allocated IDs.
If this is not good enough, and the IDs have to be allocated based on some scheme instead of randomly, you'll need to create some centralised oracle node that tracks issued IDs and only signs transactions where the ID being allocated has not been used before.

How to deploy a cordapp with a business logic which is private to selected parties?

I have a network with 5 nodes, where node 1 is Company ABC and node 2 to node 5 are customer1, customer2 , customer3 etc. If customer1 uses Company ABC's product and if he gets a profit , he has to pay certain amount to Company ABC. The profit formula varies from customer to customer and customers should not see other customers profit formula.
One customer can use the formula as A * B , where another customer can use as A+B*10
I referred the link:
When deploying Corda nodes across the network, which JARs have to be exactly the same?
My doubts.
In my scenario , where should I write the formula ? In contract or flow or should I put in a state? Which is recommended ?
Will it be feasible to maintain so many node level jars ?
Can I deploy a contract which is available only in subset of nodes ?
1) This logic should go into the flow if you wish to keep the calculation private from customers. All nodes will be utilising the same contract, but your flows can be abstracted out of the CorDapp with the implementation local to the node.
2) Yes, the state and contract will remain the same across all the CorDapps. Only the flows will differ. This will probably end up being a common scenario as any calls to external systems will happen within the flow and you can anticipate how this will differ across entities.
3) You just need to think about designing your contract such that it won't reject any of the values calculated by your profit function and distribute this same contract to everyone.
Take a look at this example CorDapp, it shows different business logic per node

how to get digital signatures between two participants, rest can see only ledger update without getting signatures?

I am using three nodes let say A, B, C and doing transaction between A & B. But I would like to make that transaction visible to C without getting any digital signature? if that possible using subflow means,how to define?
The set of required signers for a transaction is completely separate from the set of parties who see the transaction as part of FinalityFlow (the participants).
The required signers are defined by the union of all the public keys on all the commands in the transaction, and not by the union of all the participants in all the transaction's input and output states.
As Kid101 points out, you can also use the observer nodes functionality (see the tutorial here and the Observable States sample here to distribute the transaction to parties who aren't even participants as well.

Resources