Skip to content

Commit

Permalink
Add sworker v2.0.0 version description and upgrade guide to the 'sWor…
Browse files Browse the repository at this point in the history
…ker Version' page
  • Loading branch information
wuhaixian1984 committed May 6, 2024
1 parent d53ddf2 commit 7ed129b
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 5 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 43 additions & 1 deletion packages/page-sworkerVersion/src/md/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Q: What versions are currently available?
- <a href="https://github.com/crustio/crust-sworker/releases/tag/v1.1.0" target="_blank" >V1.1.0 : Support Metaverse (0xff2c145fd797e1aef56b47a91adf3d3294c433bb29b035b3020d04a76200da0a)</a>
- <a href="https://github.com/crustio/crust-sworker/releases/tag/v1.1.1" target="_blank" >V1.1.1 : Protect Diskdrop (0xa61ea2065a26a3f9f1e45ad02d8b2965c377b85ba409f6de7185c485d36dc503)</a>
- <a href="https://github.com/crustio/crust-sworker/releases/tag/v1.1.2" target="_blank" >V1.1.2 : Fix Bugs (0x72041ba321cb982168beab2b3994f8b0b83a54e6dafaa95b444a3c273b490fb1)</a>
- <a href="https://github.com/crustio/crust-sworker/releases/tag/v2.0.0" target="_blank" >V2.0.0 : Support ECDSA DCAP Attestation (0x69f72f97fc90b6686e53b64cd0b5325c8c8c8d7eed4ecdaa3827b4ff791694c0)</a>


# **Nodes**
Expand All @@ -35,6 +36,7 @@ Q: What versions are currently available?
- [V1.0.0->V1.1.1](#v100tov111)
- [V1.1.0->V1.1.1](#v110tov111)
- [V1.1.0/V1.1.1->V1.1.2](#v111tov112)
- [V1.x.x->V2.0.0](#v1xxtov200)

# **2 Upgrade guide V1.0.0 -> V1.1.1** <a id="v100tov111"></a>
## **2.1 Time**
Expand Down Expand Up @@ -152,4 +154,44 @@ The upgrade process is a background process, which takes time ranging from 1000s
</div>
<br>

![sworker_version](../assets/version_v1.1.2_en.png)
![sworker_version](../assets/version_v1.1.2_en.png)

# **5 Upgrade guide V1.x.x -> V2.0.0** <a id="v1xxtov200"></a>

## **5.1 Steps**

## Note:

sworker v2.0.0 supports ECDSA-based DCAP attestation, but also compatible with EPID IAS attestation, so you can upgrade from old v1.x to v2.0.0 directly with the following instructions which won't trigger re-entrynetwork.

But if you want to use the ECDSA-based DCAP attestation for your new servers or re-entrynetwork for current servers, please refer to [Crust Wiki: EPID & ECDSA](https://wiki.crust.network/docs/zh-CN/Q&AForEPID-ECDSA) for more information.

### **5.1.1 Check sworker sending work report successfully**
Make sure that the sworker sent the work report successfully in the past hours. If not, please fix the error first before doing the upgrade steps.

Use the following command to check whether the workload is reported successfully

<div style="background: black; font-size: 18px; font-weight:bold; color: white">sudo crust logs --tail 10 sworker
</div>
<br>

![workreport_status](../assets/workreport_status.png)

### **5.1.2 sWorker Upgrade**
The upgrade process is a background process, which takes time ranging from 1000s to 10000s. <text style="color: red">**It is strongly recommended to execute the upgrade command manually**</text> to avoid unnecessary errors. If the upgrade is abnormal, <text style="color: red">**do not restart the sworker service, which will cause data loss**</text>.
<br>
<div style="background: black; font-size: 18px; font-weight:bold; color: white">nohup sudo crust tools sworker-ab-upgrade 69f72f97fc90b6686e53b64cd0b5325c8c8c8d7eed4ecdaa3827b4ff791694c0 > upgrade.log 2>&1 &</div>
<br>

## **5.2 Upgrade status detection**
<br>
<div style="background: black; font-size: 18px; font-weight:bold; color: white">tail 100 upgrade.log -f</div>
<br>

![sworker_version](../assets/upgrade_status.png)

<div style="background: black; font-size: 18px; font-weight:bold; color: white">sudo crust version
</div>
<br>

![sworker_version](../assets/version_v2.0.0_en.png)
42 changes: 42 additions & 0 deletions packages/page-sworkerVersion/src/md/basic_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- <a href="https://github.com/crustio/crust-sworker/releases/tag/v1.1.0" target="_blank" >V1.1.0 : Support Metaverse (0xff2c145fd797e1aef56b47a91adf3d3294c433bb29b035b3020d04a76200da0a)</a>
- <a href="https://github.com/crustio/crust-sworker/releases/tag/v1.1.1" target="_blank" >V1.1.1 : Protect Diskdrop (0xa61ea2065a26a3f9f1e45ad02d8b2965c377b85ba409f6de7185c485d36dc503)</a>
- <a href="https://github.com/crustio/crust-sworker/releases/tag/v1.1.2" target="_blank" >V1.1.2 : Fix Bugs (0x72041ba321cb982168beab2b3994f8b0b83a54e6dafaa95b444a3c273b490fb1)</a>
- <a href="https://github.com/crustio/crust-sworker/releases/tag/v2.0.0" target="_blank" >V2.0.0 : Support ECDSA DCAP Attestation (0x69f72f97fc90b6686e53b64cd0b5325c8c8c8d7eed4ecdaa3827b4ff791694c0)</a>

# **升级对象**

Expand All @@ -34,6 +35,7 @@
- [V1.0.0->V1.1.1](#v100tov111)
- [V1.1.0->V1.1.1](#v110tov111)
- [V1.1.0/V1.1.1->V1.1.2](#v111tov112)
- [V1.x.x->V2.0.0](#v1xxtov200)

# **2 升级指南 V1.0.0 -> V1.1.1** <a id="v100tov111"></a>

Expand Down Expand Up @@ -158,3 +160,43 @@

![sworker_version](../assets/version_v1.1.2_zh.png)

# **5 升级指南 V1.x.x -> V2.0.0** <a id="v1xxtov200"></a>

## **5.1 升级步骤**

## 注意:

sworker v2.0.0版本支持基于ECDSA的DCAP认证,同时兼容即将过期的EPID IAS认证,所以你可以直接从旧版本v1.x直接升级到v2.0.0,不会触发重新入网。

但是如果要对新服务器入网或者旧服务器重新入网时使用ECDSA-based DCAP attestation,请按照[Crust Wiki: EPID & ECDSA](https://wiki.crust.network/docs/zh-CN/Q&AForEPID-ECDSA)中的说明进行。

### **5.1.1 确认sworker上报工作量正常**
通过sworker日志文件来确认近期工作量处于正常上报状态。如不正常,请优先修复后再进行升级操作。
通过命令查询工作量是否上报成功
<br>
<div style="background: black; font-size: 18px; font-weight:bold; color: white">sudo crust logs --tail 100 sworker</div>
<br>

![workreport_status](../assets/workreport_status_zh.png)

### **5.1.2 sWorker升级**
<br>

升级过程是一个后台进程,耗时在100s-10000s不等,<text style="color: red">**强烈建议手动执行升级命令**</text>,避免出现不必要的错误,如果升级出现异常,<text style="color: red">**切记不能reload sworker服务,以防数据丢失**</text>。
<br>
<div style="background: black; font-size: 18px; font-weight:bold; color: white">nohup sudo crust tools sworker-ab-upgrade 69f72f97fc90b6686e53b64cd0b5325c8c8c8d7eed4ecdaa3827b4ff791694c0 > upgrade.log 2>&1 &</div>
<br>

## **5.2 升级状态检测**
<br>
<div style="background: black; font-size: 18px; font-weight:bold; color: white">tail 100 upgrade.log -f</div>
<br>

![upgrade_status](../assets/upgrade_status_zh.png)

<div style="background: black; font-size: 18px; font-weight:bold; color: white">sudo crust version
</div>
<br>

![sworker_version](../assets/version_v2.0.0_zh.png)

19 changes: 15 additions & 4 deletions packages/page-sworkerVersion/src/versionQuery/VersionsState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,24 @@ export const versionsRecord: Record<string, string> = {
'0xe6f4e6ab58d6ba4ba2f684527354156c009e4969066427ce18735422180b38f4': 'V1.0.0 : First Version',
'0xff2c145fd797e1aef56b47a91adf3d3294c433bb29b035b3020d04a76200da0a': 'V1.1.0 : Support Metaverse',
'0xa61ea2065a26a3f9f1e45ad02d8b2965c377b85ba409f6de7185c485d36dc503': 'V1.1.1 : Protect Diskdrop',
'0x72041ba321cb982168beab2b3994f8b0b83a54e6dafaa95b444a3c273b490fb1': 'V1.1.2 : Fix Bugs'
'0x72041ba321cb982168beab2b3994f8b0b83a54e6dafaa95b444a3c273b490fb1': 'V1.1.2 : Fix Bugs',
'0x69f72f97fc90b6686e53b64cd0b5325c8c8c8d7eed4ecdaa3827b4ff791694c0': 'V2.0.0 : Support ECDSA DCAP Attestation'
};

export const versionsStartBlockRecord: Record<string, number> = {
'0xe6f4e6ab58d6ba4ba2f684527354156c009e4969066427ce18735422180b38f4': 490089,
'0xff2c145fd797e1aef56b47a91adf3d3294c433bb29b035b3020d04a76200da0a': 1382305,
'0xa61ea2065a26a3f9f1e45ad02d8b2965c377b85ba409f6de7185c485d36dc503': 2143559,
'0x72041ba321cb982168beab2b3994f8b0b83a54e6dafaa95b444a3c273b490fb1': 14391273
'0x72041ba321cb982168beab2b3994f8b0b83a54e6dafaa95b444a3c273b490fb1': 14391273,
'0x69f72f97fc90b6686e53b64cd0b5325c8c8c8d7eed4ecdaa3827b4ff791694c0': 14563310
};

export const versionsReleaseRecord: Record<string, string> = {
'0xe6f4e6ab58d6ba4ba2f684527354156c009e4969066427ce18735422180b38f4': 'https://github.com/crustio/crust-sworker/releases/tag/v1.0.0',
'0xff2c145fd797e1aef56b47a91adf3d3294c433bb29b035b3020d04a76200da0a': 'https://github.com/crustio/crust-sworker/releases/tag/v1.1.0',
'0xa61ea2065a26a3f9f1e45ad02d8b2965c377b85ba409f6de7185c485d36dc503': 'https://github.com/crustio/crust-sworker/releases/tag/v1.1.1',
'0x72041ba321cb982168beab2b3994f8b0b83a54e6dafaa95b444a3c273b490fb1': 'https://github.com/crustio/crust-sworker/releases/tag/v1.1.2'
'0x72041ba321cb982168beab2b3994f8b0b83a54e6dafaa95b444a3c273b490fb1': 'https://github.com/crustio/crust-sworker/releases/tag/v1.1.2',
'0x69f72f97fc90b6686e53b64cd0b5325c8c8c8d7eed4ecdaa3827b4ff791694c0': 'https://github.com/crustio/crust-sworker/releases/tag/v2.0.0'
};

function VersionState ({ address, className = '', current, isLoading: summaryLoading, pkInfos, setMessage, setStatus, setStatusOpen }: Props): React.ReactElement<Props> {
Expand Down Expand Up @@ -142,7 +145,9 @@ function VersionState ({ address, className = '', current, isLoading: summaryLoa
[t('Members')],
[t('V1.0.0')],
[t('V1.1.0')],
[t('V1.1.1')]
[t('V1.1.1')],
[t('V1.1.2')],
[t('V2.0.0')]
]);

const memberHeaderRef = useRef([
Expand Down Expand Up @@ -175,6 +180,12 @@ function VersionState ({ address, className = '', current, isLoading: summaryLoa
<td className='number'>
{addressVersionStateInfo.versionCount && addressVersionStateInfo.versionCount['V1.1.1 : Protect Diskdrop'] ? addressVersionStateInfo.versionCount['V1.1.1 : Protect Diskdrop'] : 0}
</td>
<td className='number'>
{addressVersionStateInfo.versionCount && addressVersionStateInfo.versionCount['V1.1.2 : Fix Bugs'] ? addressVersionStateInfo.versionCount['V1.1.2 : Fix Bugs'] : 0}
</td>
<td className='number'>
{addressVersionStateInfo.versionCount && addressVersionStateInfo.versionCount['V2.0.0 : Support ECDSA DCAP Attestation'] ? addressVersionStateInfo.versionCount['V2.0.0 : Support ECDSA DCAP Attestation'] : 0}
</td>
</tr>)}
</Table>
<Card>
Expand Down

0 comments on commit 7ed129b

Please sign in to comment.