I am using Getch with truffle framework and i created an account. I have Migrations and Election.sol. After i can migrate, i couldnt see it in etherscan website. Although truffle migrate --reset --network rinkeby returns saving artifacts and contract addresses, why i cant see it on website?
geth --datadir ../eth_node --nodiscover console --syncmode "fast" --rpc --rpcapi="db,eth,net,web3,personal" --cache=1024 --rpcport 8545 --rpcaddr 127.0.0.1 --networkid=4 --"allow-insecure-unlock" --mine --minerthreads 1
truffle.config
rinkeby: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "4", // Any network (default: none) (Rinkeby's id
is given)
from:"address",
gas: 3000000
OUTPUT:
Starting migrations...
Network name: 'rinkeby' Network id: 4 Block gas limit: 8000000
1_initial_migration.js
Deploying 'Migrations'
transaction hash: HASH Blocks: 0 Seconds: 536 contract address: 0xd31433a447b2C64d979e15D4CD190098DA1044Ad account: ADDRESS balance: 79228162514.252941273543950335 gas used: 284908 gas price: 20 gwei value sent: 0 ETH total cost: 0.00569816 ETH
Saving artifacts
Total cost: 0.00569816 ETH
2_deploy_contracts.js
Replacing 'Election'
transaction hash: HASH Blocks: 1 Seconds: 4 contract address: 0xD6F5BF2E4eC20FB4DEf44d77FEBF84E96e680DFe account: ADDRESS balance: 79228162514.246021893543950335 gas used: 345969 gas price: 20 gwei value sent: 0 ETH total cost: 0.00691938 ETH
Saving artifacts
Total cost: 0.00691938 ETH
Summary
Total deployments: 2 Final cost: 0.01261754 ETH
contract address: 0xd31433a447b2C64d979e15D4CD190098DA1044Ad
contract address: 0xD6F5BF2E4eC20FB4DEf44d77FEBF84E96e680DFe }
When i use this following function
function checkAllBalances() {
var i =0;
eth.accounts.forEach( function(e){
console.log(" eth.accounts["+i+"]: " + e + " \tbalance: " +
web3.fromWei(eth.getBalance(e), "ether") + " ether");
i++;
})
};
It returns balance: 79228162514.246021893543950335 ether
What is wrong in my configuration?
Election.sol
pragma solidity 0.5.8;
contract Election {
// Model a Candidate
struct Candidate {
uint id;
string name;
uint voteCount;
}
// Read/write Candidates
mapping(uint => Candidate) public candidates;
// Store Candidates Count
uint public candidatesCount;
constructor() public {
addCandidate("Candidate 1");
addCandidate("Candidate 2");
}
function addCandidate (string memory _name) private {
candidatesCount ++;
candidates[candidatesCount] = Candidate(candidatesCount, _name, 0);
}
}
Migrations.sol
pragma solidity >=0.4.21 <0.6.0;
contract Migrations {
address public owner;
uint public last_completed_migration;
constructor() public {
owner = msg.sender;
}
modifier restricted() {
if (msg.sender == owner) _;
}
function setCompleted(uint completed) public restricted {
last_completed_migration = completed;
}
function upgrade(address new_address) public restricted {
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
}
eth.getBlock(0) returns
{ difficulty: 1, extraData: "0x00", gasLimit: 4712389, gasUsed: 0, hash: "hash", logsBloom: "", miner: "0x0000000000000000000000000000000000000000", mixHash: "0x0000000000000000000000000000000000000000000000000000000000000000", nonce: "0x0000000000000042", number: 0, parentHash: "0x0000000000000000000000000000000000000000000000000000000000000000", receiptsRoot: "", sha3Uncles: "", size: 504, stateRoot: "", timestamp: 0, totalDifficulty: 1, transactions: [], transactionsRoot: "", uncles: [] }
genesis.json
{
"config": {
"chainId": 88888,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0
},
"coinbase" : "0x0000000000000000000000000000000000000000",
"difficulty" : "0x1",
"extraData" : "0x00",
"gasLimit" : "0x47e7c5",
"nonce" : "0x0000000000000042",
"timestamp" : "0x00",
"alloc" :{
"address": {"balance": "0xffffffffffffffffffffffff"}
}
}