• 테스트를 위해 Jungle Testnet에 계정(testmsig111a, testmsig111b, testmsig111d)을 미리 만들어서 cleos wallet에 key를 import 해뒀다.
  • testmsig111a, testmsig111b 두 계정 모두의 active 권한을 이용한 승인이 있어야만 testmsig111d 계정의 active 권한으로 트랜잭션을 실행할 수 있도록 시도해보는 것이 테스트의 목적이다.

참고 URL : https://steemit.com/eos/@genereos/eos-multisig-tutorial

testmsig111d 계정의 active 권한을 multisig로 셋팅

[email protected]:~# cleos -u http://jungle.cryptolions.io:18888 set account permission testmsig111d active ‘{“threshold”:2, “keys”:[], “accounts”:[{“permission”:{“actor”:”testmsig111a”, “permission”:”active”}, “weight”:1}, {“permission”:{“actor”:”testmsig111b”, “permission”:”active”}, “weight”:1}], “waits”:[]}’ owner -p [email protected]

executed transaction: 7931e12bffdd452ec61d185789107ffa9c4e2afd67713d233b7fa486211bf7f2 160 bytes 692 us
# eosio <= eosio::updateauth {“account”:”testmsig111d”,”permission”:”active”,”parent”:”owner”,”auth”:{“threshold”:2,”keys”:[],”ac…
warning: transaction executed locally, but may not be confirmed by the network yet ]

확인

[email protected]:~# cleos -u http://jungle.cryptolions.io:18888 get account testmsig111d

 

created: 2018-11-12T10:11:48.000

permissions:
owner 1: 1 EOS6vefE77SEi3sh4zpgmaVBh2zKnpUW3MZWiGMDCz5YUsTV84VSm
active 2: 1 [email protected], 1 [email protected]
memory:
quota: 5.345 KiB used: 3.379 KiB
net bandwidth:
staked: 100.0000 EOS (total stake delegated from account to self)
delegated: 0.0000 EOS (total staked delegated to account from others)
used: 335 bytes
available: 18.24 MiB
limit: 18.24 MiB
cpu bandwidth:
staked: 100.0000 EOS (total stake delegated from account to self)
delegated: 0.0000 EOS (total staked delegated to account from others)
used: 2.058 ms
available: 3.637 sec
limit: 3.639 sec
EOS balances:
liquid: 100.0000 EOS
staked: 200.0000 EOS
unstaking: 0.0000 EOS
total: 300.0000 EOS
producers:

testmsig111a, testmsig111b 둘 모두의 승인이 있어야 active 권한으로 트랜잭션을 실행할 수 있는 상태가 됐다.

현재 liquid 수량은 100 EOS.

proposal(d의 제안)

testmsig111d가 testmsig111a와 testmsig111b에게 다음 내용을 제안(propose test.msig)한다.

“testmsig111d의 계정에서 30.1234 EOS를  “Test multisig”라는 memo와 함께 testmsig111a에게 전송하는 것을 승인해달라.”

[email protected]:~# cleos -u http://jungle.cryptolions.io:18888 multisig propose test.msig ‘[{“actor”:”testmsig111a”, “permission”:”active”}, {“actor”:”testmsig111b”, “permission”:”active”}]’ ‘[{“actor”:”testmsig111d”, “permission”:”active”}]’ eosio.token transfer ‘{“from”:”testmsig111d”, “to”:”testmsig111a”, “quantity”:”30.1234 EOS”, “memo”:”Test multisig”}’ testmsig111d

executed transaction: 2c02a115cb7c8c375548e1f456b16771285fabff60d11f599f4b8793b89a2c0d 256 bytes 1197 us

# eosio.msig <= eosio.msig::propose {“proposer”:”testmsig111d”,”proposal_name”:”test.msig”,”requested”:[{“actor”:”testmsig111a”,”permiss…
warning: transaction executed locally, but may not be confirmed by the network yet ] 

review(내용확인)

[email protected]:~# cleos -u http://jungle.cryptolions.io:18888 multisig review testmsig111d test.msig

{

“proposal_name”: “test.msig”,
“packed_transaction”: “0389f25b000000000000000000000100a6823403ea3055000000572d3ccdcd01904208cc6199b1ca00000000a8ed32322e904208cc6199b1ca604208cc6199b1cab29804000000000004454f53000000000d54657374206d756c746973696700”,
“transaction”: {
“expiration”: “2018-11-19T09:57:23”,
“ref_block_num”: 0,
“ref_block_prefix”: 0,
“max_net_usage_words”: 0,
“max_cpu_usage_ms”: 0,
“delay_sec”: 0,
“context_free_actions”: [],
“actions”: [{
“account”: “eosio.token”,
“name”: “transfer”,
“authorization”: [{
“actor”: “testmsig111d”,
“permission”: “active”
}
],
“data”: {
“from”: “testmsig111d”,
“to”: “testmsig111a”,
“quantity”: “30.1234 EOS”,
“memo”: “Test multisig”
},
“hex_data”: “904208cc6199b1ca604208cc6199b1cab29804000000000004454f53000000000d54657374206d756c7469736967”
}
],
“transaction_extensions”: []
}
}

approve by testmsig111a(a의 승인)

[email protected]:~# cleos -u http://jungle.cryptolions.io:18888 multisig approve testmsig111d test.msig ‘{“actor”:”testmsig111a”, “permission”:”active”}’ -p [email protected]

executed transaction: ae9bfa83ed70204a4b64734591e02aecb2fe80b3222b918704fe6a7ee611f35c 128 bytes 663 us

# eosio.msig <= eosio.msig::approve {“proposer”:”testmsig111d”,”proposal_name”:”test.msig”,”level”:{“actor”:”testmsig111a”,”permission”:…
warning: transaction executed locally, but may not be confirmed by the network yet ] 

approve by testmsig111b(b의 승인)

[email protected]:~# cleos -u http://jungle.cryptolions.io:18888 multisig approve testmsig111d test.msig ‘{“actor”:”testmsig111b”, “permission”:”active”}’ -p [email protected]

executed transaction: 02f6616fe699dbf6c19d0e7b9a6405553ef7b67869208e239d60464bad208ba5 128 bytes 724 us

# eosio.msig <= eosio.msig::approve {“proposer”:”testmsig111d”,”proposal_name”:”test.msig”,”level”:{“actor”:”testmsig111b”,”permission”:…
warning: transaction executed locally, but may not be confirmed by the network yet ] 

execute(d의 실행)

[email protected]:~# cleos -u http://jungle.cryptolions.io:18888 multisig exec testmsig111d test.msig -p [email protected]

executed transaction: 4b870e20f2e00504ed6bf70ee627ed13891089de6809d40198d0a6c1a96c765f 176 bytes 1153 us
# eosio.msig <= eosio.msig::exec {“proposer”:”testmsig111d”,”proposal_name”:”test.msig”,”executer”:”testmsig111d”}
warning: transaction executed locally, but may not be confirmed by the network yet ] 

최종확인

[email protected]:~# cleos -u http://jungle.cryptolions.io:18888 get account testmsig111d

created: 2018-11-12T10:11:48.000

permissions:
owner 1: 1 EOS6vefE77SEi3sh4zpgmaVBh2zKnpUW3MZWiGMDCz5YUsTV84VSm
active 2: 1 [email protected], 1 [email protected]
memory:
quota: 5.345 KiB used: 3.504 KiB
net bandwidth:
staked: 100.0000 EOS (total stake delegated from account to self)
delegated: 0.0000 EOS (total staked delegated to account from others)
used: 749 bytes
available: 18.24 MiB
limit: 18.24 MiB
cpu bandwidth:
staked: 100.0000 EOS (total stake delegated from account to self)
delegated: 0.0000 EOS (total staked delegated to account from others)
used: 3.93 ms
available: 3.635 sec
limit: 3.639 sec
EOS balances:
liquid: 69.8766 EOS
staked: 200.0000 EOS
unstaking: 0.0000 EOS
total: 269.8766 EOS
producers:

[email protected]:~# cleos -u http://jungle.cryptolions.io:18888 get account testmsig111a

created: 2018-11-07T06:46:24.500

permissions:
owner 1: 1 EOS8QuiCbMkGb2hYNk1hLuYoEfPDL8sbiPuXext5GY3hUiRNFqXm7
active 1: 1 EOS8QuiCbMkGb2hYNk1hLuYoEfPDL8sbiPuXext5GY3hUiRNFqXm7
memory:
quota: 5.345 KiB used: 3.49 KiB
net bandwidth:
staked: 100.0000 EOS (total stake delegated from account to self)
delegated: 0.0000 EOS (total staked delegated to account from others)
used: 129 bytes
available: 18.24 MiB
limit: 18.24 MiB
cpu bandwidth:
staked: 100.0000 EOS (total stake delegated from account to self)
delegated: 0.0000 EOS (total staked delegated to account from others)
used: 122 us
available: 3.639 sec
limit: 3.639 sec
EOS balances:
liquid: 30.1234 EOS
staked: 200.0000 EOS
unstaking: 0.0000 EOS
total: 230.1234 EOS
producers:

4 votes, average: 4.50 out of 54 votes, average: 4.50 out of 54 votes, average: 4.50 out of 54 votes, average: 4.50 out of 54 votes, average: 4.50 out of 5 (4 votes, average: 4.50 out of 5)
You need to be a registered member to rate this.
(73 total tokens earned)
Loading...

Responses