Files
SHiNE-server/shine-solana-arweave-viewer-v2/КАК_ЭТО_РАБОТАЕТ.md
T

40 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Как работает Viewer v2
Viewer рассчитан на новый архив SHiNE: **один пользовательский блок = один ANS-104 DataItem**.
### Режим 1: login + channel
`?login=<login>&channel=<slug>`
Viewer читает Solana PDA пользователя, получает `blockchainKey`, затем ищет Arweave DataItem этого владельца с тегами `App=test5590` и `c=<slug>`.
### Режим 2: key + channel
`?key=<base58 public key>&channel=<slug>`
Viewer пропускает Solana и сразу выполняет поиск в Arweave.
### Режим без channel
`?login=<login>` или `?key=<key>`
Viewer получает все доступные DataItem владельца с `App=test5590`, разбирает их и показывает восстановленные каналы.
### Новый блок
Payload DataItem:
```text
uint16be frameCode = 0x0001
bytes[32] prevHash = SHA-256(previous Frame v1)
int32be blockSize
int32be blockNumber
int64be timestamp seconds
uint16be type
uint16be subType
uint16be version
bytes[N] body
```
Подпись пользователя, owner и tags находятся в оболочке ANS-104 DataItem, а не в SHiNE Frame v1.