The error message
"n: Exceeds block gas limit"
means your transaction has declared a gas value greater that the maximum allowed in the network. A client will reject such transaction.
With ganache-cli you can launch with a larger amount of gas available with the -l
parameter:
ganache-cli -l 8000000
Will launch ganache with a block gas limit of 8M.
From the readme documentation it has a mode where you pass extra options in a parameter when you launch ganache. There you can set gasLimit
.
const ganache = require("ganache-cli");
const options = { gasLimit: 8000000 };
const server = ganache.server(options);
server.listen(port, (err, blockchain) => {
/* */
});