Skip to content

Name History

Ryan edited this page Mar 8, 2019 · 1 revision

Name History

The name_history RPC method returns a complete history of a name.

Name History vs. Game State

The return value is not a game state. No information about a game state is directly obtainable from name_history. Game states and a name's history are very different pieces of information.

A game state tells you the results of name_update operations inside of a game for a particular block.

A name's history, on the other hand, tells you what move a player intended to make, but not the result of that move.

Prerequisites for name_history

In order to use the name_history RPC method, the blockchain must be properly indexed. This imposes additional overhead for storage space.

The default XAYA blockchain configuration avoids this overhead, which consequently means a name_history call will fail by default.

C:\Xaya>xayad.exe -wallet=vault.dat -wallet=game.dat -server -rpcallowip=127.0.0.1 -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqpubgameblocks=tcp://127.0.0.1:28332 -namehistory -reindex

C:\Xaya>xayad.exe -wallet=vault.dat -wallet=game.dat -server -rpcallowip=127.0.0.1 -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqpubgameblocks=tcp://127.0.0.1:28332 -namehistory -rpcuser="cookie" -rpcpassword="ebb5f8bb7db5e0475de30bdd31c1042a6b55552e420c2210a75226b6f6e98588"

C:\Xaya>xayad.exe -wallet=vault.dat -wallet=game.dat -server -rpcallowip=127.0.0.1 -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqpubgameblocks=tcp://127.0.0.1:28332 -namehistory -reindex

xaya-qt -wallet=game.dat -server -rpcallowip=127.0.0.1 -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubrawblock=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -zmqpubgameblocks=tcp://127.0.0.1:28332 -namehistory -reindex

"C:\Users\Renegade\Downloads\xaya_win64_1.1 (1)\xaya_win64_11\xaya-qt.exe"

ThreadRPCServer incorrect password attempt from 127.0.0.1:25468

name_history "name"

Look up the current and all past data for the given name. -namehistory must be enabled.

Arguments:

  1. "name" (string, required) the name to query for

Result: [ { "name": xxxxx, (string) the requested name "name_encoding": xxxxx, (string) the encoding of "name" "name_error": xxxxx, (string) replaces "name" in case there is an error "value": xxxxx, (string) the name's current value "value_encoding": xxxxx, (string) the encoding of "value" "value_error": xxxxx, (string) replaces "value" in case there is an error "txid": xxxxx, (string) the name's last update tx "vout": xxxxx, (numeric) the index of the name output in the last update "address": xxxxx, (string) the address holding the name "ismine": xxxxx, (boolean) whether the name is owned by the wallet "height": xxxxx, (numeric) the name's last update height }, ... ]

Examples:

xaya-cli name_history "myname" curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "name_history", "params": ["myname"] }' -H 'content-type: text/plain;' http://127.0.0.1:8336/

Clone this wiki locally