Windows系统查询commitmentAtxId

查询方法

  1. 确保已经运行spacemesh官方的钱包程序或go-spacemesh程序并同步完成;
  2. 下载grpcurl程序包后解压到任意文件夹;
  3. 用记事本新建【查询atxid.ps1】的powershell脚本文件,拷贝以下代码后保存;
  4. 右键【查询atxid.ps1】选择【使用Power Shell运行】。
Write-Host "查询前请确保smh钱包已经同步!!"
Write-Host "开始从go-smh或smh钱包查询信息,时间略长请稍等..."
# 执行命令并将输出存储到 $result 变量中
$result = .\grpcurl -plaintext 127.0.0.1:9092 spacemesh.v1.ActivationService.Highest

# 将输出的 JSON 字符串转换为 PowerShell 对象
$jsonObject = $result | ConvertFrom-Json

# 访问所需的属性值
$highestActivation = $jsonObject.atx.id.id

# 输出属性值
# Write-Host "解码前:Highest Activation ID(注意这不是P图用的): $highestActivation"

$bytes = [Convert]::FromBase64String($highestActivation)
$hexString = [BitConverter]::ToString($bytes) -replace '-'

$output = "解码后最新的atx id(可以P图用):$hexString"
Write-Host $output

pause

执行后如下图红框内就是P图用的commitmentAtxId

发表回复