# SCDO node — quick start / 快速開始

Official go-scdo full node for SCDO Shard1 (Classic), SCDO Shard2 (Classic), SCDO Shard3 (Classic) and SCDO Shard4 (Classic) (PoW), built from
https://github.com/SCDOLAB/go-scdo at commit `cd31d1c` (the same code the public
nodes run) with Go 1.12.7. One small local-only patch: the TCP RPC (port 802x) now
binds to the address in the config (127.0.0.1) instead of always 0.0.0.0.
No private keys or wallets are included. A P2P node key is generated on first start
(`run/nodekey-shardN`); it is only a network identity, **not** a wallet.

Explorer: https://scdoscan.io · Online nodes: https://scdoscan.io/nodes.html

## English

**Files:** `scdo-node` (full node + CPU miner), `scdo-client` (CLI wallet/tools; Windows: `.exe`), `start.sh` / `start.bat`,
`status.sh` / `status.bat`, `config/node-shardN.json` (templates, pre-filled with the public bootstrap nodes).

**Run a node (sync only)**

    Linux:    ./start.sh 1          # shard 1..4
    Windows:  start.bat 1

**Solo-mine** (rewards go straight to your address, shard = first digit of the address):

    Linux:    ./start.sh --mine 1S01xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --threads 4
    Windows:  start.bat --mine 1S01xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --threads 4

In practice the Classic chain is mined mainly with GPUs (GPU miners use the SCDO Shard1 (Classic) mining pool run by the project); CPUs are welcome too. This package mines solo with your own node and its built-in CPU miner. For a CPU, SCDO Wallet for Windows also has a built-in miner: https://scdoscan.io/downloads/wallet/

No address yet? `./scdo-client key --shard 1` (Windows: `client.exe key --shard 1`) prints a new
address + private key. Save the private key offline; anyone with it controls the funds.

**Check status:** `./status.sh 1` (or `status.bat 1`) → compare `CurrentBlockHeight` with scdoscan.io.
Mining only pays once the node is fully synced. During the first minutes you may see `failed to write block ... ODR ... leveldb: not found` and the
height pausing: that is normal — the node first fetches headers of the other shards, then continues. The Classic chain is a fork whose genesis is at about block 2.98 million:
a fresh node starts at around 2.98M and syncs forward from there (expected). A full node (all chains) needs about 118 GB
of disk (data under `~/.scdo/scdo-shardN`, Windows: `%USERPROFILE%\.scdo`); the first full sync from the fork genesis takes many hours.

**Ports** (shard 1/2/3/4): P2P `8057/8058/8059/8056` TCP+UDP — open it in your firewall/router so others can
connect to you (optional, outbound works without it). HTTP RPC `8037/8038/8039/8036` and TCP RPC
`8027/8028/8029/8026` listen on 127.0.0.1 only (set `RPC_HOST=0.0.0.0` only if you know what you're doing —
the RPC includes miner control).

**Run in background (Linux):** `nohup ./start.sh 1 > shard1.log 2>&1 &` · stop: `pkill -f "scdo-node start -c ./run/node-shard1.json"`
**Docker:** `docker compose up -d` (see `docker-compose.yml`; set `SHARD` / `MINE_ADDRESS` there).
Several shards on one machine are fine — each uses its own ports and data dir.
Windows: the .exe files are unsigned, so SmartScreen may warn ("More info → Run anyway"); verify SHA256SUMS first.

Bootstrap nodes: 74.208.207.184, 82.223.19.88, 217.160.65.210, 74.208.136.152 (ports as above).
Shard0 (EVM, chainId 5680) runs core-geth (Ethash PoW) and is not included here; its node binaries, genesis and README are at https://scdoscan.io/downloads/shard0/ .

## 中文

**檔案：** `scdo-node`（完整算力服務分支 + CPU 運算服務）、`scdo-client`（命令列錢包/工具；Windows 為 `.exe`）、`start.sh` / `start.bat` 啟動指令碼、
`status.sh` / `status.bat` 狀態查詢、`config/node-shardN.json`（已預填公共引導節點的配置模板）。

**執行算力服務分支（僅同步）**

    Linux:    ./start.sh 1          # 分片 1..4
    Windows:  雙擊 start.bat，或在命令列執行 start.bat 1

**單機運算服務**（出塊獎勵直接進入你的地址；分片由地址首位數字決定）：

    Linux:    ./start.sh --mine 1S01xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --threads 4
    Windows:  start.bat --mine 1S01xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --threads 4

Classic 鏈實際上主要由 GPU 提供運算服務（GPU 運算服務提供者使用專案方營運的 SCDO Shard1 (Classic) 算力中心），也歡迎 CPU 參與。本程式包用你自己的算力服務分支和內建的 CPU 運算服務程式以單機方式提供運算服務。用 CPU 也可以使用 Windows 版 SCDO 錢包內建的運算服務功能：https://scdoscan.io/downloads/wallet/

還沒有地址？執行 `./scdo-client key --shard 1`（Windows：`client.exe key --shard 1`）生成新地址和私鑰，
請離線妥善儲存私鑰，任何拿到私鑰的人都能動用資金。首次啟動會在 `run/` 目錄生成 P2P 節點金鑰，它只是網路身份，**不是錢包**。
本軟體包不含任何私鑰或錢包。

**檢視狀態：** `./status.sh 1`（或 `status.bat 1`），將 `CurrentBlockHeight` 與 scdoscan.io 上的高度對比。
算力服務分支同步完成後挖出的區塊才會被網路接受。啟動後最初幾分鐘可能出現 `failed to write block ... ODR ... leveldb: not found` 且高度暫停，屬正常現象：
算力服務分支需先同步其他分片的區塊頭，隨後會繼續同步。Classic 鏈是一條分叉鏈，創世區塊高度約為 298 萬：
新算力服務分支從約 2.98M 開始向後同步，屬正常現象。包含全部鏈的完整算力服務分支約需 118 GB 磁碟空間（資料儲存在 `~/.scdo/scdo-shardN`，
Windows 為 `%USERPROFILE%\.scdo`），從分叉創世區塊開始的首次完整同步耗時數小時以上。

**埠**（分片 1/2/3/4）：P2P `8057/8058/8059/8056`（TCP+UDP，建議在防火牆/路由器放行，便於他人連線；不放行也能同步）。
HTTP RPC `8037/8038/8039/8036` 與 TCP RPC `8027/8028/8029/8026` 預設只監聽 127.0.0.1（RPC 含運算服務控制，勿隨意對外開放）。

**後臺執行（Linux）：** `nohup ./start.sh 1 > shard1.log 2>&1 &`　**Docker：** `docker compose up -d`（在 `docker-compose.yml` 中設定 `SHARD` / `MINE_ADDRESS`）。
同一臺機器可同時執行多個分片。Windows 下 exe 未簽名，SmartScreen 可能提示（“更多資訊 → 仍要執行”），請先核對 SHA256SUMS。

引導節點：74.208.207.184、82.223.19.88、217.160.65.210、74.208.136.152。
Shard0（EVM，chainId 5680）使用 core-geth（Ethash PoW），本包不包含；其算力服務分支程式、創世檔案和說明見 https://scdoscan.io/downloads/shard0/ 。
