0

Is there a way to set the block size and the block number in Remix IDE? If not, could you suggest another platform where I can change these parameters?

Thanks

1 Answer 1

1

If you want to change parameters of the eth network, you can run ganache locally on your computer. This is an Ethereum simulator where you can change the parameters of the network. For example - this starts a simulate network with a higher gas limit (aka setting the blocksize larger)

ganache-cli -l 0xFFFFFFFF

Note when you run this command an output will be Listening on 127.0.0.1:8545 -- this will be important in the next step.

After having run this command you can connect to this local ganache instance through remix by changing the Environment variable in the Deploy & Run Transactions page. In this drop down, select web3 provider and then use default suggest end point http://127.0.0.1:8545 (we saw this earlier). Now any transactions you submit through remix will be sent to your ganche-cli network which you have the power to easily change the parameters of - like gas limit.

For increasing the block number - there are a few options - by default, ganache mines a block every time a signed transaction is submitted. You can just submit a ton of transactions to increase the block number. You can also try changing the --blockTime flag in ganache-cli so that blocks will be mined over time (I've had trouble with this in ganache-cli, but it's worked with ganache-ui)

Depending on what you are trying to do - openzeppelin-test-helper - advanceBlock function may also be an alternative helpful way to address this

advanceBlock async function time.advanceBlock() Forces a block to be mined, incrementing the block height.

6
  • would I be able to increase the number of blocks, as well? Commented Jul 31, 2020 at 21:48
  • I've updated the answer with some potential solutions for increasing the block number
    – Steven V
    Commented Aug 1, 2020 at 2:32
  • hi again, can I have more than one node with ganache? Commented Aug 5, 2020 at 22:19
  • not really - you can run multiple instances of ganache on different ports - but the wont interact with each other like nodes ethereum.stackexchange.com/questions/51572/…
    – Steven V
    Commented Aug 5, 2020 at 22:43
  • how cloud I mimic a distributed network then? wouldn't this work link I need to simulate one client and one enterprise for instance how would I do that? Commented Aug 6, 2020 at 9:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.