Get Shared Database ID#
get_shared_db_idAPI-v2 get_shared_db_id #
The get_shared_db_id method returns a 20-byte identifier (H160) derived from the node’s seed phrase.
It is used as the root folder name for all SQLite databases on the host. • The value is identical for all HD accounts derived from the same seed and different for separate seeds.
Request Parameters#
Parameter Type Required Description None N/A
–
This method has no parameters.
Response Parameters#
Parameter Type Required Description shared_db_id string
✓
42-hex-char (H160) identifier with 0x prefix used for the node's DB directory.
📌 Examples#
JSON Bash Python JavaScript PHP Go Ruby
Copy
{
"userpass" : "RPC_UserP@SSW0RD" ,
"mmrpc" : "2.0" ,
"method" : "get_shared_db_id" ,
"id" : 0
}
Copy
curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "get_shared_db_id",
"id": 0
}'
Copy
import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass" : "RPC_UserP@SSW0RD" ,
"mmrpc" : "2.0" ,
"method" : "get_shared_db_id" ,
"id" : 0
}
response = requests.post(url, json = payload)
print (json.dumps(response.json(), indent = 2 ))
Copy
const payload = {
"userpass" : "RPC_UserP@SSW0RD" ,
"mmrpc" : "2.0" ,
"method" : "get_shared_db_id" ,
"id" : 0
};
const response = await fetch ( "http://127.0.0.1:7783" , {
method: "POST" ,
body: JSON . stringify (payload),
});
console. log ( await response. json ());
Copy
<? php
$payload = <<< ' JSON '
{
"userpass" : "RPC_UserP@SSW0RD" ,
"mmrpc" : "2.0" ,
"method" : "get_shared_db_id" ,
"id" : 0
}
JSON ;
$ch = curl_init ( "http://127.0.0.1:7783" );
curl_setopt ($ch, CURLOPT_POST , true );
curl_setopt ($ch, CURLOPT_POSTFIELDS , $payload);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER , true );
curl_setopt ($ch, CURLOPT_HTTPHEADER , [ 'Content-Type: application/json' ]);
$response = curl_exec ($ch);
curl_close ($ch);
echo $response;
Copy
package main
import (
" bytes "
" fmt "
" io "
" net/http "
)
func main () {
payload := [] byte ( `{"userpass":"RPC_UserP@SSW0RD","mmrpc":"2.0","method":"get_shared_db_id","id":0}` )
resp, err := http. Post ( "http://127.0.0.1:7783" , "application/json" , bytes. NewBuffer (payload))
if err != nil {
panic (err)
}
defer resp.Body. Close ()
body, _ := io. ReadAll (resp.Body)
fmt. Println ( string (body))
}
Copy
require 'net/http'
require 'json'
require 'uri'
uri = URI ( "http://127.0.0.1:7783" )
payload = {
"userpass" : "RPC_UserP@SSW0RD" ,
"mmrpc" : "2.0" ,
"method" : "get_shared_db_id" ,
"id" : 0
}
response = Net :: HTTP . post (uri, payload. to_json , 'Content-Type' => 'application/json' )
puts JSON . pretty_generate ( JSON . parse (response. body ))
Show Get Shared Database ID Response {
"mmrpc" : "2.0" ,
"result" : {
"shared_db_id" : "0x3ca9c5b85e5f3af62f3ae3903f1e2d8d9d7e2c12"
},
"id" : 0
}
Error Types#
Parameter Type Required Description Internal string
–
Unhandled internal error (rare).