how do I set up evm to use local?
what chain do I use?
const chain = EvmChain.ETH;
how do I set up evm to use local?
what chain do I use?
const chain = EvmChain.ETH;
Where do you want to use that chain?
need to speed up testing using ganacheā¦
making api calls requires chain
I set it to chain id 1
let response = await Moralis.EvmApi.utils.runContractFunction({
abi,
functionName,
params,
address,
chain,
});
response bad request
https://d6qrvlqawkik.usemoralis.com:2053/server/functions/getNFTs
Web3api doesnāt work with a ganache server. You will be able to do that with a testnet server.
You can also run directly a contract function from front end.
aware of thatā¦ problem is running out of testnet tokensā¦
your ceo says you can connect moralis to ganache
https://v1docs.moralis.io/moralis-dapp/web3/setting-up-ganache
no way to test moralis apis locally? if not my testing just slowed down to a crawl
since faucets donāt give a lot of eth
For the equivalent of runContractFuncrion you can use executeFuncrion in front end or directly with web3 or ethers even in backend.
If that api is the only one that you need now.
negativeā¦ ganache is not even storing the transactionsā¦
you guys need testnet solutionsā¦ minting an nft on ganache isnāt working
minting an nft should work without issue, you mint it by making a request with metamask and in metamask you set local ganache network or other local devchain that you are using
or you say that the devchain server is not working as expected and it is not even storing the transactions even if they are made on your local devchain?
I get a transaction id, but nothing back from the apiāsā¦
trying it by forking goerli testnet using ganacheā¦ soon as my metamask can
connect weāll get rockingā¦
I havenāt earned a free upgrade?
what do you mean with a free upgrade?
better to not fork an entire blockchain, usually you donāt have to do that
Iām losing time on thisā¦ whats the point of the ceo making a video showing how to connect moralis to local if the thing doesnāt work with local?
means I gotta write two separate codes for testingā¦ with the EVM and without?
const [_W3, setW3] = React.useState(new Web3(new Web3.providers.HttpProvider('http://localhost:9545')))
connects to truffle
const networkId = await _W3.eth.net.getId();
const chainId = await _W3.eth.getChainId();
console.log(networkId,chainId) = 5777 and 1337
const testnetNFTs = await Web3Api.Web3API.account.getNFTs({
chain: chainId
});
console.log(testnetNFTs);
Unhandled Runtime Error
Error: Invalid chain!
your web3 stuff does not work with truffle/ganache chain ids?
you guys are going to need to offer better testing resourcesā¦ you see how long the que is for Ropsten faucet? Today is october 3rdā¦
goerli is giving out .10ā¦ . 20 if you use alchemy
itās been 6+ hours of me trying to use your tools locally with no results
you can try any evm testnet chain that we support, bsc testnet for example works too
getNFTs it is not going to work with local devchain
your list of supported chains doesnāt match Web2Api list
Chains:
AVAX_MAINNET: ā0xa86aā
AVAX_TESTNET: ā0xa869ā
BSC_MAINNET: ā0x38ā
BSC_TESTNET: ā0x61ā
CRONOS_MAINNET: ā0x19ā
CRONOS_TESTNET: ā0x152ā
ETH_GOERLI: ā0x5ā
ETH_KOVAN: ā0x2aā
ETH_LOCALDEVCHAIN: ā0x539ā
ETH_MAINNET: ā0x1ā
ETH_RINKEBY: ā0x4ā
ETH_ROPSTEN: ā0x3ā
FANTOM_MAINNET: ā0xfaā
POLYGON_MAINNET: ā0x89ā
POLYGON_MUMBAI: ā0x13881ā
ETH_LOCALDEVCHAIN is listedā¦ the api still says itās an invalid chain id
bsc is 0.05 to mint contractsā¦ they give you 0.50ā¦
you run out of test tokens faster than you can reload is the problemā¦
I can give myself 1,000 eth to test with on truffle and speed things up
devchain is not supported by web3api, it was a long time ago supported and only for a limited number of endpoints
usually you donāt have to deploy multiple times a contract
you are a better developer than meā¦ things change, the idea grows, you add something, remove something, I have 5 different contracts on the platform talking to each otherā¦
you gotta understand how frustrating and anoying it is to watch a video from your CEOā¦ explaining how to use ganacheā¦ implement itā¦ just to find out it doesnāt workā¦
You can also do some tests directly in remix. This is not related to Moralis, maybe you can test faster in remix.