I'm trying to setup a private blockchain and deploy some contracts to it. I have the blockchain running but I am running into issues when I'm trying to deploy a contract to it.
This is my genesis block:
{
"config": {
"chainId": 1994,
"homesteadBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0
},
"difficulty": "1",
"gasLimit": "900000000",
"alloc": {
"0xE9cA452f53C9541eDf0461A4160D348d6953C230": {
"balance": "9999999999999999"
}
}
}
And I'm running it with this:
./geth/build/bin/geth --datadir ./geth/data --networkid 1994 --rpc --rpcport 8543 --rpcaddr 127.0.0.1 --rpccorsdomain "*" --rpcapi "eth,net,web3,personal,miner" --allow-insecure-unlock --unlock "0xe9ca452f53c9541edf0461a4160d348d6953c230" console 2>>eth_log.log
I am trying to deploy the following smart contract:
pragma solidity >=0.5.16;
contract helloWorld {
function render() public pure returns (string memory) {
return 'Hello World!';
}
}
However truffle is giving me the following error when I do:
======================
Deploying 'Migrations'
----------------------
> transaction hash: 0xbd2e3abaf89fe79f3942270847bb981c0f3bb3c0113a758a41baf42d9dfa855f
> Blocks: 0 Seconds: 0
> contract address: 0x63BaB74Bf18c73c3E38D85fc3c04CCd53d2C5AE0
> block number: 489
> block timestamp: 1615140207
> account: 0xE9cA452f53C9541eDf0461A4160D348d6953C230
> balance: 1467.009999999999999999
> gas used: 221555 (0x36173)
> gas price: 0.000000001 gwei
> value sent: 0 ETH
> total cost: 0.000000000000221555 ETH
⠴ Saving migration to chain.
Transaction: 0x530d80bd2fff3265cdbc94d5bf6cf41d5c937e4be4b84789a4110224cf8babf2 exited with an error (status 0) after consuming all gas.
Please check that the transaction:
- satisfies all conditions set by Solidity `assert` statements.
- has enough gas to execute the full transaction.
- does not trigger an invalid opcode by other means (ex: accessing an array out of bounds).
Truffle v5.2.3 (core: 5.2.3)
Node v10.19.0
I'm obviously missing something but I can't spot it. Can someone let me know how to get this contract deployed? Thanks
EDIT: It seems to be happening during the "Saving migration to chain" of the 1_initial_migration.js file. These are my settings of my truffle config file:
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
from: "0x....",
},