mijin Catapult (v.2) 製品評価版操作編
本ページはAWSマーケットプレイス内にあるcloudformationからmijin Catapult (v.2) 製品評価版版を操作する手順となります。
node環境の準備
symbol-cliのインストール
$ npm i -g symbol-cli@0.24.1
/usr/local/var/nodebrew/node/v11.15.0/bin/symbol-cli -> /usr/local/var/nodebrew/node/v11.15.0/lib/node_modules/symbol-cli/bin/symbol-cli
> tiny-secp256k1@1.1.6 install /usr/local/var/nodebrew/node/v11.15.0/lib/node_modules/symbol-cli/node_modules/tiny-secp256k1
> npm run build || echo "secp256k1 bindings compilation fail. Pure JS implementation will be used."
> tiny-secp256k1@1.1.6 build /usr/local/var/nodebrew/node/v11.15.0/lib/node_modules/symbol-cli/node_modules/tiny-secp256k1
> node-gyp rebuild
CXX(target) Release/obj.target/secp256k1/native/addon.o
../native/addon.cpp:249:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute
[-Wunused-result]
secp256k1_ec_privkey_negate(context, tweak_negated); // returns 1 always
^~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
../native/addon.cpp:80:21: warning: comparison of integers of different signs: 'int' and 'unsigned long'
[-Wsign-compare]
if (info.Length() <= index || info[index]->IsUndefined()) {
~~~~~~~~~~~~~ ^ ~~~~~
../native/addon.cpp:151:21: note: in instantiation of function template specialization '(anonymous
namespace)::assumeCompression<2, Nan::FunctionCallbackInfo, v8::Local >' requested here
const auto flags = assumeCompression<2>(info, pA);
^
../native/addon.cpp:80:21: warning: comparison of integers of different signs: 'int' and 'unsigned long'
[-Wsign-compare]
if (info.Length() <= index || info[index]->IsUndefined()) {
~~~~~~~~~~~~~ ^ ~~~~~
../native/addon.cpp:183:21: note: in instantiation of function template specialization '(anonymous
namespace)::assumeCompression<1, Nan::FunctionCallbackInfo, v8::Local >' requested here
const auto flags = assumeCompression<1>(info, p);
^
../native/addon.cpp:92:21: warning: comparison of integers of different signs: 'int' and 'unsigned long'
[-Wsign-compare]
if (info.Length() <= index) return SECP256K1_EC_COMPRESSED;
~~~~~~~~~~~~~ ^ ~~~~~
../native/addon.cpp:198:21: note: in instantiation of function template specialization '(anonymous
namespace)::assumeCompression<1, Nan::FunctionCallbackInfo >' requested here
const auto flags = assumeCompression<1>(info);
^
../native/addon.cpp:21:32: warning: unused variable 'ZERO' [-Wunused-const-variable]
const std::array ZERO = {};
^
5 warnings generated.
CC(target) Release/obj.target/secp256k1/native/secp256k1/src/secp256k1.o
In file included from ../native/secp256k1/src/secp256k1.c:13:
../native/secp256k1/src/field_impl.h:266:13: warning: unused function 'secp256k1_fe_inv_all_var' [-Wunused-function]
static void secp256k1_fe_inv_all_var(secp256k1_fe *r, const secp256k1_fe *a, size_t len) {
^
In file included from ../native/secp256k1/src/secp256k1.c:15:
../native/secp256k1/src/group_impl.h:191:13: warning: unused function 'secp256k1_ge_set_infinity' [-Wunused-function]
static void secp256k1_ge_set_infinity(secp256k1_ge *r) {
^
../native/secp256k1/src/group_impl.h:658:12: warning: unused function 'secp256k1_gej_has_quad_y_var'
[-Wunused-function]
static int secp256k1_gej_has_quad_y_var(const secp256k1_gej *a) {
^
../native/secp256k1/src/group_impl.h:102:13: warning: unused function 'secp256k1_ge_set_gej_var' [-Wunused-function]
static void secp256k1_ge_set_gej_var(secp256k1_ge *r, secp256k1_gej *a) {
^
In file included from ../native/secp256k1/src/secp256k1.c:16:
../native/secp256k1/src/ecmult_impl.h:1035:12: warning: unused function 'secp256k1_ecmult_multi_var'
[-Wunused-function]
static int secp256k1_ecmult_multi_var(const secp256k1_callback* error_callback, const secp256k1_ecmult_context ...
^
../native/secp256k1/src/ecmult_impl.h:621:12: warning: unused function 'secp256k1_ecmult_strauss_batch_single'
[-Wunused-function]
static int secp256k1_ecmult_strauss_batch_single(const secp256k1_callback* error_callback, const secp256k1_ecmu...
^
../native/secp256k1/src/ecmult_impl.h:863:15: warning: unused function 'secp256k1_pippenger_scratch_size'
[-Wunused-function]
static size_t secp256k1_pippenger_scratch_size(size_t n_points, int bucket_window) {
^
../native/secp256k1/src/ecmult_impl.h:944:12: warning: unused function 'secp256k1_ecmult_pippenger_batch_single'
[-Wunused-function]
static int secp256k1_ecmult_pippenger_batch_single(const secp256k1_callback* error_callback, const secp256k1_ec...
^
In file included from ../native/secp256k1/src/secp256k1.c:17:
../native/secp256k1/src/ecmult_const_impl.h:137:13: warning: unused function 'secp256k1_ecmult_const'
[-Wunused-function]
static void secp256k1_ecmult_const(secp256k1_gej *r, const secp256k1_ge *a, const secp256k1_scalar *scalar, int size) {
^
In file included from ../native/secp256k1/src/secp256k1.c:18:
In file included from ../native/secp256k1/src/ecmult_gen_impl.h:14:
../native/secp256k1/src/hash_impl.h:169:13: warning: unused function 'secp256k1_sha256_initialize_tagged'
[-Wunused-function]
static void secp256k1_sha256_initialize_tagged(secp256k1_sha256 *hash, const unsigned char *tag, size_t taglen) {
^
10 warnings generated.
SOLINK_MODULE(target) Release/secp256k1.node
npm WARN ws@7.4.3 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.4.3 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
+ symbol-cli@0.24.1
added 199 packages from 139 contributors in 15.026s
基軸通貨の保持アカウント登録
Cloudformation Stack内にあるOutoutsタブを選択します。 Key「mijinEndpint」のURLを控えてください。 次に、Key「HarvestAddress」のValueのURLをクリックしてください。
下の赤枠内のprivate_keyの値をメモしておきます。
symbol-cliにて上記のprivate_keyをimportします。
項目 | 入力値 |
---|---|
Select the network type | MIJIN_TEST |
Enter the Symbol node URL | 控えていたKey「mijinEndpint」のURLを入力 |
Enter a profile name | 任意のプロファイル名を入力 |
Enter your wallet password | 任意のパスワードを入力 |
Do you want to set the account as the default profile | DefaultProfileにするかどうか、ここではYesを選択 |
Select an import type | PrivateKey |
Enter your account private key | 控えていたprivate_keyを入力 |
$ symbol-cli profile import
? Select the network type: › - Use arrow-keys. Return to submit.
MAIN_NET
TEST_NET
MIJIN
❯ MIJIN_TEST
✔ Select the network type: › MIJIN_TEST
✔ Enter the Symbol node URL. (Example: http://localhost:3000): … http://13.230.253.80:3000
✔ Enter a profile name: … mijin-free
✔ Enter your wallet password: … **********
✔ Do you want to set the account as the default profile? … yes
? Select an import type: › - Use arrow-keys. Return to submit.
❯ PrivateKey
Mnemonic
✔ Enter your account private key: … ****************************************************************
Account
┌───────────────┬──────────────────────────────────────────────────────────────────────┐
│ Property │ Value │
├───────────────┼──────────────────────────────────────────────────────────────────────┤
│ Address │ SCKNXY-3FCDH2-S5NFWF-6BZ5I2-WADC5Z-F7CZAJ-PHY │
├───────────────┼──────────────────────────────────────────────────────────────────────┤
│ Public Key │ 534642E39A466B9AC61F08B47B25AE6F8A55DE118A93218C8FB1AEDA6BC18A55 │
├───────────────┼──────────────────────────────────────────────────────────────────────┤
│ Private Key │ 003D6C16C4929CDC8901C46E8919D50E8A81236CD2F7FE5F5CB7E22A1A657C4E │
├───────────────┼──────────────────────────────────────────────────────────────────────┤
│ Password │ mijin-free │
└───────────────┴──────────────────────────────────────────────────────────────────────┘
SUCCESS Stored mijin-free profile
アカウントの情報を確認します。
Balance Informationが基軸通貨(cat.currency)となります。
$ symbol-cli account info
⠇ Processing
Account Information
┌───────────────────┬──────────────────────────────────────────────────────────────────┐
│ Property │ Value │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Address │ SCKNXY-3FCDH2-S5NFWF-6BZ5I2-WADC5Z-F7CZAJ-PHY │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Address Height │ 1 │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Public Key │ 534642E39A466B9AC61F08B47B25AE6F8A55DE118A93218C8FB1AEDA6BC18A55 │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Public Key Height │ 1 │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Importance │ 2000000000 │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Importance Height │ 1 │
└───────────────────┴──────────────────────────────────────────────────────────────────┘
Balance Information
┌──────────────────┬─────────────────┬─────────────────┬───────────────────┐
│ Mosaic Id │ Relative Amount │ Absolute Amount │ Expiration Height │
├──────────────────┼─────────────────┼─────────────────┼───────────────────┤
│ 30D00C06BFCFF8B6 │ 2,000 │ 2000000000 │ Never │
└──────────────────┴─────────────────┴─────────────────┴───────────────────┘
空アカウントの登録
Cloudformation Stack内にあるOutoutsタブを再度表示します。 Key「emptyAddress」のValueのURLをクリックしてください。
Valueにアドレスが10件登録されているため、1つ目のprivate_keyを控えてください。
symbol-cliにて上記のprivate_keyをimportします。
項目 | 入力値 |
---|---|
Select the network type | MIJIN_TEST |
Enter the Symbol node URL | 控えていたKey「mijinEndpint」のURLを入力 |
Enter a profile name | 任意のプロファイル名を入力 |
Enter your wallet password | 任意のパスワードを入力 |
Do you want to set the account as the default profile | DefaultProfileにするかどうか、ここではNoを選択 |
Select an import type | PrivateKey |
Enter your account private key | 控えていたprivate_keyを入力 |
$ symbol-cli profile import
✔ Select the network type: › MIJIN_TEST
✔ Enter the Symbol node URL. (Example: http://localhost:3000): … http://13.230.253.80:3000
✔ Enter a profile name: … mijin-free-empty1
✔ Enter your wallet password: … ************
✔ Do you want to set the account as the default profile? … no
✔ Select an import type: › PrivateKey
✔ Enter your account private key: … ****************************************************************
Account
┌───────────────┬──────────────────────────────────────────────────────────────────────┐
│ Property │ Value │
├───────────────┼──────────────────────────────────────────────────────────────────────┤
│ Address │ SBBI5D-K2735Y-63YNOI-4PJ4U4-F6XDB7-KKEHZP-L5A │
├───────────────┼──────────────────────────────────────────────────────────────────────┤
│ Public Key │ 24737825D42B970C90ECF04657B3F931DD97E25155A677A6385D499DFED1BF76 │
├───────────────┼──────────────────────────────────────────────────────────────────────┤
│ Private Key │ 9EAB981AE0F6D0B39D38BCFF1C50C5343E2D66AA6A1C46FA69E6893DFEFEFB3D │
├───────────────┼──────────────────────────────────────────────────────────────────────┤
│ Password │ mijin-empty1 │
└───────────────┴──────────────────────────────────────────────────────────────────────┘
SUCCESS Stored mijin-free-empty1 profile
この時点でアカウントを確認しても、存在しないことになっています。
ブロックチェーン上で、このアドレスのやり取りがないため、存在を確認できないからです。
$ symbol-cli account info --profile mijin-free-empty1
ERR {"statusCode":404,"statusMessage":"Not Found","body":"{\"code\":\"ResourceNotFound\",\"message\":\"no resource exists with id 'SBBI5DK2735Y63YNOI4PJ4U4F6XDB7KKEHZPL5A'\"}"}
TIP The account has to receive at least one transaction to be recorded on the network
基軸通貨を送信する
先程登録した空のアドレスに対して、基軸通貨を送信してみます。 以下のコマンドを実行し、AddressのValueを控えてください。
$ symbol-cli profile list --profile mijin-free-empty1
┌──────────────────┬──────────────────────────────────────────────────────────────────┐
│ Property │ Value │
├──────────────────┼──────────────────────────────────────────────────────────────────┤
│ Name │ mijin-free-empty1 │
├──────────────────┼──────────────────────────────────────────────────────────────────┤
│ Address │ SBBI5D-K2735Y-63YNOI-4PJ4U4-F6XDB7-KKEHZP-L5A │
├──────────────────┼──────────────────────────────────────────────────────────────────┤
│ Network │ MIJIN_TEST │
├──────────────────┼──────────────────────────────────────────────────────────────────┤
│ Node URL │ http://13.230.253.80:3000 │
├──────────────────┼──────────────────────────────────────────────────────────────────┤
│ Generation Hash │ 5099CF98B38F51FFAAFEFFF4C1890E3E853F801DDBCE88762C1F2B962EE57A0E │
├──────────────────┼──────────────────────────────────────────────────────────────────┤
│ Network Currency │ name: cat.currency, divisibility: 6 │
├──────────────────┼──────────────────────────────────────────────────────────────────┤
│ Profile type │ PrivateKey │
└──────────────────┴──────────────────────────────────────────────────────────────────┘
1cat.currencyを空のアドレスへ送信します。
項目 | 入力値 |
---|---|
Mosaics to transfer in the format | cat.currencyは可分性6のため、1送る場合は以下のようにする @cat.currency::1000000 |
Enter the recipient address | ここでは、プロファイル「mijin-free-empty1」のアドレスを指定 |
Enter a message | トランザクションのメッセージを追加 test |
Enter the maximum fee | トランザクション手数料を指定。手数料は計算が必要だが、ここでは以下を指定 20000 |
$ symbol-cli transaction transfer
✔ Enter your wallet password: … **********
✔ Mosaics to transfer in the format (mosaicId(hex)|@aliasName)::absoluteAmount, (Ex: sending 1 symbol.xym, @symbol.xym::1000000). Add multiple mosaics separated by commas: … @cat.currency::1000000
✔ Enter the recipient address or @alias: … SBBI5D-K2735Y-63YNOI-4PJ4U4-F6XDB7-KKEHZP-L5A
✔ Enter a message: … test
✔ Enter the maximum fee (absolute amount): … 20000
✔ Select the transaction announce mode: › normal
┌──────────────────────────────────────────────────────────────────────────────────┐
│ TRANSFER │
├───────────────┬──────────────────────────────────────────────────────────────────┤
│ Max fee: │ 20,000 │
├───────────────┼──────────────────────────────────────────────────────────────────┤
│ Network type: │ MIJIN_TEST │
├───────────────┼──────────────────────────────────────────────────────────────────┤
│ Deadline: │ 2020-08-28 17:41:08.512 │
├───────────────┼──────────────────────────────────────────────────────────────────┤
│ Recipient: │ SBBI5D-K2735Y-63YNOI-4PJ4U4-F6XDB7-KKEHZP-L5A │
├───────────────┼──────────────────────────────────────────────────────────────────┤
│ Message: │ test │
├───────────────┼──────────────────────────────────────────────────────────────────┤
│ Mosaic (1/1): │ 1,000,000 cat.currency (85BBEA6CC462B244) │
├───────────────┴──────────────────────────────────────────────────────────────────┤
│ Signature details │
├───────────────┬──────────────────────────────────────────────────────────────────┤
│ Payload: │ B50000000000000042B404182D3BA9DB07C8284E459FD7442664110E52171ED1 │
│ │ 63C9D713976376A55F9C7FF91226CBE1C0B5F97F66D9BBB04B660094886A7D64 │
│ │ F39639C2CE730804534642E39A466B9AC61F08B47B25AE6F8A55DE118A93218C │
│ │ 8FB1AEDA6BC18A550000000001905441204E000000000000A0B277DC05000000 │
│ │ 90428E8D5AFEFB8F6F0D7238F4F29C2FAE30FD4A21F2F5F40500010000000000 │
│ │ 44B262C46CEABB8540420F00000000000074657374 │
├───────────────┼──────────────────────────────────────────────────────────────────┤
│ Hash: │ 8874ABF30B9B1D8A1F962C7EECCE4008B4B05D4839E9DB5C14557677E131962F │
├───────────────┼──────────────────────────────────────────────────────────────────┤
│ Signer: │ 534642E39A466B9AC61F08B47B25AE6F8A55DE118A93218C8FB1AEDA6BC18A55 │
└───────────────┴──────────────────────────────────────────────────────────────────┘
✔ Do you want to announce this transaction? … yes
SUCCESS Transaction announced correctly
TIP To check if the network confirms or rejects the transaction, run the command 'symbol-cli transaction status'
トランザクションが送信できたかを確認します。
$ symbol-cli transaction status
✔ Enter a transaction hash: … 8874ABF30B9B1D8A1F962C7EECCE4008B4B05D4839E9DB5C14557677E131962F
Transaction Status
┌─────────────┬──────────────────────────────────────────────────────────────────┐
│ Property │ Value │
├─────────────┼──────────────────────────────────────────────────────────────────┤
│ Group │ confirmed │
├─────────────┼──────────────────────────────────────────────────────────────────┤
│ Hash │ 8874ABF30B9B1D8A1F962C7EECCE4008B4B05D4839E9DB5C14557677E131962F │
├─────────────┼──────────────────────────────────────────────────────────────────┤
│ Status Code │ Success │
├─────────────┼──────────────────────────────────────────────────────────────────┤
│ Deadline │ 2020-08-28T17:41:08.512 │
├─────────────┼──────────────────────────────────────────────────────────────────┤
│ Height │ 120 │
└─────────────┴──────────────────────────────────────────────────────────────────┘
送信元のアカウントを確認します。
1cat.currencyと手数料が合算され引かれています
$ symbol-cli account info
⠙ Processing
Account Information
┌───────────────────┬──────────────────────────────────────────────────────────────────┐
│ Property │ Value │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Address │ SCKNXY-3FCDH2-S5NFWF-6BZ5I2-WADC5Z-F7CZAJ-PHY │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Address Height │ 1 │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Public Key │ 534642E39A466B9AC61F08B47B25AE6F8A55DE118A93218C8FB1AEDA6BC18A55 │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Public Key Height │ 1 │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Importance │ 2000000000 │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Importance Height │ 1 │
└───────────────────┴──────────────────────────────────────────────────────────────────┘
Balance Information
┌──────────────────┬─────────────────┬─────────────────┬───────────────────┐
│ Mosaic Id │ Relative Amount │ Absolute Amount │ Expiration Height │
├──────────────────┼─────────────────┼─────────────────┼───────────────────┤
│ 30D00C06BFCFF8B6 │ 1,998.999 │ 1998999005 │ Never │
└──────────────────┴─────────────────┴─────────────────┴───────────────────┘
送信元の空アドレスを確認します。
1cat.currecnyを持っていることを確認できます。
$ symbol-cli account info --profile mijin-free-empty1
⠙ Processing
Account Information
┌───────────────────┬──────────────────────────────────────────────────────────────────┐
│ Property │ Value │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Address │ SBBI5D-K2735Y-63YNOI-4PJ4U4-F6XDB7-KKEHZP-L5A │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Address Height │ 120 │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Public Key │ 0000000000000000000000000000000000000000000000000000000000000000 │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Public Key Height │ 0 │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Importance │ 0 │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Importance Height │ 0 │
└───────────────────┴──────────────────────────────────────────────────────────────────┘
Balance Information
┌──────────────────┬─────────────────┬─────────────────┬───────────────────┐
│ Mosaic Id │ Relative Amount │ Absolute Amount │ Expiration Height │
├──────────────────┼─────────────────┼─────────────────┼───────────────────┤
│ 30D00C06BFCFF8B6 │ 1 │ 1000000 │ Never │
└──────────────────┴─────────────────┴─────────────────┴───────────────────┘