Deploying to a Rinkeby Testnet (Live)
tip
- How to make local project deployed on Live as what we did on Remix by
Injected Web3
onto Rinkeby testnet? - Or how to run a node that connected to a real blockchain?
- Or is there a client that run the blockchain for us?
#
Blockchain service provider- Infura gives a blochchain url to connect with to run whatever.
- alchemy is another blockchain service platform.
#
Url, ChainId, Wallet address, Wallet private_key
deploy.py
w3 = Web3(Web3.HTTPProvider("https://rinkeby.infura.io/v3/197788da1a3c40bfb9aad007b61d893b")) chain_id = 4my_address = "0x51943e929aB4A4704F808E4C2de56169d052893a"
note
change the .env
by put the MetaMask wallet private key there.
PRIVATE_KEY=0xc28.....
Then run the python script, wait for a longer time to get the result.
$ python deploy.pyDeploying contract...Deployed!0Updating Contract...Updated!15
Either check the MetaMask wallet activity,
Or check the Rinkeby Etherscan.
note
- Every activity (transaction) is binded with a transaction hash(Txn Hash).
- The function that executed for the activity is shown in the
Method
as name or method id. - The block number (
nonce
) indicate the block that the activity is recorded. We should expect the prev(parent) block number should be the block number that the previous activity is binded with.10524159->10524160
as we coded"nonce": nonce + 1
in thedeploy.py
. From
indicates the activity taker.To
indicates the object (contract) that the activity is executed on.age
might be inconsistent for the screenshot is taken at different time.
Click on the latest transaction hash to see the activity that we store the number 15
into the deployed contract.