仮想通貨NEMの次のバージョンとして注目されているXYMのSymbolプラットホームについて、とても興味を持っています。
https://docs.symbolplatform.com/ja/getting-started/setup-workstation.html
https://docs.symbolplatform.com/ja/getting-started/first-application.html
上記ドキュメントに書かれていることを実際に試してみました。
環境) Ubuntu20.04(WSL) / Windows 11
ここではデスクトップウォレットをイントールして(テストネットフォーセットでXYMを取得後)、そのアカウントからコンソールで作成したアカウントに送金しています。(設定値はドキュメントどおり)
もう一つのテストとして、モザイクの送信もしました。
symbol-cliのインストール
$ npm init
$ npm install symbol-sdk rxjs
$ sudo npm install -g typescript
$ sudo npm install -g ts-node
アカウントの作成
$ symbol-cli account generate
Select the network type: › TEST_NET
Do you want to save the account? … yes
Select an import type: › PrivateKey
Enter the Symbol node URL. (Example: http://localhost:3000): … https://sym-test.***.jp:3001
Enter a profile name: … testnet11
Enter your wallet password: … ********
Do you want to set the account as the default profile? … yes
Account
┌───────────────┬──────────────────────────────────────────────────────────────────────┐
│ Property │ Value │
├───────────────┼──────────────────────────────────────────────────────────────────────┤
│ Address │ TCWPA2-5NNISY-BJUOON-VOMPPD-XTNADH-DTA4Y6-6JQ │
├───────────────┼──────────────────────────────────────────────────────────────────────┤
……
着金後の状態
$ symbol-cli account info –profile testnet11
⠸ Processing
Account Information
┌───────────────────┬──────────────────────────────────────────────────────────────────┐
│ Property │ Value │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Address │ TCWPA2-5NNISY-BJUOON-VOMPPD-XTNADH-DTA4Y6-6JQ │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
…..
Balance Information
┌──────────────────┬─────────────────┬─────────────────┬───────────────────┐
│ Mosaic Id │ Relative Amount │ Absolute Amount │ Expiration Height │
├──────────────────┼─────────────────┼─────────────────┼───────────────────┤
│ 3A8416DB2D53B6C8 │ 100 │ 100000000 │ Never │
└──────────────────┴─────────────────┴─────────────────┴───────────────────┘
モザイクで表現されたチケットの作成
$ symbol-cli transaction mosaic –amount 99 –supply-mutable –divisibility 0 –duration 1000 –max-fee 2000000 –sync –profile testnet11
Enter your wallet password: … ********
Do you want a non-expiring mosaic? … yes
Do you want this mosaic to be transferable? … yes
Do you want this mosaic to be restrictable? … yes
Select the transaction announce mode: › normal
┌───────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ AGGREGATE_COMPLETE │
├────────────────────────────────────┬──────────────────────────────────────────────────────────────────┤
│ Max fee: │ 2,000,000 │
├────────────────────────────────────┼─────────────────────────────────────────────────────…..
├────────────────────────────────────┬──────────────────────────────────────────────────────────────────┤
│ [Inner tx. 1 of 2] Mosaic Id: │ 312BBCDC24282392 │
├────────────────────────────────────┼──────────────────────────────────────────────────────────────────┤
……..
チケットの送信
$ ts-node firstApp.ts
TransactionAnnounceResponse {
message: ‘packet 9 was pushed to the network via /transactions’
}
firstApp.ts
テストフォーネットでの取得、送金、モザイクの受信を確認できました。
まだ入り口に立っただけですが、機能が豊富でさまざまな課題解決の手段として面白いと思いました。
あと、ローカルのテストノードの構築とアカウント作成も確認しました。
https://github.com/symbol/symbol-bootstrap
しかし私の環境では、テストノードの同期がとれないようで構築したテストノードで作成したアカウントと上記アカウントでのやりとりができませんでした。
他にもいろいろとテストしましたが、長くなりますのでとりあえずここまで備忘録でした。