Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the use of namespace display name in keva operations #12

Open
kevacoin-project opened this issue Feb 18, 2020 · 1 comment
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@kevacoin-project
Copy link
Owner

Current keva operations (e.g keva_put, keva_get, keva_delete, keva_filter) need the actual namespace Id (prefix 'N'). It would be more convenient if we can simply use the internal display name.

E.g. instead of:

kevacoin-cli keva_namespace test5

{
  "txid": "1b79f58f278e731ba59484c53fc65c472ee1373a7bc559c907336c860c53b36a",
  "namespaceId": "NL5VgsZcmyHANsLjsdvhP8roctBEKC55Nv"
}

kevacoin-cli keva_put NL5VgsZcmyHANsLjsdvhP8roctBEKC55Nv first_key first_value

It can be simplied as:

kevacoin-cli keva_namespace test5
kevacoin-cli keva_put 'test5' first_key first_value

Internally, it searches the namespace with the display name "test5", and find out the namespace Id, and uses the namespace Id for the operation.

Remember that the display name is not unique, which means two namespaces can have the same display name. In this case, maybe we can decline the operation and ask for actual namespace Id.

@kevacoin-project kevacoin-project added enhancement New feature or request good first issue Good for newcomers labels Feb 18, 2020
@kawww
Copy link

kawww commented Mar 8, 2020

I have another idea: add "keva_num block count" to get namespaceid, key and value.

Number is easy to remember and talk. Number is also unique.

I use these command to get data.

`
keva_filter NY36kGYydqRrCtZrKryegKQbecs4JBq7qq ONEONE

[
{
"key": "ONEONE",
"value": "OKOKgogogogogogogNY36kGYydqRrCtZrKryegKQbecs4JBq7qq",
"txid": "ddbb47c78264d06bc5a2790d15610b7bdce9653aaf20874af29611b1fe4abacc",
"vout": 1,
"address": "VF4AZ3T4eWfEVmoWSCEJmVMqMGahcL1GLK",
"height": 29224
}
]
`

`
getblockhash 29224

b375836dd625e26d77a6713a6f2d426fd3d6f9d4781e308c872a714b659713be
`

`
getblock b375836dd625e26d77a6713a6f2d426fd3d6f9d4781e308c872a714b659713be

{
"hash": "b375836dd625e26d77a6713a6f2d426fd3d6f9d4781e308c872a714b659713be",
"confirmations": 4446,
"strippedsize": 1257,
"size": 1726,
"weight": 5497,
"height": 29224,
"version": 536870912,
"versionHex": "20000000",
"merkleroot": "5f0462e42d4429360806004815281f271f64220e9dfed10572144aefb93a0952",
"tx": [
"ab2d2fd5de674d467ba8c87ce016fecbf963644a987597cfa73a45e671709c44",
"ddbb47c78264d06bc5a2790d15610b7bdce9653aaf20874af29611b1fe4abacc",
"10eb71a9792a7e4ea4598ed0f4c3505987a92f296477de44e872753df9eb0f8f"

],
"time": 1583057655,
"mediantime": 1583057009,
"nonce": 1426088432,
"bits": "1d0a6597",
"difficulty": 413097026.6293495,
"chainwork": "000000000000000000000000000000000000000000000000000006d189195507",
"nTx": 3,
"previousblockhash": "994abe4f6dafe8b3d23375a32c74a650a95610cce5f983596f4de0a2b95467df",
"nextblockhash": "f224c441e7e0032fb9d7e58e6f82630e42535c91cfcdca83a90822aa1539c800"
}
`

So we get these txid, we get key and value:

keva_num 29224 1 => ab2d2fd5de674d467ba8c87ce016fecbf963644a987597cfa73a45e671709c44
null
keva_num 29224 2 =>ddbb47c78264d06bc5a2790d15610b7bdce9653aaf20874af29611b1fe4abacc
namespaceid...key...value
keva_num 29224 2 =>10eb71a9792a7e4ea4598ed0f4c3505987a92f296477de44e872753df9eb0f8f
namespaceid...key...value

keva_num 29224

txid1 null
txid2 namespaceid...key...value
txid3 namespaceid...key...value

example: http://galaxyos.io/subscription.php?block=29224

I use size to select the different txid.

http://galaxyos.io/subscription.php?block=29224&sub=503

http://galaxyos.io/subscription.php?block=29224&sub=895

Then every txid, namespaceid, key and value have a number for getting namespaceid, key and value.

29224
29224 503
29224 895

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants