xiaoyao1991 / presto-ethereum

Presto Ethereum Connector -- SQL on Ethereum
Apache License 2.0
471 stars 56 forks source link

question regarding ethereum / testrpc #13

Closed johndpope closed 7 years ago

johndpope commented 7 years ago

do you know if it's possible to 'seed' a test environment with production blockchain? eg. when you fire up testrpc - your granted wallets / imaginary ether etc what I'm trying to do is re-run the same $32 million commands that were run the other week on a forked / local blockchain. or maybe it's possible to simulate this by importing faulty smart contract?

xiaoyao1991 commented 7 years ago

Hi John, I'm not sure if I'm understanding your question correctly.

When you start up testrpc, you can certainly grant ethers to accounts. If you are using testrpc, you can certainly grant by testrpc --account="<privatekey>,balance". If you are setting up private network using geth, you can mine quickly. Once you have ethers preallocated, you can then import faulty smart contract into your private chain and replay the attack.

I'm not sure how you can port/clone a part of public blockchain data(up to some block number) into your own private network. I don't think it's unfeasible, but it might take some hack.

johndpope commented 7 years ago

thanks xiaoyao. I found this https://github.com/levelkdev/race-to-zero-exploit