Hot answers tagged

10

If you are looking for a fully managed third party RPC provider for BSC, you can use: Quiknode Ankr If you want complete chain data, you can use their snapshots


5

Ganache and Infura are two very different things. Ganache is a tool for quickly creating a local network that can be used for development. It can be used to automatically run tests, etc. completely locally, without relying on one of the public testnets (Goerli, Ropsten, etc.). Infura is a infrastructure provider, primarily for Ethereum. It provides access to ...


3

modify your build.gradle to this and rebuild (i usually use maven), the problem was probably with okhttp used in web3j dependencies { // https://mvnrepository.com/artifact/org.web3j/core implementation 'org.web3j:core:4.8.4' implementation 'org.springframework.boot:spring-boot-starter-web' testImplementation 'org.springframework.boot:spring-...


2

The petition not return the balance value instantly. For that reason you need to call the balance as a promise and wait the result, then print to HTML. You can co it with a callback function and wait the result. For ex: function getETHBalanceOf(address){ web3js.eth.getBalance(address).then(function(balance){ myBalanceVar = balance; //Your HTML ...


2

Your better solution is a cluster of local nodes. Your node choice should be a light node if you are only reading data and have enough bandwidth. the Geth ethereum node can handle more than 10000 requests per second very well but it might crash if not enough memory is available, so keep an eye on that. I would say 4 nodes with a server with 50GB RAM and 6 ...


2

Infura is a gateway to enable access to some Ethereum networks. Remix may work with a simulated blockchain or be attached to a real blockchain network. For example, you can use Remix linked to Metamask. Your Metamask may point to an Infura gateway or not. You can use Metamask to point to a permissioned blockchain network for example. You will probably use ...


2

Since you created a contract instance, you can use it have Metamask format the transaction and send sign request to user. Try replacing this: const txHash = await this.provider.request({ method: 'eth_sendTransaction', params: [ { from: this.account, to: this.contractAddress, data: ?????????????? } ], }) With this: contract....


2

If you want to sign and send a transaction, you have to use a private key. That's one of they key features of blockchains: one private key represents one public address, so when you sign a transaction with a private key, everyone can trust that the key's public address is yours. There is no way to send a transaction without a private key. Of course you ...


2

Just found out. Dont need to get signer from provider. The tx can be sent by: provider.sendTransaction(signedTx)


1

Brownie actually has infura built in, so you only need the WEB3_INFURA_PROJECT_ID and brownie will sort all the URLs and such under the hood. Test it out and see what happens!


1

when you are calling setMessage function you should use send instead of call $("#setMessageButton").click(function () { var val = $("#userInput").val(); RemixContract.methods.setMessage(val) .send() .then(function(result){ console.log(result) }) }); Hope this helps


1

Minor blockchain reorganisations up to 6 blocks deep are normal for Ethereum. Ethereum mainnet with proof of work has only probabilistic finality, not true finality and any block is subject to disappearing. More about finality here.


1

Usually you would use the built-in Infura mainnet object: At the command line: $ export WEB3_INFURA_PROJECT_ID=<project id> $ export WEB3_INFURA_API_SECRET=<secret> Then in Python: >>> from web3.auto.infura.mainnet import w3 >>> w3.isConnected() True >>> w3.eth.block_number 12642083


1

Your PRIVATE_KEY is likely set to an empty string. Do you have a .env file with: export PRIVATE_KEY=XXXXX and then in your brownie config: dotenv: .env wallets: from_key: ${PRIVATE_KEY}


1

Maybe this code help you. It contains recursive function. def checkBlockNumber(blockNumber = None): if blockNumber: if blockNumber == w3.eth.get_block_number(): time.sleep(1) checkBlockNumber(blockNumber) else: return w3.eth.get_block_number() while True: block_number = checkBlockNumber() print(...


1

You need to listen to blockchain events. From Web3js documentation: var subscription = web3.eth.subscribe('newBlockHeaders', function(error, result){ if (!error) { console.log(result); return; } console.error(error); }) .on("connected", function(subscriptionId){ console.log(subscriptionId); }) .on("data", ...


1

If you don't specify the network in truffle it will default to the network named development. if you don't define the development network in your config file it will default to the default development network spec it has hardcoded. to use your kovan network you will need to specify the network : truffle console --network=kovan this will work with any ...


1

Infura does not request or obtain private keys. Infura cannot sign transactions. Signing requests are made by the dApp you are using. The dApp is more important for security, because it is what asks you what you want to do with your assets: Infura is just a node that passes your signed transaction to other nodes and miners. dApps also use Infura to show you ...


1

In some cases, you might need to gather synchronized data from the blockchain. A good example is querying token prices from Uniswap. You don't want to have the price for one token from block x and a price for another token at block y. Multicall aggregates all queries to different contracts in one call, so it guarantees your data is retrieved from the same ...


1

Please read MultiCall README. Multicall allows multiple smart contract constant function calls to be grouped into a single call and the results aggregated into a single result. This reduces the number of separate JSON RPC requests that need to be sent over the network if using a remote node like Infura, and provides the guarantee that all values returned ...


1

See the Choose a Network section of the Infura docs. All the main testnets have associated HTTPS and websocket endpoints. You'll need to register for a (free) API key though, if you haven't already. If you want to use another chain, you'll have to refer to the associated docs to determine what endpoints are available. (e.g. The Binance Smart Chain endpoints ...


1

There are two issues with your code : Replace const Tx = require('@ethereumjs/tx').Transaction by const Tx = require('ethereumjs-tx').Transaction (as in the link you provided). You are currently using the 2.x version of ethereumjs-tx which should not be confused with the 3.x (renamed to @ethereumjs/tx) as there are breaking changes. Your gas limit is way ...


1

I found the fix by changing the infura Rinkeby RPC_URL in 'the truffle-config.js' file. Originally I was using the https://rinkeby_url. On using wss://rinkeby_url - it got fixed. Please see a snapshot of the URL from infura. You can create a account on infura and generate these URL. Example of my truffle-config.js rinkeby: { provider: () => { ...


1

There are some RPC providers for Binance Smart Chain, BSC. You can read BSC docs for RPC I think this will be the best curated (and official) list for RPC in BSC.


1

Ethereum requires to upfront gas * gasPrice for the transaction fee, it will return unused gas but the gas has to be paid in advance. The config has gas = 4M and gasPrice = 65 gwei so for every transaction you have to have 4 * 10^6 * 65 * 10^9 = 26 * 10^16 wei = 0.26 ether. Set gasPrice low enough in truffle-config (200k gas) and individually set the gas for ...


1

After some trial and error I've found a way to make this work. Not sure if this is the only way or the best, but here it goes: const provider = new HDWalletProvider(process.env.WALLET_MNEMONIC, `https://:${process.env.PROVIDER_SECRET}@rinkeby.infura.io/v3/${process.env.PROVIDER_ID}`); const web3 = new Web3(provider); Notice how there's a : before the secret ...


1

Its because you have to specify the network type, otherwise it will take mainnet as default if not provided also make sure your infura provider websocket is for rinkeby/supports rinkeby var wsProvider = new ethers.providers.WebSocketProvider("wss://rinkeby.infura.io/ws/v3/idhere", "rinkeby");


1

According to this recent post by Infura on September 23, 2020: https://blog.infura.io/part-2-getting-started-with-ipfs-on-infura/ Data is currently pinned until it’s been 6 months since it was last used, so as long as you’re accessing your data within that time frame, it’ll be there for you!


1

The miners needs to mine the transactions. Its need time. In addiction, Ethereum is collapsed. You can see more than 100K pending transactions in Ether Scan


1

I think you need to wrap deploy() function in async (async () => { deploy('myContract'); })(); In general I prefer to use Truffle for contacts testing and deployment.


Only top voted, non community-wiki answers of a minimum length are eligible