开发DAPP(去中心化应用)大致可分为四部分,首先开发智能合约,一般选择以太坊合约、bsc合约、tron合约建议采用solidity语言;接着部署智能合约,可先在测试网部署;然后,开发DAPP前端,一般采用VUE架构开发;最后,DAPP后端开发,一般需要后端作为辅助。
DAPP(去中心化应用)是什么?
去中心化应用,简称DAPP,通常与区块链平台例如以太坊相联系,一个在分布式点对点网络上运行的应用程序,而不是在一台中央计算机上,这使得网络的用户不依赖于中央计算机来发送和接收信息。只有当满足以下所有条件时,应用才能被称为DAPP:
1.应用程序必须是完全开源和自治的,没有实体控制应用程序的大部分令牌。应用程序必须能够根据市场反馈和技术要求进行升级,但只有在应用程序的用户达成共识后才能直接进行升级;
2.应用程序数据必须加密并存储在公共区块链上;
3.应用必须有令牌机制,矿工或者应用维护节点需要获得令牌奖励;
4.应用令牌的生成必须基于标准的加密算法,有价值的节点可以通过该算法准确获得应用令牌奖励。
What are the core elements of DAPP?
DAPP(decentralized application)code is completely open source,data is stored in smart contracts,and is fair and open.You can create a complete blockchain system and develop your own applications from scratch.This is equivalent to developing a new blockchain project,which is more laborious and requires higher capabilities.Our team has rich experience in developing blockchain projects,DAPP application development,and the system is stable.
The core elements of DAPP include development platform,consensus mechanism,and token distribution.At present,the most popular development platform is Ethereum;The consensus mechanism determines how nodes running DAPP reach consensus and obtain rewards.At present,the most commonly used consensus mechanisms are POW,POS,DPOS,etc;Generally,DAPP has built-in tokens.If you want more users to participate in the maintenance and use of DAPP,you need to consider how to distribute tokens to users.
关于部署合约代码:
./cmc client contract user create
--contract-name=fact
--runtime-type=DOCKER_GO
--byte-code-path=./testdata/claim-docker-go-demo/docker-fact.7z
--version=1.0
--sdk-conf-path=./testdata/sdk_config.yml
--admin-key-file-paths=./testdata/crypto-config/wx-org1.chainmaker.org/user/admin1/admin1.tls.key,./testdata/crypto-config/wx-org2.chainmaker.org/user/admin1/admin1.tls.key,./testdata/crypto-config/wx-org3.chainmaker.org/user/admin1/admin1.tls.key,./testdata/crypto-config/wx-org4.chainmaker.org/user/admin1/admin1.tls.key
--admin-crt-file-paths=./testdata/crypto-config/wx-org1.chainmaker.org/user/admin1/admin1.tls.crt,./testdata/crypto-config/wx-org2.chainmaker.org/user/admin1/admin1.tls.crt,./testdata/crypto-config/wx-org3.chainmaker.org/user/admin1/admin1.tls.crt,./testdata/crypto-config/wx-org4.chainmaker.org/user/admin1/admin1.tls.crt
--sync-result=true
--params="{}"
##调用合约
./cmc client contract user invoke
--contract-name=fact
--method=save
--sdk-conf-path=./testdata/sdk_config.yml
--params="{"file_name":"name007","file_hash":"ab3456df5799b87c77e7f88","time":"6543234"}"
--sync-result=true
##查询合约
./cmc client contract user get
--contract-name=fact
--method=findByFileHash
--sdk-conf-path=./testdata/sdk_config.yml
--params="{"file_hash":"ab3456df5799b87c77e7f88"}"