1

Let's say peer A makes a contract and deployed it to the private network.Peer B joins the network.Will it be available to peer B ?How the deployed contract will get reflected to peer B.It will be available automatically or we need to do something to happen it.

1

as per your scenario, When Node A deploys the contract in a private network P1.The contract's compiled code (bytecode) is stored in the blockchain which is duplicated in each node in this network. When node B joins the network P1, it syncs with this network by downloading a copy of the current blockchain and therefore downloading the block which contain the contract's code.

0

Yes all peer B needs is the contract address to interact with it provided peer A has not written any logic/conditions in the contract that restrict who can run certain functions/methods e.g. 'only owner can run this method'. If this is the case then peer B would have to deploy the contract. Different use cases dependant on the contract logic, hope this helps

0

The peer will need to synchronize the private blockchain. E.g. if the transaction happened in a block 100,000 and peer B have 90,000 blocks in his copy of the blockchain he'll not be able to use the contract.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.