1

I have an application (dev stage) running on one validator, one transaction processor and client. I would like to update the way I create addresses. If I change the way I create addresses, the old addresses won't be accessible. I would like to know what is the practice that should be followed in order to achieve the aforementioned.

Right now, if I make any changes at the processor level, I simply flush the existing blockchain and create a new genesis block and start over. I know this isn't the way it should be.

Please advise.

Shivam Mutreja
  • 45
  • 1
  • 10

1 Answers1

2

You can read all the current addresses and write the value to the new address. Use the delete_state in the SDK to delete the old state variable. The data will remain in previously-created blocks (which are immutable), but will not be in the current blockchain state.

Dan Anderson
  • 2,265
  • 1
  • 9
  • 20
  • 2
    You can do this as a one time export by getting all the state from the state list. Or this can be done in a lazy way, by having a backward compatibility built into the processor and exporting each addresses to new ones when any new modifications happen – shonjs Apr 26 '19 at 05:14
  • 1
    The idea behind asking this is to understand how to handle updation on production. Thus, what if some changes are to be made to the protobuf (i.e few fields are added and deleted) of some transaction. What would be the best way to handle that? – Shivam Mutreja Apr 30 '19 at 08:27