Ethereum smart contract obtains wallet information
The smart contract has been written for a long time
if they can add changes, the description is centralized
the contract is written into the Ethereum smart contract, which is a contradiction sentence
the financial customer service doesn't understand, which is very unreliable
community sites
If you want to query the transaction records on the main network, you can use Etherscan. However, if you build your own private chain, how should you query the transaction records
the answer is that you need to listen to the logs on the chain, save them in the database, and then query them in the database. For example:
< pre t = "code" L = "Java" > varaddr = & quot& quot;< br />varfilter=web3.eth.filter({fromB lock:0 ,toBlock:' latest', address:addr });< br />filter.get(function(err,transactions){transactions.forEach(function(tx){
vartxInfo=web3.eth.getTransaction(tx.transactionHash);
/ / at this time, the transaction information txinfo can be stored in the database
})< br />}); Pre >
Web3. Eth. Filter() is used to monitor the log on the chain, and Web3. Eth. Gettransaction() is used to extract the information of the specified transaction. Once the transaction information is obtained, it can be stored in the database for query
recommend a practical introction, you can see: Ethereum tutorial
what is Ethereum
Ethereum is often compared with bitcoin, but the situation is different. Bitcoin is a kind of cryptocurrency and distributed payment network, which allows bitcoin to be transferred between users
related: what is bitcoin? How does it work
Ethereum has a bigger goal. As Ethereum says, "Ethereum is a distributed platform running smart contracts.". These smart contracts run on "Ethereum virtual machine", a distributed computing network composed of all devices running Ethernet nodes
"distributed platform" means that anyone can set up and run an Ethereum node just as anyone can run a bitcoin node. Anyone who wants to run "smart contracts" on nodes must pay the operators of these nodes in ether, which is a cryptocurrency related to Ethereum. Therefore, the person running the Ethernet node provides computing power and gets paid in the Ethernet, which is similar to the way that the person running the bitcoin node provides hash power and pays in bitcoin
in other words, although bitcoin is only a blockchain and payment network, Ethereum is a distributed computing network, and its blockchain can be used for many other things. Details are provided in the Ethereum white paper
what is ether
Ethernet is a digital token (or cryptocurrency) related to Ethereum blockchain. In other words, Ethereum is the token and Ethereum is the platform. But now people often use these terms alternately. For example, coinbase allows you to buy Ethereum, which stands for Ethereum
this is technically "altcoin", which actually means a non bitcoin cryptocurrency. Like bitcoin, ether is supported by distributed blockchain - in this case, Ethereum blockchain
developers who want to create applications or Ethereum smart contracts on Ethereum blockchain need Ethernet token to pay for nodes to host it, while users of Ethereum based applications may need Ethernet to pay for services in these applications. People can also sell services outside the Ethereum network and accept Ethernet payments, or they can sell Ethernet tokens in cash - just like bitcoin
at present, the central bank's research on digital currency is still at an early stage, and it only plans to launch digital currency, but it is still far away from issuing digital currency. When the central bank studies digital currency, it may study the existing mainstream digital currencies such as bitcoin, Ruitai, dogcoin, etc.
let's first talk about the calculation method of "item": the difference between the number of items on both sides, such as 180.5 items on the black side and 180.5 items on the white side, is that the white side wins 7.5 items, because the black side has to post 7.5 items first
let's talk about the calculation method of "sub": half of the intersection point is 180.5 + 3 + 3 / 4 (half of 7.5 mesh). If one party wins by more than this number, the number of sub winning is the difference between the number of sub winning party and 180.5 + 3 + 3 / 4, which is the same as the above example, that is, white party wins 3 + 3 / 4.