DApp 升级方案
本次 DApp 升级方案如下:
一、节点从1.3.6 升级到1.4版本
升级文档参考Asch 1.4 升级方案 · AschPlatform/asch Wiki
二、 替换 sandbox
下载地址: http//39.107.52.143/dist.tgz. 解压后是 dist 目录,需要替换node_modules里的asch-sandbox 内容。 进入asch-sandbox 执行 npm install
添加一行代码,366行附近:
vim node_modules/asch-core/src/core/blocks.js
} else { modules.chains.onNewBlock(block) }
修改后的代码为:
if (options.broadcast) {
options.votes.signatures = options.votes.signatures.slice(0, 6)
library.bus.message('newBlock', block, options.votes)
} else { modules.chains.onNewBlock(block) }
三、数据库修改
目前主链上查询到的 seq 为(主链blockchain.db 执行 select chain, max(seq) from deposits group by chain;)
ddl|11050
dreamworld|11150
hellokimi|11028
koumeiCottage|11059
subspace|11145
ubiquity|11151
xingbei|11080
项目方根据上面的结果确定自己应用的 seq 值。
接下来的操作:
- 进入应用目录 sqlite3 blockchain.db
- 执行 alter table deposits add column seq bigint;
- 执行 select max(rowid) from deposits;
- 执行 update deposits set seq = 11050 where rowid = 上一条命令的值;
四、修改config.json
在应用的 config.json 里,需要添加 peers,格式如下:
"secrets": [
],
"peers":[{"ip":"47.75.26.200","port":8193}]
这里的 ip 和端口是本机的 ip 以及 peerport,可以参考config.json 里的配置
五、其他
- 应用不用重新注册,但是需要拷贝到 asch 目录里的 chains/youdappname, 内容和以前的dapps/dappid 一致。
- 此次主链的数据库为 data 目录,不再是一个blockchain.db
@liangpeili should i also replace the sandbox when doing a fresh install of Asch;
git clone https://github.com/AschPlatform/asch && cd asch && chmod u+x aschd followed by npm install
@bassjobsen I just updated the installation document , click here