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

fisco bcos用caliper0.2.0进行压力测试的安装配置

一、前期环境
1. 硬件
需要外网权限
2. 操作系统
版本要求:Ubuntu >= 16.04, CentOS >= 7, MacOS >= 10.14
3. 基础软件
python 2.7,make,g++,gcc,git

sudo apt install python2.7 make g++ gcc git curl
git config --global url.git://github.com/.insteadOf https://github.com/

4. NodeJS

版本要求:
NodeJS 8 (LTS), 9, 或 10 (LTS),Caliper尚未在更高的NodeJS版本中进行过验证。

安装指南:
建议使用nvm(Node Version Manager)安装,nvm的安装方式如下:

# 安装nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash# 若出现因网络问题导致长时间下载失败,可尝试以下命令
curl -o- https://gitee.com/mirrors/nvm/raw/v0.33.2/install.sh | bash# 加载nvm配置
source ~/.$(basename $SHELL)rc
# 安装Node.js 8
nvm install 8
# 使用Node.js 8
nvm use 8

5. Docker

# 更新包索引
sudo apt-get update
# 安装基础依赖库
sudo apt-get install \apt-transport-https \ca-certificates \curl \gnupg-agent \software-properties-common
# 添加Docker官方GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# 添加docker仓库
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# 更新包索引
sudo apt-get update
# 安装Docker
sudo apt-get install docker-ce docker-ce-cli containerd.io
#查看Docker版本
docker --version
#添加docker用户组
sudo groupadd docker          
#将当前用户添加至docker用户组
sudo gpasswd -a $USER docker
#更新docker用户组  
newgrp docker  
# 重启Docker服务
sudo service docker restart
# 验证Docker是否已经启动
sudo systemctl status docker               

6. Docker Compose

版本要求:>= 1.22.0

安装指南:

#有时候连接错误,多试几次就好了
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
#查看docker-compose版本
docker-compose -v

二、Caliper部署

1. 部署

#建立一个工作目录
mkdir benchmarks && cd benchmarks
#对NPM项目进行初始化
npm init -y
#安装caliper-cli
npm install --only=prod @hyperledger/caliper-cli@0.2.0
#验证caliper-cli安装成功
npx caliper --version

需要改三个配置文件

/home/echo/benchmarks/node_modules/@hyperledger/caliper-fisco-bcos/lib/fiscoBcos.js

/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/'use strict';const {BlockchainInterface,CaliperUtils
} = require('@hyperledger/caliper-core');
const installSmartContractImpl = require('./installSmartContract');
const invokeSmartContractImpl = require('./invokeSmartContract');
const generateRawTransactionImpl = require('./generateRawTransactions');
const sendRawTransactionImpl = require('./sendRawTransactions');
const Color = require('./common').Color;
const commLogger = CaliperUtils.getLogger('fiscoBcos.js');/*** Implements {BlockchainInterface} for a FISCO BCOS backend.*/
class FiscoBcos extends BlockchainInterface {/*** Create a new instance of the {FISCO BCOS} class.* @param {string} config_path The absolute path of the FISCO BCOS network configuration file.* @param {string} workspace_root The absolute path to the root location for the application configuration files.*/constructor(config_path, workspace_root) {super(config_path);this.bcType = 'fisco-bcos';this.workspaceRoot = workspace_root;this.fiscoBcosSettings = CaliperUtils.parseYaml(this.configPath)['fisco-bcos'];if (this.fiscoBcosSettings.network && this.fiscoBcosSettings.network.authentication) {for (let k in this.fiscoBcosSettings.network.authentication) {this.fiscoBcosSettings.network.authentication[k] = CaliperUtils.resolvePath(this.fiscoBcosSettings.network.authentication[k], workspace_root);}}}/*** Initialize the {FISCO BCOS} object.* @async* @return {Promise<object>} The promise for the result of the execution.*/async init() {return Promise.resolve();}/*** Deploy the smart contract specified in the network configuration file to all nodes.* @async*/async installSmartContract() {const fiscoBcosSettings = this.fiscoBcosSettings;try {await installSmartContractImpl.run(fiscoBcosSettings, this.workspaceRoot);} catch (error) {commLogger.error(Color.error(`FISCO BCOS smart contract install failed: ${(error.stack ? error.stack : error)}`));throw error;}}/*** Get a context for subsequent operations* 'engine' attribute of returned context object must be reserved for benchmark engine to extend the context*  engine = {*   submitCallback: callback which must be called once new transaction(s) is submitted, it receives a number argument which tells how many transactions are submitted* }* @param {String} name name of the context* @param {Object} args adapter specific arguments* @param {Integer} clientIdx the client index* @return {Promise<object>} The promise for the result of the execution.*/async getContext(name, args, clientIdx) {return Promise.resolve();}/*** Release a context as well as related resources* @param {Object} context adapter specific object* @return {Promise<object>} The promise for the result of the execution.*/async releaseContext(context) {return Promise.resolve();}/*** Invoke the given smart contract according to the specified options. Multiple transactions will be generated according to the length of args.* @param {object} context The FISCO BCOS context returned by {getContext}.* @param {string} contractID The name of the smart contract.* @param {string} contractVer The version of the smart contract.* @param {Array} args Array of JSON formatted arguments for transaction(s). Each element contains arguments (including the function name) passing to the smart contract. JSON attribute named transaction_type is used by default to specify the function name. If the attribute does not exist, the first attribute will be used as the function name.* @param {number} timeout The timeout to set for the execution in seconds.* @return {Promise<object>} The promise for the result of the execution.*/async invokeSmartContract(context, contractID, contractVer, args, timeout) {let promises = [];try {args.forEach((arg) => {let fcn = null;let fcArgs = [];for (let key in arg) {if (key === 'transaction_type') {fcn = arg[key].toString();} else {fcArgs.push(arg[key].toString());}}promises.push(invokeSmartContractImpl.run(context, this.fiscoBcosSettings, contractID, fcn, fcArgs, this.workspaceRoot));});return await Promise.all(promises);} catch (error) {commLogger.error(Color.error(`FISCO BCOS smart contract invoke failed: ${(error.stack ? error.stack : JSON.stringify(error))}`));throw error;}}/*** Query state from the ledger* @param {Object} context The FISCO BCOS context returned by {getContext}* @param {String} contractID Identity of the contract* @param {String} contractVer Version of the contract* @param {String} key lookup key* @param {String} fcn The smart contract query function name* @return {Promise<object>} The result of the query.*/async queryState(context, contractID, contractVer, key, fcn) {try {return invokeSmartContractImpl.run(context, this.fiscoBcosSettings, contractID, fcn, key, this.workspaceRoot, true);} catch (error) {commLogger.error(Color.error(`FISCO BCOS smart contract query failed: ${(error.stack ? error.stack : error)}`));throw error;}}/*** Generate an raw transaction and store in local file* @param {Object} context The FISCO BCOS context returned by {getContext}* @param {String} contractID Identity of the contract* @param {Object} arg Arguments of the transaction* @param {String} file File path which will be used to store then transaction* @return {TaskStatus} Indicates whether the transaction is written to the file successfully or not*/async generateRawTransaction(context, contractID, arg, file) {return generateRawTransactionImpl.run(this.fiscoBcosSettings, this.workspaceRoot, context, contractID, arg, file);}/*** Send raw transactions* @param {Object} context The FISCO BCOS context returned by {getContext}* @param {Array} transactions List of raw transactions* @return {Promise} The promise for the result of the execution*/async sendRawTransaction(context, transactions) {return sendRawTransactionImpl.run(this.fiscoBcosSettings, context, transactions);}
}module.exports = FiscoBcos;

/home/echo/benchmarks/node_modules/@hyperledger/caliper-fisco-bcos/lib/channelPromise.js

/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/'use strict';const tls = require('tls');
const fs = require('fs');
const net = require('net');
const uuidv4 = require('uuid/v4');
const events = require('events');/*** NetworkError exception class thrown in socket connection*/
class NetworkError extends Error {/**** @param {String} msg exception message*/constructor(msg) {super(msg);this.name = 'NetworkError';}
}let emitters = new Map();
let buffers = new Map();
let sockets = new Map();
let lastBytesRead = new Map();/*** Parse response returned by node* @param {Buffer} response Node's response*/
function parseResponse(response) {let seq = response.slice(6, 38).toString();let result = JSON.parse(response.slice(42).toString());let emitter = emitters.get(seq);if(!emitter) {//Stale message receievedreturn;}emitter = emitter.emitter;if (emitter) {let readOnly = Object.getOwnPropertyDescriptor(emitter, 'readOnly').value;if (readOnly) {if (result.error || result.result !== undefined ) {emitter.emit('gotresult', result);}} else {if (result.error || result.status || (result.result && result.result.status)) {emitter.emit('gotresult', result);} else {if (!result.result) {throw new NetworkError(`unknown message receieved, seq=${seq}, data=${response.toString()}`);}}}} else {throw new NetworkError(`unknown owner message receieved, seq=${seq}, data=${response.toString()}`);}
}/*** Create a new TLS socket* @param {String} ip IP of channel server* @param {Number} port Port of channel server* @param {Object} authentication A JSON object contains certificate file path, private key file path and CA file path* @return {TLSSocket} A new TLS socket*/
function createNewSocket(ip, port, authentication) {let secureContextOptions = {key: fs.readFileSync(authentication.key),cert: fs.readFileSync(authentication.cert),ca: fs.readFileSync(authentication.ca),ecdhCurve: 'secp256k1',};let secureContext = tls.createSecureContext(secureContextOptions);let socket = new net.Socket();socket.connect(port, ip);let clientOptions = {rejectUnauthorized: false,secureContext: secureContext,socket: socket};let tlsSocket = tls.connect(clientOptions);tlsSocket.on('error', function (error) {throw new Error(error);});let socketID = `${ip}:${port}`;lastBytesRead.set(socketID, 0);tlsSocket.on('data', function (data) {let response = null;if (data instanceof Buffer) {response = data;}else {response = Buffer.from(data, 'ascii');}if (!buffers.has(socketID)) {// First time to read data from this socketlet expectedLength = null;if (tlsSocket.bytesRead - lastBytesRead.get(socketID) >= 4) {expectedLength = response.readUIntBE(0, 4);}if (!expectedLength || tlsSocket.bytesRead < lastBytesRead.get(socketID) + expectedLength) {buffers.set(socketID, {expectedLength: expectedLength,buffer: response});} else {lastBytesRead.set(socketID, lastBytesRead.get(socketID) + expectedLength);parseResponse(response);buffers.delete(socketID);}} else {// Multiple readinglet cache = buffers.get(socketID);cache.buffer = Buffer.concat([cache.buffer, response]);if (!cache.expectedLength && tlsSocket.bytesRead - lastBytesRead.get(socketID) >= 4) {cache.expectedLength = cache.buffer.readUIntBE(0, 4);}if (cache.expectedLength && tlsSocket.bytesRead - lastBytesRead.get(socketID) >= cache.expectedLength) {lastBytesRead.set(socketID, lastBytesRead.get(socketID) + cache.expectedLength);parseResponse(buffers.get(socketID).buffer);buffers.delete(socketID);}}});return tlsSocket;
}/*** Prepare the data which will be sent to channel server* @param {String} data JSON string of load* @return {Object} UUID and packaged data*/
function packageData(data) {const headerLength = 4 + 2 + 32 + 4;let length = Buffer.alloc(4);length.writeUInt32BE(headerLength + data.length);let type = Buffer.alloc(2);type.writeUInt16BE(0x12);let uuid = uuidv4();uuid = uuid.replace(/-/g, '');let seq = Buffer.from(uuid, 'ascii');let result = Buffer.alloc(4);result.writeInt32BE(0);let msg = Buffer.from(data, 'ascii');return {'uuid': uuid,'packagedData': Buffer.concat([length, type, seq, result, msg])};
}/*** Clear context when a message got response or timeout* @param {String} uuid The ID of an `channelPromise`request*/
function clearContext(uuid) {clearTimeout(emitters.get(uuid).timer);emitters.delete(uuid);buffers.delete(uuid);
}/*** Return channel promise for a request* @param {Object} node A JSON object which contains IP and port configuration of channel server* @param {Object} authentication A JSON object contains certificate file path, private key file path and CA file path* @param {String} data JSON string of load* @param {Number} timeout Timeout to wait response* @param {Boolean} readOnly Is this request read-only?* @return {Promise} a promise which will be resolved when the request is satisfied*/
function channelPromise(node, authentication, data, timeout, readOnly = false) {let ip = node.ip;let port = node.channelPort;let connectionID = `${ip}${port}`;if (!sockets.has(connectionID)) {let newSocket = createNewSocket(ip, port, authentication);newSocket.unref();sockets.set(connectionID, newSocket);}let tlsSocket = sockets.get(connectionID);let dataPackage = packageData(JSON.stringify(data));let uuid = dataPackage.uuid;tlsSocket.socketID = uuid;let packagedData = dataPackage.packagedData;let channelPromise = new Promise(async (resolve, reject) => {let eventEmitter = new events.EventEmitter();Object.defineProperty(eventEmitter, 'readOnly', {value: readOnly,writable: false,configurable: false,enumerable: false});eventEmitter.on('gotresult', (result) => {clearContext(uuid);if (result.error) {reject(result);} else {resolve(result);}return; // This `return` is not necessary, but it may can avoid future trap});eventEmitter.on('timeout', () => {clearContext(uuid);reject({ 'error': 'timeout' });return; // This `return` is not necessary, but it may can avoid future trap});emitters.set(uuid, {emitter: eventEmitter,timer: setTimeout(() => {eventEmitter.emit('timeout');}, timeout)});tlsSocket.write(packagedData);});return channelPromise;
}module.exports = channelPromise;

/home/echo/benchmarks/node_modules/@hyperledger/caliper-fisco-bcos/lib/web3lib/web3sync.js

/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/'use strict';const uuidv4 = require('uuid/v4');
const utils = require('./utils');
const Transaction = require('./transactionObject').Transaction;/*** Generate a random number via UUID* @return {Number} random number*/
function genRandomID() {let uuid = uuidv4();uuid = '0x' + uuid.replace(/-/g, '');return uuid;
}/*** Sign a transaction with private key and callback* @param {String} txData transaction data* @param {Buffer} privKey private key* @param {callback} callback callback function* @return {String} signed transaction data*/
function signTransaction(txData, privKey, callback) {let tx = new Transaction(txData);let privateKey = Buffer.from(privKey, 'hex');tx.sign(privateKey);// Build a serialized hex version of the txlet serializedTx = '0x' + tx.serialize().toString('hex');if (callback !== null) {callback(serializedTx);} else {return serializedTx;}
}/*** get transaction data* @param {String} func function name* @param {Array} params params* @return {String} transaction data*/
function getTxData(func, params) {let r = /^\w+\((.*)\)$/g.exec(func);let types = [];if (r[1]) {types = r[1].split(',');}return utils.encodeTxData(func, types, params);
}/*** get signed transaction data* @param {Number} groupId ID of the group where this transaction will be sent to* @param {Buffer} account user account* @param {Buffer} privateKey private key* @param {Buffer} to target address* @param {String} func function name* @param {Array} params params* @param {Number} blockLimit block limit* @return {String} signed transaction data*/
function getSignTx(groupId, account, privateKey, to, func, params, blockLimit) {let txData = getTxData(func, params);let postdata = {data: txData,from: account,to: to,gas: 1000000,randomid: genRandomID(),blockLimit: blockLimit,chainId: 1,groupId: groupId,extraData: '0x0'};return signTransaction(postdata, privateKey, null);
}/*** get signed deploy tx* @param {Number} groupId ID of the group where this transaction will be sent to* @param {Buffer} account user account* @param {Buffer} privateKey private key* @param {Buffer} bin contract bin* @param {Number} blockLimit block limit* @return {String} signed deploy transaction data*/
function getSignDeployTx(groupId, account, privateKey, bin, blockLimit) {let txData = bin.indexOf('0x') === 0 ? bin : ('0x' + bin);let postdata = {data: txData,from: account,to: null,gas: 1000000,randomid: genRandomID(),blockLimit: blockLimit,chainId: 1,groupId: groupId,extraData: '0x0'};return signTransaction(postdata, privateKey, null);
}module.exports.getSignDeployTx = getSignDeployTx;
module.exports.signTransaction = signTransaction;
module.exports.getSignTx = getSignTx;
module.exports.getTxData = getTxData;

进入/home/echo/benchmarks/node_modules/@hyperledger/caliper-fisco-bcos目录,编辑该目录下的package.json文件,在"dependencies"中添加一项"secp256k1": "^3.8.0",随后在该目录下执行npm i secp256k1@3.0.0

2. 绑定

npx caliper bind --caliper-bind-sut fisco-bcos --caliper-bind-sdk latest

3. 运行基准测试

#拉取代码
git clone https://gitee.com/vita-dounai/caliper-benchmarks.git
#测试helloworld合约
npx caliper benchmark run --caliper-workspace caliper-benchmarks --caliper-benchconfig benchmarks/samples/fisco-bcos/helloworld/config.yaml  --caliper-networkconfig networks/fisco-bcos/4nodes1group/fisco-bcos.json

在这里插入图片描述

#执行Solidity版转账合约测试
npx caliper benchmark run --caliper-workspace caliper-benchmarks --caliper-benchconfig benchmarks/samples/fisco-bcos/transfer/solidity/config.yaml  --caliper-networkconfig networks/fisco-bcos/4nodes1group/fisco-bcos.json

在这里插入图片描述

#执行预编译版转账合约测试
npx caliper benchmark run --caliper-workspace caliper-benchmarks --caliper-benchconfig benchmarks/samples/fisco-bcos/transfer/precompiled/config.yaml  --caliper-networkconfig networks/fisco-bcos/4nodes1group/fisco-bcos.json

在这里插入图片描述

相关文章:

fisco bcos用caliper0.2.0进行压力测试的安装配置

一、前期环境 1. 硬件 需要外网权限 2. 操作系统 版本要求&#xff1a;Ubuntu > 16.04, CentOS > 7, MacOS > 10.14 3. 基础软件 python 2.7&#xff0c;make&#xff0c;g&#xff0c;gcc&#xff0c;git sudo apt install python2.7 make g gcc git curl git confi…...

正在进行 | 用友企业数智化财务峰会落地广州 高能不断

3月28日,以「智能会计 价值财务」为主题的“2023企业数智化财务创新峰会”登陆广州。 此次用友企业数智化财务创新峰会,邀请了知名院校的专家学者、央国企等大型企业财务数智化领路人以及羊城权威媒体,近千人相约广州越秀国际会议中心,深度聚焦大型企业财务数智化创新应用…...

uniapp - APP云打包、蒲公英平台发布APP的步骤

一、uniapp 云打包 1、注册 dcloud 开发者 首先需要注册一个 dcloud 开发者的账号 dcloud开发者中心&#xff1a;登录 (dcloud.net.cn) 根据流程注册即可。 2、云打包&#xff08;已安卓为例&#xff09; 项目创建完成后&#xff0c;查看 dcloud 开发者中心&#xff0c;看是否…...

reposync命令详解--reposync同步aliyunyum库到本地

参考: reposync - 命令 - -桃枝夭夭- - 博客园 0. 简介 reposync 命令简单来说就是可以把指定外网源&#xff08;repo id&#xff09;的包同步到本地文件中 1. 安装 reposync 命令 [rootV10SP1-1 ~]# yum install -y dnf-plugins-core2. 常用选项以及参数 选项含义-c [fil…...

OCR之论文笔记TrOCR

文章目录TrOCR: Transformer-based Optical Character Recognition with Pre-trained Models一. 简介二. TrOCR2.1. Encoder2.2 Decoder2.3 Model Initialiaztion2.4 Task Pipeline2.5 Pre-training2.6 Fine-tuning2.7 Data Augmentation三. 实验3.1 Data3.2 Settings3.2 Resul…...

雷电4模拟器安装xposed框架(2022年)

别问我都2202年了为什么还在用雷电4安卓7。我特么哪知道Xposed的相关资料这么难找啊&#xff0c;只能搜到一些老旧的资料&#xff0c;尝试在老旧的平台上实现了。 最初的Xposed框架现在已经停止更新了&#xff0c;只支持到安卓8。如果要在更高版本的安卓系统上使用Xposed得看看…...

微信小程序支付完整流程(前端)

微信小程序中&#xff0c;常见付款给商家的场景&#xff0c;下面列出企业小程序中&#xff0c;从0起步完整微信支付流程。 一&#xff0c;注册微信支付商户号&#xff08;由上级或法人注册&#xff09; 接入微信支付 - 微信商户平台 此商户号&#xff0c;需要由主管及更上级领导…...

设置鼠标右键打开方式,添加IDEA的打开方式

一、问题描述 已下载IDEA&#xff0c;但是右键打开之前保存的项目文件&#xff0c;无法显示以IDEA方式打开。 二、解决步骤 1. 打开注册表 winR键输入regedit 2、查找路径为计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell &#xff08;我找了半天没看到Class…...

LAMP架构之zabbix监控(2):zabbix基础操作

目录 一、zabbix监控节点添加和删除 &#xff08;1&#xff09;手动添加 &#xff08;2&#xff09;自动添加 &#xff08;3&#xff09;按照条件批量添加 &#xff08;4&#xff09;使用api工具进行管理 二、针对应用的zabbix监控 一、zabbix监控节点添加和删除 实验说明&a…...

ShareSDK常见问题

QQ-分享报错901111&#xff0c;9001010等 由于QQ现在需要审核后才可以分享&#xff08;之前分享不需要审核&#xff09;&#xff0c;所以此错误解决方法只需通过腾讯开放平台的审核即可&#xff0c;另外要检查注册好的应用的基本信息&#xff0c;包名、md5签名和Bundle id是不…...

[Spring]一文明白IOC容器和思想

✅作者简介&#xff1a;大家好,我是Philosophy7&#xff1f;让我们一起共同进步吧&#xff01;&#x1f3c6; &#x1f4c3;个人主页&#xff1a;Philosophy7的csdn博客 &#x1f525;系列专栏&#xff1a; 数据结构与算法 &#x1f451;哲学语录: 承认自己的无知&#xff0c;乃…...

程序人生 | 与足球共舞的火柴人(致敬格拉利什,赋予足球更深的意义)

个人简介 &#x1f440;个人主页&#xff1a; 前端杂货铺 &#x1f64b;‍♂️学习方向&#xff1a; 主攻前端方向&#xff0c;也会涉及到服务端 &#x1f4c3;个人状态&#xff1a; 在校大学生一枚&#xff0c;已拿多个前端 offer&#xff08;秋招&#xff09; &#x1f680;未…...

MATLAB | R2023a更新了哪些好玩的东西

R2023a来啦&#xff01;&#xff01;废话不多说看看新版本有啥有趣的玩意和好玩的特性叭&#xff01;&#xff01;把绘图放最前面叭&#xff0c;有图的内容看的人多。。 1 区域填充 可以使用xregion及yregion进行区域填充啦&#xff01;&#xff01; x -10:0.25:10; y x.^…...

Python Module — OpenAI ChatGPT API

目录 文章目录目录OpenAI Python SDKopenai.ChatCompletion 模块openai.ChatCompletion.create 函数OpenAI Python SDK 官方文档&#xff1a;https://platform.openai.com/docs/api-reference/introduction OpenAI Python SDK 用于开发与 OpenAI RESTful API 进行交互的客户端…...

Docker学习记录

阅读前请看一下&#xff1a;我是一个热衷于记录的人&#xff0c;每次写博客会反复研读&#xff0c;尽量不断提升博客质量。文章设置为仅粉丝可见&#xff0c;是因为写博客确实花了不少精力。希望互相进步谢谢&#xff01;&#xff01; 文章目录阅读前请看一下&#xff1a;我是一…...

Linux-VIM使用

文章目录前言VIM使用1、切换模式2、跳转(1) 跳转到指定行(2) 跳转到首行(3) 跳转到末行3、自动格式化程序4. 大括号对应5. 删除&#xff08;1&#xff09;删除一个单词&#xff08;2&#xff09;删除光标位置至行尾&#xff08;3&#xff09;删除光标位置至行首&#xff08;4&a…...

Windows安全中心内存完整性无法打开问题的处理方法

Windows11安全中心内存完整性无法打开 今天电脑使用过程中突然看到系统桌面右下角任务栏中 windows安全中心图标出现了警告信息&#xff0c;如下图红框所示&#xff1a; 点击该图标进入windows安全中心的 安全性概览 界面&#xff0c;如下图&#xff1a; 在该界面可以看到出现安…...

在芯片设计行业,从项目的初期到交付,不同的岗位的工程师主要负责什么?

大家都知道在芯片设计行业&#xff0c;项目是至关重要的一环。从项目的初期到交付&#xff0c;不同的岗位的工程师在项目的各环节主要负责什么?他们是怎样配合的?下面看看资深工程师怎么说。 一个项目&#xff0c;从初期到交付的过程是比较漫长的。我们知道最早的时候&#…...

Spring Cloud Alibaba全家桶(七)——Sentinel控制台规则配置

前言 本文小新为大家带来 Sentinel控制台规则配置 相关知识&#xff0c;具体内容包括流控规则&#xff08;包括&#xff1a;QPS流控规则&#xff0c;并发线程数流控规则&#xff09;&#xff0c;BlockException统一异常处理&#xff0c;流控模式&#xff08;包括&#xff1a;直…...

mysql-installer安装教程(详细图文)

目录 1.安装 2.配置系统环境变量 3.配置初始化my.ini文件 4.MySQL彻底删除 5.Navicat 安装 1.安装 先去官网下载需要的msi&#xff0c;在这放出官网下载地址下载地址 这里我具体以8.0.28 为安装例子&#xff0c;除了最新版安装界面有些变动以往的都是差不多的。 过去的版本…...

XML Group端口详解

在XML数据映射过程中&#xff0c;经常需要对数据进行分组聚合操作。例如&#xff0c;当处理包含多个物料明细的XML文件时&#xff0c;可能需要将相同物料号的明细归为一组&#xff0c;或对相同物料号的数量进行求和计算。传统实现方式通常需要编写脚本代码&#xff0c;增加了开…...

YSYX学习记录(八)

C语言&#xff0c;练习0&#xff1a; 先创建一个文件夹&#xff0c;我用的是物理机&#xff1a; 安装build-essential 练习1&#xff1a; 我注释掉了 #include <stdio.h> 出现下面错误 在你的文本编辑器中打开ex1文件&#xff0c;随机修改或删除一部分&#xff0c;之后…...

Go 语言接口详解

Go 语言接口详解 核心概念 接口定义 在 Go 语言中&#xff0c;接口是一种抽象类型&#xff0c;它定义了一组方法的集合&#xff1a; // 定义接口 type Shape interface {Area() float64Perimeter() float64 } 接口实现 Go 接口的实现是隐式的&#xff1a; // 矩形结构体…...

鸿蒙中用HarmonyOS SDK应用服务 HarmonyOS5开发一个医院挂号小程序

一、开发准备 ​​环境搭建​​&#xff1a; 安装DevEco Studio 3.0或更高版本配置HarmonyOS SDK申请开发者账号 ​​项目创建​​&#xff1a; File > New > Create Project > Application (选择"Empty Ability") 二、核心功能实现 1. 医院科室展示 /…...

leetcodeSQL解题:3564. 季节性销售分析

leetcodeSQL解题&#xff1a;3564. 季节性销售分析 题目&#xff1a; 表&#xff1a;sales ---------------------- | Column Name | Type | ---------------------- | sale_id | int | | product_id | int | | sale_date | date | | quantity | int | | price | decimal | -…...

c#开发AI模型对话

AI模型 前面已经介绍了一般AI模型本地部署&#xff0c;直接调用现成的模型数据。这里主要讲述讲接口集成到我们自己的程序中使用方式。 微软提供了ML.NET来开发和使用AI模型&#xff0c;但是目前国内可能使用不多&#xff0c;至少实践例子很少看见。开发训练模型就不介绍了&am…...

基于 TAPD 进行项目管理

起因 自己写了个小工具&#xff0c;仓库用的Github。之前在用markdown进行需求管理&#xff0c;现在随着功能的增加&#xff0c;感觉有点难以管理了&#xff0c;所以用TAPD这个工具进行需求、Bug管理。 操作流程 注册 TAPD&#xff0c;需要提供一个企业名新建一个项目&#…...

2025年渗透测试面试题总结-腾讯[实习]科恩实验室-安全工程师(题目+回答)

安全领域各种资源&#xff0c;学习文档&#xff0c;以及工具分享、前沿信息分享、POC、EXP分享。不定期分享各种好玩的项目及好用的工具&#xff0c;欢迎关注。 目录 腾讯[实习]科恩实验室-安全工程师 一、网络与协议 1. TCP三次握手 2. SYN扫描原理 3. HTTPS证书机制 二…...

mac 安装homebrew (nvm 及git)

mac 安装nvm 及git 万恶之源 mac 安装这些东西离不开Xcode。及homebrew 一、先说安装git步骤 通用&#xff1a; 方法一&#xff1a;使用 Homebrew 安装 Git&#xff08;推荐&#xff09; 步骤如下&#xff1a;打开终端&#xff08;Terminal.app&#xff09; 1.安装 Homebrew…...

探索Selenium:自动化测试的神奇钥匙

目录 一、Selenium 是什么1.1 定义与概念1.2 发展历程1.3 功能概述 二、Selenium 工作原理剖析2.1 架构组成2.2 工作流程2.3 通信机制 三、Selenium 的优势3.1 跨浏览器与平台支持3.2 丰富的语言支持3.3 强大的社区支持 四、Selenium 的应用场景4.1 Web 应用自动化测试4.2 数据…...