88

You can use an Oracle. An oracle is any device or entity that connects real-world data with the blockchain. There are several examples of oracle technologies. Chainlink and Provable (formerly Oraclize) are two examples that do exactly that. There are some code examples here as well as the documentation of our Solidity API. Oraclize is available both on ...


74

The Ethereum blockchain was designed to be entirely deterministic. This means, that if I took the whole history of the network, then replayed it on my computer, I should always end up with the correct state. Since the internet is non-deterministic and changes over time, then every time I replayed all of the transactions on the network, I would receive a ...


40

You can't do this directly; Ethereum contracts can't hit URLs, because Ethereum needs everyone to be able to independently validate the outcome of running any given contract, and you can't guarantee that they'd all get the same result from any given URL. What you can do is get some third-party, or a combination of third-parties, to hit the URL for you and ...


26

You can actually take in data from the internet. You just need someone to hand it to your contract. How can you trust that person? Use something like Provable. https://provable.xyz This is an idea that uses TLS Notary to guarantee the answer is authentic from the web server. I found it because I was originally thinking of doing the same thing with TLS ...


14

Thomas from Oraclize here. You probably are having this issue because you are not sending any value along. The Oraclize API calls come at a cost, the small fee we charge is paid in advance when calling oraclize_query. The first API call from each contract is free, so this is why your first call is working. Please check out our pricing here. This applies to ...


11

How about using Etherscan's Event Log API? https://api.etherscan.io/api?module=logs&action=getLogs &fromBlock=0 &toBlock=latest &address=[Token Contract Address] &topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef &topic1=[From Address, padded to 32 bytes - optional] &topic2=[To ...


11

Ethereum contracts are sandboxed from the world and cannot do much more than add/subtract/multiply/send on ether/invoke other contracts, etc. (There's a complete list of opcodes, I hope you get the idea.) This is to prevent DDoS attacks. (Imagine if you just told all Ethereum miners to access some web page a million times.) A server can monitor the data ...


10

A detailed tutorial for how a contract can obtain data has been written for the Python Ethereum client (pyethapp): https://github.com/ethereum/pyethapp/wiki/Making-a-User-Service:-Tutorial One of pyethapp's most powerful distinguishing features is its ability to easily create built-in user services: scripts written in python that run alongside ...


7

I believe this was designed as a feature to minimize the burden on the network and reduce resources. There are several solutions if you want to "api call on a contract": http://www.ethereum-alarm-clock.com/ Source: https://forum.ethereum.org/discussion/3571/ethereum-alarm-clock-call-scheduling-for-contracts pipermerriam Posts: 10Member ✭ September 2015 in ...


7

There is no Web API, but you can perform this using SQL. You can do it simply with "Presto Ethereum Connector" (https://github.com/xiaoyao1991/presto-ethereum) Using Presto Ethereum, you can query the blocks using an SQL command. You can base the where condition on block_timestamp. Bellow is the structure of the "block" table provided by Presto Ethereum: ...


6

You haven't mentioned it, but there is always the basic Ethereum JSON-RPC API. It's essentially what Infura offers, but you could run it yourself. It's supported by all the main Ethereum implementations. I reccomend this route, or using something like Infura that meets this API, because then you will be able to easily switch providers and not have to rewrite ...


6

(The Ethplorer API is specific to ERC-20 tokens, so won't give you what you want.) Price is subjective, and different exchanges will trade at different rates depending on the markets that use them. If you want an average price you'll need to either use several APIs - from those exchanges you care about - and take an average, or use a service that ...


6

Yes, you can do this. With web3.js 0.2x.x, note from https://github.com/ethereum/wiki/wiki/JavaScript-API#contract-methods that all calls to contracts take an optional block number. So the following will get the balance of an account at a specific block number: tokenContract.balanceOf(account, {}, blockNumber); I believe the syntax for web3.js 1.0.0-beta ...


5

You could use JSON RPC to create a wallet and set password. But PHP and geth don't go well together, it will limit your app. I recommend going directly with web3.js, and by the way, myetherwallet is a very nice code and open-source so you could integrate as on site wallet. For generating wallet thought JSON-RPC (pass sent over the network): //create eth ...


5

An oracle can be a manually controlled human account that feeds data in a timely manner or better an automated bunch of bots on traditional servers that scrape a website and feeds in data via the account. You'd need to hard code a contract address into your contract as an oracle of truthful values for your programme. The private key is kept private, unlike a ...


5

This is not 100% what you asked for, but it's (what I believe) is the closest thing so far. Using Oraclize, you can grab twitter data for a contract. (And this is actually a BIG step forward because previous to this it was near impossible without trusting that some third party isn't feeding in false data.) Also, I've not seen a tutorial that shows step by ...


5

The whole purpose of building smart contracts is so that your contracts can execute without having to rely on any single centralized company, individual, or entity. You want to have your smart contracts be as secure as possible, so no individuals are harmed, and people don't have to worry about whether or not they can trust the application. Adding a ...


4

As others have stated, you must use an Oracle. Some projects like ChainLink and Oracleize will do this for you. To set up an oracle on your own, the process looks like this: Create a smart contract Setup a server listening for some external event, eg a sports game Once a particular condition is met, eg one team wins, your server will send a transaction to ...


4

BlockCypher is your answer, and it's been used by top organizations in the crypto space including exchanges. Both Private and Public keys of ETH or BTC are generated instantly and deleted from their server but you get to store in a db, assign to user or do whatever you want with it. Get Token at https://accounts.blockcypher.com/ FREE plan comes with: ...


4

(from https://github.com/ethereum/go-ethereum/wiki/Management-APIs): To determine which APIs an interface provides, the modules JSON-RPC method can be invoked. For example over an ipc interface on unix systems: echo '{"jsonrpc":"2.0","method":"rpc_modules","params":[],"id":1}' | nc -U $datadir/geth.ipc will give all enabled modules including ...


4

First, import web3 as such: const Web3 = require('web3') Then instantiate a variable (in my case web3) and set a provider: const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io/INFURA_ACCESS_TOKEN:8545')) Then you can use all the available web3 methods. Hope it helped you!


3

No, there are no such services because of obvious reasons. If you trust a 3rd party with your wallet creation they can store the keys which is a serious problem. If you think you are non technical and can do the API call you can do more with myetherwallet.com offline build. It will help you run the entire myetherwallet.com in your local machine, even ...


3

it isn't a bug the balance is returned in weis not in The Ethers. chek one of many conversion tools: https://etherconverter.online/ 268705.32703842675 Ether = 268705327038426745609145 wei the "," is used to separate three digits (look at the amount in $).


3

If you observe the balance check tool, you can see there are two options Date Block Number If you know the block number, you can use the following function to get the historic balance web3.eth.getBalance(address, blockNumber).then(balance => `Balance at block number is ${balance} If you dont know the block number, but want to get it by date/time. You ...


3

Probably after creating the account in the way you do, your new address is not returned when you do web3.eth.getAccounts() because this creates an account that is not associated with your node. Use instead web3.eth.personal.newAccount(password, [callback]) Hope this helps.


3

The number of requests per second is limited to 5 request per second. There is not paid service yet. The Etherscan Ethereum Developer APIs are provided as a community service and without warranty, so please just use what you need and no more. They support both GET/POST requests and a rate limit of 5 requests/sec. To use the API service please ...


3

Infura is basically just running a bunch of nodes to which it provides access for you. So you just need to run your own node. There are a few different node clients available; the most popular are Geth and Parity. You can choose any client you wish. So just download the client program, read instructions and start synchronizing the node with the blockchain. ...


2

Quick and Easy with this command: curl -sX POST https://api.blockcypher.com/v1/eth/main/addrs


2

First of all, you can't really make an API call in blockchain the way you normally can in a python/java/go/other programming language. You have to make a call through an oracle like Chainlink. You can then, go ahead and make these API calls through these Chainlink oracles. You can do this for any API, and integrate it with any platform (like SAP).


2

sap is a complex database, but these guys at finlync have managed direct integration for sap to ethereum. suggest you reach out to them... http://www.the-blockchain.com/2017/01/18/finlync-designs-erp-integration-distributed-ledger-blockchain/


Only top voted, non community-wiki answers of a minimum length are eligible