当前位置: 首页 > news >正文

FiscoBcos使用Go调用合约

环境: fisco2.8.0
go 1.17
go-sdk 1.0.0
solidity 0.4.25

前言

请提前启动好四个fisco节点。

请准备好一个属于此fisco节点的账户私钥【待会调用合约和部署合约会用到】

此文章将讲解 官方文档使用gosdk部署helloworld合约并调用其方法 合约开发样例

官网提示

Golang, 版本需不低于1.13.6,本项目采用go module进行包管理。具体可查阅Using Go Modules,环境配置
FISCO BCOS 2.2.0+, 需要提前运行 FISCO BCOS 区块链平台,可参考安装搭建
Solidity编译器,默认0.4.25版本

gosdk的拉取

# 拉取代码
git clone https://github.com/FISCO-BCOS/go-sdk.git# 若因为网络问题导致长时间无法执行上面的命令,请尝试以下命令:
git clone https://gitee.com/FISCO-BCOS/go-sdk.git
root@192-168-19-133:/usr/project/goproject# ll
drwxr-xr-x 17 root root 4096 1116 10:29 go-sdk/

go-sdk的tag版本

root@192-168-19-133:/usr/project/goproject/go-sdk# git show
commit d1a8411d0e7600e2ece7c50c6da523ee52f32a45 (HEAD -> master, tag: v1.0.0, origin/master, origin/HEAD)
Merge: 5ca92a0 797900f
Author: XingQiang Bai <bxq2011hust@qq.com>
Date:   Thu May 12 17:22:46 2022 +0800Merge pull request #148 from FISCO-BCOS/release-v1.0.0Release v1.0.0

创建 helloworld的项目

我选择不跟官网的步骤,不在go-sdk目录进行创建,选择在gopath的工作目录下面进行项目创建【这样比较方便管理】

root@192-168-19-133:/usr/project/goproject# mkdir helloworld

然后进行go项目初始化

root@192-168-19-133:/usr/project/goproject/helloworld# go mod init helloworld
go: creating new go.mod: module helloworld

然后在helloworld目录下,编写一个HelloWorld.sol的合约

pragma solidity>=0.4.24 <0.6.11;contract HelloWorld {string value;constructor() public {value = "你好,golang!";}function get() public view returns (string memory) {return value;}function set(string v) public {value = v;}
}

进行安装solc编译器

在helloworld项目下执行此命令,需要用到在go-sdk里面的下载编译器脚本文件, go-sdk的目录需要根据各自的实际情况来选择

 bash  /usr/project/goproject/go-sdk/tools/download_solc.sh -v 0.4.25 # 它会做链接到当前目录下
root@192-168-19-133:/usr/project/goproject/helloworld# bash  /usr/project/goproject/go-sdk/tools/download_solc.sh -v 0.4.25
Downloading solc 0.4.25 solc-linux.tar.gz from https://github.com/FISCO-BCOS/solidity/releases/download/v0.4.25/solc-linux.tar.gz
==============================================================
[INFO] os            : linux
[INFO] solc version  : 0.4.25
[INFO] solc location : ./solc-0.4.25
==============================================================
[INFO] ./solc-0.4.25 --version
solc, the solidity compiler commandline interface
Version: 0.4.25+commit.46d177ad.mod.Linux.g++
root@192-168-19-133:/usr/project/goproject/helloworld# ll
总用量 12
drwxr-xr-x 2 root root 4096 1116 10:46 ./
drwxrwxrwx 8 root root 4096 1116 10:38 ../
-rw-r--r-- 1 root root  294 1116 10:43 HelloWorld.sol
lrwxrwxrwx 1 root root   29 1116 10:46 solc-0.4.25 -> /root/.fisco/solc/solc-0.4.25*

生成abi,bin文件

使用solc 进行编译 命令的意思是,根据HelloWorld.sol生成abi,bin文件到当前目录下

root@192-168-19-133:/usr/project/goproject/helloworld# ./solc-0.4.25 --bin --abi -o ./ ./HelloWorld.sol #
root@192-168-19-133:/usr/project/goproject/helloworld# ll
总用量 20
drwxr-xr-x 2 root root 4096 1116 10:49 ./
drwxrwxrwx 8 root root 4096 1116 10:38 ../
-rw-r--r-- 1 root root  375 1116 10:49 HelloWorld.abi
-rw-r--r-- 1 root root 2010 1116 10:49 HelloWorld.bin
-rw-r--r-- 1 root root  294 1116 10:43 HelloWorld.sol
lrwxrwxrwx 1 root root   29 1116 10:46 solc-0.4.25 -> /root/.fisco/solc/solc-0.4.25*

构建go-sdk的代码生成工具abigen

该工具用于将 abi 和 bin 文件转换为 go 文件
进入go-sdk目录,编译生成abigen工具 [会生成一个abigen的二进制文件]

root@192-168-19-133:/usr/project/goproject/go-sdk# go build ./cmd/abigen/
root@192-168-19-133:/usr/project/goproject/go-sdk# ll | grep abigen
-rwxr-xr-x  1 root root 21519720 1116 11:33 abigen*

若 上面步骤报错:可以在go-sdk目录执行此命令,把依赖重新下载导入一下

go mod tidy

然后将此文件复制到helloworld项目,[此abigen可以复用,以后想用abigen,直接复制就可以了,不需要再去go-sdk里再编译]

 cp -r abigen ../helloworld/`

编译生成go文件

在helloworld目录下执行命令编译

./abigen --bin ./HelloWorld.bin --abi ./HelloWorld.abi --pkg helloworld --type HelloWorld --out ./HelloWorld.go

命令的意思是使用bin,abi文件在当前目录下 生成一个包为helloworld ,类型为HelloWorld的HelloWorld.go文件

root@192-168-19-133:/usr/project/goproject/helloworld# ll
drwxrwxrwx 4 root root     4096 1116 11:36 ./
drwxrwxrwx 8 root root     4096 1116 11:35 ../
-rwxrwxrwx 1 root root 21519720 1116 11:37 abigen*
-rwxrwxrwx 1 root root      531 1116 11:06 config.toml*
-rw-r--r-- 1 root root     1970 1116 11:31 go.mod
-rwxrwxrwx 1 root root      375 1116 10:49 HelloWorld.abi*
-rwxrwxrwx 1 root root     2010 1116 10:49 HelloWorld.bin*
-rwxrwxrwx 1 root root    13739 1116 11:03 HelloWorld.go*
-rwxrwxrwx 1 root root      294 1116 10:43 HelloWorld.sol*
lrwxrwxrwx 1 root root       29 1116 10:46 solc-0.4.25 -> /root/.fisco/solc/solc-0.4.25*

准备部署合约的相关文件

拷贝 config.toml 并修改配置

将 go-sdk目录下config.toml拷贝到helloworld目录下

cp -r ../go-sdk/config.toml .

拷贝节点的sdk文件目录到helloworld目录下【根据自己的机子存放情况来执行命令】
拷贝账户私钥到helloworld目录下【前言有说明】

当前目录存在的文件

root@192-168-19-133:/usr/project/goproject/helloworld# ll
总用量 21120
drwxrwxrwx 4 root root     4096 1116 12:41 ./
drwxrwxrwx 8 root root     4096 1116 11:35 ../
-rwxrwxrwx 1 root root 21519720 1116 11:37 abigen*
-rwxrwxrwx 1 root root      249 1116 11:05 admin.pem*   ## 私钥
-rwxrwxrwx 1 root root      531 1116 11:06 config.toml* ## 配置文件
-rw-r--r-- 1 root root     1970 1116 11:31 go.mod  # go mod文件
-rwxrwxrwx 1 root root      375 1116 10:49 HelloWorld.abi*
-rwxrwxrwx 1 root root     2010 1116 10:49 HelloWorld.bin*
-rwxrwxrwx 1 root root    13739 1116 11:03 HelloWorld.go*
-rwxrwxrwx 1 root root      294 1116 10:43 HelloWorld.sol*
drwxrwxrwx 2 root root     4096 1116 11:03 sdk/ # 节点连接证书
lrwxrwxrwx 1 root root       29 1116 10:46 solc-0.4.25 -> /root/.fisco/solc/solc-0.4.25*

修该config.toml


[Network]
#type rpc or channel
Type="channel"
# 三个节点证书,使用相对路径
CAFile="./sdk/ca.crt"   
Cert="./sdk/sdk.crt"
Key="./sdk/sdk.key"
# if the certificate context is not empty, use it, otherwise read from the certificate file
# multi lines use triple quotes
CAContext=''''''
KeyContext=''''''
CertContext=''''''[[Network.Connection]]
NodeURL="127.0.0.1:20200"  # 节点的地址
GroupID=1  # 群组id
# [[Network.Connection]]
# NodeURL="127.0.0.1:20200"
# GroupID=2[Account]
# only support PEM format for now
KeyFile="./admin.pem"  #使用什么账户调用合约[Chain]
ChainID=1 #链id
SMCrypto=false # 费国密[log]
Path="./"

编写部署合约的go文件 并部署

在helloworld目录下创建cmd文件夹,在cmd文件夹下创建一个main.go文件
代码如下

package mainimport ("fmt""log""helloworld"  //导入本地项目helloworld"github.com/FISCO-BCOS/go-sdk/client""github.com/FISCO-BCOS/go-sdk/conf"
)func main(){configs, err := conf.ParseConfigFile("config.toml")  //读取config.toml文件if err != nil {log.Fatal(err)}config := &configs[0]client, err := client.Dial(config)  //加载配置文件,生成client进行相关链操作if err != nil {log.Fatal(err)}address, tx, instance, err := helloworld.DeployHelloWorld(client.GetTransactOpts(), client) // 调用hellowrold的部署合约方法if err != nil {log.Fatal(err)}fmt.Println("contract address: ", address.Hex())  // 合约的地址fmt.Println("transaction hash: ", tx.Hash().Hex())  //此次部署合约的交易hash_ = instance
}

然后在helloworld目录下执行依赖包导入命令

go mod tidy

如果导入失败了,可以复制go-sdk的go.mod和go.sum文件,修改好项目名,进行go mod tidy
还有确保GO111MODULE是on

此时项目的目录

root@192-168-19-133:/usr/project/goproject/helloworld# ll
总用量 21120
drwxrwxrwx 4 root root     4096 1116 12:50 ./
drwxrwxrwx 8 root root     4096 1116 11:35 ../
-rwxrwxrwx 1 root root 21519720 1116 11:37 abigen*
-rwxrwxrwx 1 root root      249 1116 11:05 admin.pem*
drwxrwxrwx 2 root root     4096 1116 12:47 cmd/
-rwxrwxrwx 1 root root      531 1116 12:42 config.toml*
-rw-r--r-- 1 root root     1970 1116 11:31 go.mod
-rw-r--r-- 1 root root    46323 1116 11:31 go.sum
-rwxrwxrwx 1 root root      375 1116 10:49 HelloWorld.abi*
-rwxrwxrwx 1 root root     2010 1116 10:49 HelloWorld.bin*
-rwxrwxrwx 1 root root    13739 1116 11:03 HelloWorld.go*
-rwxrwxrwx 1 root root      294 1116 10:43 HelloWorld.sol*
drwxrwxrwx 2 root root     4096 1116 11:03 sdk/
lrwxrwxrwx 1 root root       29 1116 10:46 solc-0.4.25 -> /root/.fisco/solc/solc-0.4.25*

在helloworld 文件夹下执行命令 go run cmd/main.go

root@192-168-19-133:/usr/project/goproject/helloworld# go run cmd/main.go
contract address:  0xA2132f9E796F954f4483A7078a357114F54D2f1B
transaction hash:  0x741fe11c3f1da7ad2ca43deb3b7045c170ce43aa5b3581bdfbf86a6fc323e331

然后就获得了部署合约的地址,部署成功

编写get/set方法的go文件,并调用

根据官网的例子,在helloworld文件夹下创建contract文件夹,并在在contract文件夹下编写go文件helloworld_set_get.go文件

package mainimport ("fmt""log""helloworld"  //导入本地项目helloworld"github.com/FISCO-BCOS/go-sdk/client""github.com/FISCO-BCOS/go-sdk/conf""github.com/ethereum/go-ethereum/common"
)func main() {configs, err := conf.ParseConfigFile("config.toml")   //读取配置文件if err != nil {log.Fatal(err)}config := &configs[0]  client, err := client.Dial(config)  //加载配置文件,生成clientif err != nil {log.Fatal(err)}// load the contractcontractAddress := common.HexToAddress("0xA2132f9E796F954f4483A7078a357114F54D2f1B") // 这里请放入刚刚部署的合约地址,注意,是你自己的机子部署的地址instance, err := helloworld.NewHelloWorld(contractAddress, client)  //根据地址和client生成helloworld合约对象if err != nil {log.Fatal(err)}helloworldSession := &helloworld.HelloWorldSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}  //根据合约对象和client的call和transact进行实例化一个合约通信对象 helloworldSessionvalue, err := helloworldSession.Get()    // 调用get方法if err != nil {log.Fatal(err)}fmt.Println("value :", value)value = "Hello, Hello,Hello"tx, receipt, err := helloworldSession.Set(value)  // 调用set方法if err != nil {log.Fatal(err)}fmt.Printf("tx sent: %s\n", tx.Hash().Hex())  //调用set方法的交易hashfmt.Printf("transaction hash of receipt: %s\n", receipt.GetTransactionHash())  //调用set方法的交易hash ,与上面的hash是一样,只是存在不同的地方而已
}

执行go文件,在helloworld目录下

 go run contract/helloworld_set_get.go

结果

root@192-168-19-133:/usr/project/goproject/helloworld# go run contract/helloworld_set_get.go
value : 你好,golang!
tx sent: 0x5a49ac1b48ebe717c75cbeb3a3144a031db8cfd5a0cdf7c38a151a87f1454583
transaction hash of receipt: 0x5a49ac1b48ebe717c75cbeb3a3144a031db8cfd5a0cdf7c38a151a87f1454583

结语

相较于fisco的java-sdk ,go-sdk的使用起来还是比较困难,因为webase也集成了java-sdk,一键就能导出所有所需要的java项目文件。
若有空,我将讲解如果结合goweb的框架,集成fisco和使用go文件调用合约,生成web项目【我比较倾向讲解beego框架】。

相关文章:

FiscoBcos使用Go调用合约

环境&#xff1a; fisco2.8.0 go 1.17 go-sdk 1.0.0 solidity 0.4.25 前言 请提前启动好四个fisco节点。 请准备好一个属于此fisco节点的账户私钥【待会调用合约和部署合约会用到】 此文章将讲解 官方文档使用gosdk部署helloworld合约并调用其方法 合约开发样例 官网提示 G…...

自然语言处理(NLP)-spacy简介以及安装指南(语言库zh_core_web_sm)

spacy 简介 spacy 是 Python 自然语言处理软件包&#xff0c;可以对自然语言文本做词性分析、命名实体识别、依赖关系刻画&#xff0c;以及词嵌入向量的计算和可视化等。 1.安装 spacy 使用 “pip install spacy" 报错&#xff0c; 或者安装完 spacy&#xff0c;无法正…...

CTF-PWN-tips

文章目录 overflowscanfgetreadstrcpystrcat Find string in gdbgdbgdb peda Binary ServiceFind specific function offset in libc手工自动 Find /bin/sh or sh in library手动自动 Leak stack addressFork problem in gdbSecret of a mysterious section - .tlsPredictable …...

《Effective C++》条款21

必须返回对象时&#xff0c;别妄想返回其reference 如果你的运算符重载函数写成了返回reference的形式&#xff1a; class A { public:A(int a,int b):x(a),y(b){}friend const A& operator*(const A& a, const A& b); private:int x;int y; }; const A& opera…...

决策树,sql考题,30个经典sql题目

大数据&#xff1a; 2022找工作是学历、能力和运气的超强结合体&#xff0c;遇到寒冬&#xff0c;大厂不招人&#xff0c;可能很多算法学生都得去找开发&#xff0c;测开 测开的话&#xff0c;你就得学数据库&#xff0c;sql&#xff0c;oracle&#xff0c;尤其sql要学&#x…...

【ES6.0】- 扩展运算符(...)

【ES6.0】- 扩展运算符... 文章目录 【ES6.0】- 扩展运算符...一、概述二、拷贝数组对象三、合并操作四、参数传递五、数组去重六、字符串转字符数组七、NodeList转数组八、解构变量九、打印日志十、总结 一、概述 **扩展运算符(...)**允许一个表达式在期望多个参数&#xff0…...

关于Java中的深拷贝与浅拷贝

Java中的深拷贝和浅拷贝是针对对象和数组等引用数据类型的复制操作。 浅拷贝&#xff08;Shallow Copy&#xff09;&#xff1a; 对于基本数据类型&#xff0c;浅拷贝直接复制其值。对于引用数据类型&#xff0c;浅拷贝只复制对原对象的引用&#xff0c;而不是复制对象本身。因…...

13.真刀实枪做项目---博客系统(页面设计)

文章目录 1.预期效果1.1博客列表页效果1.2博客详情页效果1.3博客登陆页效果1.4博客编辑页效果 2.实现博客列表页2.1实现导航栏2.2实现版心2.3实现个人信息2.4实现博客列表2.5博客列表页完整代码 3.实现博客正文页3.1引入导航栏3.2引入版心3.3引入个人信息3.4实现博客正文3.5博客…...

VScode 配置用户片段

文件->首选项->配置用户片段->新建全局用户片段 后续就可以通过vv3来直接生成下面的代码 {// Place your 全局 snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and // description. Add comma separated ids of the l…...

Fedora 项目近日发布了 Fedora Linux 39

导读几经推迟之后&#xff0c;Fedora 项目近日发布了 Fedora Linux 39&#xff0c;这是红帽公司赞助的面向大众的 GNU/Linux 发行版的最新稳定版本&#xff0c;采用了最新的技术和开源应用程序。 Fedora Linux 39 由 Linux 内核 6.5 支持&#xff0c;并提供了一些最新的桌面环境…...

Uniapp连接iBeacon设备——实现无线定位与互动体验(理论篇)

目录 前言&#xff1a; 一、什么是iBeacon技术 二、Uniapp连接iBeacon设备的准备工作 硬件设备&#xff1a; 三、Uniapp连接iBeacon设备的实现步骤 创建Uniapp项目&#xff1a; 四、Uniapp连接iBeacon设备的应用场景 室内导航&#xff1a; 五、Uniapp连接iBeacon设备的未来…...

GCD:异步同步?串行并发?一文轻松拿捏!

GCD 文章目录 GCD进程线程进程与线程的关系进程与线程的区别 任务&#xff08;执行的代码&#xff09;队列线程与队列的关系 队列任务**同步执行任务&#xff08;sync&#xff09;**辅助方法**异步执行任务&#xff08;async)**总结栅栏任务迭代任务 队列详细属性QoSAttributes…...

学习c#的第十七天

目录 C# 异常处理 异常的原因 System.Exception 类 如何处理异常 常见的异常类 throw 语句 throw 表达式 try 语句 try-catch 语句 try-finally 语句 try-catch-finally 语句 when 异常筛选器 异步和迭代器方法中的异常 C# 异常处理 C # 中的异常提供了结构化、统…...

龙芯 操作系统选择和安装

龙芯3a5000及之后的cpu底层架构已经从mips64el改为了loongarch64 所以这里分了2种来说明&#xff0c;分别对应3a4000之前的和3a5000之后的 龙芯的系统安装难点在于操作系统的选取和引导 一、烧录工具 制作安装盘使用常规的烧录工具是不行滴&#xff0c;会提示没有\boot\initrd…...

【开源】基于JAVA的智能停车场管理系统

项目编号&#xff1a; S 005 &#xff0c;文末获取源码。 \color{red}{项目编号&#xff1a;S005&#xff0c;文末获取源码。} 项目编号&#xff1a;S005&#xff0c;文末获取源码。 目录 一、摘要1.1 项目介绍1.2 项目录屏 二、研究内容A. 车主端功能B. 停车工作人员功能C. 系…...

使用IDEA 将Eclipse java工程转为maven格式

使用IDEA 将Eclipse java工程转为maven格式 ①使用idea打开项目&#xff0c;在项目根目录下右键选择 Add Framework Support 选择 maven &#xff0c;引入maven ②找到项目中的.classpath文件或者lib目录 根据.classpath文件或者lib目录中列举的jar包名&#xff0c;将其依次手…...

CCF CSP认证 历年题目自练Day47

题目 试题编号&#xff1a; 201712-3 试题名称&#xff1a; Crontab 时间限制&#xff1a; 10.0s 内存限制&#xff1a; 256.0MB 样例输入 3 201711170032 201711222352 0 7 * * 1,3-5 get_up 30 23 * * Sat,Sun go_to_bed 15 12,18 * * * have_dinner 样例输出 201711170…...

LeetCode Hot100之十:239.滑动窗口最大值

题目 给你一个整数数组 nums&#xff0c;有一个大小为 k 的滑动窗口从数组的最左侧移动到数组的最右侧。你只可以看到在滑动窗口内的 k 个数字。滑动窗口每次只向右移动一位。 返回 滑动窗口中的最大值 。 提示&#xff1a; 1 < nums.length < 10^5 -10^4 < nums[i…...

x264、x265、OpenH264 简要对比

一&#xff1a; x264、x265、OpenH264&#xff0c;都是开源代码库&#xff1b;二&#xff1a; H264(MPEG-4/AVC)、H265(HEVC)&#xff0c;是视频编码格式。是视频标准&#xff1b; H264(MPEG-4/AVC) 简称: H264 或 AVC&#xff1b; H265(HEVC) 简称: H265 …...

二维码智慧门牌管理系统升级解决方案:门牌聚合,让管理更便捷!

文章目录 前言一、传统门牌管理系统的瓶颈二、地图门牌聚合展示的优势三、地图门牌聚合展示的实现方法四、智慧门牌管理系统的未来发展 前言 随着城市的发展和建设&#xff0c;对于地址信息的管理变得越来越重要。而智慧门牌管理系统作为管理地址信息的重要工具&#xff0c;其…...

AI-调查研究-01-正念冥想有用吗?对健康的影响及科学指南

点一下关注吧&#xff01;&#xff01;&#xff01;非常感谢&#xff01;&#xff01;持续更新&#xff01;&#xff01;&#xff01; &#x1f680; AI篇持续更新中&#xff01;&#xff08;长期更新&#xff09; 目前2025年06月05日更新到&#xff1a; AI炼丹日志-28 - Aud…...

docker详细操作--未完待续

docker介绍 docker官网: Docker&#xff1a;加速容器应用程序开发 harbor官网&#xff1a;Harbor - Harbor 中文 使用docker加速器: Docker镜像极速下载服务 - 毫秒镜像 是什么 Docker 是一种开源的容器化平台&#xff0c;用于将应用程序及其依赖项&#xff08;如库、运行时环…...

day52 ResNet18 CBAM

在深度学习的旅程中&#xff0c;我们不断探索如何提升模型的性能。今天&#xff0c;我将分享我在 ResNet18 模型中插入 CBAM&#xff08;Convolutional Block Attention Module&#xff09;模块&#xff0c;并采用分阶段微调策略的实践过程。通过这个过程&#xff0c;我不仅提升…...

Python爬虫(一):爬虫伪装

一、网站防爬机制概述 在当今互联网环境中&#xff0c;具有一定规模或盈利性质的网站几乎都实施了各种防爬措施。这些措施主要分为两大类&#xff1a; 身份验证机制&#xff1a;直接将未经授权的爬虫阻挡在外反爬技术体系&#xff1a;通过各种技术手段增加爬虫获取数据的难度…...

多模态大语言模型arxiv论文略读(108)

CROME: Cross-Modal Adapters for Efficient Multimodal LLM ➡️ 论文标题&#xff1a;CROME: Cross-Modal Adapters for Efficient Multimodal LLM ➡️ 论文作者&#xff1a;Sayna Ebrahimi, Sercan O. Arik, Tejas Nama, Tomas Pfister ➡️ 研究机构: Google Cloud AI Re…...

在QWebEngineView上实现鼠标、触摸等事件捕获的解决方案

这个问题我看其他博主也写了&#xff0c;要么要会员、要么写的乱七八糟。这里我整理一下&#xff0c;把问题说清楚并且给出代码&#xff0c;拿去用就行&#xff0c;照着葫芦画瓢。 问题 在继承QWebEngineView后&#xff0c;重写mousePressEvent或event函数无法捕获鼠标按下事…...

JVM虚拟机:内存结构、垃圾回收、性能优化

1、JVM虚拟机的简介 Java 虚拟机(Java Virtual Machine 简称:JVM)是运行所有 Java 程序的抽象计算机,是 Java 语言的运行环境,实现了 Java 程序的跨平台特性。JVM 屏蔽了与具体操作系统平台相关的信息,使得 Java 程序只需生成在 JVM 上运行的目标代码(字节码),就可以…...

七、数据库的完整性

七、数据库的完整性 主要内容 7.1 数据库的完整性概述 7.2 实体完整性 7.3 参照完整性 7.4 用户定义的完整性 7.5 触发器 7.6 SQL Server中数据库完整性的实现 7.7 小结 7.1 数据库的完整性概述 数据库完整性的含义 正确性 指数据的合法性 有效性 指数据是否属于所定…...

C++.OpenGL (20/64)混合(Blending)

混合(Blending) 透明效果核心原理 #mermaid-svg-SWG0UzVfJms7Sm3e {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-SWG0UzVfJms7Sm3e .error-icon{fill:#552222;}#mermaid-svg-SWG0UzVfJms7Sm3e .error-text{fill…...

push [特殊字符] present

push &#x1f19a; present 前言present和dismiss特点代码演示 push和pop特点代码演示 前言 在 iOS 开发中&#xff0c;push 和 present 是两种不同的视图控制器切换方式&#xff0c;它们有着显著的区别。 present和dismiss 特点 在当前控制器上方新建视图层级需要手动调用…...