- Home
- libra-core v1.0.7 でリブラの送金ができない問題
libra-core v1.0.7 でリブラの送金ができない問題
Libra Testnet のアップデート
Libra CommunityのTestnet update – September 4thに記載の通り、9/4にTestnetがアップデートされ、後方互換性のない変更があったためDBのリセットが行われた。
There were several incompatible changes in this latest release, so we also reset the database. Please update all clients to the updated testnet branch. The major incompatible changes include:
- https://github.com/libra/libra/pull/373
- https://github.com/libra/libra/pull/429
- https://github.com/libra/libra/pull/464
- https://github.com/libra/libra/pull/516
- https://github.com/libra/libra/pull/622
- https://github.com/libra/libra/pull/606
libra-core v1.0.7 で送金ができない
前述のTestnetのアップデートの影響で、perfectmak/libra-core v1.0.7(+ PR #40) を利用した送金処理が動作しなくなっている。(2019/09/09 現在)
下記はperfectmak/libra-coreで送金するコードのサンプル、およびその実行結果。
const libra_core = require("libra-core"); const LibraClient = libra_core.LibraClient; const LibraNetwork = libra_core.LibraNetwork; async function send(sender, destAddress, amount) { const client = new LibraClient({ network: LibraNetwork.Testnet }); const response = await client.transferCoins(sender, destAddress, amount * 1e6); await response.awaitConfirmation(client); return response; } // account, dest, amount は各自で宣言が必要 send(account, dest, amount).then(r => console.log(r));
$ node send.js LibraTransactionResponse { signedTransaction: LibraSignedTransaction { transaction: [LibraTransaction], publicKey: [Uint8Array], signature: [Uint8Array] }, validatorId: Uint8Array [], acStatus: -1, mempoolStatus: -1, vmStatus: LibraVMStatusError { errorType: 1, validationStatusError: [Object], verificationStatusErrors: undefined, invariantViolationError: undefined, deserializationError: undefined, executionError: undefined } }
Pull Requests
perfectmak/libra-coreのPRを見ると、Testnetのアップデート後に以下の2つのPRが作成されている。
- #43: Added EventHandle and changed parsing of the AccountState blob
- #44: Updated proto files and changed LibraTransactionEvent class to match
これらの変更を取り込んでみたが、送金処理の実行結果は変わらなかったため、Testnetアップデートに関する対応が何かしら不足しているものと思われる。
参考情報、および推測
Libra CommunityのUnable to submit a transaction in Net Core Client を見ると C# 版クライアント(SDK)が紹介されており、そちらでは Testnet のアップデート後に送金トランザクションを生成できている模様。
- リポジトリ: Rio-dapp/libra-csharp-sdk
- Testnet update 対応のコミット: 9ee3385efe2f474b00117ee6770d129034466c34
libra/libraのPR #622 [common] Add Canonical Serialization Specにおいて、LCS(Libra Canonical Serialization) というものが追加されているが、perfectmak/libra-coreのPR#43, #44にはLCSというキーワードが出てこない。perfectmak/libra-coreにも関連処理を追加すれば動作するのかもしれないが不明。