简体   繁体   中英

How the state of Ethereum blockchain is updated?

How can I update the status of the blockchain?

  1. I issue a transaction and pass an id to the smart contract. Smart contract A retrieves data from smart contract B and uses it to check whether a condition in the smart contract is true or not. If checked, save 'id, true' otherwise 'id, false.' My first question is: should there be a transaction to save this information on the blockchain? I only have the initial transaction sending id, so how is this possible?
  2. I store id, true. After some time the value true becomes false. But if the old pair was stored on the blockchain and the blockchain is immutable, how can the copy be updated?

I am using Ethereum

Though blockchain is immutable, it does not mean the current state can not be updated. Each Ethereum block is a new state that consists of account balances and smart contract variables. The current state is the last valid block which your Ethereum node sees. History cannot be altered, but the current state can be altered with transactions.

As the question is overly broad and over basic blockchain concepts, I suggest taking classes in Ethereum smart contract development first.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM