[@ant] fix(boot): fail-fast при ошибке деплоя контракта в setContract + dicoop/blockchain:latest

Раньше Blockchain.setContract молча проглатывал ENOENT (отсутствующий
wasm/abi) и любые ошибки api.transact: console.log + return. boot:remote
завершался exit 0 даже когда часть контрактов не установилась —
sideboot мог отдать "готовую" цепь с дырами в развёртывании.

Изменения:
- await на api.transact (раньше fire-and-forget — ошибки транзакций
  тоже не ловились, только синхронные fs.readFileSync)
- catch перебрасывает обогащённой Error: имя контракта, target-аккаунт,
  путь к артефакту, причина (через cause). startInfra прерывается
  в startInfra → boot:remote → exit 1.

SIDEBOOT.md: dicoop/blockchain_v5.1.1:dev → dicoop/blockchain:latest
во всех ссылках (таблица артефактов + compose snippet).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
coopops
2026-05-01 10:19:13 +00:00
parent 72c824f5a2
commit 360619332b
2 changed files with 8 additions and 4 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ blockchain-protocol и т.п.), которым нужна чистая EOSIO-н
| Образ | Назначение | Тег |
|---|---|---|
| `dicoop/blockchain_v5.1.1` | EOSIO node (nodeos + cdt) | `dev` |
| `dicoop/blockchain` | EOSIO node (nodeos + cdt) | `latest` |
| `dicoop/contracts` | wasm/abi артефакт со всеми контрактами | `dev` / `testnet` / `main` / `latest` |
| `dicoop/bootcoop` | one-shot bootstrap (накатывает контракты на ноду) | `dev` / `testnet` / `main` / `latest` |
@@ -24,7 +24,7 @@ multi-stage из `dicoop/contracts:dev` (no skew).
```yaml
services:
node:
image: dicoop/blockchain_v5.1.1:dev
image: dicoop/blockchain:latest
ports:
- "8888:8888"
- "9876:9876"
+6 -2
View File
@@ -229,7 +229,7 @@ export default class Blockchain {
// console.log(data)
// console.log("abi: ", serializedAbiHexString)
this.api.transact(
await this.api.transact(
{
actions: [
{
@@ -267,7 +267,11 @@ export default class Blockchain {
console.log('contract setted: ', contract.target)
}
catch (e) {
console.log(e)
const msg = e instanceof Error ? e.message : String(e)
throw new Error(
`Failed to set contract '${contract.name}' on '${contract.target}' (path: ${contract.path}): ${msg}`,
{ cause: e },
)
}
}