Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Solidity have HTTP request function?

I am making a project using Ethereum.

In this project , I am making a contract called "A".

When I send a message to "A", I want "A" to make a web request.

Is it possible that Solidity requests using http (method GET/POST )?

like image 429
문효범 Avatar asked Dec 23 '22 17:12

문효범


1 Answers

Ethereum blockchain cannot interact with outside world, otherwise it would no longer be deterministic and 10,000s of Ethereum nodes getting different HTTP return values could not reach a consensus on a blockchain state.

The only way to input outside world data to Ethereum is to have an Ethereum account that pushes data to the blockchain. This kind of setups are called oracles.

  • Oracle is a server-side worker process

  • Oracle does HTTP GET/POST

  • Oracle writes the data to a smart contract using a normal Ethereum smart contract transaction

like image 107
Mikko Ohtamaa Avatar answered Dec 27 '22 07:12

Mikko Ohtamaa