# 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** (there is no pool; 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

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 first sync downloads the full shard history
(millions of blocks, tens of GB under `~/.scdo/scdo-shardN`, Windows: `%USERPROFILE%\.scdo`) and 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

還沒有地址？執行 `./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` 且高度暫停，屬正常現象：
節點需先同步其他分片的區塊頭，隨後會繼續同步。首次同步需下載整個分片歷史（數百萬區塊、數十 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/ 。
