代币合约流动性质押挖矿开发功能丨代币合约流动性质押挖矿分红系统开发实现技术分析及源码

简介: topo.yaml示例# # Global variables are applied to all deployments and used as the default value of# # the deployments if a specific deployment value is missing.

topo.yaml示例

Global variables are applied to all deployments and used as the default value of

the deployments if a specific deployment value is missing.

global:
user: "root"
ssh_port: 22
deploy_dir: "/yourpath/data/tidb-deploy"
data_dir: "/yourpath/data/tidb-data"

server_configs:
tikv:

raftstore.sync-log: true
storage.reserve-space: "0"
storage.block-cache.capacity: "4G"
server.grpc-concurrency: 48
server.grpc-concurrent-stream: 4096
server.grpc-stream-initial-window-size: "32M"
storage.scheduler-concurrency: 1048576
storage.scheduler-worker-pool-size: 32
rocksdb.titan.enabled: true
rocksdb.defaultcf.write-buffer-size: "512MB"
rocksdb.defaultcf.max-write-buffer-number: 32
rocksdb.max-background-jobs: 32
rocksdb.defaultcf.block-cache-size: "16GB"
rocksdb.defaultcf.compression-per-level: [
    'zstd',
    'zstd',
    'lz4',
    'lz4',
    'lz4',
    'lz4',
    'lz4',
]

pd:

replication.location-labels: ["host"]
replication.max-replicas: 1

pd_servers:

  • host: 127.0.0.1

tikv_servers:

  • host: 127.0.0.1
    port: 20160
    status_port: 20180
    deploy_dir: "/yourpath/data/deploy/tikv1"
    data_dir: "/yourpath/data/data/tikv1"
    log_dir: "/yourpath/data/log/tikv1"
    config:

    server.labels: { host: "logic-host-1" }
    
  • host: 127.0.0.1
    port: 20161
    status_port: 20181
    deploy_dir: "/yourpath/data/deploy/tikv2"
    data_dir: "/yourpath/data/data/tikv2"
    log_dir: "/yourpath/data/log/tikv2"
    config:

    server.labels: { host: "logic-host-2" }
    
  • host: 127.0.0.1
    port: 20162
    status_port: 20182
    deploy_dir: "/yourpath/data/deploy/tikv3"
    data_dir: "/yourpath/data/data/tikv3"
    log_dir: "/yourpath/data/log/tikv3"
    config:

    server.labels: { host: "logic-host-3" }
    

monitoring_servers:

  • host: 127.0.0.1

grafana_servers:

  • host: 127.0.0.1

alertmanager_servers:

  • host: 127.0.0.1

5.1.3. 配置ssh连接上限
添加如下配置到/etc/ssh/sshd_config MaxSessions 100 MaxStartups 50:30:100

重启centos上 sshd: systemctl restart sshd.service

vim /etc/ssh/sshd_config
5.1.4. tiup操作tidb cluster
tiup cluster deploy chainmaker-tidb v5.1.1 topo.yaml --user root -p # 部署 tidb cluster, 输入密码为服务器登陆密码
tiup cluster list # 查看 tidb cluster
tiup cluster start chainmaker-tidb # 启动 tidb cluster
tiup cluster display chainmaker-tidb # 查看 tidb cluster 状态
tiup cluster stop chainmaker-tidb # 停止 tidb cluster
tiup cluster clean chainmaker-tidb --all --ignore-role prometheus --ignore-role grafana # 清理 tidb cluster数据,并保留监控数据
tiup cluster destroy chainmaker-tidb # 销毁 tidb cluster
5.1.5. 配置chainmaker storage模块
blockdb_config:

provider: tikvdb
tikvdb_config:
  endpoints: "127.0.0.1:2379" # tikv pd server url,支持多个url, 如: "192.168.1.2:2379,192.168.1.3:2379"
  max_batch_count: 128 # 每次kv batch最大大小 默认128
  grpc_connection_count: 16 # chainmaker连接tikv的连接数, 默认4
  grpc_keep_alive_time: 10 # 保持连接的连接数, 默认10
  grpc_keep_alive_timeout: 3 # 保持连接的超时时间 默认3
  write_batch_size: 128 # 每次提交tikv批次最大大小,默认128

statedb_config:

provider: tikvdb
tikvdb_config:
  endpoints: "127.0.0.1:2379"
  max_batch_count: 128
  grpc_connection_count: 16
  grpc_keep_alive_time: 10
  grpc_keep_alive_timeout: 3
  write_batch_size: 128

disable_historydb: true
historydb_config:

provider: tikvdb
tikvdb_config:
  endpoints: "127.0.0.1:2379"
  max_batch_count: 128
  grpc_connection_count: 16
  grpc_keep_alive_time: 10
  grpc_keep_alive_timeout: 3
  write_batch_size: 128

resultdb_config:

provider: tikvdb
tikvdb_config:
  endpoints: "127.0.0.1:2379"
  max_batch_count: 128
  grpc_connection_count: 16
  grpc_keep_alive_time: 10
  grpc_keep_alive_timeout: 3
  write_batch_size: 128
相关文章
|
JavaScript 前端开发 区块链
DAPP代币合约流动性质押分红挖矿系统开发丨技术分析
DAPP代币合约流动性质押分红挖矿系统开发丨技术分析
|
算法 区块链
Defi+NFT质押流动性挖矿系统开发/LP质押挖矿功能开发解析
Defi+NFT质押流动性挖矿系统开发/LP质押挖矿功能开发解析
|
存储 前端开发 JavaScript
浅谈DAPP智能合约流动性质押挖矿分红系统开发技术分析及代码部署
“Web3.0”是一个用户共建、隐私保护、平台开放的生态体系。相比“Web2.0”,“Web3.0”的目标是实现一个更加开放、零信任或是低信任、无许可的价值互联网时代。其生态体系主要由“Web3.0钱包”、“稳定币”、“公链”、“NFT”、“GameFi”、“去中心化存储”、“Dapp”、“DAO”、“DeFi”构成。
浅谈DAPP智能合约流动性质押挖矿分红系统开发技术分析及代码部署
|
区块链
defi/lp/nft/dapp代币预售合约流动性质押挖矿开发正式版,defi/lp/nft/dapp代币预售合约流动性质押挖矿系统开发(方案及详细)
 智能合约(Smart contract)是依托计算机在网络空间运行的合约,它以信息化方式传播、验证或执行合同,由计算机读取、执行,具备自助的特点。而区块链的去中心化,数据的防篡改,决定了智能合约更加适合于在区块链上来实现
|
5G 区块链 vr&ar
DAPP智能合约流动性质押挖矿分红开发案例版丨DAPP智能合约流动性质押挖矿分红系统开发(开发案例及源码)
The metauniverse is an immersive digital world created by the combination of virtual reality,augmented reality and the Internet.The connotation and key technologies of the metauniverse require further breaking the space-time limit(5G and the Internet of Things),real immersion(VR),and value transmi
|
区块链
代币合约dapp开发丨代币合约dapp流动性质押挖矿分红系统开发实现技术案例及源码
 因为整个区块链系统是点对点的对等网络,没有统一的中心机构协调各个节点的行为,所以在生成区块时,各个节点的行为都是相互独立的,很有可能同时由多个矿工在同一区块高度生成出2个以上的区块来。这些区块打包的交易很可能是不一样的,同时满足条件的数字n不是唯一的,多个矿工之间生成的数字n是不一样的,但是同样是满足不等式的。在这种情况下,网络中的其他节点很可能同步到不同的区块数据,并且这些数据在数学上都是合法的、有效的。当不同的节点中的不同的区块作为当前最新区块时,就会存在分叉的情况,即不同的矿机对同一高度的区块生产了内存不一样的新区快,并且这些矿工都找到了满足不等式的数字n。
|
区块链 索引
DAPP/LP代币智能合约流动性质押挖矿互助公排开发需求丨DAPP/LP代币智能合约流动性质押挖矿互助公排系统开发详细及方案
 以区块链为核心的数字科技可以推动信息技术服务,从而促进数字产业化;元宇宙可以创造和创新更广泛的应用场景,拉动信息消费促进产业数字化。因此,以区块链为核心的Web3.0技术体系推动形成的元宇宙数字生态,将对数字产业化和产业数字化提供有力支撑,为数字经济高质量发展打造新引擎。
NFT流动性质押挖矿开发功能丨NFT流动性质押挖矿系统开发(开发详细)丨NFT流动性质押挖矿系统源码部署
  Liquidity mining is an incentive mechanism to promote the use of DeFi and a new decentralized token distribution mechanism.Most DeFi applications require users to lock tokens into the contract.The larger the amount of lock-in the contract has,the better financial services can be obtained.Liquidity
defi丨dapp丨nft丨lp流动性质押挖矿分红开发详细,defi丨dapp丨nft丨lp流动性质押挖矿分红系统开发(源码版)
 Liquidity mining encourages users to pledge tokens and pledge vouchers to liquidity mining contracts. For users, using DeFi will not only gain the original profits, but also obtain liquidity mining rewards. Inspired by liquidity mining, it has promoted users to become the LP of DeFi and promoted th
|
人工智能
defi流动性质押挖矿系统丨defi流动性质押挖矿系统开发(dapp开发)丨defi流动性质押挖矿源码版
 Liquidity mining,in short,is a token incentive plan designed to attract liquidity providers(LPs)to provide liquidity for specific transaction pairs/pools on AMM.