Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the lack of Bytom Dapp development process?

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "Bytom Dapp development process is less what," interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "Bytom Dapp development process is less"!

overall process

The development process is divided into 1) writing smart contracts;2) issuing contract transactions;3) testing the method of unlocking contracts;4) developing Dapp front-end based on plug-in wallets;5) developing backend;

The process seems very simple, I wasted a lot of time in steps 1, 2 and 3. Some of these pits have been stepped on. Let's introduce them next;

1) Write smart contract, the above provided than the original chain DAPP development process, written very clearly, the use of equity is very simple, directly download the latest version with the command [./ Equity TradeOffer --instance] will get a string of compiled contract program code, referred to as smart contract program.

E:\GoWorks\src\github.com\equity\equity>equity.exe jiedai_6.txt --instance ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 260374 260474 260574 260674 260774 260874 260874 00141ccef16d2ac1ab22baa8acfa1633fdc32dfd55aa b1f38553d95177c53755996baf523da006da977008f069792bb6a2c3b6a253fb======= PartLoanCollateral =======Instantiated program:20b1f38553d95177c53755996baf523da006da977008f069792bb6a2c3b6a253fb1600141ccef16d2ac1ab22baa8acfa1633fdc32dfd55aa030afb03030afb0303a6fa030342fa0303def903037af9030316f90320ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4d2b015b7a76529c641d010000640c0100005c7900a0695c790500f2052a01947600a0695379cd9f5579cda09a916164380000005a95639a00000054798ccd9f5679cda09a916164500000005895639a00000055798ccd9f5779cda09a916164680000005695639a00000056798ccd9f5879cda09a916164800000005495639a00000057798ccd9f5979cda09a916164980000005295639a0000005195c3787ca169c3787c9f916164f5000000005e795479515e79c1695178c2516079c16952c3527994c251006079895f79895e79895d79895c79895b79895a79895979895879895779895679890274787e008901c07ec1696307010000005e795479515e79c16951c3c2516079c169632b010000587acd9f6900c3c2515c7ac1632b010000755b7aaa5b7a8800c3c2515d7ac1747800c0

2) Contract trading, first explain the logic of the contract, the savings dividend contract is too complicated, so we use currency trading contract to give an example.

contract TradeOffer(assetRequested: Asset, amountRequested: Amount, seller: Program, cancelKey: PublicKey) locks valueAmount of valueAsset { clause trade() { lock amountRequested of assetRequested with seller unlock valueAmount of valueAsset } clause cancel(sellerSig: Signature) { verify checkTxSig(cancelKey, sellerSig) unlock valueAmount of valueAsset }}

Take a look at the transaction chart of smart contract, which is convenient for Xiaobai to understand:

Therefore, the savings dividend contract must lock in some assets at the beginning, so it must be deployed to trade contracts. So how do you trigger it?

I deploy contracts through PC wallet interfaces, and many examples can be seen in the smart contract learning document.

PC wallet mode, all transactions must have three parts, build-transaction, sign-transaction, submit-transaction, three interfaces.

Pits trodden:

Debugging smart contracts is very slow, you have to wait until the transaction is confirmed to know whether it is successful, and the error is not obvious, you don't know where the problem is;

Solution:

Local PC wallet solonet mode debugging, change the source code, quickly block difficulty/difficulty.go

func CheckProofOfWork(hash, seed *bc.Hash, bits uint64) bool { compareHash := tensority.AIHash.Hash(hash, seed) return HashToBig(compareHash).Cmp(CompactToBig(bits))

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report