NEWTON
Asked
9 months ago
85
views
1
does anybody have a working local setup ? I find myself having to run tests on the testnet...
I tried both nile and protostar. the problem is that I can set it up but I don't know how to get access to the accounts that are pre-loaded with ETH. new accounts that I create don't have ETH and I don't have a way to transfer ETH to them..
if anybody has a go-to setup that they can share that'd be much appreciated đ
ggballas
asked
9 months ago
1
Accepted answer
So if you are testing on Goerli, you can use the faucet to get some testnet Eth (https://faucet.goerli.starknet.io/)
If you are testing locally, you can load the starknet-devnet private keys using this sample code (if you are happy to use starknet-py):
from starknet_py.net.gateway_client import GatewayClient
from starknet_py.net.networks import TESTNET
from starknet_py.net import AccountClient, KeyPair
from starknet_py.net.models.chains import StarknetChainId
from starknet_py.net.signer.stark_curve_signer import StarkCurveSigner
from starknet_py.contract import Contract
node_url = "http://localhost:5050"
private_key = "ENTER HERE"
address = "ENTER HERE"
key_pair = KeyPair.from_private_key(key=int(private_key, 16))
signer = StarkCurveSigner(address, key_pair, StarknetChainId.TESTNET)
account_client = AccountClient(client=gateway_client,
address=player_address, signer=signer)
contract_address = "ENTER HERE"
abi = "LOAD YOUR ABI"
testing_contract = Contract(address=contract_address, abi=abi, client=account_client)
Otherwise, you can use starknet-devnet
faucet to get some funds:
https://github.com/Shard-Labs/starknet-devnet#mint-token---local-faucet
I don't know about Protostar, but if you are using Nile I would recommend you deploy your account contract, and then use the faucet to send funds to that address.
answered
9 months ago
How to get the contract ABI?
How do I develop against cairo devnet with browser wallets?
How can I pass an array of felt to call with Nile in StarkNet?
How can I get ETH for the test net in StarkNet?
Cairo Lang / StarkNet: What are Revoked references? What is alloc_locals?
StarkNet Faucet: How can I get a Goerli-2 eth faucet tokens (StarkNet)?
How to use get_fp_and_pc in Cairo Lang?
What if my solidity contract contains Assembly or special EVM calls ?
Comparing the efficiency gains of direct Cairo vs. transpiling with Warp for 2D graphics rendering
I'm currently trying to transpile an ERC 721 contract I have that uses openzeppelin libraries, is that possible?
How can I connect to deployed StarkNet contract using starknetjs?
How do I see my Pathfinder logs?
How does Argent X wallet estimate fees in Starknet before sending a tx?
How to deploy a contract through starknet.py?