hyperledger fabric2.4测试网络添加组织数量
!!!修改内容比较繁琐,预期未来提供模板修改
修改初始配置文件,初始添加3个组织
organizations文件夹
/cryptogen文件夹下创建文件crypto-config-org3.yaml,内容如下:
PeerOrgs:# ---------------------------------------------------------------------------# Org3# ---------------------------------------------------------------------------- Name: Org3Domain: org3.example.comEnableNodeOUs: trueTemplate:Count: 1SANS:- localhostUsers:Count: 1
在/fabric-ca/org3文件夹中创建fabric-ca-server-config.yaml,内容如下:
version: 1.2.0
port: 11054
debug: false
crlsizelimit: 512000
tls:enabled: truecertfile:keyfile:clientauth:type: noclientcertcertfiles:
ca:name: Org3CAkeyfile:certfile:chainfile:
crl:expiry: 24h
registry:maxenrollments: -1identities:- name: adminpass: adminpwtype: clientaffiliation: ""attrs:hf.Registrar.Roles: "*"hf.Registrar.DelegateRoles: "*"hf.Revoker: truehf.IntermediateCA: truehf.GenCRL: truehf.Registrar.Attributes: "*"hf.AffiliationMgr: true
db:type: sqlite3datasource: fabric-ca-server.dbtls:enabled: falsecertfiles:client:certfile:keyfile:
ldap:enabled: falseurl: ldap://<adminDN>:<adminPassword>@<host>:<port>/<base>tls:certfiles:client:certfile:keyfile:attribute:names: ['uid','member']converters:- name:value:maps:groups:- name:value:
affiliations:org1:- department1- department2org2:- department1
signing:default:usage:- digital signatureexpiry: 8760hprofiles:ca:usage:- cert sign- crl signexpiry: 43800hcaconstraint:isca: truemaxpathlen: 0tls:usage:- signing- key encipherment- server auth- client auth- key agreementexpiry: 8760h
csr:cn: ca.org3.example.comnames:- C: USST: "North Carolina"L: "Raleigh"O: org3.example.comOU:hosts:- localhost- org3.example.comca:expiry: 131400hpathlength: 1
bccsp:default: SWsw:hash: SHA2security: 256filekeystore:keystore: msp/keystore
cacount:
cafiles:
intermediate:parentserver:url:caname:enrollment:hosts:profile:label:tls:certfiles:client:certfile:keyfile:
修改/fabric-ca中的registerEnroll.sh,添加如下内容:
function createOrg3() {infoln "Enrolling the CA admin"mkdir -p organizations/peerOrganizations/org3.example.com/export FABRIC_CA_CLIENT_HOME=${PWD}/organizations/peerOrganizations/org3.example.com/set -xfabric-ca-client enroll -u https://admin:adminpw@localhost:11054 --caname ca-org3 --tls.certfiles "${PWD}/organizations/fabric-ca/org3/ca-cert.pem"{ set +x; } 2>/dev/nullecho 'NodeOUs:Enable: trueClientOUIdentifier:Certificate: cacerts/localhost-11054-ca-org3.pemOrganizationalUnitIdentifier: clientPeerOUIdentifier:Certificate: cacerts/localhost-11054-ca-org3.pemOrganizationalUnitIdentifier: peerAdminOUIdentifier:Certificate: cacerts/localhost-11054-ca-org3.pemOrganizationalUnitIdentifier: adminOrdererOUIdentifier:Certificate: cacerts/localhost-11054-ca-org3.pemOrganizationalUnitIdentifier: orderer' > "${PWD}/organizations/peerOrganizations/org3.example.com/msp/config.yaml"# Since the CA serves as both the organization CA and TLS CA, copy the org's root cert that was generated by CA startup into the org level ca and tlsca directories# Copy org3's CA cert to org3's /msp/tlscacerts directory (for use in the channel MSP definition)mkdir -p "${PWD}/organizations/peerOrganizations/org3.example.com/msp/tlscacerts"cp "${PWD}/organizations/fabric-ca/org3/ca-cert.pem" "${PWD}/organizations/peerOrganizations/org3.example.com/msp/tlscacerts/ca.crt"# Copy org3's CA cert to org3's /tlsca directory (for use by clients)mkdir -p "${PWD}/organizations/peerOrganizations/org3.example.com/tlsca"cp "${PWD}/organizations/fabric-ca/org3/ca-cert.pem" "${PWD}/organizations/peerOrganizations/org3.example.com/tlsca/tlsca.org3.example.com-cert.pem"# Copy org3's CA cert to org3's /ca directory (for use by clients)mkdir -p "${PWD}/organizations/peerOrganizations/org3.example.com/ca"cp "${PWD}/organizations/fabric-ca/org3/ca-cert.pem" "${PWD}/organizations/peerOrganizations/org3.example.com/ca/ca.org3.example.com-cert.pem"infoln "Registering peer0"set -xfabric-ca-client register --caname ca-org3 --id.name peer0 --id.secret peer0pw --id.type peer --tls.certfiles "${PWD}/organizations/fabric-ca/org3/ca-cert.pem"{ set +x; } 2>/dev/nullinfoln "Registering user"set -xfabric-ca-client register --caname ca-org3 --id.name user1 --id.secret user1pw --id.type client --tls.certfiles "${PWD}/organizations/fabric-ca/org3/ca-cert.pem"{ set +x; } 2>/dev/nullinfoln "Registering the org admin"set -xfabric-ca-client register --caname ca-org3 --id.name org3admin --id.secret org3adminpw --id.type admin --tls.certfiles "${PWD}/organizations/fabric-ca/org3/ca-cert.pem"{ set +x; } 2>/dev/nullinfoln "Generating the peer0 msp"set -xfabric-ca-client enroll -u https://peer0:peer0pw@localhost:11054 --caname ca-org3 -M "${PWD}/organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/msp" --tls.certfiles "${PWD}/organizations/fabric-ca/org3/ca-cert.pem"{ set +x; } 2>/dev/nullcp "${PWD}/organizations/peerOrganizations/org3.example.com/msp/config.yaml" "${PWD}/organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/msp/config.yaml"infoln "Generating the peer0-tls certificates, use --csr.hosts to specify Subject Alternative Names"set -xfabric-ca-client enroll -u https://peer0:peer0pw@localhost:11054 --caname ca-org3 -M "${PWD}/organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls" --enrollment.profile tls --csr.hosts peer0.org3.example.com --csr.hosts localhost --tls.certfiles "${PWD}/organizations/fabric-ca/org3/ca-cert.pem"{ set +x; } 2>/dev/null# Copy the tls CA cert, server cert, server keystore to well known file names in the peer's tls directory that are referenced by peer startup configcp "${PWD}/organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/tlscacerts/"* "${PWD}/organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt"cp "${PWD}/organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/signcerts/"* "${PWD}/organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/server.crt"cp "${PWD}/organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/keystore/"* "${PWD}/organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/server.key"infoln "Generating the user msp"set -xfabric-ca-client enroll -u https://user1:user1pw@localhost:11054 --caname ca-org3 -M "${PWD}/organizations/peerOrganizations/org3.example.com/users/User1@org3.example.com/msp" --tls.certfiles "${PWD}/organizations/fabric-ca/org3/ca-cert.pem"{ set +x; } 2>/dev/nullcp "${PWD}/organizations/peerOrganizations/org3.example.com/msp/config.yaml" "${PWD}/organizations/peerOrganizations/org3.example.com/users/User1@org3.example.com/msp/config.yaml"infoln "Generating the org admin msp"set -xfabric-ca-client enroll -u https://org3admin:org3adminpw@localhost:11054 --caname ca-org3 -M "${PWD}/organizations/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp" --tls.certfiles "${PWD}/organizations/fabric-ca/org3/ca-cert.pem"{ set +x; } 2>/dev/nullcp "${PWD}/organizations/peerOrganizations/org3.example.com/msp/config.yaml" "${PWD}/organizations/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp/config.yaml"
}
ccp-generate.sh中添加如下代码
ORG=3
P0PORT=11051
CAPORT=11054
PEERPEM=organizations/peerOrganizations/org3.example.com/tlsca/tlsca.org3.example.com-cert.pem
CAPEM=organizations/peerOrganizations/org3.example.com/ca/ca.org3.example.com-cert.pemecho "$(json_ccp $ORG $P0PORT $CAPORT $PEERPEM $CAPEM)" > organizations/peerOrganizations/org3.example.com/connection-org3.json
echo "$(yaml_ccp $ORG $P0PORT $CAPORT $PEERPEM $CAPEM)" > organizations/peerOrganizations/org3.example.com/connection-org3.yaml
test-network文件夹
在setOrgEnv.sh中添加如下内容
elif [[ ${ORG,,} == "org3" ]]; thenCORE_PEER_LOCALMSPID=Org3MSPCORE_PEER_MSPCONFIGPATH=${DIR}/test-network/organizations/peerOrganizations/org3.example.com/users/Admin@org3.example.com/mspCORE_PEER_ADDRESS=localhost:11051CORE_PEER_TLS_ROOTCERT_FILE=${DIR}/test-network/organizations/peerOrganizations/org3.example.com/tlsca/tlsca.org3.example.com-cert.pem
compose文件夹
compose-ca.yaml添加如下内容:
ca_org3:image: hyperledger/fabric-ca:latestlabels:service: hyperledger-fabricenvironment:- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server- FABRIC_CA_SERVER_CA_NAME=ca-org3- FABRIC_CA_SERVER_TLS_ENABLED=true- FABRIC_CA_SERVER_PORT=11054- FABRIC_CA_SERVER_OPERATIONS_LISTENADDRESS=0.0.0.0:19054ports:- "11054:11054"- "19054:19054"command: sh -c 'fabric-ca-server start -b admin:adminpw -d'volumes:- ../organizations/fabric-ca/org3:/etc/hyperledger/fabric-ca-servercontainer_name: ca_org3networks:- test
compose-couch.yaml添加如下内容
couchdb2:container_name: couchdb2image: couchdb:3.2.2labels:service: hyperledger-fabric# Populate the COUCHDB_USER and COUCHDB_PASSWORD to set an admin user and password# for CouchDB. This will prevent CouchDB from operating in an "Admin Party" mode.environment:- COUCHDB_USER=admin- COUCHDB_PASSWORD=adminpw# Comment/Uncomment the port mapping if you want to hide/expose the CouchDB service,# for example map it to utilize Fauxton User Interface in dev environments.ports:- "9984:5984"networks:- testpeer0.org3.example.com:environment:- CORE_LEDGER_STATE_STATEDATABASE=CouchDB- CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb4:5984# The CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME and CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD# provide the credentials for ledger to connect to CouchDB. The username and password must# match the username and password set for the associated CouchDB.- CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=admin- CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=adminpwdepends_on:- couchdb2
compose-test-net.yaml修改以及添加如下内容
volumes:orderer.example.com:peer0.org1.example.com:peer0.org2.example.com:peer0.org3.example.com:peer0.org3.example.com:container_name: peer0.org3.example.comimage: hyperledger/fabric-peer:latestlabels:service: hyperledger-fabricenvironment:- FABRIC_CFG_PATH=/etc/hyperledger/peercfg- FABRIC_LOGGING_SPEC=INFO#- FABRIC_LOGGING_SPEC=DEBUG- CORE_PEER_TLS_ENABLED=true- CORE_PEER_PROFILE_ENABLED=false- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt# Peer specific variables- CORE_PEER_ID=peer0.org3.example.com- CORE_PEER_ADDRESS=peer0.org3.example.com:11051- CORE_PEER_LISTENADDRESS=0.0.0.0:11051- CORE_PEER_CHAINCODEADDRESS=peer0.org3.example.com:11052- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:11052- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org3.example.com:11051- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org3.example.com:11051- CORE_PEER_LOCALMSPID=Org3MSP- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp - CORE_OPERATIONS_LISTENADDRESS=peer0.org3.example.com:9446- CORE_METRICS_PROVIDER=prometheus- CHAINCODE_AS_A_SERVICE_BUILDER_CONFIG={"peername":"peer0org3"}- CORE_CHAINCODE_EXECUTETIMEOUT=300svolumes:- ../organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com:/etc/hyperledger/fabric - peer0.org3.example.com:/var/hyperledger/productionworking_dir: /rootcommand: peer node startports:- 11051:11051- 9446:9446networks:- test
测试
启动测试网络
sudo ./network.sh up
创建通道
sudo ./network.sh createChannel
安装链码
sudo chmod -R 777 ../test-network
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go
之后按照我这篇博客:小白也能读懂的Fabric测试网络运行以及链码部署进行测试.
可以看到完整结果如下:

链码部署文件修改
/script 中的deployCC.sh修改的地方比较零散,用下面的内容进行覆盖:
#!/bin/bashsource scripts/utils.shCHANNEL_NAME=${1:-"mychannel"}
CC_NAME=${2}
CC_SRC_PATH=${3}
CC_SRC_LANGUAGE=${4}
CC_VERSION=${5:-"1.0"}
CC_SEQUENCE=${6:-"1"}
CC_INIT_FCN=${7:-"NA"}
CC_END_POLICY=${8:-"NA"}
CC_COLL_CONFIG=${9:-"NA"}
DELAY=${10:-"3"}
MAX_RETRY=${11:-"5"}
VERBOSE=${12:-"false"}println "executing with the following"
println "- CHANNEL_NAME: ${C_GREEN}${CHANNEL_NAME}${C_RESET}"
println "- CC_NAME: ${C_GREEN}${CC_NAME}${C_RESET}"
println "- CC_SRC_PATH: ${C_GREEN}${CC_SRC_PATH}${C_RESET}"
println "- CC_SRC_LANGUAGE: ${C_GREEN}${CC_SRC_LANGUAGE}${C_RESET}"
println "- CC_VERSION: ${C_GREEN}${CC_VERSION}${C_RESET}"
println "- CC_SEQUENCE: ${C_GREEN}${CC_SEQUENCE}${C_RESET}"
println "- CC_END_POLICY: ${C_GREEN}${CC_END_POLICY}${C_RESET}"
println "- CC_COLL_CONFIG: ${C_GREEN}${CC_COLL_CONFIG}${C_RESET}"
println "- CC_INIT_FCN: ${C_GREEN}${CC_INIT_FCN}${C_RESET}"
println "- DELAY: ${C_GREEN}${DELAY}${C_RESET}"
println "- MAX_RETRY: ${C_GREEN}${MAX_RETRY}${C_RESET}"
println "- VERBOSE: ${C_GREEN}${VERBOSE}${C_RESET}"FABRIC_CFG_PATH=$PWD/../config/#User has not provided a name
if [ -z "$CC_NAME" ] || [ "$CC_NAME" = "NA" ]; thenfatalln "No chaincode name was provided. Valid call example: ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go"# User has not provided a path
elif [ -z "$CC_SRC_PATH" ] || [ "$CC_SRC_PATH" = "NA" ]; thenfatalln "No chaincode path was provided. Valid call example: ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go"# User has not provided a language
elif [ -z "$CC_SRC_LANGUAGE" ] || [ "$CC_SRC_LANGUAGE" = "NA" ]; thenfatalln "No chaincode language was provided. Valid call example: ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go"## Make sure that the path to the chaincode exists
elif [ ! -d "$CC_SRC_PATH" ] && [ ! -f "$CC_SRC_PATH" ]; thenfatalln "Path to chaincode does not exist. Please provide different path."
fiCC_SRC_LANGUAGE=$(echo "$CC_SRC_LANGUAGE" | tr [:upper:] [:lower:])# do some language specific preparation to the chaincode before packaging
if [ "$CC_SRC_LANGUAGE" = "go" ]; thenCC_RUNTIME_LANGUAGE=golanginfoln "Vendoring Go dependencies at $CC_SRC_PATH"pushd $CC_SRC_PATHGO111MODULE=on go mod vendorpopdsuccessln "Finished vendoring Go dependencies"elif [ "$CC_SRC_LANGUAGE" = "java" ]; thenCC_RUNTIME_LANGUAGE=javarm -rf $CC_SRC_PATH/build/install/infoln "Compiling Java code..."pushd $CC_SRC_PATH./gradlew installDistpopdsuccessln "Finished compiling Java code"CC_SRC_PATH=$CC_SRC_PATH/build/install/$CC_NAMEelif [ "$CC_SRC_LANGUAGE" = "javascript" ]; thenCC_RUNTIME_LANGUAGE=nodeelif [ "$CC_SRC_LANGUAGE" = "typescript" ]; thenCC_RUNTIME_LANGUAGE=nodeinfoln "Compiling TypeScript code into JavaScript..."pushd $CC_SRC_PATHnpm installnpm run buildpopdsuccessln "Finished compiling TypeScript code into JavaScript"elsefatalln "The chaincode language ${CC_SRC_LANGUAGE} is not supported by this script. Supported chaincode languages are: go, java, javascript, and typescript"exit 1
fiINIT_REQUIRED="--init-required"
# check if the init fcn should be called
if [ "$CC_INIT_FCN" = "NA" ]; thenINIT_REQUIRED=""
fiif [ "$CC_END_POLICY" = "NA" ]; thenCC_END_POLICY=""
elseCC_END_POLICY="--signature-policy $CC_END_POLICY"
fiif [ "$CC_COLL_CONFIG" = "NA" ]; thenCC_COLL_CONFIG=""
elseCC_COLL_CONFIG="--collections-config $CC_COLL_CONFIG"
fi# import utils
. scripts/envVar.sh
. scripts/ccutils.shpackageChaincode() {set -xpeer lifecycle chaincode package ${CC_NAME}.tar.gz --path ${CC_SRC_PATH} --lang ${CC_RUNTIME_LANGUAGE} --label ${CC_NAME}_${CC_VERSION} >&log.txtres=$?PACKAGE_ID=$(peer lifecycle chaincode calculatepackageid ${CC_NAME}.tar.gz){ set +x; } 2>/dev/nullcat log.txtverifyResult $res "Chaincode packaging has failed"successln "Chaincode is packaged"
}function checkPrereqs() {jq --version > /dev/null 2>&1if [[ $? -ne 0 ]]; thenerrorln "jq command not found..."errorlnerrorln "Follow the instructions in the Fabric docs to install the prereqs"errorln "https://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html"exit 1fi
}#check for prerequisites
checkPrereqs## package the chaincode
packageChaincode## Install chaincode on peer0.org1 and peer0.org2
infoln "Installing chaincode on peer0.org1..."
installChaincode 1
infoln "Install chaincode on peer0.org2..."
installChaincode 2
infoln "Install chaincode on peer0.org3..."
installChaincode 3## query whether the chaincode is installed
queryInstalled 1## approve the definition for org1
approveForMyOrg 1## check whether the chaincode definition is ready to be committed
## expect org1 to have approved and org2 not to
checkCommitReadiness 1 "\"Org1MSP\": true" "\"Org2MSP\": false" "\"Org3MSP\": false"
checkCommitReadiness 2 "\"Org1MSP\": true" "\"Org2MSP\": false" "\"Org3MSP\": false"
checkCommitReadiness 3 "\"Org1MSP\": true" "\"Org2MSP\": false" "\"Org3MSP\": false"## now approve also for org2
approveForMyOrg 2## check whether the chaincode definition is ready to be committed
## expect them both to have approved
checkCommitReadiness 1 "\"Org1MSP\": true" "\"Org2MSP\": true" "\"Org3MSP\": false"
checkCommitReadiness 2 "\"Org1MSP\": true" "\"Org2MSP\": true" "\"Org3MSP\": false"
checkCommitReadiness 3 "\"Org1MSP\": true" "\"Org2MSP\": true" "\"Org3MSP\": false"## now approve also for org2
approveForMyOrg 3checkCommitReadiness 3 "\"Org1MSP\": true" "\"Org2MSP\": true" "\"Org3MSP\": false"## now that we know for sure both orgs have approved, commit the definition
commitChaincodeDefinition 1 2 3## query on both orgs to see that the definition committed successfully
queryCommitted 1
queryCommitted 2
queryCommitted 3## Invoke the chaincode - this does require that the chaincode have the 'initLedger'
## method defined
if [ "$CC_INIT_FCN" = "NA" ]; theninfoln "Chaincode initialization is not required"
elsechaincodeInvokeInit 1 2 3
fi
exit 0
运行
修改上述文件之后再重新启动网络,查看输出结果,可以看到3个组织都同意了.

初始化4个节点,添加addorg5
根据之前的内容定义第四个组织
此处不在赘述
添加org5
之后的博客再写.
相关文章:
hyperledger fabric2.4测试网络添加组织数量
!!!修改内容比较繁琐,预期未来提供模板修改 修改初始配置文件,初始添加3个组织 organizations文件夹 /cryptogen文件夹下创建文件crypto-config-org3.yaml,内容如下: PeerOrgs:# ---------------------------------------------------------------------------# Org3# ----…...
分库分表
分库,分表,分库分表 “只分库“,“只分表“,“既分库又分表" 何时分库 在面对高并发的情况下,数据库连接成为性能瓶颈。当数据QPS过高导致数据库连接数不足时,考虑分库。在读多写少的场景下&#x…...
uniapp自定义组件
在UniApp中,你可以使用自定义组件来拓展应用程序的功能和界面。自定义组件是由多个Vue组件构成的,可以在应用程序中重复使用。 要创建一个自定义组件,你需要在UniApp项目中的components目录下创建一个新的文件夹,并在该文件夹中创…...
linux gdb调试
安装gdb yum install gdb -y 查看dump文件所在路径: 可通过 cat /proc/sys/kernel/core_pattern命令获取dump目录路径 gdb调试: 可执行文件为 xxx(例如:main),结合其运行时产生的dump文件进行调试 命令&a…...
java17 linux 环境配置
linux版本 :centos 8 1.能联网的情况下: wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz 2.mkdir /usr/local/java tar zxvf jdk-17_linux-x64_bin.tar.gz -C /usr/local/java 3./etc/profile增加: export JAVA_HOME/usr/local/java/jdk-17.…...
Flutter最新稳定版3.16 新特性介绍
Flutter 3.16 默认采用 Material 3 主题,Android 平台预览 Impeller,DevTools 扩展等等 欢迎回到每季度一次的 Flutter 稳定版本发布,这次是 Flutter 3.16。这个版本将 Material 3 设为新的默认主题,为 Android 带来 Impeller 预览…...
nodejs+vue慢性胃炎健康管理系统的设计与实现-微信小程序-安卓-python-PHP-计算机毕业设计
随着科学技术的飞速发展,各行各业都在努力与现代先进技术接轨,通过科技手段提高自身的优势;对于慢性胃炎健康管理系统当然也不能排除在外,随着网络技术的不断成熟,带动了慢性胃炎健康管理系统, 系统首页、个…...
【C++】传递‘类非静态成员函数’用作回调函数
在C语言中,传递函数指针是非常常见的操作。 在C语言中,使用C语言一致的方法传递全局函数指针,或者传递静态函数指针也很常见。 不过如果遇到想传递非静态成员函数时,可以参考以下示例代码。 #ifndef _WORKER_HPP_ #define _WOR…...
vscode 创建 运行c++ 项目
1 扩展 install c 2.1安装 mingw g 下载 MinGW-w64 - for 32 and 64 bit Windows - Browse Files at SourceForge.net win32下载地址 Download x86_64-8.1.0-release-win32-seh-rt_v6-rev0.7z (MinGW-w64 - for 32 and 64 bit Windows) 2.2 把 文件夹 bin 路径 添加到环境…...
Spring Cloud学习(十)【Elasticsearch搜索功能 分布式搜索引擎02】
文章目录 DSL查询文档DSL查询分类全文检索查询精准查询地理坐标查询组合查询相关性算分Function Score Query复合查询 Boolean Query 搜索结果处理排序分页高亮 RestClient查询文档快速入门match查询精确查询复合查询排序、分页、高亮 黑马旅游案例 DSL查询文档 DSL查询分类 …...
大数据HCIE成神之路之数学(3)——概率论
概率论 1.1 概率论内容介绍1.1.1 概率论介绍1.1.2 实验介绍 1.2 概率论内容实现1.2.1 均值实现1.2.2 方差实现1.2.3 标准差实现1.2.4 协方差实现1.2.5 相关系数1.2.6 二项分布实现1.2.7 泊松分布实现1.2.8 正态分布1.2.9 指数分布1.2.10 中心极限定理的验证 1.1 概率论内容介绍…...
【论文解读】FFHQ-UV:用于3D面部重建的归一化面部UV纹理数据集
【论文解读】FFHQ-UV 论文地址:https://arxiv.org/pdf/2211.13874.pdf 0. 摘要 我们提出了一个大规模的面部UV纹理数据集,其中包含超过50,000张高质量的纹理UV贴图,这些贴图具有均匀的照明、中性的表情和清洁的面部区域,这些都是…...
simple foc 移植odriver foc的 anti-cogging(抗齿槽算法)
文章目录 ESP32 simple foc 移植odriver anti-cogging.1.硬件,在淘宝买的。esp32 simple foc(最新). 下电阻三采样。2. 效果,见视频https://www.bilibili.com/video/BV1xg4y1X7Yr/?vd_source4fd70d693021f289fb2d339c6c0407193.代码添加(生成…...
基于深度学习的恶意软件检测
恶意软件是指恶意软件犯罪者用来感染个人计算机或整个组织的网络的软件。 它利用目标系统漏洞,例如可以被劫持的合法软件(例如浏览器或 Web 应用程序插件)中的错误。 恶意软件渗透可能会造成灾难性的后果,包括数据被盗、勒索或网…...
环境配置|GitHub——解决Github无法显示图片以及README无法显示图片
一、问题背景 最近在整理之前写过的实验、项目,打算把这些东西写成blog,并把工程文件整理上传到Github上。但在上传README文件的时候,发现github无法显示README中的图片,如下图所示: 在README中该图片路径为࿱…...
AIGC(生成式AI)试用 12 -- 年终再总结
上次使用年终总结为题测试了CSDN创作助手和文心一言的表现,随着不断对总结给出更细节的提示。AIGC(生成式AI)试用 11 -- 年终总结-CSDN博客 总结年终总结生活/工作年终总结IT开发/运维年终总结 AIGC都能就新给出的主题修饰给出相应的关点&am…...
Linux下 tar 命令详解
一、tar 命令概述 Tar(Tape ARchive,磁带归档的缩写,LCTT 译注:最初设计用于将文件打包到磁带上,现在我们大都使用它来实现备份某个分区或者某些重要的目录)。 tar 是类 Unix 系统中广泛使用的命令&#x…...
SQL单表复杂查询where、group by、order by、limit
1.1SQL查询代码如下: select job as 工作类别,count(job) as 人数 from tb_emp where entrydate <2015-01-01 group by job having count(job) > 2 order by count(job) limit 1,1where entrydate <‘2015-01-01’ 表示查询日期小于2015-01-01的记录…...
安卓中轻量级数据存储方案分析探讨
轻量级数据存储功能通常用于保存应用的一些常用配置信息,并不适合需要存储大量数据和频繁改变数据的场景。应用的数据保存在文件中,这些文件可以持久化地存储在设备上。需要注意的是,应用访问的实例包含文件所有数据,这些数据会一…...
数据结构【DS】栈的应用
描述一下如何实现括号匹配? 初始时栈为空。 从左往右遍历算术表达式中的每个括号元素: ①当遍历到左括号时,将其压入栈顶。 ②当遍历到右括号时,将栈顶元素出栈,并判断出栈的左括号与当前遍历的右括号是否匹配&…...
KubeSphere 容器平台高可用:环境搭建与可视化操作指南
Linux_k8s篇 欢迎来到Linux的世界,看笔记好好学多敲多打,每个人都是大神! 题目:KubeSphere 容器平台高可用:环境搭建与可视化操作指南 版本号: 1.0,0 作者: 老王要学习 日期: 2025.06.05 适用环境: Ubuntu22 文档说…...
未来机器人的大脑:如何用神经网络模拟器实现更智能的决策?
编辑:陈萍萍的公主一点人工一点智能 未来机器人的大脑:如何用神经网络模拟器实现更智能的决策?RWM通过双自回归机制有效解决了复合误差、部分可观测性和随机动力学等关键挑战,在不依赖领域特定归纳偏见的条件下实现了卓越的预测准…...
云原生核心技术 (7/12): K8s 核心概念白话解读(上):Pod 和 Deployment 究竟是什么?
大家好,欢迎来到《云原生核心技术》系列的第七篇! 在上一篇,我们成功地使用 Minikube 或 kind 在自己的电脑上搭建起了一个迷你但功能完备的 Kubernetes 集群。现在,我们就像一个拥有了一块崭新数字土地的农场主,是时…...
dedecms 织梦自定义表单留言增加ajax验证码功能
增加ajax功能模块,用户不点击提交按钮,只要输入框失去焦点,就会提前提示验证码是否正确。 一,模板上增加验证码 <input name"vdcode"id"vdcode" placeholder"请输入验证码" type"text&quo…...
Java毕业设计:WML信息查询与后端信息发布系统开发
JAVAWML信息查询与后端信息发布系统实现 一、系统概述 本系统基于Java和WML(无线标记语言)技术开发,实现了移动设备上的信息查询与后端信息发布功能。系统采用B/S架构,服务器端使用Java Servlet处理请求,数据库采用MySQL存储信息࿰…...
基于SpringBoot在线拍卖系统的设计和实现
摘 要 随着社会的发展,社会的各行各业都在利用信息化时代的优势。计算机的优势和普及使得各种信息系统的开发成为必需。 在线拍卖系统,主要的模块包括管理员;首页、个人中心、用户管理、商品类型管理、拍卖商品管理、历史竞拍管理、竞拍订单…...
作为测试我们应该关注redis哪些方面
1、功能测试 数据结构操作:验证字符串、列表、哈希、集合和有序的基本操作是否正确 持久化:测试aof和aof持久化机制,确保数据在开启后正确恢复。 事务:检查事务的原子性和回滚机制。 发布订阅:确保消息正确传递。 2、性…...
嵌入式常见 CPU 架构
架构类型架构厂商芯片厂商典型芯片特点与应用场景PICRISC (8/16 位)MicrochipMicrochipPIC16F877A、PIC18F4550简化指令集,单周期执行;低功耗、CIP 独立外设;用于家电、小电机控制、安防面板等嵌入式场景8051CISC (8 位)Intel(原始…...
【C++】纯虚函数类外可以写实现吗?
1. 答案 先说答案,可以。 2.代码测试 .h头文件 #include <iostream> #include <string>// 抽象基类 class AbstractBase { public:AbstractBase() default;virtual ~AbstractBase() default; // 默认析构函数public:virtual int PureVirtualFunct…...
stm32进入Infinite_Loop原因(因为有系统中断函数未自定义实现)
这是系统中断服务程序的默认处理汇编函数,如果我们没有定义实现某个中断函数,那么当stm32产生了该中断时,就会默认跑这里来了,所以我们打开了什么中断,一定要记得实现对应的系统中断函数,否则会进来一直循环…...
