In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "what are the data types in JSON RPC". In daily operation, I believe that many people have doubts about the data types in JSON RPC. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "what data types in JSON RPC". Next, please follow the editor to study!
JSON is a lightweight data exchange format. It can represent numeric values, strings, ordered value sequences, and collections of name / value pairs.
JSON-RPC is a stateless lightweight remote procedure call (RPC) protocol. The JSON-RPC specification defines the data structure and its processing rules, which are transport-independent and therefore can be applied to socket, HTTP, WebSocket, or other messaging environments. JSON-RPC uses JSON (RFC 4627) as the data format.
Network Transport Settings for Parity
HTTP: listening on port 8545
WebSocket: listening on port 8546
IPC Socket: the listening path is $BASE/jsonrpc.ipc, and the default value on linux is ~ / .local / share/io.parity.ethereum/jsonrpc.ipc.
Data types in JSON RPC
There are several types of data that are passed using JSON. Since JavaScript/JSON does not have native byte arrays and large number types, these two types are specifically designed for Ethernet Square API, both using hexadecimal encoding, but have different formatting requirements.
When encoding a quantitative type (integer or numeric), encode as the most compact hexadecimal and use the 0x prefix, which means that 0 should be encoded as 0x0 instead of 0x00. Examples are as follows:
0x41: decimal 65
0x400: decimal 1024
0x: error! There should be at least one number, such as 0x0
0x0400: error! No leading 0 is required
Ff: error! Must use the prefix 0x
When encoding unformatted data (byte array, account address, hash, bytecode array), the encoding is hexadecimal, using the prefix 0x, and each byte is represented by two hexadecimal digits. For example:
0x41: for "A", 1 byte
0x004200: for "\ 0B\ 0", 3 bytes
0x: for "", zero byte
0xf0f0f: error! Must be even length
004200: error! Must use the prefix 0x
In addition to data and quantity, there are also standard JSON types, which we call STR (string) and INT (integer).
Enable JSON-RPC API for Parity
By default, not all API are exposed. But you can use-- jsonrpc-apis APIS to enable the corresponding API when you start Parity.
A list of API names separated by commas when APIS. Available names include: all, safe, web3, eth, net, personal, parity, parity_set, traces, rpc, parity_accounts, signer. You can use the-prefix to disable a specific api, for example: all,-personal.
The api enabled by default is web3,eth,pubsub,net,parity,parity_pubsub,traces,rpc,secretstore.
Parity's JSON-RPC API list
Basic API of account Management
Personal_ecRecover-recover address from signature
Personal_listAccounts-list all accounts
Personal_newAccount-create a new account
Personal_sendTransaction-send a normal transaction
Personal_sign-calculate ethernet square signature
Personal_sign191-calculate EIP191 compatible signatures
Personal_signTransaction-deal signature
Personal_signTypedData-Type data signature
Personal_unlockAccount-unlock the account
Parity extension API
Parity_allTransactionHashes-get deal pool transaction hash
Parity_allTransactions-get deal pool deal
Parity_call-Serial invocation of multiple transactions
Parity_cidV0-Compute content ID
Parity_composeTransaction-complete the transaction field
Parity_consensusCapability-query consensus capability
Parity_decryptMessage-decrypt the messa
Parity_encryptMessage-encrypted messa
Parity_futureTransactions
Parity_getBlockHeaderByNumber-query block headers
Parity_getBlockReceipts-get all transaction receipts for the block
Parity_hardwarePinMatrixAck-unlock hardware wallet
Parity_listOpenedVaults-enumerates open vaults
Parity_listStorageKeys-enumerates the storage key
Parity_listVaults-list all vaults
Parity_localTransactions-list local transactions
Parity_lockedHardwareAccountsInfo-enumerate locked hardware wallets
Parity_releasesInfo-get release information
Parity_signMessage-calculates the message signature
Parity_submitWorkDetail-submit the POW scheme
Parity_verifySignature-verifies the signature
Parity_versionInfo-get version information
Vault Management API
Parity_changeVault-change the vault of the account
Parity_changeVaultPassword-change the vault password
Parity_closeVault-close the vault
Parity_getVaultMeta-get vault metadata
Parity_newVault-create a vault
Parity_openVault-Open the vault
Parity_setVaultMeta-set up vault metadata
Signature API
Parity_accountsInfo-get account description meta-information
Parity_checkRequest-check whether the request is successful
Parity_defaultAccount-get the default account
Parity_generateSecretPhrase-create mnemonic words
Parity_hardwareAccountsInfo-get hardware wallet account information
Parity_listAccounts-get all addresses
Parity_phraseToAddress-convert mnemonic words to ethernet address
Parity_postSign-request to sign the specified message
Parity_postTransaction-send deal
Mining related API
Parity_defaultExtraData-get default extra data
Parity_extraData-get current additional data
Parity_gasCeilTarget-get the current gas upper limit target
Parity_gasFloorTarget-get the current gas lower limit target
Parity_minGasPrice-get the current lowest gas price
Parity_transactionsLimit-gets the current quota of the transaction queue
Develop related API
Parity_devLogs-get the development log
Parity_devLogsLevels-gets the current log level
Network information API
Parity_chain-get the name of the connected chain
Parity_chainStatus-gets the block chain synchronization status
Parity_gasPriceHistogram-get gas price histogram
Parity_netChain-get chain name [deprecated]
Parity_netPeers-get the connected peer node
Parity_netPort-get listening port
Parity_nextNonce-gets the next available nonce value
Parity_pendingTransactions-get pending deal list
Parity_pendingTransactionsStats-get statistics on pending transactions
Parity_registryAddress-get the address of the registry
Parity_removeTransaction-Delete a local deal
Parity_rpcSettings-gets the current RPC API settings
Parity_unsignedTransactionsCount-get the number of unsigned transactions
Node setting API
Parity_enode-gets the node enode address
Parity_mode-get node operation mode
Parity_nodeKind-get node type
Parity_nodeName-gets the node name
Parity_wsUrl-get the websocket service address
Parity account Management extension API
Parity_allAccountsInfo-get all account description information
Parity_changePassword-change the account password
Parity_deriveAddressHash-specify a new address for hash derivation
Parity_deriveAddressIndex-specify a new address for index derivation
Parity_exportAccount-Export account
Parity_importGethAccounts-Import Geth account
Parity_killAccount-Delete an account
Parity_listGethAccounts-enumerate Geth accounts
Parity_newAccountFromPhrase-create a new account with mnemonic words
Parity_newAccountFromSecret-create a new account with the private key
Parity_newAccountFromWallet-create a new account with a wallet object
Parity_removeAddress-Delete addr
Parity_setAccountMeta-set account metadata
Parity_setAccountName-set account name
Parity_testPassword-Test account password
Parity configuration API
Parity_acceptNonReservedPeers-allow acceptance of non-reserved nodes
Parity_addReservedPeer-add reserved nod
Parity_dropNonReservedPeers-prohibit acceptance of non-reserved nodes
Parity_executeUpgrade-upgrade softwar
Parity_hashContent-calculates the hash of the specified content
Parity_removeReservedPeer-Delete reserved nod
Parity_setAuthor-sets the currency base address
Parity_setChain-set chain specification
Parity_setEngineSigner-set up a consensus signature account
Parity_setExtraData-whether the new block is set successfully
Parity_setGasCeilTarget-sets the upper limit of outbound block gas
Parity_setGasFloorTarget-sets the lower limit of the outgoing block gas
Parity_setMaxTransactionGas-sets the transaction maximum gas
Parity_setMinGasPrice-set the lowest gas price
Parity_setMode-sets the operation mode
Parity_setTransactionsLimit
Parity_upgradeReady-query for upgradeable version
Pairty subscribe to API
Parity_subscribe
Parity_unsubscribe
Signature API
Signer_confirmRequest-confirm the transaction request
Signer_confirmRequestRaw-confirm signed request
Signer_confirmRequestWithToken-confirm the request with a token
Signer_generateAuthorizationToken-generate authorization token
Signer_generateWebProxyAccessToken-generate web proxy access token
Signer_rejectRequest-reject the transaction request
Signer_requestsToConfirm-request waiting for confirmation
Signer_subscribePending-subscribe to pending deal
Signer_unsubscribePending-unsubscribe to pending deal
Trace and debug API
Overview of trace API
Trace_call-trace calls
Trace_callMany-tracks multiple calls
Trace_rawTransaction-traces naked transaction calls
Trace_replayBlockTransactions-track replayed block transactions
Trace_replayTransaction-track replayed transactions
Trace_block-returns the result of block tracking
Trace_filter-filter trace results
Trace_get-extract the tracking results from the specified location
Trace_transaction-extract the tracking results for the specified deal
Whisper extension API
Shh_info
Shh_newKeyPair
Shh_addPrivateKey
Shh_newSymKey
Shh_addSymKey
Shh_getPublicKey
Shh_getPrivateKey
Shh_getSymKey
Shh_deleteKey
Shh_post
Shh_newMessageFilter
Shh_getFilterMessages
Shh_deleteMessageFilter
Shh_subscribe
Shh_unsubscribe
KeyStore API
Overview of secretstore API
Secretstore_decrypt-decrypt the document
Secretstore_encrypt-encrypt the document
Secretstore_generateDocumentKey-generate document key
Secretstore_serversSetHash-Compute Node set Hash
Secretstore_shadowDecrypt-Shadow decryption
Secretstore_signRawHash-Naked Hash signature
At this point, the study of "what are the data types in JSON RPC" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.