Position: Home page » Ethereum » Java calling Ethereum contract

Java calling Ethereum contract

Publish: 2021-05-25 05:00:28
1.

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

2. Gas & gt; ethestimateGas({ from:ethaccounts [1], to: ethaccounts[2], value:50000000000000 }) 21001 > Ethgasprice 2000000000, as shown above, shows this account [1] = & gt; The transaction of account [2] needs 21001 gas, and the current gasprice is 2000000000. How many gas does it take to send transaction / call contract method in Ethereum
3. Ethereum is a distributed computing platform. It generates an cryptocurrency called ether. Programmers can write "smart contracts" on the Ethereum blockchain, and these Ethereum smart contracts will be executed automatically according to the code

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
4.

Yes, refer to the interaction between contracts. Digital currency exchange platform for example, I am trying to sign a smart contract from another factory contract and then redeploy the address of the new smart contract. However, the address it returns is the transaction hash, not the contract address. I believe this is because when the address is returned, the contract has not been exploited. When I deploy the smart contract with Web3, it seems that it will not output the contract address until the smart contract is deployed

5. There is no inevitable relationship between whether the virtual currency will disappear or not and whether it can not be used on the third-party platform. Online third-party trading platform can only say that this kind of currency has another platform for trading, which shows that this kind of currency is more reliable
Ruitai coin has not been launched on the third-party platform, but it is rumored that it will also be launched on the third-party platform.
6.

Generally speaking, the steps of deploying smart contract are as follows:

  1. start an Ethereum node (such as geth or testrpc)

  2. use Solc to compile smart contracts=& gt; Get the binary code

  3. deploy the compiled contract to the network This step will consume Ethernet currency, and you need to use the default address or specified address of your node to sign the contract.)=& gt; Get the blockchain address and ABI of the contract (JSON representation of the contract interface, including variables, events and callable methods) The author confused ABI with contract interface here. ABI is the binary representation of the contract interface.)

  4. use the JavaScript API provided by web3.js to call the contract Depending on the type of call, it may consume Ethernet currency.)

7. In solidness, a contract consists of a set of code (contract function) and data (contract state). The contract is located at a special address on the Ethereum blockchain. uint storedData; This line of code declares a state variable, named storeddata, of type uint (256 bits unsigned integer). You can think of it as a storage unit in a database. Just like managing a database, you can query and modify it by calling functions. In Ethereum, usually only the owner of the contract can do so. In this example, the functions set and get are used to modify and query the values of variables, respectively

like many other languages, when accessing state variables, it is not necessary to add a prefix such as this

this contract can't do a lot (limited by Ethereum's infrastructure), it just allows anyone to store a number. And anyone in the world can access this number. There is no reliable way to protect the number you publish. Anyone can call the set method to set a different number to cover your published number. But your numbers will remain in the history of blockchain. Later we'll learn how to add an access limit so that only you can change the number

token example

the next contract will implement a cryptocurrency in the simplest form. Taking money in the air is no longer a magic trick. Of course, only the person who creates the contract can do it (it's also very easy to use other currency issuance modes, just to realize the differences in details). And anyone can send money to others, without registering a user name and password, as long as there is a pair of Ethereum public and private keys

note
this is not a good example for online solidness environments. If you use the online solidity environment to try this example. The address of from cannot be changed when the function is called. So you can only play the role of a coiner, you can cast money and send it to others, but you can't play the role of others. This online solidity environment will be improved in the future.
8.

Solidness language is a special language for writing and executing smart contracts. It is a contract oriented high-level language running on the basis of Ethereum virtual machine. It was first proposed by the former CTO and co-founder Gavin wood of Ethereum in August 2014. Later, Ethereum developers set up a special team to continuously improve solidness language, At present, it is still under development and optimization. The development storage area on GitHub is HTPs / github.com/thereum/solidness. Here we can learn the most comprehensive details and related documents about the development and iteration process of solidness language. In terms of language style, solid language is deeply influenced by C + +, Python and JavaScript. It is a static programming language, compiled in bytecode mode, so it can run on Ethereum virtual machine. Gavin wood uses the syntax rules of ECMAScript scripting language of JavaScript for reference when developing solid language, which makes it somewhat similar to the existing web development language, but it is quite different. For example, solid language has static type, variable return function and so on. The most important point is that solid language can write contracts with self executing business logic and embedded in smart contracts. Therefore, it is not only one of the basic programming languages of Ethereum, but also the basic programming languages of most other Ethereum based blockchain procts (blockchain 2.0) with smart contracts, It is widely used in the vast majority of blockchain procts, such as hyperledger project, which is developed with soliditv language

the Xueshuo innovation blockchain Technology Workstation of Lianqiao ecation online is the only approved "blockchain Technology Specialty" pilot workstation of "smart learning workshop 2020 Xueshuo innovation workstation" launched by the school planning, construction and development center of the Ministry of ecation of China. Based on providing diversified growth paths for students, the professional station promotes the reform of the training mode of the combination of professional degree research, proction, learning and research, and constructs the applied and compound talent training system

Hot content
Inn digger Publish: 2021-05-29 20:04:36 Views: 341
Purchase of virtual currency in trust contract dispute Publish: 2021-05-29 20:04:33 Views: 942
Blockchain trust machine Publish: 2021-05-29 20:04:26 Views: 720
Brief introduction of ant mine Publish: 2021-05-29 20:04:25 Views: 848
Will digital currency open in November Publish: 2021-05-29 19:56:16 Views: 861
Global digital currency asset exchange Publish: 2021-05-29 19:54:29 Views: 603
Mining chip machine S11 Publish: 2021-05-29 19:54:26 Views: 945
Ethereum algorithm Sha3 Publish: 2021-05-29 19:52:40 Views: 643
Talking about blockchain is not reliable Publish: 2021-05-29 19:52:26 Views: 754
Mining machine node query Publish: 2021-05-29 19:36:37 Views: 750