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

Hyperledger Fabric 管理链码 peer lifecycle chaincode 指令使用

链上代码(Chaincode)简称链码,包括系统链码和用户链码。系统链码(System Chaincode)指的是 Fabric Peer 中负责系统配置、查询、背书、验证等平台功能的代码逻辑,运行在 Peer 进程内,将在第 14 章介绍。用户链码指的是用户编写的用来实现智能合约的应用代码。如无特殊说明,链码一般指的就是用户链码。

链码被部署在 Peer 节点上,运行在独立的沙盒(目前为 Docker 容器)中,并通过 gRPC 协议与相应的 Peer 节点进行交互。用户可以通过命令行或 SDK 调用链码方法,链码被调用时,会按照链码内预定逻辑来计算账本状态的更新集合(读写集合)。

链码操作命令

Operate a chaincode: install|instantiate|invoke|package|query|signpackage|upgrade|list.Usage:peer chaincode [command]Available Commands:install     Install a chaincode.instantiate Deploy the specified chaincode to the network.invoke      Invoke the specified chaincode.list        Get the instantiated chaincodes on a channel or installed chaincodes on a peer.package     Package a chaincodequery       Query using the specified chaincode.signpackage Sign the specified chaincode packageupgrade     Upgrade chaincode.Flags:--cafile string                       Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint--certfile string                     Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint--clientauth                          Use mutual TLS when communicating with the orderer endpoint--connTimeout duration                Timeout for client to connect (default 3s)-h, --help                                help for chaincode--keyfile string                      Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint-o, --orderer string                      Ordering service endpoint--ordererTLSHostnameOverride string   The hostname override to use when validating the TLS connection to the orderer--tls                                 Use TLS when communicating with the orderer endpoint--tlsHandshakeTimeShift duration      The amount of time to shift backwards for certificate expiration checks during TLS handshakes with the orderer endpoint--transient string                    Transient map of arguments in JSON encodingUse "peer chaincode [command] --help" for more information about a command.

最简单的操作链码的方式是使用命令行。Fabric 自 2.0 版本开始正式启用新的生命周期系统链码(位于 core/chaincode/lifecycle)来管理链码(需开启应用能力 V2_0),客户端通过新的 peer lifecycle chaincode 子命令(位于 internal/peer/lifecycle)对链码进行打包、安装、批注和提交等生命周期管理,取代 1.x 中的 peer chaincode 命令。

相对 1.x 版本中的模式,新的链码管理从单个组织升级为通道范畴。例如,链码的背书策略可由通道内多个组织来商定,部署和升级也作为通道层面的操作,这些都提高了链码生命周期的安全性。如果要对链码进行调用或查询,仍可以使用原有的 peer chaincode invokepeer chaincode query 命令。

如果要使用 1.x 版本中的链码生命周期管理(peer chaincodeinstall/instantaite/upgrade/list 等命令),需要将通道的应用能力版本设置为兼容的低版本,如 V1_4_2。当通道启用了应用能力 V2_0 后,将无法再部署或升级原有模式下的链码。

链码生命周期:

链码操作支持全局命令选项:

全局选项类型含义
--cafilestring信任的排序服务的 TLS CA 的证书(PEM 编码格式)路径
--certfilestring与排序服务进行双向 TLS 认证时使用的本地证书文件路径
--clientauthbool与排序服务通信时是否启用双向 TLS 认证
--connTimeoutduration客户端连接超时,默认为 3 秒
--keyfilestring与排序服务双向 TLS 认证时使用的本地私钥文件路径
-o,--ordererstringOrderer 服务地址
--ordererTLSHostnameOverridestring验证 Orderer TLS 时覆盖所校验的主机名
--tlsbool连接到 Orderer 服务时是否启用 TLS
--transientstring调用链码时传递的临时信息,其他 peer 将无法获取该信息

打包链码

package 子命令可以封装链码相关的数据,将其打包为.tar.gz 安装包,供安装使用。

Package a chaincode and write the package to a file.Usage:peer chaincode package [outputfile] [flags]Flags:-s, --cc-package                  create CC deployment spec for owner endorsements instead of raw CC deployment spec-c, --ctor string                 Constructor message for the chaincode in JSON format (default "{}")-h, --help                        help for package-i, --instantiate-policy string   instantiation policy for the chaincode-l, --lang string                 Language the chaincode is written in (default "golang")-n, --name string                 Name of the chaincode-p, --path string                 Path to chaincode-S, --sign                        if creating CC deployment spec package for owner endorsements, also sign it with local MSP-v, --version string              Version of the chaincode specified in install/instantiate/upgrade commandsGlobal Flags:--cafile string                       Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint--certfile string                     Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint--clientauth                          Use mutual TLS when communicating with the orderer endpoint--connTimeout duration                Timeout for client to connect (default 3s)--keyfile string                      Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint-o, --orderer string                      Ordering service endpoint--ordererTLSHostnameOverride string   The hostname override to use when validating the TLS connection to the orderer--tls                                 Use TLS when communicating with the orderer endpoint--tlsHandshakeTimeShift duration      The amount of time to shift backwards for certificate expiration checks during TLS handshakes with the orderer endpoint--transient string                    Transient map of arguments in JSON encoding

其中,生成的打包文件中包括 Chaincode-Package-Metadata.json、Code-Package.tar.gz 两个文件。Chaincode-Package-Metadata.json 内容包括链码路径、类型、标签等信息.Code-Package.tar.gz 内容包括链码的源码包结构,如 src/examples/chaincode/go/testcc/ 路径以及内容,但不能包括对目录以外路径的引用。

注意:自 2.0 版本起,编译链码的 ccenv 镜像不再包括 shim 层。链码需要自行包括 github.com/hyperledger/fabric-chaincode-go/shim 和其他所需要的依赖包。


安装链码

打包后的链码安装包文件,可以使用 install 命令安装到运行链码的各个 Peer。

Install a chaincode on a peer. This installs a chaincode deployment spec package (if provided) or packages the specified chaincode before subsequently installing it.Usage:peer chaincode install [flags]Flags:--connectionProfile string       Connection profile that provides the necessary connection information for the network. Note: currently only supported for providing peer connection information-c, --ctor string                    Constructor message for the chaincode in JSON format (default "{}")-h, --help                           help for install-l, --lang string                    Language the chaincode is written in (default "golang")-n, --name string                    Name of the chaincode-p, --path string                    Path to chaincode--peerAddresses stringArray      The addresses of the peers to connect to--tlsRootCertFiles stringArray   If TLS is enabled, the paths to the TLS root cert files of the peers to connect to. The order and number of certs specified should match the --peerAddresses flag-v, --version string                 Version of the chaincode specified in install/instantiate/upgrade commandsGlobal Flags:--cafile string                       Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint--certfile string                     Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint--clientauth                          Use mutual TLS when communicating with the orderer endpoint--connTimeout duration                Timeout for client to connect (default 3s)--keyfile string                      Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint-o, --orderer string                      Ordering service endpoint--ordererTLSHostnameOverride string   The hostname override to use when validating the TLS connection to the orderer--tls                                 Use TLS when communicating with the orderer endpoint--tlsHandshakeTimeShift duration      The amount of time to shift backwards for certificate expiration checks during TLS handshakes with the orderer endpoint--transient string                    Transient map of arguments in JSON encoding
参数类型含义
-- connectionProfilestring网络访问信息文件路径,目前仅支持 peer 连接信息
-- peerAddressesstringArray请求所发往的 peer 地址列表
--tlsRootCertFilesstringArray所连接的 peer 的信任 TLS 根证书

Peer 会尝试编译链码,如果编译成功,则将安装包以二进制的形式储存到指定路径的 chaincodes 子目录下,并利用元数据标签和安装包生成的 SHA256 值作为文件名。

Peer 会尝试编译链码,如果编译成功,则将安装包以二进制的形式储存到指定路径的 chaincodes 子目录下,并利用元数据标签和安装包生成的 SHA256 值作为文件名。

注意,安装操作需要是 Peer 认可的组织管理员身份(证书在 Peer 的 admincerts 目录下存在)。


查询和批准链码

通道内组织在部署链码前需要足够多的组织管理员对链码定义进行投票批准。链码定义包括链码名称、版本、序列号、背书和验证参数、是否需要初始化、链码包 Id,以及可能带有的私密数据集合配置等。操作涉及 queryinstalled、getinstalled-package、approveformyorg、checkcommitrea-diness 四个链码生命周期子命令。

queryinstalled 子命令可以查询目标 Peer 上已经安装的链码信息。支持的参数包括:

●--connectionProf ile string,网络访问信息文件路径,目前仅支持 Peer 连接信息。

●-O,--output string,结果输出的格式,目前支持格式化为 json 格式。

●--peerAddresses stringArray,请求所发往的 Peer 地址列表。

●--tlsRootCertFiles stringArray,所连接的 Peer 的信任的 TLS 根证书。getinstalledpackage 子命令可以获取指定的链码安装包(与发送给 Peer 的安装包内容相同)。支持参数包括:

●--connectionProf ile string,网络访问信息文件路径,目前仅支持 Peer 连接信息。

●--output-directory string,将获取到的链码安装包保存到指定路径,默认为当前路径。

●--package-id string,所要获取的链码安装包的 ID。

●--peerAddresses stringArray,请求所发往的 Peer 地址列表。

●--tlsRootCertFiles stringArray,所连接的 Peer 的信任的 TLS 根证书。

approveformyorg 子命令允许用户将链码的定义发送给 Peer 进行背书,通过后发给 Orderer 进行排序和确认。所有需要执行链码的组织都需要完成此步骤。默认情况下,只有通道内大多数组织(通道内的 Channel/Application/LifecycleEndorsement 策略指定,默认为通道内大多数成员)都批准了链码定义,对应链码才能在通道内部署运行。支持的参数包括:

●--channel-config-policy string,指定链码的背书策略名称,该策略名称需要提前存储在通道策略配置中,默认为 Channel/Application/Endorsement 策略(默认为通道内大多数成员组织背书)。

●-C,--channelID string,执行命令面向的通道名称。

●--collections-conf ig string,启用私密数据功能时,指定集合文件的路径。

●--connectionProf ile string,网络访问信息文件路径,目前仅支持 Peer 连接信息。

●-E,--endorsement-plugin string,链码所使用的背书插件的名称。

●--init-required,是否需要调用 Init 方法对链码进行初始化。

●-n,--name string,链码名称。

●--package-id string,链码安装包的名称。

●--peerAddresses stringArray,所连接的 Peer 节点列表。

●--sequence int,通道内对链码进行定义的序列号(默认为 1),每次更新链码定义则需要递增。

●--signature-policy string,指定链码的(基于签名的)背书策略,默认采用 Channel/Application/Endorsement 指定的策略(默认为通道内大多数成员组织背书),不能与 --channel-conf ig-policy 同时使用。

●--tlsRootCertFiles stringArray,连接 Peer 启用 TLS 时,所信任的 TLS 根证书列表(注意与 Peer 地址顺序匹配)。

●-V,--validation-plugin string,链码所使用的校验系统插件名称。

●--waitForEvent,是否等待事件以确认交易在各个 Peer 提交(默认开启)。

●--waitForEventTimeout duration,等待事件的时间(默认为 30s)。

checkcommitreadiness 子命令可以获取指定的链码安装包当前的批准状态,调用_lifecycle 链码 CheckCommitReadiness 方法(位于 core/chaincode/lifecycle/scc.go)。支持参数与 approveformyorg 子命令类似。


提交链码并查询状态

通道内链码得到足够多的组织批准后,将成为可以合法运行的链码。此时,任意通道内组织可以使用 commit 子命令发起提交操作。链码定义被成功提交到通道后,通道内成员可以使用链码(如进行调用)。支持的参数包括:

●--channel-config-policy string,指定链码的背书策略名称,该策略名称需要提前存储在通道策略配置中,默认为 Channel/Application/Endorsement 策略(默认为通道内大多数成员组织背书)。

●-C,--channelID string,执行命令面向的通道名称。

●--collections-conf ig string,启用私密数据功能时,指定集合文件的路径。

●--connectionProf ile string,网络访问信息文件路径,目前仅支持 Peer 连接信息。

●-E,--endorsement-plugin string,链码所使用的背书插件的名称。

●--init-required,是否需要调用 Init 方法对链码进行初始化。

●-n,--name string,链码名称。

●--package-id string,链码安装包的名称。

●--peerAddresses stringArray,所连接的 Peer 节点列表。

●--sequence int,通道内对链码进行定义的序列号(默认为 1),每次更新链码定义则需要递增。

●--signature-policy string,指定链码的(基于签名的)背书策略,默认采用 Channel/Application/Endorsement 指定的策略(默认为通道内大多数成员组织背书),不能与 --channel-conf ig-policy 同时使用。

●--tlsRootCertFiles stringArray,连接 Peer 启用 TLS 时,所信任的 TLS 根证书列表(注意与 Peer 地址顺序匹配)。

●-V,--validation-plugin string,链码所使用的校验系统插件名称。

●--waitForEvent,是否等待事件以确认交易在各个 Peer 提交(默认开启)。

●--waitForEventTimeout duration,等待事件的时间(默认为 30s)。

●-C,--channelID string,执行命令的通道名称。

●--connectionProf ile string,网络访问信息文件路径,目前仅支持 Peer 连接信息。

●-n,--name string,链码名称。

●-O,--output string,结果输出的格式,目前支持 json 格式。

●--peerAddresses stringArray,所连接的 Peer 地址列表。

●--tlsRootCertFiles stringArray,连接 Peer 启用 TLS 时,所信任的 TLS 根证书列表(注意与 Peer 地址顺序匹配)。

首先使用 commit 子命令提交已经得到批准的链码定义,然后使用 querycommitted 子命令查询提交状态


使用私有数据

在批准和提交链码定义时,可以通过 --collections-conf ig collection.json 来指定与私密数据相关的集合配置(Fabric v1.1.0 开始支持),可以实现在同一通道内私密数据的调用只有部分成员共享。如果不指定该参数则默认不启用该特性,意味着通道内所有成员都可以看到链码调用结果。

collections_config.json 配置文件示例 :

[{"name": "collection1", // 集合名称"policy": "OR('Org1MSP.member')", // 集合成员"requiredPeerCount": 0, // 背书之前至少扩散私有数据到的节点数"maxPeerCount": 3, // 背书之前尝试扩散最多节点个数, 不能小于 requiredPeerCount"blockToLive": 1000000, // 私有数据保存时长 0 意味着永不过期"memberOnlyRead": true, // 是否只允许集合成员来读取私有数据"memberOnlyWrite": true ,// 是否只允许集合成员来发起对私有数据的写交易"endorsementPolicy": "OR('Org1MSP.member')" ,// 指定对私有数据写操作时的背书策略"signaturePolicy": "OR('Org1MSP.member')" // 指定使用签名策略
},{"name": "collection2","policy": "OR('Org2MSP.member')","requiredPeerCount": 0,"maxPeerCount": 3,"blockToLive": 1,"memberOnlyRead": true}
]

其中,collection.json 中定义了 collection1 和 collection2 两个集合,其成员分别为 Org1、Org2 两个组织。当在链码逻辑中指定某个键值属于特定集合时,只有集合内成员能看到明文的读写集合,非集合成员即使在同一通道内也无法获取私密数据。对应 policy 只支持 OR 语法,指定哪些组织可以看到私密数据集合。

requiredPeerCount 和 maxPeerCount 指定了在执行背书过程中尝试扩散数据到其他合法节点的个数,避免因背书节点的突然故障而导致私密数据丢失。背书阶段未获取私密数据的合法节点,在提交阶段会尝试从其他节点来拉取私密数据。


调用链码

通过 peer chaincode invoke 命令(实现位于 internal/peer/chaincode)可以调用运行中链码定义的方法,所指定的函数名和参数会被传到链码的 Invoke () 方法进行处理。调用链码操作需要同时与 Peer 和 Orderer 打交道。

Invoke the specified chaincode. It will try to commit the endorsed transaction to the network.Usage:peer chaincode invoke [flags]Flags:-C, --channelID string               The channel on which this command should be executed--connectionProfile string       Connection profile that provides the necessary connection information for the network. Note: currently only supported for providing peer connection information-c, --ctor string                    Constructor message for the chaincode in JSON format (default "{}")-h, --help                           help for invoke-I, --isInit                         Is this invocation for init (useful for supporting legacy chaincodes in the new lifecycle)-n, --name string                    Name of the chaincode--peerAddresses stringArray      The addresses of the peers to connect to--tlsRootCertFiles stringArray   If TLS is enabled, the paths to the TLS root cert files of the peers to connect to. The order and number of certs specified should match the --peerAddresses flag--waitForEvent                   Whether to wait for the event from each peer's deliver filtered service signifying that the 'invoke' transaction has been committed successfully--waitForEventTimeout duration   Time to wait for the event from each peer's deliver filtered service signifying that the 'invoke' transaction has been committed successfully (default 30s)Global Flags:--cafile string                       Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint--certfile string                     Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint--clientauth                          Use mutual TLS when communicating with the orderer endpoint--connTimeout duration                Timeout for client to connect (default 3s)--keyfile string                      Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint-o, --orderer string                      Ordering service endpoint--ordererTLSHostnameOverride string   The hostname override to use when validating the TLS connection to the orderer--tls                                 Use TLS when communicating with the orderer endpoint--tlsHandshakeTimeShift duration      The amount of time to shift backwards for certificate expiration checks during TLS handshakes with the orderer endpoint--transient string                    Transient map of arguments in JSON encoding

注意,invoke 是异步操作,invoke 成功只能保证交易已经进入 Orderer 进行排序,但无法保证最终写到账本中(例如交易未通过 Committer 验证而被拒绝)。需要通过事件监听或主动查询等方式来进行确认交易是否最终写到账本上。


查询链码

查询链码可以通过 peer chaincode query 子命令。

该子命令实际上是 invoke 操作与 Peer 打交道的部分,即将签名后的 Proposal 发给指定的 Peer 节点的 ProcessProposal () gRPC 接口。最终将 - c 指定的命令参数发送给了链码中的 Invoke () 方法执行。

query 操作与 invoke 操作的区别在于,query 操作用来查询 Peer 上账本状态(需要链码支持查询逻辑),不生成交易,也不需要与 Orderer 打交道。同时,query 命令默认只返回第一个 Peer 的查询结果。

Get endorsed result of chaincode function call and print it. It won't generate transaction.Usage:peer chaincode query [flags]Flags:-C, --channelID string               The channel on which this command should be executed--connectionProfile string       Connection profile that provides the necessary connection information for the network. Note: currently only supported for providing peer connection information-c, --ctor string                    Constructor message for the chaincode in JSON format (default "{}")-h, --help                           help for query-x, --hex                            If true, output the query value byte array in hexadecimal. Incompatible with --raw-n, --name string                    Name of the chaincode--peerAddresses stringArray      The addresses of the peers to connect to-r, --raw                            If true, output the query value as raw bytes, otherwise format as a printable string--tlsRootCertFiles stringArray   If TLS is enabled, the paths to the TLS root cert files of the peers to connect to. The order and number of certs specified should match the --peerAddresses flagGlobal Flags:--cafile string                       Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint--certfile string                     Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint--clientauth                          Use mutual TLS when communicating with the orderer endpoint--connTimeout duration                Timeout for client to connect (default 3s)--keyfile string                      Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint-o, --orderer string                      Ordering service endpoint--ordererTLSHostnameOverride string   The hostname override to use when validating the TLS connection to the orderer--tls                                 Use TLS when communicating with the orderer endpoint--tlsHandshakeTimeShift duration      The amount of time to shift backwards for certificate expiration checks during TLS handshakes with the orderer endpoint--transient string                    Transient map of arguments in JSON encoding

升级链码

链码升级过程需要重复 peer lifecycle chaincode 相关命令,来执行完整的生命周期,具体步骤如下:

1)更新旧版本链码的源代码,并重新打包链码包。

2)将新的链码包再次安装到 Peer,获取新的包 Id。注意,相对旧版本要递增版本号。

3)按照策略,通道内足够多组织都要重新对新版本的链码定义进行批准。注意,序列号要递增。

4)通道内足够多组织批准定义后,可以提交新版本链码定义到通道。

5)再次调用链码,确保链码已经自动更新为新的版本。

peersfabricgosequencehyperledger fabricvalidationgrpc

© 著作权归作者所有

举报

相关文章:

Hyperledger Fabric 管理链码 peer lifecycle chaincode 指令使用

链上代码(Chaincode)简称链码,包括系统链码和用户链码。系统链码(System Chaincode)指的是 Fabric Peer 中负责系统配置、查询、背书、验证等平台功能的代码逻辑,运行在 Peer 进程内,将在第 14 …...

L1-011 A-B(Java)

题目 本题要求你计算A−B。不过麻烦的是,A和B都是字符串 —— 即从字符串A中把字符串B所包含的字符全删掉,剩下的字符组成的就是字符串A−B。 输入格式: 输入在2行中先后给出字符串A和B。两字符串的长度都不超过10的四次方,并且…...

系列七、Ribbon

一、Ribbon 1.1、概述 Ribbon是基于Netflix Ribbon实现的一套客户端负载均衡的工具,是Netflix发布的一款开源项目,其主要功能是提供客户端的软件负载均衡算法和服务调用,Ribbon客户端组件提供一系列完善的配置项,例如&#xff1a…...

山东名岳轩印刷包装携专业包装袋盛装亮相2024济南生物发酵展

山东名岳轩印刷包装有限公司盛装亮相2024第12届国际生物发酵展,3月5-7日山东国际会展中心与您相约! 展位号:1号馆F17 山东名岳轩印刷包装有限公司是一家拥有南北两个生产厂区,设计、制版、印刷,营销策划为一体的专业…...

BGP公认必遵属性——Next-hop(一)

BGP公认必遵属性共有三个,分别是:Next-hop、Origin、As-path,本期介绍Next-hop 点赞关注,持续更新!!! Next-hop 华为BGP路由下一跳特点: 默认情况下传给EBGP邻居的BGP路由的下一跳…...

增强Wi-Fi信号的10种方法,值得去尝试

Wi-Fi信号丢失,无线盲区。在一个对一些人来说,上网和呼吸一样必要的世界里,这些问题中的每一个都令人抓狂。 如果你觉得你的Wi-Fi变得迟钝,有很多工具可以用来测试你的互联网速度。你还可以尝试一些技巧来解决网络问题。然而,如果你能获得良好接收的唯一方法是站在无线路…...

第十五章 ECMAScript6新增的常用语法

文章目录 一、声明关键字二、箭头函数三、解构赋值四、展开运算符五、对字符的补充六、Symbol七、对象的简写语法八、Set和Map九、for-of 一、声明关键字 ES6新增的声明关键字: let,const:声明变量class:声明类import&#xff0c…...

vulhub中的Apache SSI 远程命令执行漏洞

Apache SSI 远程命令执行漏洞 1.cd到ssi-rce cd /opt/vulhub/httpd/ssi-rce/ 2.执行docker-compose up -d docker-compose up -d 3.查看靶场是否开启成功 dooker ps 拉取成功了 4.访问url 这里已经执行成功了,注意这里需要加入/upload.php 5.写入一句话木马 &…...

MSB20M-ASEMI迷你贴片整流桥MSB20M

编辑:ll MSB20M-ASEMI迷你贴片整流桥MSB20M 型号:MSB20M 品牌:ASEMI 封装:UMSB-4 特性:贴片、整流桥 最大平均正向电流:2A 最大重复峰值反向电压:1000V 恢复时间:&#xff1…...

工程管理系统功能设计与实践:实现高效、透明的工程管理

在现代化的工程项目管理中,一套功能全面、操作便捷的系统至关重要。本文将介绍一个基于Spring Cloud和Spring Boot技术的Java版工程项目管理系统,结合Vue和ElementUI实现前后端分离。该系统涵盖了项目管理、合同管理、预警管理、竣工管理、质量管理等多个…...

【C#】网址不进行UrlEncode编码会存在一些问题

欢迎来到《小5讲堂》,大家好,我是全栈小5。 这是2024年第3篇文章,此篇文章是C#知识点实践序列文章,博主能力有限,理解水平有限,若有不对之处望指正! 目录 前言数据丢失效果请求端代码接口端代码…...

深入Pandas(二):高级数据处理技巧

文章目录 系列文章目录引言时间序列分析可视化示例 高级数据分析技术分组与聚合操作时间序列分析 高级数据操作数据合并与重塑示例:数据合并merge示例:数据合并concat示例:数据重塑 - 透视表 高级索引技巧 结论 系列文章目录 Python数据分析…...

实验8 分析HTTP协议和DNS

实验8 分析HTTP协议和DNS 一、 实验目的及任务 熟悉并掌握wireshark的基本操作,了解网络协议实体间的交互以及报文交换。分析HTTP协议分析DNS协议 二、 实验设备 与因特网连接的计算机网络系统;主机操作系统为Windows;wireshark等软件。 …...

Talk | EMNLP 2023 最佳长论文:以标签为锚-从信息流动的视角分析上下文学习

本期为TechBeat人工智能社区第561期线上Talk。 北京时间1月4日(周四)20:00,北京大学博士生—王乐安的Talk已准时在TechBeat人工智能社区开播! 他与大家分享的主题是: “以标签为锚-从信息流动的视角分析上下文学习”,介绍了他的团队在上下文学…...

2024年中国电子学会青少年编程等级考试安排的通知

各有关单位、全体考生: 中国电子学会青少年等级考试(以下简称等级考试)是中国电子学会为落实《全民科学素质行动规划纲要》,提升青少年电子信息科学素质水平而开展的社会化评价项目。等级考试自2011年启动以来,作为中国电子学会科…...

[足式机器人]Part3 机构运动学与动力学分析与建模 Ch00-2(2) 质量刚体的在坐标系下运动

本文仅供学习使用,总结很多本现有讲述运动学或动力学书籍后的总结,从矢量的角度进行分析,方法比较传统,但更易理解,并且现有的看似抽象方法,两者本质上并无不同。 2024年底本人学位论文发表后方可摘抄 若有…...

【亚马逊云科技】自家的AI助手 - Amazon Q

写在前面:博主是一只经过实战开发历练后投身培训事业的“小山猪”,昵称取自动画片《狮子王》中的“彭彭”,总是以乐观、积极的心态对待周边的事物。本人的技术路线从Java全栈工程师一路奔向大数据开发、数据挖掘领域,如今终有小成…...

网络安全—SSL安全访问应用

文章目录 网络拓扑部署CA服务器颁发证书开启Web服务安装IIS服务修改Web默认网页 申请Web证书前提准备申请文件生成申请web证书开始安装web证书 客户机访问web默认网站使用HTTP使用HTTPS 为客户机安装浏览器证书 环境:Windows Server 2003 网络拓扑 这里使用NAT还是…...

Qt5.14.2实现将html文件转换为pdf文件

文章目录 简介源码widget.cppwidget.uihtml文件演示效果简介 QPdfWriter是Qt框架中用于创建和写入PDF文件的类。它允许您在您的Qt应用程序中动态生成并输出PDF文档,以便进行打印、保存或导出。 QPdfWriter类提供了以下一些常用的函数和方法,可以让您创建和定制PDF文件: 构…...

Minecraft教程:使用MCSM面板搭建我的世界私服并实现远程联机

文章目录 前言1. 安装JAVA2. MCSManager安装3.局域网访问MCSM4.创建我的世界服务器5.局域网联机测试6.安装cpolar内网穿透7. 配置公网访问地址8.远程联机测试9. 配置固定远程联机端口地址9.1 保留一个固定tcp地址9.2 配置固定公网TCP地址9.3 使用固定公网地址远程联机 前言 Li…...

springboot学生成绩管理系统源码和论文

随着信息技术和网络技术的飞速发展,人类已进入全新信息化时代,传统管理技术已无法高效,便捷地管理信息。为了迎合时代需求,优化管理效率,各种各样的管理系统应运而生,各行各业相继进入信息管理时代&#xf…...

w20webshell之文件上传

1.什么是文件上传? 将本地文件传输到指定位置。2.什么是webshell 给恶意脚本提供运行环境3.文件上传所需要的条件 a.文件成功上传,未被删除 b.知道文件路径 c.文件所在系统支持脚本运行4.文件上传流程 支持任意文件上传的文件上传 a.恶意文件上传成功 b.…...

【Redis】非关系型数据库之Redis的主从复制、哨兵和集群高可用

目录 一、主从复制、哨兵、集群的区别 二、主从复制 2.1主从复制的作用 2.2主从复制的原理 2.3主从复制的实操 步骤一:环境准备 步骤二:安装Redis以及配置文件修改 Redis的主从配置文件都一样 步骤四:验证主从复制 三、哨兵 3.1哨兵…...

从私有Git仓库的搭建到命令的使用及部署再到分支管理

一、版本控制系统/版本控制器 1. 版本控制系统: git 分布式 —没有中心代码库,所有机器之间的地位同等(每台机器上都有相同的代码) svn 集中管理的 —有中心代码库,其他都是客户端 2.git与svn介绍 1.git属于分布…...

mysql基础-常用函数汇总

目录 1. 查询技巧 2. 时间函数 2.1 now() 2.2 current_date() 2.3 时间差timestampdiff()与datediff() 2.4 其他时间函数 3. 字符函数 3.1 截取函数 3.2 分割函数 3.3 left与right函数 3.4 其他函数 4. 数字函数 5. …...

COCO数据格式的json文件内容

COCO(Common Objects in Context)数据集现在有3种标注类型:object instances(目标实例), object keypoints(目标上的关键点), 和image captions(看图说话),使用JSON文件存储,包含了对图像中目标的边界框、类别标签、分割掩码等信息。 COCO标注文件是一个包含多个字…...

AI-数学-高中-3.二次函数的根的分布问题的解题方法

原作者学习视频:二次】3二次函数根分布问题(中档)_哔哩哔哩_bilibili 一、伟达定理(根与0比较的二次函数) 示例: 二、画图法: 1.开口方向的确定,有的示例可能存在向上、下两种情况…...

golang中gorm使用

前言 记录下go语言操作mysql数据库,选用gorm,gorm是一个流行的对象关系映射(ORM)库,用于简化与数据库的交互。 接入步骤 安装gorm:首先,你需要使用Go模块来安装gorm。在终端中运行以下命令&…...

centoss7安装mysql详细教程

【MySQL系列】在Centos7环境安装MySQL_centos7安装mysql-CSDN博客 【MySQL系列】在Centos7环境安装MySQL_centos7安装mysql-CSDN博客 【MySQL系列】在Centos7环境安装MySQL_centos7安装mysql-CSDN博客...

SpringBoot-拓展

邮件 依赖 <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId>配置 spring.mail.username邮箱 spring.mail.password授权码 spring.mail.hostsmtp.qq.com # 开启加密验证 spring.mail.properties.mai…...

大气装饰公司网站源码/seo1搬到哪里去了

【一】错误代码&#xff1a; package demo;public class demo4 {public static void main(String[] args) {System.out.println("I likejava");} }【二】错误样例&#xff1a; 【三】错误分析&#xff1a; 以上这种错误&#xff0c;一般会出现在过长字符串换行时&a…...

建设银行信用卡申请网站/今日头条指数查询

因为本人美工不行&#xff0c;假如要做出界面来的话不知何年马月才有成果&#xff0c;所以&#xff0c;我决定&#xff0c; 采用类似 mvc&#xff08;asp.net上面的mvc我用过asp.net mvc及monorail&#xff0c;所以参考他们的模型来&#xff09;模型来进行定义&#xff0c;然后…...

软件测试培训包就业是真的吗/某网站seo策划方案

在进行项目整体架构设计时&#xff0c;我们应该明确知道哪些项目是可以被重复再利用的&#xff0c;而哪些项目是与领域模块关系密切的&#xff0c;对于后者我们是应该在解决方案中保留的&#xff0c;而前者则是应该提取出来的。 在一个完整的解决方案中&#xff0c;应该是由“公…...

常州城投建设招标网站/手机怎么搭建网站

DBUnit是一个方便的数据准备工具, 方便于我们做单元测试的时候准备数据, 它的数据准备是基于XML格式的, 如下: <?xml version1.0 encodingUTF-8?> <dataset><YourTableName_1 Field_1"1" Field_2"f2" Field_3"f3"/><Your…...

我的校园网站制作/宁波seo网络推广代理公司

2020年8月26日&#xff0c;由武汉达梦数据库有限公司主办、上海腾科教育科技有限公司独家赞助的“‘信创人才万人培养计划’暨2020首届达梦数据库精英挑战赛”高校组决赛通道正式开启。经过线上实操和答辩两轮的激烈角逐&#xff0c;大赛最后工作124名选手获奖。其中一等奖20名…...

网站开发 链接指向文件夹/百度推广做二级域名

今天就很开心&#xff0c;所以写了两篇内容一个是inode、block两个含义&#xff0c;以及后面的硬链接与软连接&#xff0c;东西不是很难。 目录一、inode1.目录文件的结构2.inode号码3.访问文件的流程4.inode大小5.inode特殊作用二、inode耗尽故障处理三、硬链接与软连接1.硬链…...