2

There are two types of requests in Ethereum - Call & Send

Send requests will send a transaction and hence will take up gas as transaction fee. Call requests will call the “constant” method and execute its smart contract method in the EVM without sending a transaction.

I have 2 questions here: 1. How can I connect to a main/testnet blockchain and make the read/call requests on that node? 2. If the above is possible, how does Ethereum protect itself from such attacks?

  • 1
    Please do not flag to close a question as "unclear what they are asking" without trying to contact the author! Some question are interesting but are not redacted properly. We want to help everyone solve their issues! – Ismael Feb 19 '18 at 19:20
1

Answering your second question first: the “read” query as you call it happens against a single node, so you can spam it all you want. The entire rest of the network will go on happily without that node. This is the idea of fault tolerance.

The first question then is answered by telling you to run your own node (or find a publicly available node such as Infura or QuickNode which run nodes on your behalf). The node provides an interface called RPC (most easily accessed with web3.js) which will allow you to query to your heart’s content.

  • So all the data that Etherscan.io provides is by connecting to it's own nodes running Ethereum? – Sumanth Feb 20 '18 at 7:10
  • Not all, because Etherscan builds some data (for example it parses input data and combines data from the receipt with the transaction (i.e. gasUsed), but basically yes. – Thomas Jay Rush Feb 26 '18 at 2:46
4

There is no attack in question. In order to read data from the Ethereum blockchain, you either need to run your own node (in which case there is no attack because you're only using your own resources to read it), or you need access to someone else's node, like an Infura node. If the node you connect to doesn't have some kind of authorization or rate limiting, then you could spam it with requests that essentially DOS it, but this only affects that one node, not the network as a whole.

1
  1. In order to connect to the blockchain, you need to either install an ethereum node to run on your machine/server, or to gain access to a hosted one.

I'm not aware of anybody providing free access to a full ethereum node.

  1. Since it's your node, hosted on your machine, you can make whatever you want with it and you don't need any kind of protection.
  • Infura provides free note at least for now – Thomas Jay Rush Feb 19 '18 at 21:18
1

This is not really an attack. To read data from the Ethereum blockchain, you need to do one of the following things:

  1. Run your own full node on your machine and download the entire blockchain. All the data is now stored on your computer, so reading data from it happens entirely offline. Code in constant methods will only be run offline, spamming calls to it will simply put strain on your own system
  2. Contact a third party company that provides a node to the public. Such companies have rate-limiting and authentication set up to prevent spam. If they haven't, you can obviously spam them, but the network as a whole wouldn't even notice it since no data is sent to it.

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.