2

How do I run Substrate in fake validating mode for development purposes (is there anything similar to --dev in geth where transactions are mined instantly)?

Andy B.
  • 181
  • 2
  • 9
  • There is a `--dev` flag for Substrate. Have you tried to use it? If so, do you have problems with it? `substrate --dev` – Shawn Tabrizi May 01 '20 at 12:00
  • It's slow.. I need something like a script that creates a block as soon as there is a transaction, if not do nothing.. something like mining on demand in geth or something that works like ganache-cli.. need it for dev and banchmarking – Andy B. May 01 '20 at 20:31

1 Answers1

7

Actually, substrate recently integrated two new consensus (or "block authoring" --whichever you prefer to call them) algorithms that might be exactly what you need:

1- Manual seal: Where there is one author and it authors a block whenever you tell it via an RPC call.

2- Instant seal: Where there is one author and it attempts to author a block as soon as it sees a transaction in the pool, most often leading to one transaction per block

This is pretty recent work and perhaps has not be reflected in the docs yet. But you can find an in-depth intro to it here. Check out the video description for code examples.

kianenigma
  • 1,365
  • 12
  • 20
  • 1
    Wow, this looks really interesting. I think this is exactly what I was looking for. I will have a look at it today :) – Andy B. May 03 '20 at 12:11