Taiyue Blockchain-Dapp background development record (1)

tags: Blockchain operation manual  javascript

For example: To get the signature from the APP, the current thinking is that the front-end signs through Dapp, and after signing the signature, it is processed through the back-end chainService service.

APP interface copywriting:

get_signedTx:

js:

{

	"timestamp":"" //string
	
	"method": "get_signedTx"//string
	
	"data":{
	
		"from":""//string
		
		"message":""//string
		
		"tx":{
		
			"to":""//string
			
			"value":""//string
			
			"data":""//string
			
			"nonce":""//string
			
			"gas":""//string
			
			"gasPrice":""//string
			
			"chainId":""//string
			
			"coin":""//string can be ""
			
			"chainType":""//string "0","1".....
			
			"contract":""//string "true"/"eth"
			
			"contractAddress":""//string is not ""
		
		}
		
	}

}

app:

{

	"timestamp":"" //string
	
	"method": "get_signedTx"//string
	
	"data":{
	
		"ok":true/false//bool
		
		"rawTx":""//string
		
	}

}

In addition, there are several points to note for the use of dapp:

1. First call the TPxxx interface of the chainService service version XX to obtain the chain data, and obtain the corresponding nonce, gasLimit, and gasPrice; call method AG:

Parameters:
{
 address: "Wallet Address",
 chain: "Node chain mark 0: Initial chain 1: Initial chain testnet 2: Ethereum 3: Ethereum testnet 4: Bitcoin",
 ethFunction: {
  inputParameters: [{
   type: "address",
   value: "Coin address"
  }, {
   type: "uint256",
   value: "Receive coins Gwei, example 1000000000000000000"
  }],
  name: "Call ABIname, example transfer",
  outputParameters: [{
   "type": "bool"
  }]
 }
}
 Description:
 The inputParameters and outputParameters depend on the configuration writing method corresponding to ABIname. 

2. JS assembly example:

let gasPrice = new Decimal(divnew Decimal1000000000000000000toFixed// gasLimit is the upper limit of gas available in a transaction, gas is the paid miner fee, gasPrice is how much Gwei is willing to pay for 1 unit of gas and ether
let txParams = to: "Coin address",
value: "0",
data: "The function that returns the result in the first step",
nonce: "The first step returns the nonce of the result",
gas: "The first step returns the limitToken of the result",
gasPrice: gasPricetoString,
chainId: ,
coin:"",
chainType: "Chain node tag", 
contract: "Coin Contract Chain Type", 
contractAddress: 

Intelligent Recommendation

Actual combat-hands-on development of the first blockchain voting DAPP

Reprinted from https://www.imooc.com/article/25330 Foreword I am a rookie, so the quality of the code may not be very good, welcome your advice. Reading this article may require a certain foundation, ...

Notes on Dapp Development Based on Blockchain-Chapter One-Environmental Requirements

Environmental requirements Ethereum private chain environment NodeJS environment Truffle environment Ethereum Wallet wallet Ethereum private chain construction After installation, executegeth --helpCo...

Implementation of Ethereum Blockchain Entering Gate Simple DApp development

Preliminary preparation This DAPP is developed with Ganache-CLI's private chain, using Express to create projects, web3js to connect to the private chain If web3js is always installing an error, pleas...

Learning blockchain from scratch and learning about dapp development

What is a DApp Everyone should be familiar with the app. It is the various applications we often use. So what is d? Everyone should be familiar with the decentralized characteristics of blockchain, so...

Blockchain learning record 1

Following the online tutorial, I implemented a simple blockchain with java. The real Bitcoin should add 10,000 details :) is mainly based on the following articles: Detailed explanation of the princip...

More Recommendation

Ethereum private chain DApp development environment (1)

First, preparation before installation 1.1 Viewing the current CPU architecture Execute the following command in the terminal to determine whether it is a 32-bit architecture or a 64-bit architecture:...

Ethereum DAPP development (1)-environment construction

Ethereum DAPP development (1)-environment construction  Free flooding_ad44 attention 2018.05.06 14:22 Word Count 496 Read 301 Comments 0 Likes 0 Let's useTruffleFramework for DAPP developmen...

Ethereum-based Dapp development learning experience (1)

1. Introduction to Ethereum The learning content includes three parts: the use of smart wallet, the smart contract Solidity and truffle framework, IPFS distributed storage Ethereum: It is an open sour...

Truffle blockchain music Dapp

Source github address https://github.com/873421427/blockchainProject Background of the topic, based on Distributed Music Applications Based on Blockchain and Smart Contracts Topic Background Since the...

Develop dapp with EOS.IO blockchain

Listening to Bettina WarburgSpeechAfter that, I was fascinated by the concept of decentralized economy (dApps). The traditional web application is: Frontend→Backend→Database In contrast, the...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top