区块链
BCOS 标签描述

以下从开发(包括完整测试)的角度梳理每一步的关键点: 搭建区块链 这一步就不细说了,根据现在的开源文档,完全对应配置化就可以了,然后直接一撸到底,具体参见文档: https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/getstart/index.html 对应的节点起来以后,通过ps-ef|grepfisco来验证对应目录的节点是否正常启动。 合约的创建与部署 先写一个简单的合约,如下,一个Demo,用来更新合约中的一个balance值,返回对应的地址: pragma solidity ^0....

  L5Ww0Ggv00OG   2023年11月02日   46   0   0 区块链BCOSFISCO

1.安装FISCOBCOS,单群组FISCOBCOS联盟链的搭建、启动、停止 https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/installation.html   2.快速搭建节点前置服务(WeBASE-Front),就可通过WeBASE-Front的合约编辑器进行合约的编辑,编译,部署,调试 https://fintech.webank.com/developer/docs/webase/docs/WeBASE-Install/developer.html   3. 使用...

  DJsdk34H4Gbu   2023年11月02日   41   0   0 区块链BCOSFISCO

1.搭建联盟链 https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/articles/4_tools/five_step_to_develop_application.html https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/installation.html 2.安装webase https://fintech.webank.com/developer/docs/webase/docs/WeBASE-Install/deve...

  DJsdk34H4Gbu   2023年11月02日   36   0   0 区块链BCOSFISCO

1.函数定义returns定义好返回个数; 2.函数中使用return(x,x,x)返回 3.效果 <!-本文包含:- <!--

  DJsdk34H4Gbu   2023年11月02日   29   0   0 区块链BCOSFISCO

1.先安装webase-front,使用它的IDE编译智能合约(可以查看我其它文章https://blog.csdn.net/u013288190/article/details/108762775) 2.例子功能说明:https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/articles/3_features/35_contract/entry_quick_guide.html 3.源码 StudentScoreByCRUD.sol pragmasolidity^0.4.25; //import"./Tab...

  DJsdk34H4Gbu   2023年11月02日   23   0   0 区块链BCOSFISCO

Solidity智能合约是没法返回json对象、字典、结构体的。 https://vomtom.at/how-to-return-a-mapping-in-solidity-and-web3/ &nbsp; 解决方案:返回多个数组,然后在应用层再进行拼接。 返回数组的方法:https://blog.csdn.net/u013288190/article/details/108832503 //一定要在文件开头引入这个 pragmaexperimentalABIEncoderV2; //查询某个学生的所有成绩 functionselect_scores_info(addressstu...

  DJsdk34H4Gbu   2023年11月02日   44   0   0 区块链BCOSFISCO

1.定义函数时,返回值需要定义为数组,比如int[] 2.函数中需要根据数据的多少初始化数组的大小 3.为数组一一赋值 //查询某个学生的某课成绩所有成绩 functionselect_all_scores(addressstudentId,stringcourseName)publicviewreturns(int[]){ TableFactorytf=TableFactory(0x1001); Tabletable=tf.openTable("stu_score"); stringmemorystuIdStr=addressToString(studentId); ...

  DJsdk34H4Gbu   2023年11月02日   32   0   0 区块链BCOSFISCO

&nbsp; //一定要写这个 pragmaexperimentalABIEncoderV2; //批量插入成绩操作 functionbatch_insert(addressstudentId,string[]courseName,int[]score)publiconlyOwnerreturns(string[],int[]){ return(courseName,score); } &nbsp; &nbsp; <!-本文包含:- <!--

  DJsdk34H4Gbu   2023年11月02日   24   0   0 区块链BCOSFISCO

最开始引入: pragmaexperimentalABIEncoderV2; &nbsp; pragmasolidity^0.4.25; pragmaexperimentalABIEncoderV2; //import"./Table.sol"; contractStudentScoreByCRUD{ addressprivate_owner; modifieronlyOwner{ require(_ownermsg.sender,"Auth:onlyownerisauthorized"); _; } constructor()public{ _owner=...

  DJsdk34H4Gbu   2023年11月02日   46   0   0 区块链BCOSFISCO

一、原因: stack保存很小的局部变量,免费使用,但有数量限制(16个变量),包含参数和返回值(includingparametersandreturnparameters) https://blog.csdn.net/HiBlock/article/details/82763399 &nbsp;二、解决方法: 1.减少输入参数: a.以数组的方式传入 原来是 //设置用户信息 functionset_user_info(stringuser_address,stringname,stringage)publicreturns(int){ TableFactorytf=TableFa...

  DJsdk34H4Gbu   2023年11月02日   37   0   0 区块链BCOSFISCO

&nbsp; //批量插入成绩操作 functionbatch_insert(addressstudentId,string[]courseNames,int[]scores)publiconlyOwnerreturns(int){ TableFactorytf=TableFactory(0x1001); Tabletable=tf.openTable("stu_score"); stringmemorystuIdStr=addressToString(studentId); intcount=0; for(inti=0;i&lt;int(courseNa...

  DJsdk34H4Gbu   2023年11月02日   37   0   0 区块链BCOSFISCO

1.安装FISCOBCOS,单群组FISCOBCOS联盟链的搭建、启动、停止 https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/installation.html &nbsp; 2.快速搭建节点前置服务(WeBASE-Front),就可通过WeBASE-Front的合约编辑器进行合约的编辑,编译,部署,调试 https://fintech.webank.com/developer/docs/webase/docs/WeBASE-Install/developer.html &nbsp; 3.&nbsp;使用...

  DJsdk34H4Gbu   2023年11月02日   39   0   0 数据库智能合约BCOShtml其他

一、字符串得用双引号,不能用单引号 ❌ 'helloworld' ['1','2'] ✅ "helloworld" ["1","2"] &nbsp; 二、引号是否对齐补齐了 ❌ ["1,"2"] <!-本文包含:- <!--

  DJsdk34H4Gbu   2023年11月13日   35   0   0 区块链BCOSFISCO