Categories
Bitcoin Cryptocurrency Mastering Development

how to find the block height from merkle root?

I have the merkle root, using this value, how to get the block hash or its height? There is this merkle root available in getblock RPC output: ./bitcoin-cli getblock 0320d6c1bd3c4cd2a08d6f76acb50b06a3ed766b058d247fbda3147aecfef388 { "tx": [ "bccf4c873984245694f64263a3392c4d67c6a6f60efe4ed53aa4965f6d8b7dc0" ], "hash": "0320d6c1bd3c4cd2a08d6f76acb50b06a3ed766b058d247fbda3147aecfef388", "confirmations": 2, "size": 180, "height": 102, "version": 536870912, "versionHex": "20000000", "merkleroot": "bccf4c873984245694f64263a3392c4d67c6a6f60efe4ed53aa4965f6d8b7dc0", "num_tx": 1, "time": 1593523883, "mediantime": 1593467398, […]

Categories
Cryptocurrency Ethereum Mastering Development

I am getting Error: Project ID is required deploying to ropsten in truffle

I am getting the following error: Error: PollingBlockTracker – encountered an error while attempting to update latest block: Error: project ID is required at C:\Users\myuser\Code Projects\sdfsd\node_modules@trufflesuite\web3-provider-engine\subproviders\provider.js:18:36 ropsten: { provider: new HDWalletProvider(mnemonic, "https://ropsten.infura.io/myropstenidhere"), network_id: 3, gas: 4000000 }, live: { provider: () => new HDWalletProvider(mnemonic,’https://mainnet.infura.io’), network_id: ‘*’, gasPrice: 25000000000, gas: 5000000, confirmations: 2 }

Categories
Cryptocurrency Ethereum Mastering Development

Truffle + Infura Mainnet deploy. Transactions never get mined, timing out after 750 seconds

The contract deploys on Rinkeby without a hitch, but when it comes to mainnet it is erroring out strangely. Infura’s HTTP endpoint was giving me Invalid JSON RPC RESPONSE "", so I decided to switch to WebSocket endpoints, provided by Infura. const webSocketProvider = new Web3.providers.WebsocketProvider(‘wss://mainnet.infura.io/ws/v3/eeb0ee32c0364281afb37982fbbe26fb’); //network live: { network_id: 1, provider: function() { return […]

Categories
Cryptocurrency Ethereum Mastering Development

“Migrations” could not deploy due to insufficient funds

I’m getting the error: “Migrations” could not deploy due to insufficient funds. Sender doesn’t have enough funds to send tx. The upfront cost is: 45000000000000000 and the sender’s account only has: 0 as I’m migrating into Rinkeby test network. I have enough ether in Account #2 from faucet that I’m trying to use, but Truffle […]

Categories
Cryptocurrency Development Ethereum

Cannot deploy to Ropsten with truffle

I keep getting an error when trying to deploy a project to ropsten. This is my config file. Any idea??? const HDWalletProvider = require(“@truffle/hdwallet-provider”); const infuraKey = “xxxxxlmaoxxxxx”; const fs = require(‘fs’); const mnemonic = fs.readFileSync(“.secret”).toString().trim(); module.exports = { networks: { development: { provider: () => new HDWalletProvider(mnemonic, “http://127.0.0.1:7545”), network_id: “” // Any network (default: […]