PageSourceSearch

https://www.zetachain.com/docs/_next/static/chunks/pages/nodes/start-here/setup.zh-CN-d4ab2479b4d33f1b.js

js zetachain.com collected 2026-10-03 21:45:27 UTC 30,134 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9257],{50789:function(e,t,n){"use strict";n.r(t),n.d(t,{__toc:function(){return h}});var r=n(59499),i=n(29060),o=n(82643),l=n(69148),s=n(35944);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){(0,r.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var h=[{depth:2,value:"安装 ZetaChain 节点二进制",id:"安装-zetachain-节点二进制"},{depth:2,value:"创建非 root 用户",id:"创建非-root-用户"},{depth:2,value:"初始化数据目录",id:"初始化数据目录"},{depth:2,value:"获取配置文件",id:"获取配置文件"},{depth:2,value:"修改配置",id:"修改配置"},{depth:2,value:"设置文件与进程限制",id:"设置文件与进程限制"},{depth:2,value:"安装 Cosmovisor",id:"安装-cosmovisor"},{depth:3,value:"源码安装",id:"源码安装"},{depth:3,value:"预编译二进制",id:"预编译二进制"},{depth:2,value:"配置 Cosmovisor",id:"配置-cosmovisor"},{depth:3,value:"创建 cosmovisor 目录",id:"创建-cosmovisor-目录"},{depth:3,value:"安装当前 zetacored 二进制",id:"安装当前-zetacored-二进制"},{depth:2,value:"配置 zetacored systemd 服务",id:"配置-zetacored-systemd-服务"},{depth:3,value:"创建 systemd 单元",id:"创建-systemd-单元"},{depth:2,value:"下一步",id:"下一步"},{depth:3,value:"升级准备",id:"升级准备"},{depth:3,value:"监控",id:"监控"},{depth:3,value:"指标",id:"指标"}];function d(e){var t=Object.assign({h2:"h2",p:"p",code:"code",a:"a",pre:"pre",span:"span",table:"table",thead:"thead",tr:"tr",th:"th",tbody:"tbody",td:"td",blockquote:"blockquote",h3:"h3",strong:"strong",ul:"ul",li:"li"},(0,o.a)(),e.components);return(0,s.BX)(s.HY,{children:[(0,s.tZ)(t.h2,{id:"安装-zetachain-节点二进制",children:"安装 ZetaChain 节点二进制"}),"\n",(0,s.BX)(t.p,{children:["首先下载二进制文件并赋予可执行权限。请将 ",(0,s.tZ)(t.code,{children:"VERSION"})," 替换为最新的 ",(0,s.tZ)(t.a,{href:"/reference/tools/proposals",children:"治理软件升级提案"})," 中指定版本,同时根据需要修改平台后缀(如 ",(0,s.tZ)(t.code,{children:"-linux-amd64"}),")。"]}),"\n",(0,s.tZ)(t.pre,{"data-language":"text","data-theme":"default",hasCopyCode:!0,children:(0,s.BX)(t.code,{"data-language":"text","data-theme":"default",children:[(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"sudo wget https://github.com/zeta-chain/node/releases/download/VERSION/zetacored-linux-amd64 -O /usr/local/bin/zetacored &&\\"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"sudo chmod a+x /usr/local/bin/zetacored"})})]})}),"\n",(0,s.BX)(t.p,{children:["关于版本的更多信息,请查看 ",(0,s.tZ)(t.a,{href:"https://github.com/zeta-chain/node/releases",children:"GitHub Releases"}),"。"]}),"\n",(0,s.BX)(t.p,{children:["验证 ",(0,s.tZ)(t.code,{children:"zetacored"})," 版本:"]}),"\n",(0,s.tZ)(t.pre,{"data-language":"text","data-theme":"default",hasCopyCode:!0,children:(0,s.tZ)(t.code,{"data-language":"text","data-theme":"default",children:(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"zetacored version"})})})}),"\n",(0,s.tZ)(t.h2,{id:"创建非-root-用户",children:"创建非 root 用户"}),"\n",(0,s.tZ)(t.p,{children:"建议使用普通用户运行 ZetaChain 二进制,而非 root。"}),"\n",(0,s.tZ)(t.pre,{"data-language":"bash","data-theme":"default",hasCopyCode:!0,children:(0,s.tZ)(t.code,{"data-language":"bash","data-theme":"default",children:(0,s.BX)(t.span,{className:"line",children:[(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-function)"},children:"sudo"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"useradd"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"-m"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"-s"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"/bin/bash"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"zetachain"})]})})}),"\n",(0,s.tZ)(t.h2,{id:"初始化数据目录",children:"初始化数据目录"}),"\n",(0,s.BX)(t.table,{children:[(0,s.tZ)(t.thead,{children:(0,s.BX)(t.tr,{children:[(0,s.tZ)(t.th,{children:"网络"}),(0,s.tZ)(t.th,{children:"链 ID"})]})}),(0,s.BX)(t.tbody,{children:[(0,s.BX)(t.tr,{children:[(0,s.tZ)(t.td,{children:"主网"}),(0,s.tZ)(t.td,{children:"zetachain_7000-1"})]}),(0,s.BX)(t.tr,{children:[(0,s.tZ)(t.td,{children:"测试网"}),(0,s.tZ)(t.td,{children:"athens_7001-1"})]})]})]}),"\n",(0,s.tZ)(t.pre,{"data-language":"text","data-theme":"default",hasCopyCode:!0,children:(0,s.tZ)(t.code,{"data-language":"text","data-theme":"default",children:(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"sudo -u zetachain zetacored init MONIKER --chain-id zetachain_7000-1"})})})}),"\n",(0,s.BX)(t.p,{children:["将 ",(0,s.tZ)(t.code,{children:"MONIKER"})," 替换为节点名称。默认初始化路径为 ",(0,s.tZ)(t.code,{children:"$HOME/.zetacored"}),",可通过 ",(0,s.tZ)(t.code,{children:"--home"})," 自定义。"]}),"\n",(0,s.tZ)(t.h2,{id:"获取配置文件",children:"获取配置文件"}),"\n",(0,s.BX)(t.table,{children:[(0,s.tZ)(t.thead,{children:(0,s.BX)(t.tr,{children:[(0,s.tZ)(t.th,{children:"网络"}),(0,s.tZ)(t.th,{children:"配置文件"})]})}),(0,s.BX)(t.tbody,{children:[(0,s.BX)(t.tr,{children:[(0,s.tZ)(t.td,{children:"主网"}),(0,s.tZ)(t.td,{children:(0,s.tZ)(t.a,{href:"https://github.com/zeta-chain/network-config/tree/main/mainnet",children:"https://github.com/zeta-chain/network-config/tree/main/mainnet"})})]}),(0,s.BX)(t.tr,{children:[(0,s.tZ)(t.td,{children:"测试网"}),(0,s.tZ)(t.td,{children:(0,s.tZ)(t.a,{href:"https://github.com/zeta-chain/network-config/tree/main/athens3",children:"https://github.com/zeta-chain/network-config/tree/main/athens3"})})]})]})]}),"\n",(0,s.tZ)(t.p,{children:"将配置文件下载到数据目录:"}),"\n",(0,s.tZ)(t.pre,{"data-language":"text","data-theme":"default",hasCopyCode:!0,children:(0,s.BX)(t.code,{"data-language":"text","data-theme":"default",children:[(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"sudo -u zetachain wget https://raw.githubusercontent.com/zeta-chain/network-config/main/mainnet/genesis.json -O /home/zetachain/.zetacored/config/genesis.json &&\\"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"sudo -u zetachain wget https://raw.githubusercontent.com/zeta-chain/network-config/main/mainnet/cl
1ient.toml -O /home/zetachain/.zetacored/config/client.toml &&\\"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"sudo -u zetachain wget https://raw.githubusercontent.com/zeta-chain/network-config/main/mainnet/config.toml -O /home/zetachain/.zetacored/config/config.toml &&\\"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"sudo -u zetachain wget https://raw.githubusercontent.com/zeta-chain/network-config/main/mainnet/app.toml -O /home/zetachain/.zetacored/config/app.toml"})})]})}),"\n",(0,s.tZ)(t.h2,{id:"修改配置",children:"修改配置"}),"\n",(0,s.tZ)(t.p,{children:"虽然下载的配置已包含通用参数,但仍需根据节点情况做少量调整。"}),"\n",(0,s.tZ)(t.p,{children:"若机器拥有公网 IPv4 地址,可运行:"}),"\n",(0,s.tZ)(t.pre,{"data-language":"text","data-theme":"default",hasCopyCode:!0,children:(0,s.tZ)(t.code,{"data-language":"text","data-theme":"default",children:(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"curl -4 icanhazip.com"})})})}),"\n",(0,s.tZ)(t.p,{children:"如果有 IPv6 地址,也可以使用。"}),"\n",(0,s.BX)(t.p,{children:["将节点 ",(0,s.tZ)(t.code,{children:"moniker"})," 与外部地址替换为正确值:"]}),"\n",(0,s.tZ)(t.pre,{"data-language":"text","data-theme":"default",filename:"~/.zetacored/config/config.toml",hasCopyCode:!0,children:(0,s.BX)(t.code,{"data-language":"text","data-theme":"default",children:[(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:'moniker = "{MONIKER}"'})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:'external_address = "{YOUR_EXTERNAL_IP_ADDRESS_HERE}:26656"'})})]})}),"\n",(0,s.tZ)(t.h2,{id:"设置文件与进程限制",children:"设置文件与进程限制"}),"\n",(0,s.tZ)(t.p,{children:"为更好地管理节点资源,建议调整最大文件描述符(nofile)与进程数(nproc)。"}),"\n",(0,s.BX)(t.p,{children:["编辑 ",(0,s.tZ)(t.code,{children:"/etc/security/limits.conf"}),":"]}),"\n",(0,s.tZ)(t.pre,{"data-language":"text","data-theme":"default",hasCopyCode:!0,children:(0,s.BX)(t.code,{"data-language":"text","data-theme":"default",children:[(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"*       soft    nproc   262144"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"*       hard    nproc   262144"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"*       soft    nofile  262144"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"*       hard    nofile  262144"})})]})}),"\n",(0,s.BX)(t.p,{children:["编辑 ",(0,s.tZ)(t.code,{children:"/etc/sysctl.conf"}),":"]}),"\n",(0,s.tZ)(t.pre,{"data-language":"text","data-theme":"default",hasCopyCode:!0,children:(0,s.tZ)(t.code,{"data-language":"text","data-theme":"default",children:(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"fs.file-max=262144"})})})}),"\n",(0,s.tZ)(t.h2,{id:"安装-cosmovisor",children:"安装 Cosmovisor"}),"\n",(0,s.BX)(t.p,{children:["来自 ",(0,s.tZ)(t.a,{href:"https://docs.cosmos.network/v0.47/build/tooling/cosmovisor",children:"Cosmos 文档"}),":"]}),"\n",(0,s.BX)(t.blockquote,{children:["\n",(0,s.tZ)(t.p,{children:"cosmovisor 是 Cosmos SDK 应用的进程管理器,可在链升级时自动切换应用二进制。它会轮询升级高度创建的 upgrade-info.json 文件,并自动下载新二进制、停止旧进程、切换并重启节点。"}),"\n"]}),"\n",(0,s.tZ)(t.h3,{id:"源码安装",children:"源码安装"}),"\n",(0,s.tZ)(t.pre,{"data-language":"bash","data-theme":"default",hasCopyCode:!0,children:(0,s.BX)(t.code,{"data-language":"bash","data-theme":"default",children:[(0,s.BX)(t.span,{className:"line",children:[(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-function)"},children:"go"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"install"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"cosmossdk.io/tools/cosmovisor/cmd/[email protected]"})]}),"\n",(0,s.BX)(t.span,{className:"line",children:[(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-function)"},children:"mv"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string-expression)"},children:"$("}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-function)"},children:"go"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string-expression)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"env"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string-expression)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"GOPATH"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string-expression)"},children:")"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"/bin/cosmovisor"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"}
1,children:"/usr/local/bin/cosmovisor"})]})]})}),"\n",(0,s.tZ)(t.h3,{id:"预编译二进制",children:"预编译二进制"}),"\n",(0,s.BX)(t.p,{children:["从 ",(0,s.tZ)(t.a,{href:"https://github.com/cosmos/cosmos-sdk/releases/tag/cosmovisor%2Fv1.7.1",children:"cosmovisor v1.7.1 发布页"})," 下载对应平台的压缩包。例如:"]}),"\n",(0,s.tZ)(t.pre,{"data-language":"bash","data-theme":"default",hasCopyCode:!0,children:(0,s.BX)(t.code,{"data-language":"bash","data-theme":"default",children:[(0,s.BX)(t.span,{className:"line",children:[(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-function)"},children:"wget"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"https://github.com/cosmos/cosmos-sdk/releases/download/cosmovisor%2Fv1.7.1/cosmovisor-v1.7.1-linux-amd64.tar.gz"})]}),"\n",(0,s.BX)(t.span,{className:"line",children:[(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-function)"},children:"tar"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"xf"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"cosmovisor-v1.7.1-linux-amd64.tar.gz"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-punctuation)"},children:"&&"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"\\"})]}),"\n",(0,s.BX)(t.span,{className:"line",children:[(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-function)"},children:"chmod"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"a+x"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"cosmovisor"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-punctuation)"},children:"&&"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"\\"})]}),"\n",(0,s.BX)(t.span,{className:"line",children:[(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-function)"},children:"sudo"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"mv"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"cosmovisor"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"/usr/local/bin"})]})]})}),"\n",(0,s.tZ)(t.h2,{id:"配置-cosmovisor",children:"配置 Cosmovisor"}),"\n",(0,s.BX)(t.h3,{id:"创建-cosmovisor-目录",children:["创建 ",(0,s.tZ)(t.code,{children:"cosmovisor"})," 目录"]}),"\n",(0,s.tZ)(t.pre,{"data-language":"bash","data-theme":"default",hasCopyCode:!0,children:(0,s.BX)(t.code,{"data-language":"bash","data-theme":"default",children:[(0,s.BX)(t.span,{className:"line",children:[(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-function)"},children:"sudo"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"-u"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"zetachain"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"mkdir"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"-p"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"/home/zetachain/.zetacored/cosmovisor/genesis/bin"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-punctuation)"},children:"&&"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"\\"})]}),"\n",(0,s.BX)(t.span,{className:"line",children:[(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-function)"},children:"sudo"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"-u"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"zetachain"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"mkdir"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"-p"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"/home/zetachain/.zetacored/cosmovisor/upgrades"})]})]})}),"\n",(0,s.BX)(t.h3,{id:"安装当前-zetacored-二进制",children:["安装当前 ",(0,s.tZ)(t.code,{children:"zetacored"})," 二进制"]}),"\n",(0,s.BX)(t.p,{children:["将 ",(0,s.tZ)(t.a,{href:"./setup",children:"部署阶段"})," 获取的 ",(0,s.tZ)(t.code,{children:"zetacored"})," 二进制放入 ",(0,s.tZ)(t.code,{children:"/home/zetachain/.zetacored/cosmovisor/genesis/bin"}),":"]}),"\n",(0,s.tZ)(t.pre,{"data-language":"bash","data-theme":"default",hasCopyCode:!0,children:(0,s.tZ)(t.code,{"data-language":"bash","data-theme":"default",children:(0,s.BX)(t.span,{className:"line",children:[(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-function)"},children:"sudo"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"-u"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"zetachain"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"cp"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"}
1,children:"/usr/local/bin/zetacored"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"/home/zetachain/.zetacored/cosmovisor/genesis/bin"})]})})}),"\n",(0,s.BX)(t.h2,{id:"配置-zetacored-systemd-服务",children:["配置 ",(0,s.tZ)(t.code,{children:"zetacored"})," systemd 服务"]}),"\n",(0,s.tZ)(t.h3,{id:"创建-systemd-单元",children:"创建 systemd 单元"}),"\n",(0,s.tZ)(t.p,{children:"创建本地 systemd 单元目录:"}),"\n",(0,s.tZ)(t.pre,{"data-language":"bash","data-theme":"default",hasCopyCode:!0,children:(0,s.tZ)(t.code,{"data-language":"bash","data-theme":"default",children:(0,s.BX)(t.span,{className:"line",children:[(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-function)"},children:"sudo"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"mkdir"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"-p"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"/usr/local/lib/systemd/system/"})]})})}),"\n",(0,s.BX)(t.p,{children:["创建 ",(0,s.tZ)(t.code,{children:"/usr/local/lib/systemd/system/zetacored.service"}),":"]}),"\n",(0,s.tZ)(t.pre,{"data-language":"bash","data-theme":"default",hasCopyCode:!0,children:(0,s.BX)(t.code,{"data-language":"bash","data-theme":"default",children:[(0,s.BX)(t.span,{className:"line",children:[(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-function)"},children:"cat"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-keyword)"},children:"<<"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"EOF"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-keyword)"},children:"|"}),(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:" sudo tee /usr/local/lib/systemd/system/zetacored.service"})]}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"[Unit]"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"Description=zetacored (running under cosmovisor)"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"After=multi-user.target"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"StartLimitIntervalSec=0"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"[Install]"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"WantedBy=multi-user.target"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"[Service]"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"WorkingDirectory=/home/zetachain/.zetacored/cosmovisor"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:'Environment="DAEMON_HOME=/home/zetachain/.zetacored"'})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:'Environment="DAEMON_NAME=zetacored"'})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:'Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true"'})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:'Environment="DAEMON_RESTART_AFTER_UPGRADE=true"'})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:'Environment="DAEMON_DATA_BACKUP_DIR=/home/zetachain/.zetacored"'})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:'Environment="UNSAFE_SKIP_BACKUP=true"'})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"Type=simple"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"Restart=always"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"RestartSec=10"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"User=zetachain"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"LimitNOFILE=262144"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-token-string)"},children:"ExecStart=cosmovisor run start --home /home/zetachain/.zetacored/ --log_format json"})}),"\n",(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"EOF"})})]})}),"\n",(0,s.tZ)(l.bZ,{variant:"danger",children:(0,s.BX)(t.p,{children:["在此示例中
1,我们设置了 ",(0,s.tZ)(t.code,{children:"DAEMON_ALLOW_DOWNLOAD_BINARIES=true"}),",意味着 ",(0,s.tZ)(t.code,{children:"cosmovisor"})," 会自动下载升级提案指定的新二进制。如果 GitHub API 故障,下载会失败。建议保持该功能开启,但在升级前预加载并校验新二进制,以降低风险。如已预加载,将不会触发下载。更多内容请查看 ",(0,s.tZ)(t.a,{href:"https://docs.cosmos.network/v0.47/build/tooling/cosmovisor#auto-download",children:"cosmovisor 自动下载说明"}),"。"]})}),"\n",(0,s.BX)(t.p,{children:["运行 ",(0,s.tZ)(t.code,{children:"sudo systemctl daemon-reload"})," 以加载服务。"]}),"\n",(0,s.BX)(t.p,{children:["运行 ",(0,s.tZ)(t.code,{children:"sudo systemctl enable zetacored"})," 以设置开机自启,你应看到如下信息:"]}),"\n",(0,s.tZ)(t.pre,{"data-language":"text","data-theme":"default",hasCopyCode:!0,children:(0,s.tZ)(t.code,{"data-language":"text","data-theme":"default",children:(0,s.tZ)(t.span,{className:"line",children:(0,s.tZ)(t.span,{style:{color:"var(--shiki-color-text)"},children:"Created symlink /etc/systemd/system/multi-user.target.wants/zetacored.service → /usr/local/lib/systemd/system/zetacored.service."})})})}),"\n",(0,s.tZ)(t.h2,{id:"下一步",children:"下一步"}),"\n",(0,s.tZ)(t.h3,{id:"升级准备",children:"升级准备"}),"\n",(0,s.BX)(t.p,{children:["关注 Discord 上的 ",(0,s.tZ)(t.a,{href:"https://discord.com/channels/858516330432299008/1088945250124435486",children:"#testnet-announcements"})," 与 ",(0,s.tZ)(t.a,{href:"https://discord.com/channels/858516330432299008/1210655572798476338",children:"#mainnet-announcements"})," 获取升级提案通知。"]}),"\n",(0,s.BX)(t.p,{children:["为升级做准备时,请从 GitHub Release 下载新二进制并放入 cosmovisor 升级目录,目录名称需与升级名称一致。升级名称",(0,s.tZ)(t.strong,{children:"不是"})," GitHub 发布名称,可在 ",(0,s.tZ)(t.a,{href:"/reference/tools/proposals",children:"治理升级提案页面"})," 查阅。示例:"]}),"\n",(0,s.BX)(t.table,{children:[(0,s.tZ)(t.thead,{children:(0,s.BX)(t.tr,{children:[(0,s.tZ)(t.th,{children:"升级名称"}),(0,s.BX)(t.th,{children:[(0,s.tZ)(t.code,{children:"zetacored"})," 路径"]}),(0,s.tZ)(t.th,{children:"git tag"})]})}),(0,s.BX)(t.tbody,{children:[(0,s.BX)(t.tr,{children:[(0,s.tZ)(t.td,{children:(0,s.tZ)(t.code,{children:"v26"})}),(0,s.tZ)(t.td,{children:(0,s.tZ)(t.code,{children:"~/.zetacored/cosmovisor/upgrades/v26/bin/zetacored"})}),(0,s.tZ)(t.td,{children:(0,s.tZ)(t.code,{children:"v26.0.0"})})]}),(0,s.BX)(t.tr,{children:[(0,s.tZ)(t.td,{children:(0,s.tZ)(t.code,{children:"v27"})}),(0,s.tZ)(t.td,{children:(0,s.tZ)(t.code,{children:"~/.zetacored/cosmovisor/upgrades/v27/bin/zetacored"})}),(0,s.tZ)(t.td,{children:(0,s.tZ)(t.code,{children:"v27.0.1"})})]})]})]}),"\n",(0,s.tZ)(t.p,{children:"安装完成后请:"}),"\n",(0,s.BX)(t.ul,{children:["\n",(0,s.tZ)(t.li,{children:"校验校验和"}),"\n",(0,s.BX)(t.li,{children:["运行 ",(0,s.tZ)(t.code,{children:"zetacored version"})," 确认二进制可执行"]}),"\n"]}),"\n",(0,s.tZ)(t.h3,{id:"监控",children:"监控"}),"\n",(0,s.tZ)(t.p,{children:"生产环境建议监控节点资源(CPU、内存、磁盘及 IO),以便及时发现性能下降。"}),"\n",(0,s.BX)(t.p,{children:[(0,s.tZ)(t.code,{children:"zetacored"})," 会生成日志,可用于定位错误并排查问题。若按上述步骤配置为 Systemd 服务,可使用 ",(0,s.tZ)(t.code,{children:"journalctl -eu zetacored"})," 查看日志。"]}),"\n",(0,s.tZ)(t.h3,{id:"指标",children:"指标"}),"\n",(0,s.BX)(t.p,{children:["Prometheus 默认在 ",(0,s.tZ)(t.strong,{children:"26660"})," 端口提供指标,可由 Prometheus Collector 拉取。更多信息请参考 ",(0,s.tZ)(t.a,{href:"https://docs.cosmos.network/v0.50/learn/advanced/telemetry",children:"Cosmos SDK Telemetry 文档"}),"。***"]})]})}t.default=(0,i.j)({MDXContent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},(0,o.a)(),e.components).wrapper;return t?(0,s.tZ)(t,c(c({},e),{},{children:(0,s.tZ)(d,c({},e))})):d(e)},pageOpts:{filePath:"src/pages/nodes/start-here/setup.zh-CN.mdx",route:"/nodes/start-here/setup",frontMatter:{title:"节点部署",description:"本指南演示如何部署 ZetaChain 主网 Beta 节点。如需部署测试网节点,请遵循相同步骤,只需将部分参数(如链 ID、种子节点等)替换为对应表格中的值。"},timestamp:1780355744e3,title:"节点部署",headings:h},pageNextRoute:"/nodes/start-here/setup.zh-CN"})},4994:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/nodes/start-here/setup.zh-CN",function(){return n(50789)}])}},function(e){e.O(0,[9060,2888,9774,179],function(){return e(e.s=4994)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.