zl程序教程

您现在的位置是:首页 >  工具

当前栏目

最强大脑(量化交易)合约版系统开发源码(搭建部署)

源码部署系统开发 搭建 交易 大脑 最强
2023-06-13 09:16:45 时间

 什么是量化交易?确切地说,量化交易属于人工智能的一个应用分支,它利用计算机的强大运算能力,用数学模型来模仿人的思维作出决策,通过数据建模、统计学分析、程序设计等工具

  Compared with traditional contracts,smart contracts have three characteristics:

  1.The contract content is open and transparent

  The smart contract is deployed on the blockchain,and its contract content is naturally open and transparent.

  2.The contents of the contract cannot be tampered with

  Similarly,the content of the smart contract cannot be modified because it is deployed on the blockchain.

  3.Permanent operation

向 fabric 网络中添加新节点是常见的业务需求,基本上需要以下几个步骤:

生成新节点证书

添加新节点配置信息并启动

新节点加入通道

安装链码

以 fabric-sample 库中 v1.3 版本的 byfn.sh 建立的简单测试网为例进行操作。这个测试网络中包含两个组织,每个组织都有两个节点:

org1:

peer0.org1.example.com

peer1.org1.example.com

org2:

peer0.org2.example.com

peer1.org2.example.com

我们需要在 org2 中添加一个 peer2.org2.example.com 节点。

1. 生成新节点证书

每个节点都有相应的证书才能连接网络,需要使用 cryptogen 工具生成新节点的证书。因为是新节点加入现有网络组织,因此,需要使用 cryptogen extend 命令首先对现有网络的证书文件进行扩展。在执行该命令之前需要首先修改 crypto-config.yaml 配置文件,将 org2 组织的节点数增加 1,其它的配置信息不要修改。

点击查看修改后的 crypto-config.yaml 配置文件

# Copyright IBM Corp. All Rights Reserved.

#

# SPDX-License-Identifier: Apache-2.0

#

# ---------------------------------------------------------------------------

# "OrdererOrgs" - Definition of organizations managing orderer nodes

# ---------------------------------------------------------------------------

OrdererOrgs:

# ---------------------------------------------------------------------------

# Orderer

# ---------------------------------------------------------------------------

- Name: Orderer

Domain: example.com

# ---------------------------------------------------------------------------

# "Specs" - See PeerOrgs below for complete description

# ---------------------------------------------------------------------------

Specs:

- Hostname: orderer

# ---------------------------------------------------------------------------

# "PeerOrgs" - Definition of organizations managing peer nodes

# ---------------------------------------------------------------------------

PeerOrgs:

# ---------------------------------------------------------------------------

# Org1

# ---------------------------------------------------------------------------

- Name: Org1

Domain: org1.example.com

EnableNodeOUs: true

# ---------------------------------------------------------------------------

# "Specs"

# ---------------------------------------------------------------------------

# Uncomment this section to enable the explicit definition of hosts in your

# configuration. Most users will want to use Template, below

#

# Specs is an array of Spec entries. Each Spec entry consists of two fields:

# - Hostname: (Required) The desired hostname, sans the domain.

# - CommonName: (Optional) Specifies the template or explicit override for

# the CN. By default, this is the template:

#

# "{{.Hostname}}.{{.Domain}}"

#

# which obtains its values from the Spec.Hostname and

# Org.Domain, respectively.

# ---------------------------------------------------------------------------

# Specs:

# - Hostname: foo # implicitly "foo.org1.example.com"

# CommonName: foo27.org5.example.com # overrides Hostname-based FQDN set above

# - Hostname: bar

# - Hostname: baz

# ---------------------------------------------------------------------------

# "Template"

# ---------------------------------------------------------------------------

# Allows for the definition of 1 or more hosts that are created sequentially

# from a template. By default, this looks like "peer%d" from 0 to Count-1.

# You may override the number of nodes (Count), the starting index (Start)

# or the template used to construct the name (Hostname).

#

# Note: Template and Specs are not mutually exclusive. You may define both

# sections and the aggregate nodes will be created for you. Take care with

# name collisions

# ---------------------------------------------------------------------------

Template:

Count: 2

# Start: 5

# Hostname: {{.Prefix}}{{.Index}} # default

# ---------------------------------------------------------------------------

# "Users"

# ---------------------------------------------------------------------------

# Count: The number of user accounts _in addition_ to Admin

# ---------------------------------------------------------------------------

Users:

Count: 1

# ---------------------------------------------------------------------------

# Org2: See "Org1" for full specification

# ---------------------------------------------------------------------------

- Name: Org2

Domain: org2.example.com

EnableNodeOUs: true

Template:

Count: 3 # count 表示组织下的peer数量,这里需要把 2 改为 3

Users:

Count: 1