pocketnetteam / pocketnet.core

Decentralized social network based on the blockchain
https://pocketnet.app
Apache License 2.0
114 stars 28 forks source link

RPC help command no longer lists any of the pocketnet RPC calls or their related help information. #303

Closed the-real-vortex-v closed 2 years ago

the-real-vortex-v commented 2 years ago

I just went into the debug console on the windows executable and typed in help.

I get a list of all of the normal bitcoin related RPC calls but none of the pocketnet exclusive calls returned.

Expected behavior

The previous versions all showed the pocketnet RPC calls.

Screenshots

21:31:50  == Blockchain == getbestblockhash getblock "blockhash" ( verbosity ) getblockchaininfo getblockcount getblockhash height getblockheader "hash" ( verbose ) getblockstats hash_or_height ( stats ) getchaintips getchaintxstats ( nblocks blockhash ) getdifficulty getmempoolancestors txid (verbose) getmempooldescendants txid (verbose) getmempoolentry txid getmempoolinfo getrawmempool ( verbose ) gettxout "txid" n ( include_mempool ) gettxoutproof ["txid",...] ( blockhash ) gettxoutsetinfo preciousblock "blockhash" pruneblockchain savemempool scantxoutset ( ) verifychain ( checklevel nblocks ) verifytxoutproof "proof"

== Control == getmemoryinfo ("mode") logging ( +category -category ) stop uptime

== Generating == generate nblocks ( maxtries ) generatetoaddress nblocks address (maxtries)

== Mining == getblocktemplate ( TemplateRequest ) getmininginfo getnetworkhashps ( nblocks height ) prioritisetransaction submitblock "hexdata" ( "dummy" ) submitheader "hexdata"

== Network == addnode "node" "add|remove|onetry" clearbanned disconnectnode "[address]" [nodeid] getaddednodeinfo ( "node" ) getconnectioncount getnettotals getnetworkinfo getnodeaddresses ( count ) getpeerinfo getstakinginfo listbanned ping setban "subnet" "add|remove" (bantime) (absolute) setnetworkactive true|false

== Rawtransactions == combinepsbt ["psbt",...] combinerawtransaction ["hexstring",...] converttopsbt "hexstring" ( permitsigdata iswitness ) createpsbt [{"txid":"id","vout":n},...] [{"address":amount},{"data":"hex"},...] ( locktime ) ( replaceable ) createrawtransaction [{"txid":"id","vout":n},...] [{"address":amount},{"data":"hex"},...] ( locktime ) ( replaceable ) decodepsbt "psbt" decoderawtransaction "hexstring" ( iswitness ) decodescript "hexstring" finalizepsbt "psbt" ( extract ) fundrawtransaction "hexstring" ( options iswitness ) getrawtransaction "txid" ( verbose "blockhash" ) sendrawtransaction "hexstring" ( allowhighfees ) signrawtransactionwithkey "hexstring" ["privatekey1",...] ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] sighashtype ) testmempoolaccept ["rawtxs"] ( allowhighfees )

== Util == createmultisig nrequired ["key",...] ( "address_type" ) estimatesmartfee conf_target ("estimate_mode") signmessagewithprivkey "privkey" "message" validateaddress "address" verifymessage "address" "signature" "message"

== Wallet == abandontransaction "txid" abortrescan addmultisigaddress nrequired ["key",...] ( "label" "address_type" ) backupwallet "destination" bumpfee "txid" ( options ) createwallet "wallet_name" ( disable_private_keys ) dumpprivkey "address" dumpwallet "filename" encryptwallet "passphrase" getaddressbook getaddressesbylabel "label" getaddressinfo "address" getbalance ( "(dummy)" minconf include_watchonly ) getnewaddress ( "label" "address_type" ) getprivkeyaddress "private" ( output_type ) getrawchangeaddress ( "address_type" ) getreceivedbyaddress "address" ( minconf ) getreceivedbylabel "label" ( minconf ) getstakereport gettransaction "txid" ( include_watchonly ) getunconfirmedbalance getwalletinfo importaddress "address" ( "label" rescan p2sh ) importmulti "requests" ( "options" ) importprivkey "privkey" ( "label" ) ( rescan ) importprunedfunds importpubkey "pubkey" ( "label" rescan ) importwallet "filename" keypoolrefill ( newsize ) listaddresses listaddressgroupings listlabels ( "purpose" ) listlockunspent listreceivedbyaddress ( minconf include_empty include_watchonly address_filter ) listreceivedbylabel ( minconf include_empty include_watchonly) listsinceblock ( "blockhash" target_confirmations include_watchonly include_removed ) listtransactions (dummy count skip include_watchonly) listunspent ( minconf maxconf ["addresses",...] [include_unsafe] [query_options]) listwallets loadwallet "filename" lockunspent unlock ([{"txid":"txid","vout":n},...]) removeprunedfunds "txid" rescanblockchain ("start_height") ("stop_height") sendmany "" {"address":amount,...} ( minconf "comment" ["address",...] replaceable conf_target "estimate_mode") sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount replaceable conf_target "estimate_mode") sethdseed ( "newkeypool" "seed" ) setlabel "address" "label" settxfee amount signmessage "address" "message" signrawtransactionwithwallet "hexstring" ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] sighashtype ) unloadwallet ( "wallet_name" ) walletcreatefundedpsbt [{"txid":"id","vout":n},...] [{"address":amount},{"data":"hex"},...] ( locktime ) ( replaceable ) ( options bip32derivs ) walletlock walletpassphrase "passphrase" timeout walletpassphrasechange "oldpassphrase" "newpassphrase" walletprocesspsbt "psbt" ( sign "sighashtype" bip32derivs )

== Zmq == getzmqnotifications

Desktop (please complete the following information): Windows 10. Updated to what ever the last update was about a week ago. 21H2 or what ever. I'm using current v20.21 node software debug console.

This issue wasn't present in previous versions of the node. RPC calls are an easy way to facilitate local node access/queries in a fast and easy way for debuging and general use. Please put it back in.

andyoknen commented 2 years ago

This happened because we separated the interfaces for private and public api. Until they got their hands on the implementation of the public help method. We will do it as soon as possible.

the-real-vortex-v commented 2 years ago

Thank you because it makes platform independent interfaces and debugging much easier if there's help and the rpc methods are accessible via public and private rpc. Are public and private rpc calls identical? perhaps that should be made clear when displaying help in the future?

andyoknen commented 2 years ago

They differ both in meaning and content Here is the starting point, where all the methods of the public API that clients work with are indicated. https://github.com/pocketnetteam/pocketnet.core/blob/0.20/src/pocketdb/web/PocketRpc.cpp

the-real-vortex-v commented 2 years ago

Ok. So to clarify and make sure I understand what you are saying: The public and private interfaces are seperated. Help is not working in the public interface.

The debug console is using the public interface or the private interface? Why would you have any real distinction between the two? Is it because one is not encrypted by default? (http instead of https for example?)

andyoknen commented 2 years ago

They are separated due to security issues. Private (port 37071) should not be accessible from the outside - API methods for node and wallet management are located here. Public (port 38081) does not contain any logic related to node management.

andyoknen commented 2 years ago

I raised this question - in fact, everything works for the public interface. You only need to specify the port. Of course, the description of the commands is lame - we have a problem with documentation, somehow it does not merge with this, we need help with documentation.

> pocketcoin-cli -rpcport=38081 help
the-real-vortex-v commented 2 years ago

There should be a bunch of blockchain related stuff exposed on the public rpc. Such as: getbestblockhash getblockcount getblockhash height getchaintips

I can see these being useful for tools to query nodes. Perhaps toggle what can appear in the public rpc via the config file? If you think that's a good idea then opening a feature request might be a good idea.

At the very least getbestblockhash and getblockcount are good ideas.

andyoknen commented 2 years ago

getnodeinfo - gives general information about the node, as well as the last block

To get information about a specific block, the following methods can be used: getcompactblock - Where the first argument is the hash of the block, and the second is the height. Arguments are passed by the principle OR getlastblocks - The first argument is the number, the second is from what height to start counting