6 月 262018
 

创世账号信息

AccountID:rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh
MasterSeed/Secret:snoPBrXtMeMyMHUVTgbuqAfg1SUTb
TotalCoins:100000000000000000

为创世账号生成和启用RegularKey并禁用MasterSeed
1)生成RegularKey

curl -k -H 'Content-Type: application/json' -X POST -d '
{
"method": "wallet_propose",
"params": [
{
"key_type": "secp256k1"
}
]
}' http://localhost:8008
{"result":{"account_id":"ratab3YWDfFXn5HXSpeHmU8ybZ9MNMJLHR","key_type":"secp256k1","master_key":"PIT FED BAY JUKE TRUE SUB NEST ADDS BURY VETO HANG WIRE","master_seed":"sawgEVr2AyVsekSKdng9yvD2hxHTd","master_seed_hex":"F93759FA841DA9C37C04EF5119680234","public_key":"aBRrpkhvwV66hCtNpZcuz3vJvRZLNbUiP3nLDavj6Z5jJB21G7GR","public_key_hex":"0390D540145E7FEABA03948D2E2F438A5F5BEB9DAC6CDC1CFE8F09C4FB1EBD68A3","status":"success"}}

2)为创世账号启用RegularKey

curl -k -H 'Content-Type: application/json' -X POST -d '
{
"method": "sign",
"params": [
{
"tx_json": {
"TransactionType": "SetRegularKey",
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"RegularKey": "ratab3YWDfFXn5HXSpeHmU8ybZ9MNMJLHR"
},
"secret": "snoPBrXtMeMyMHUVTgbuqAfg1SUTb"
}
]
}' http://localhost:8008
{"result":{"status":"success","tx_blob":"1200052280000000240000000168400000000000000A73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074473045022100C9D3479A4CBA7620CBDFFE34B60DAA9566FF429235D3D9DB6DB9DA8A57AF7F02022042B43C0975C1B130654E53AEAAFBB37420FE82B06FF2F673F8D7D14BB45B85728114B5F762798A53D543A014CAF8B297CFF8F2F937E888144082820A7E5AB5992534142CEA0D78151D9E9915","tx_json":{"Account":"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh","Fee":"10","Flags":2147483648,"RegularKey":"ratab3YWDfFXn5HXSpeHmU8ybZ9MNMJLHR","Sequence":1,"SigningPubKey":"0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020","TransactionType":"SetRegularKey","TxnSignature":"3045022100C9D3479A4CBA7620CBDFFE34B60DAA9566FF429235D3D9DB6DB9DA8A57AF7F02022042B43C0975C1B130654E53AEAAFBB37420FE82B06FF2F673F8D7D14BB45B8572","hash":"DE38DC47C9CDF7B7576F7AC0C6F075C7BF18824B29A3EEAA2351E6E841B07C54"}}}
{
"result" : {
"engine_result" : "tesSUCCESS",
"engine_result_code" : 0,
"engine_result_message" : "The transaction was applied. Only final in a validated ledger.",
"status" : "success",
"tx_blob" : "1200052280000000240000000168400000000000000A73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074473045022100C9D3479A4CBA7620CBDFFE34B60DAA9566FF429235D3D9DB6DB9DA8A57AF7F02022042B43C0975C1B130654E53AEAAFBB37420FE82B06FF2F673F8D7D14BB45B85728114B5F762798A53D543A014CAF8B297CFF8F2F937E888144082820A7E5AB5992534142CEA0D78151D9E9915",
"tx_json" : {
"Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"Fee" : "10",
"Flags" : 2147483648,
"RegularKey" : "ratab3YWDfFXn5HXSpeHmU8ybZ9MNMJLHR",
"Sequence" : 1,
"SigningPubKey" : "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"TransactionType" : "SetRegularKey",
"TxnSignature" : "3045022100C9D3479A4CBA7620CBDFFE34B60DAA9566FF429235D3D9DB6DB9DA8A57AF7F02022042B43C0975C1B130654E53AEAAFBB37420FE82B06FF2F673F8D7D14BB45B8572",
"hash" : "DE38DC47C9CDF7B7576F7AC0C6F075C7BF18824B29A3EEAA2351E6E841B07C54"
}
}
}

3)发起AccountSet交易禁用创世账号的MasterSeed(最后一次使用MasterSeed)(asfDisableMaster)

curl -k -H 'Content-Type: application/json' -X POST -d '
{
"method": "sign",
"params": [
{
"offline": false,
"secret": "snoPBrXtMeMyMHUVTgbuqAfg1SUTb",
"tx_json": {
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"SetFlag": 4,
"TransactionType": "AccountSet"
},
"fee_mult_max": 10
}
]
}' localhost:8008
{"result":{"status":"success","tx_blob":"1200032280000000240000000220210000000468400000000000000A73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD0207446304402205D6C52A67E5A596955B4E9466B8869762EA9D655EAE4F03FD901ACE2DB506936022050CB5DDF494BF7625516814DDAD938E329E4147FE34CB6AC1AD433719E21FC8B8114B5F762798A53D543A014CAF8B297CFF8F2F937E8","tx_json":{"Account":"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh","Fee":"10","Flags":2147483648,"Sequence":2,"SetFlag":4,"SigningPubKey":"0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020","TransactionType":"AccountSet","TxnSignature":"304402205D6C52A67E5A596955B4E9466B8869762EA9D655EAE4F03FD901ACE2DB506936022050CB5DDF494BF7625516814DDAD938E329E4147FE34CB6AC1AD433719E21FC8B","hash":"328C416EBD9B8BD336018D4ED1D57FBD591309560BC5D7F915A80F8678456981"}}}
{
"result" : {
"engine_result" : "tesSUCCESS",
"engine_result_code" : 0,
"engine_result_message" : "The transaction was applied. Only final in a validated ledger.",
"status" : "success",
"tx_blob" : "1200032280000000240000000220210000000468400000000000000A73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD0207446304402205D6C52A67E5A596955B4E9466B8869762EA9D655EAE4F03FD901ACE2DB506936022050CB5DDF494BF7625516814DDAD938E329E4147FE34CB6AC1AD433719E21FC8B8114B5F762798A53D543A014CAF8B297CFF8F2F937E8",
"tx_json" : {
"Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"Fee" : "10",
"Flags" : 2147483648,
"Sequence" : 2,
"SetFlag" : 4,
"SigningPubKey" : "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"TransactionType" : "AccountSet",
"TxnSignature" : "304402205D6C52A67E5A596955B4E9466B8869762EA9D655EAE4F03FD901ACE2DB506936022050CB5DDF494BF7625516814DDAD938E329E4147FE34CB6AC1AD433719E21FC8B",
"hash" : "328C416EBD9B8BD336018D4ED1D57FBD591309560BC5D7F915A80F8678456981"
}
}
}

4)查看创世账号的RegularKey启用状态及余额

{
"result" : {
"account_data" : {
"Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"Balance" : "99999999999999980",
"Flags" : 1114112,
"LedgerEntryType" : "AccountRoot",
"OwnerCount" : 0,
"PreviousTxnID" : "328C416EBD9B8BD336018D4ED1D57FBD591309560BC5D7F915A80F8678456981",
"PreviousTxnLgrSeq" : 27079,
"RegularKey" : "ratab3YWDfFXn5HXSpeHmU8ybZ9MNMJLHR",
"Sequence" : 3,
"index" : "2B6AC232AA4C4BE41BF49D2459FA4A0347E1B543A4C92FCEE0821C0201E2E9A8"
},
"ledger_current_index" : 27100,
"status" : "success",
"validated" : false
}
}

5)测试(使用创世账号原始MasterSeed发起一笔空AccountSet交易)

curl -k -H 'Content-Type: application/json' -X POST -d '
{
"method": "sign",
"params": [
{
"offline": false,
"secret": "snoPBrXtMeMyMHUVTgbuqAfg1SUTb",
"tx_json": {
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"TransactionType": "AccountSet"
},
"fee_mult_max": 10
}
]
}' localhost:8008
{"result":{"error":"masterDisabled","error_code":23,"error_message":"Master key is disabled.","request":{"command":"sign","fee_mult_max":10,"offline":false,"secret":"snoPBrXtMeMyMHUVTgbuqAfg1SUTb","tx_json":{"Account":"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh","TransactionType":"AccountSet"}},"status":"error"}}

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据