0

is it possible to copy data from smart contract to a local drive?? ie, suppose I created a smart contract and i wish to copy the available data at the storage to my local drive... Is there any possible way to accomplish this?

  • What are you actually trying to achieve here? – Raghav Sood Aug 7 '18 at 6:26
  • what if i want to update my contract without loosing data??@RaghavSood – Akshay Dev Aug 7 '18 at 6:29
  • You would usually build that functionality into the contract, or use a proxy system if you want to update the code itself. – Raghav Sood Aug 7 '18 at 6:30
  • so is it possible to store data in a local storage rather than the Blockchain storage.??(useful for situation where large data need to be stored in blockchain) @RaghavSood – Akshay Dev Aug 7 '18 at 6:35
  • Your smart contract cannot access data outside the blockchain, unless you use something like an oracle. You would usually store hashes and pointers to the data on ipfs/swarm/http if you need to store something large – Raghav Sood Aug 7 '18 at 6:36
0

Apart from the ways mentioned here, another way to do this is by using events in solidity. Fire an event, every time a transaction happens that changes your data variables. Watch for those events on your front-end and add them to wherever you want to store them

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.