[WIP] Adding casper deployment instruction to readme.md #152#162
[WIP] Adding casper deployment instruction to readme.md #152#162GagziW wants to merge 13 commits intoethereum:masterfrom
Conversation
|
According to your README, params of init() like this. But in https://github.com/ethereum/casper/blob/master/casper/contracts/simple_casper.v.py#L130 I do not have confidence, but I think that |
|
e.g. |
djrtwo
left a comment
There was a problem hiding this comment.
Glad to see y'all made it through the deploy!
I generally want to be less verbose in the readme. The high level details are more important than the python specific implementation.
Take a look at my notes and let me know if you ahve any questions.
README.md
Outdated
| In this example we will be using [eth-tester](https://github.com/ethereum/eth-tester). | ||
|
|
||
|
|
||
| ### Step 1: Imports |
There was a problem hiding this comment.
I want this to be way less system specific. Think, high level notes and a little bit of pseudocode. So we don't need to deal with imports
README.md
Outdated
|
|
||
| ### Step 2: Raise the Gas Limit | ||
|
|
||
| ```bash |
There was a problem hiding this comment.
Just note that the contract costs a lot of gas (can give a number) and that if they are deploying via a normal CREATE tx, then they need to make sure the block gas limit is high enough
README.md
Outdated
|
|
||
| [Link to the web3.py documentation.](https://github.com/ethereum/web3.py) | ||
| ```bash | ||
| base_tester = EthereumTester(PyEVMBackend()) ## instantiates the eth-test suite |
There was a problem hiding this comment.
Just assume a web3 object exists. People will be deploying via all sorts of framekworks so the particulars here aren't important.
README.md
Outdated
|
|
||
| ### Step 4: Deploy Helper Contracts | ||
| NOTE: In addition to the two helper contracts `msg_hasher` and `purity_checker` you also need to deploy the `rlp_decoder` Contract. On a production chain, an `rlp_decoder` contract is already deployed and vyper’s standard internal library knows it’s address and gives vyper contracts access to some functionality at that address. | ||
| **When using a test chain, these helper contract must be deployed before the casper contract.** |
There was a problem hiding this comment.
Important to note that rlp_decoder must be deployed before compiling the casper contract.
README.md
Outdated
| NOTE: In addition to the two helper contracts `msg_hasher` and `purity_checker` you also need to deploy the `rlp_decoder` Contract. On a production chain, an `rlp_decoder` contract is already deployed and vyper’s standard internal library knows it’s address and gives vyper contracts access to some functionality at that address. | ||
| **When using a test chain, these helper contract must be deployed before the casper contract.** | ||
|
|
||
| NOTE: these helper contracts are currently written in serpenat, so until they are converted to Vyper it is best to use the hardcoded transaction hex below. |
There was a problem hiding this comment.
"These helper contracts can be deployed via the below pre-signed txs. Instructions for compiling and deploying via other methods will soon be available."
README.md
Outdated
| ### Step 6: Compiling and Deploying Casper | ||
| ```bash | ||
|
|
||
| file = open(os.getcwd()+('/casper/contracts/simple_casper.v.py')) #this will change depending on where the casper contract is located relative to your current working directory |
There was a problem hiding this comment.
We should show how casper is compiled from the command line, rather than from python. Don't worry about showing how to open files.
vyper simple_casper.v.py
vyper -f abi simple_casper.v.py
|
I am glad to receive your reply. I understand your policy but your readme maybe incorrect. |
README.md
Outdated
| w3.eth.sendTransaction({'to': casper_address, 'value': 10**21}) | ||
|
|
||
| casper_contract = w3.eth.contract(address=casper_address, abi=casper_abi) | ||
| casper_contract.functions.init(*casper_args).transact() |
There was a problem hiding this comment.
I think that it will not work with the latest version because casper_args is not correct.
There was a problem hiding this comment.
Thank you for the hint. I will double check this issue.
|
I made a pull request to fix "casper_args". If you like, please refer it. Thanks. |
Add null_sender to the params of init()
Readmedeploy
|
@djrtwo I tried to incorporate your comments. Please review. |
|
Hi @djrtwo I think this one might be with you for review, no? Hope you're doing well 🙂 |
No description provided.