https://github.com/patrickalphac/web3_py_simple_storage
https://github.com/patrickalphac/web3_py_simple_storage
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/patrickalphac/web3_py_simple_storage
- Owner: PatrickAlphaC
- Created: 2021-06-09T12:28:44.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-05-02T18:32:50.000Z (about 3 years ago)
- Last Synced: 2023-05-02T19:32:33.702Z (about 3 years ago)
- Language: Python
- Size: 17.6 KB
- Stars: 42
- Watchers: 2
- Forks: 78
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
> NOTE: This repo has been updated to use the sepolia testnet over rinkeby, goerli and kovan.
1. Clone this repo
```
git clone https://github.com/PatrickAlphaC/web3_py_simple_storage
cd web3_py_simple_storage
```
2. Setup a [local ganache chain](https://www.trufflesuite.com/ganache)
3. Install requirements
```bash
pip install -r requirements.txt
```
4. Set your private keys and address, and adjust this section appropriately:
```python
# For connecting to ganache
w3 = Web3(Web3.HTTPProvider("http://0.0.0.0:8545"))
chaind_id = 1337
my_address = "0x6aABE487828603b6f0a3E1C7DAcF7F42bA42A9B2"
private_key = os.getenv("PRIVATE_KEY")
```
To set your private key as an environment variable, run `export PRIVATE_KEY=0xasdfasdfasfdasf`. If you're confused on how environment variables work, just set:
```python
private_key = "0xYOUR_KEY_HERE"
```
5. Run
```
python deploy.py
```
To run on a testnet, just change these variables to whatever testnet you want to work with:
```
w3 = Web3(Web3.HTTPProvider("http://0.0.0.0:8545"))
chaind_id = 1337
my_address = "0x94B806BB0e455576ea46193D9DBbB08d1cc57Da9"
private_key = os.getenv("PRIVATE_KEY")
```
And make sure you have testnet ETH for whatever testnet you're on!