1

I have a very beginner level question. Suppose I have a list containing the IP address of different machines and I want to share them via ethereum blockchain and suppose that the list is very large as the time passes, how much time it will take to share with other nodes and add into the block? Does it take 14 seconds irrespective of list size or what? If any reference available that would be great. Please help.

1

This is just a contrived example for learning purposes. It would be expensive to operate.

You would create a contract to hold the state and the update function. I've set the access-control concern aside as well as checking for duplicates to keep the example quite brief.

  1. The contract would propagate as soon as the deployment transaction is mined.
  2. Insertions (append, as implemented) would propagate as soon as the appendIP("address") transaction sent to the contract is mined.

-

pragma solidity 0.4.25;

contract IPList {

    string[] public ipList;

    event LogNewIp(address sender, string ip);

    function appendIP(string ip) public {
        ipList.push(ip);
        emit LogNewIp(msg.sender, ip);
    }

    function getIPCount() public view returns(uint count) {
        return ipList.length;
    }
}

The important thing is the mining process. The transaction "burns" about 65,000 gas, which is computational weight including storage. Transactions include a bid for gasPrice which is the price the user is willing to pay for each unit of gas. Together, gas times gasPrice is the cost of the transaction, in ETH.

Why is that important? Because miners prioritize transactions with higher gasPrice. Priced accordingly, the transaction is a probable candidate for inclusion in 15-30 seconds. Priced lower, and it may not be mined for a while, or not at all.

Once mined, then the transaction is part of the canonical history of the blockchain and will be known to all up-to-date nodes in a few seconds.

In case that isn't clear, the transaction will be part of a certain block, and therefore known to all nodes that have caught up to that block, which will be most of them in a short period of time.

Hope it helps.

  • Hitchens - how long does it take the mined block to be propagated to all nodes in a network? How long for full nodes and how long for lite nodes? – Femtosecond Jun 5 at 23:55
  • 1
    I would stop short of "all" because that doesn't take thier condition into consideration. Most nodes keep up with the most recent blocks, so most nodes will know within about 15 seconds of inclusion in a block. Watch ethstats.net to get a better feel for it. – Rob Hitchens - B9lab Jun 6 at 0:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.