personal_importValKey

描述:导入验证者私钥,使用新的加密密码重新加密后存储在本地。

parameter

数据类型 描述
string 使用 personal_exportValKey 导出的验证者私钥
string 使用 personal_exportValKey 导出时设置的加密密码
string 重新设置 valKey 密码

return

参数名 数据类型 描述
address string 账户地址
mainPubKey string 已压缩的共识公钥
blsPubKey string 已压缩的 BLS 公钥

example

Request:

curl -X POST \
  http://127.0.0.1:8283 \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "personal_importValKey", "params": ["0x7b2261646472657373223a2233333066633236313662396439303130623862623864343365643333313664363735366561616336222c2263727970746f223a7b22636970686572223a226165732d3132382d637472222c2263697068657274657874223a226236633331393734373261323934646163363634633363616330373262333632396165633162303938616465613833333233396331613062636261323861343631336235396365363634313964326432386634386664333337336530363739346138643534306563636632306364356562623032363933386264363366383435222c22636970686572706172616d73223a7b226976223a223334383638643132656665316434633530326561303531373166616365653339227d2c226b6466223a22736372797074222c226b6466706172616d73223a7b22646b6c656e223a33322c226e223a3236323134342c2270223a312c2272223a382c2273616c74223a2233653033303038303363393331633563313637326266303839363061326562353830356138346366333131626430373732376132616233363438663765643564227d2c226d6163223a2239333839366332393166646131326130326237383839323134343530663536353034663831616436353762663934323965393566363230346666383062376137227d2c226964223a2265356639303763382d663462622d313165392d623630322d313836353930643433366437222c2276657273696f6e223a337d", "123456", "123"]}'

Response:

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "address": "0x330fC2616b9d9010B8BB8d43eD3316d6756EaAC6",
        "mainPubKey": "0x033a4586e7ef86a0f50960c4bef7b9c75bcb3d7f7929e5bbb74ac19f3091ff808e",
        "blsPubKey": "0x960a63207d957a14c0e495a58422264de76d2e0a989b67c2433792697ff7a828efa6532956d07d405b07fb7fce4b21b10036a9e3bbb1e9c766097e6bd99cd57f7a2faf5af418901ea6ea36ae0aed4e3ad9b00781decdd58bc646147020019290"
    }
}