关于使用多签修改EOS黑名单账户权限的流程说明

一、黑名单账户列表

actor-blacklist = blacklistmee

actor-blacklist = ge2dmmrqgene

actor-blacklist = gu2timbsguge

actor-blacklist = ge4tsmzvgege

actor-blacklist = gezdonzygage

actor-blacklist = ha4tkobrgqge

actor-blacklist = gq4dkmzzhege

actor-blacklist = gu2teobyg4ge

actor-blacklist = gq4demryhage

actor-blacklist = q4dfv32fxfkx

actor-blacklist = ktl2qk5h4bor

actor-blacklist = haydqnbtgene

actor-blacklist = g44dsojygyge

actor-blacklist = guzdonzugmge

actor-blacklist = ha4doojzgyge

actor-blacklist = gu4damztgyge

actor-blacklist = haytanjtgige

actor-blacklist = exchangegdax

actor-blacklist = cmod44jlp14k

actor-blacklist = 2fxfvlvkil4e

actor-blacklist = yxbdknr3hcxt

actor-blacklist = yqjltendhyjp

actor-blacklist = pm241porzybu

actor-blacklist = xkc2gnxfiswe

actor-blacklist = ic433gs42nky

actor-blacklist = fueaji11lhzg

actor-blacklist = w1ewnn4xufob

actor-blacklist = ugunxsrux2a3

actor-blacklist = gz3q24tq3r21

actor-blacklist = u5rlltjtjoeo

actor-blacklist = k5thoceysinj

actor-blacklist = ebhck31fnxbi

actor-blacklist = pvxbvdkces1x

actor-blacklist = oucjrjjvkrom

actor-blacklist = neverlandwal

actor-blacklist = tseol5n52kmo

actor-blacklist = potus1111111

actor-blacklist = craigspys211

actor-blacklist = eosfomoplay1

actor-blacklist = wangfuhuahua

actor-blacklist = guytqmbuhege

actor-blacklist = huobldeposit

actor-blacklist = gm3dcnqgenes

actor-blacklist = gm34qnqrepqt

actor-blacklist = gt3ftnqrrpqp

actor-blacklist = gtwvtqptrpqp

actor-blacklist = gm31qndrspqr

actor-blacklist = lxl2atucpyos

actor-blacklist = g4ytenbxgqge

actor-blacklist = jinwen121212

actor-blacklist = ha4tomztgage

actor-blacklist = my1steosobag

actor-blacklist = iloveyouplay

actor-blacklist = eoschinaeos2

actor-blacklist = eosholderkev

actor-blacklist = dreams12true

actor-blacklist = imarichman55

actor-blacklist = gizdcnjyg4ge

actor-blacklist = gyzdmmjsgige

actor-blacklist = guzdanrugene

actor-blacklist = earthsop1sys

actor-blacklist = refundwallet

actor-blacklist = jhonnywalker

actor-blacklist = alibabaioeos

actor-blacklist = whitegroupes

actor-blacklist = 24cryptoshop

actor-blacklist = minedtradeos

actor-blacklist = gizdkmjvhege

actor-blacklist = newdexmobapp

actor-blacklist = ftsqfgjoscma

actor-blacklist = hpbcc4k42nxy

actor-blacklist = 3qyty1khhkhv

actor-blacklist = xzr2fbvxwtgt

actor-blacklist = myqdqdj4qbge

actor-blacklist = shprzailrazt

actor-blacklist = qkwrmqowelyu

actor-blacklist = lmfsopxpr324

actor-blacklist = lhjuy3gdkpq4

actor-blacklist = lcxunh51a1gt

actor-blacklist = geydddsfkk5e

actor-blacklist = pnsdiia1pcuy

actor-blacklist = kwmvzswquqpb

actor-blacklist = guagddoefdqu

actor-blacklist = eosusswallet

actor-blacklist = hazdkmjzgage

actor-blacklist = kh4azehosmop

actor-blacklist = 5pol2thb2ria

actor-blacklist = mq3glv2stv4e

actor-blacklist = i3fzzfgrjbjc

actor-blacklist = 4mtfxsewttaf

actor-blacklist = rcwrod3lhuhq

actor-blacklist = jgj1mnxfhff5

actor-blacklist = qlbbgfli1nuj

actor-blacklist = gwapdrd2p4ko

actor-blacklist = tvtumtera3he

actor-blacklist = gjtii2d4tj14

actor-blacklist = b2c1ywwknop5

actor-blacklist = ut2ggwbjdknq

actor-blacklist = jmp12mlstdob

actor-blacklist = tmnazyf5ftqi

actor-blacklist = pab5kap44ivb

actor-blacklist = cds4gvmxhg3m

actor-blacklist = wsrapxubkl55

actor-blacklist = mhlxqjez3lqs

actor-blacklist = i2aubmanszsk

actor-blacklist = onzcps2arolt

actor-blacklist = rit5yr25a1lk

actor-blacklist = wqyj3xlmp13b

actor-blacklist = tmnjd3r2gt5q

actor-blacklist = dobyhfj31fmo

actor-blacklist = lzvysxbjeypf

actor-blacklist = y2x1kenbtyia

actor-blacklist = dxt14xuvycko

actor-blacklist = rok1uwevzqts

actor-blacklist = giisxooweeew

actor-blacklist = amzow3p4zi43

actor-blacklist = fbycrvvd5qmb

actor-blacklist = ii4muo2ipf3x

actor-blacklist = b52fsjjqdzaa

actor-blacklist = fjupnherro2j

actor-blacklist = sluy5gcfzove

actor-blacklist = sadomqwm3k1f

actor-blacklist = bgvoe4jt3eui

actor-blacklist = dweoouwbxfgc

actor-blacklist = hoveuorxadro

actor-blacklist = hiporche1111

二、需要一个一个处理黑名单账户,生成一个综合的json文件,过程如下

1、生成第一个黑名单账户的 updateauth 数据文件updateblacklistaccauth.json
cleos set account permission -s -j -d blacklistmee active '{"threshold":1,"keys":[], "accounts":[{"permission": {"actor": "eosio.prods", "permission": "active"},"weight":1}]}' owner > updateblacklistaccauth.json

2、vim修改updateblacklistaccauth.json文件,将文件中的 ref_block_num 和 ref_block_prefix 改为 0,将 expiration 改为 1970-01-01T00:00:00
{
"expiration": "1970-01-01T00:00:00",
"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",
"name": "updateauth",
"authorization": [{
"actor": "blacklistmee",
"permission": "active"
}
],
"data": "a094ccd845884c3c00000000a8ed32320000000080ab26a70100000000010070a2b702ea305500000000a8ed3232010000"
}
],
"transaction_extensions": [],
"signatures": [],
"context_free_data": []
}

3、调用 wrap 合约执行下面命令,生成最终的 transaction data 文件名sudo_update_all_blacklistacc_active_trx.json
cleos wrap exec -s -j -d hashfineosio updateblacklistaccauth.json > sudo_update_all_blacklistacc_active_trx.json

4、vim修改sudo_update_all_blacklistacc_active_trx.json文件内容,将文件中的 ref_block_num 和 ref_block_prefix 设置为 0,将 expiration 的日期向后推迟一定的时间(比如 1 天后),这个时间表示 transaction 的过期时间。由于这个 transaction 最终需要等待 BP 多签生效,因此过期时间不能太短。

修改前

cat sudo_update_all_blacklistacc_active_trx.json
{
"expiration": "2019-10-14T09:26:17",
"ref_block_num": 13003,
"ref_block_prefix": 1773687655,
"max_net_usage_words": 0,
"max_cpu_usage_ms": 0,
"delay_sec": 0,
"context_free_actions": [],
"actions": [{
"account": "eosio.wrap",
"name": "exec",
"authorization": [{
"actor": "hashfineosio",
"permission": "active"
},{
"actor": "eosio.wrap",
"permission": "active"
}
],
"data": "00000026dd0a30550000000000000000000000000000010000000000ea30550040cbdaa86c52d501a094ccd845884c3c00000000a8ed323231a094ccd845884c3c00000000a8ed32320000000080ab26a70100000000010070a2b702ea305500000000a8ed323201000000"
}
],
"transaction_extensions": [],
"signatures": [],
"context_free_data": []
}

修改后

{
"expiration": "2019-10-15T09:26:17",
"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.wrap",
"name": "exec",
"authorization": [{
"actor": "hashfineosio",
"permission": "active"
},{
"actor": "eosio.wrap",
"permission": "active"
}
],
"data": "00000026dd0a30550000000000000000000000000000010000000000ea30550040cbdaa86c52d501a094ccd845884c3c00000000a8ed323231a094ccd845884c3c00000000a8ed32320000000080ab26a70100000000010070a2b702ea305500000000a8ed323201000000"
}
],
"transaction_extensions": [],
"signatures": [],
"context_free_data": []
}

5、生成第二个黑名单账户的 updateauth 数据,可以覆盖上一个文件updateblacklistaccauth.json
cleos set account permission -s -j -d ge2dmmrqgene active '{"threshold":1,"keys":[], "accounts":[{"permission": {"actor": "eosio.prods", "permission": "active"},"weight":1}]}' owner > updateblacklistaccauth.json

6、参考第2步修改,将文件中的 ref_block_num 和 ref_block_prefix 改为 0,将 expiration 改为 1970-01-01T00:00:00

7、参考第3步,调用 wrap 合约执行上述命令,生成第二个黑名单账户ge2dmmrqgene的 transaction data,注意,命令中生成文件名要改一下,不要覆盖文件名sudo_update_all_blacklistacc_active_trx.json
cleos wrap exec -s -j -d hashfineosio updateblacklistaccauth.json > sudo_update_2_blacklistacc_active_trx.json

8、打开文件sudo_update_2_blacklistacc_active_trx.json,复制actions部分,添加到文件中sudo_update_all_blacklistacc_active_trx.json,如下所示
cat sudo_update_2_blacklistacc_active_trx.json
{
"expiration": "2019-10-14T09:40:58",
"ref_block_num": 14767,
"ref_block_prefix": 678488647,
"max_net_usage_words": 0,
"max_cpu_usage_ms": 0,
"delay_sec": 0,
"context_free_actions": [],
"actions": [{
"account": "eosio.wrap",
"name": "exec",
"authorization": [{
"actor": "hashfineosio",
"permission": "active"
},{
"actor": "eosio.wrap",
"permission": "active"
}
],
"data": "00000026dd0a30550000000000000000000000000000010000000000ea30550040cbdaa86c52d501a0a662f64a99846200000000a8ed323231a0a662f64a99846200000000a8ed32320000000080ab26a70100000000010070a2b702ea305500000000a8ed323201000000"
}
],
"transaction_extensions": [],
"signatures": [],
"context_free_data": []
}

复制下面一部分到文件sudo_update_all_blacklistacc_active_trx.json中的actions数组,追加到后面

{
"account": "eosio.wrap",
"name": "exec",
"authorization": [{
"actor": "hashfineosio",
"permission": "active"
},{
"actor": "eosio.wrap",
"permission": "active"
}
],
"data": "00000026dd0a30550000000000000000000000000000010000000000ea30550040cbdaa86c52d501a0a662f64a99846200000000a8ed323231a0a662f64a99846200000000a8ed32320000000080ab26a70100000000010070a2b702ea305500000000a8ed323201000000"
}

修改后到sudo_update_all_blacklistacc_active_trx.json文件如下

cat sudo_update_all_blacklistacc_active_trx.json
{
"expiration": "2019-10-15T09:26:17",
"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.wrap",
"name": "exec",
"authorization": [{
"actor": "hashfineosio",
"permission": "active"
},{
"actor": "eosio.wrap",
"permission": "active"
}
],
"data": "00000026dd0a30550000000000000000000000000000010000000000ea30550040cbdaa86c52d501a094ccd845884c3c00000000a8ed323231a094ccd845884c3c00000000a8ed32320000000080ab26a70100000000010070a2b702ea305500000000a8ed323201000000"
},
{
"account": "eosio.wrap",
"name": "exec",
"authorization": [{
"actor": "hashfineosio",
"permission": "active"
},{
"actor": "eosio.wrap",
"permission": "active"
}
],
"data": "00000026dd0a30550000000000000000000000000000010000000000ea30550040cbdaa86c52d501a0a662f64a99846200000000a8ed323231a0a662f64a99846200000000a8ed32320000000080ab26a70100000000010070a2b702ea305500000000a8ed323201000000"
}
],
"transaction_extensions": [],
"signatures": [],
"context_free_data": []
}

9、用上面的方式从第5步开始到第8步,继续追加第3个,第4个......黑名单账户第action信息到文件sudo_update_all_blacklistacc_active_trx.json中,直到把所有到黑名单全部加进去
三、生成 producer_permissions.json 文件,假设网络中有 21 个 BP, producer_permissions.json 的文件内容如下所示:
[
{"actor": "okcapitalbp1", "permission": "active"},
{"actor": "eoshuobipool", "permission": "active"},
{"actor": "eoseouldotio", "permission": "active"},
{"actor": "eoslaomaocom", "permission": "active"},
{"actor": "big.one", "permission": "active"},
{"actor": "helloeoscnbp", "permission": "active"},
{"actor": "eosiomeetone", "permission": "active"},
{"actor": "eoscannonchn", "permission": "active"},
{"actor": "blockpooleos", "permission": "active"},
{"actor": "eosdotwikibp", "permission": "active"},
{"actor": "eosiosg11111", "permission": "active"},
{"actor": "bitfinexeos1", "permission": "active"},
{"actor": "newdex.bp", "permission": "active"},
{"actor": "eosflytomars", "permission": "active"},
{"actor": "starteosiobp", "permission": "active"},
{"actor": "zbeosbp11111", "permission": "active"},
{"actor": "eosasia11111", "permission": "active"},
{"actor": "eosinfstones", "permission": "active"},
{"actor": "whaleex.com", "permission": "active"},
{"actor": "eosrapidprod", "permission": "active"},
{"actor": "cochainworld", "permission": "active"}
]

四、发起多签 proposal
cleos multisig propose_trx updateactive producer_permissions.json sudo_update_all_blacklistacc_active_trx.json hashfineosio

五、查看提案:
cleos get table eosio.msig hashfineosio proposal
{ "rows": [{ "proposal_name": "updateactive", "packed_transaction": "be13a05d00000000000000000000010040359703ea305500000000008054570200000026dd0a305500000000a8ed32320040359703ea305500000000a8ed32327d00000026dd0a30550000000000000000000000000000010000000000ea30550040cbdaa86c52d50190b1ca5ec16c52d500000000a8ed32324390b1ca5ec16c52d500000000a8ed32320000000080ab26a7010000000100039db69730252dc7af792688068959c71aaa8641c92b3e31a2c0950e6b39a0a3af010000000000" } ], "more": false }

六、在群里或社区提醒其他节点approve该提案

cleos multisig approve BP_ACCOUNT updateactive '{"actor": "hashfineosio", "permission": "active"}' -p BP_ACCOUNT
————————————————
版权声明:本文为CSDN博主「kevin昆」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/caokun_8341/article/details/102553597

你可能感兴趣的:(关于使用多签修改EOS黑名单账户权限的流程说明)