Create multisig owner permission in kylin testnet
EOS で owner パーミッションをマルチシグにする。
実行環境
ubuntu 16.04 LTS
eosjs v16.0.9
code:actions.json
[{
"account": "eosio",
"name": "newaccount",
"authorization": [{
"actor": "mokemokecore",
"permission": "active"
}
],
"data": {
"creator": "mokemokecore",
"name": "mokemoke2222",
"owner": {
"threshold": 2,
"keys": [],
"accounts": [{
"permission": {
"actor": "mokemoke1111",
"permission": "active"
},
"weight": 1
}, {
"permission": {
"actor": "leohioleohio",
"permission": "active"
},
"weight": 1
}
],
"waits": []
},
"active": {
"threshold": 1,
"keys": [{
"key": "EOS7hnP2sZGr2DAwfL5fSZ8btYF99gjmeEBbKftFeWWhG4jSK3zRo",
"weight": 1
}
],
"accounts": [],
"waits": []
}
}
},{
"account": "eosio",
"name": "buyrambytes",
"authorization": [{
"actor": "mokemokecore",
"permission": "active"
}
],
"data": {
"payer": "mokemokecore",
"receiver": "mokemoke2222",
"bytes": 5120
}
}
]
code:index.js
(async function() {
const Eos = require("eosjs");
const actions = require("./actions.json");
const private_key_of_mokemokecore_active_permission = ***;
const eos = Eos({
chainId: "5fff1dae8dc8e2fc4d5b23b2c7665c97f9e9d8edf2b6485a86ba311c25639191"
});
const res = await eos.transaction({actions});
console.log(res);
})();
code:invoke01.sh
ls
code:response01.sh
actions.json index.js
code:invoke02.sh
yarn add eosjs
code:response02.sh
yarn add v1.12.3
1/4 Resolving packages... 3/4 Linking dependencies... 4/4 Building fresh packages... success Saved 1 new dependency.
info Direct dependencies
└─ eosjs@16.0.9
info All dependencies
└─ eosjs@16.0.9
Done in 0.71s.
code:invoke03.sh
node index.js
code:response03.sh
{ broadcast: true,
transaction:
{ compression: 'none',
transaction:
{ expiration: '2019-03-30T05:59:01',
ref_block_num: 12594,
ref_block_prefix: 1888376210,
max_net_usage_words: 0,
max_cpu_usage_ms: 0,
delay_sec: 0,
context_free_actions: [],
transaction_extensions: [] },
signatures:
transaction_id: '8a6b6a44f1e3262be358e3c3bfac74964ec4fd0556423fcc4bbcd54991194f84',
processed:
{ id: '8a6b6a44f1e3262be358e3c3bfac74964ec4fd0556423fcc4bbcd54991194f84',
block_num: 40972924,
block_time: '2019-03-30T05:58:02.500',
producer_block_id: null,
receipt: { status: 'executed', cpu_usage_us: 9764, net_usage_words: 31 },
elapsed: 9764,
net_usage: 248,
scheduled: false,
except: null } }
testnet や mainnet では、eosio::newaccount は eosio::buyrambytes と同時にアクションを出さないと、RAM 不足のエラーが出るので注意が必要です。
関連ワード