1

I have deployed an Ethereum private network PoA with geth connecting 3 nodes: 2 nodes in aws EC2 instances and my own laptop. My purpose is to store strings in the network, so therefore, i have deployed the following Smart Contract:

// SPDX-License-Identifier: MIT pragma solidity ^0.8.4;

contract CRUDOptimizado {

// Variables de estado 
string[] data;

// Operaciones CRUD: CREATE, READ, UPDATE y DELETE:

// Operación CREATE
function createData(string memory _description) public{
    data.push(_description);
}

// Operación READ por búsqueda de la posición en memoria
function readData(uint _id) public view returns (string memory) {
    return (data[_id]);
}

//Operacion READ todos las entradas de datos
function readAllData() public view returns (string[] memory){
    return data;
}

//Operacion COUNT de todas las entradas de datos
function readcount() public view returns (uint){
    return data.length;
}

// Operación UPDATE
function updateData(uint _id, string memory _description) public returns (string memory){
    data[_id] = _description;
    return (data[_id]);
}

// Operación DELETE
function deleteData(uint _id) public{
    delete data[_id];
}

}

I have succesfully deployed an API with Express to interact with my Smart Contract methods. The following middleware calls the function "createData" from Smart Contract: app.post('/post/file',async (req,res,next) =>{

    const file = JSON.stringify(req.files.file);
    console.log(file)
    //const buffer = req.files.file.data;

    const receipt = await contract.methods.createData(file).send({
        from: addressSender
    })
    res.status(200).json(receipt);
    
})

When I store huge JSONs (parsing them to strings in the API), I have problems with gas allowance. Geth console: Served eth_sendTransaction duration=470.274556ms err="gas required exceeds allowance (50000000)"

Here is part of my genesis file (I have modified gasLimit): { "config": { "chainId": 113, "homesteadBlock": 0, "eip150Block": 0, "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000", "eip155Block": 0, "eip158Block": 0, "byzantiumBlock": 0, "constantinopleBlock": 0, "petersburgBlock": 0, "istanbulBlock": 0, "clique": { "period": 3, "epoch": 30000 } }, "nonce": "0x0", "timestamp": "0x62f60dbd", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000cf9c875960822c4d232db99ac36f7cfbc66b07c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1fffffffffffffff", "difficulty": "0x1", ....

Is there any way of modifying Geth max allowance (it is capping gas at 50,000,000)? If it isn´t, is there any other private Blockchain with 0 gas price with documentation?

Thanks.

1 Answer 1

1

Checkout the geth commandline options here. I think you're looking for rpc.gascap

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.