-
Notifications
You must be signed in to change notification settings - Fork 14
rpc errors
- example
{
"jsonrpc": "2.0",
"id": 1,
"method": "ledger_accountInfo",
"params": [
"qlc_18f1pbm1hb56ujmx1c9bjyp5wnwmcdxygajkh5cb5dmayddtfps9a5hiooue"
]
}
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32000,
"message": "account not found"
}
}There are similar errors, like block/ token/pending transaction/ frontier/ representation/ pov xxx/ block link/... not found
This error indicates that the query content does not exist on gqlc chain.
- example
{
"jsonrpc": "2.0",
"id": 18,
"method": "ledger_process",
"params": [
{
"type": "Open",
"token": "a7e8fa30c063e96a489a47bc43909505bd86735da4a109dca28be936118a8582",
"address": "qlc_17mppebrj5kocjtr9i1wfxa1ooc9xqtgyqbemgr8wsjxck1xmcppp9abciaf",
"balance": "2000000000000",
"vote": "0",
"network": "0",
"storage": "0",
"oracle": "0",
"previous": "0000000000000000000000000000000000000000000000000000000000000000",
"link": "d1984dbe427a7bee231eff836b2d15b3f3f90e9da6ff947a9ab1d35c408999ff",
"message": "0000000000000000000000000000000000000000000000000000000000000000",
"povHeight": 0,
"timestamp": 1587972646,
"extra": "0000000000000000000000000000000000000000000000000000000000000000",
"representative": "qlc_3hw8s1zubhxsykfsq5x7kh6eyibas9j3ga86ixd7pnqwes1cmt9mqqrngap4",
"work": "0000000000000000",
"signature": "de75be6e25cf8a8a2181b80862008507261da71e084f1153d1fb1cb7459c31c3204045570bbeed5097eceaf6a9287a12d231a9ff4ddc3729ee86e87797e7490b"
}
]
}
{
"jsonrpc": "2.0",
"id": 18,
"error": {
"code": -32000,
"message": "60450af084ecee2991808db8e04cc899a043d9ae31c3cf2063f1e267e24df6da[Open]: gap source: d1984dbe427a7bee231eff836b2d15b3f3f90e9da6ff947a9ab1d35c408999ff"
}
}This error is returned by ledger_process, it indicates that the block check failed before broadcast, the common reason include gap source/gap previous/fork/old/bad work/bad signature etc.
- example
{
"jsonrpc": "2.0",
"id": 2,
"method": "ledger_generateOnlineBlock",
"params": [
qlc_17mppebrj5kocjtr9i1wfxa1ooc9xqtgyqbemgr8wsjxck1xmcppp9abciaf,
e61fac2893c6efc3b42f7ad82f12c704ae1bee6d4195d997b1d7e440f8caaa82af612f95865dd961880c2ba6bca56ca97ad28e7c54c117dfcdb758d4de9a4174,
1
]
}
{
"jsonrpc": "2.0",
"id": 2,
"error": {
"code": -32000,
"message": "account[qlc_17mppebrj5kocjtr9i1wfxa1ooc9xqtgyqbemgr8wsjxck1xmcppp9abciaf] has no chain token"
}
}This error indicates that the account does not have chain token. it needs to send some chain token to the account
- example
{
"jsonrpc": "2.0",
"id": 2,
"method": "ledger_generateSendBlock",
"params": [
{
"from": "qlc_3hw8s1zubhxsykfsq5x7kh6eyibas9j3ga86ixd7pnqwes1cmt9mqqrngap4",
"tokenName": "QLC",
"to": "qlc_17mppebrj5kocjtr9i1wfxa1ooc9xqtgyqbemgr8wsjxck1xmcppp9abciaf",
"amount": "2000000000000"
},
"abaabdd687fe3f2e2a947d1a29566a868e46431767402ef9a073ffd17f6bd2aabf86c83fb4bfb9f49b9b8fa593c8cf4128c9e21720c487565b52fc6640a9e823"
]
}
{
"jsonrpc": "2.0",
"id": 2,
"error": {
"code": -32000,
"message": "send address (qlc_3hw8s1zubhxsykfsq5x7kh6eyibas9j3ga86ixd7pnqwes1cmt9mqqrngap4) is mismatch privateKey"
}
}
This error is returned by generate block api, it indicates that the block address and the private key are not match. please check whether the private key is correct.
- example
{
"jsonrpc": "2.0",
"id": 2,
"method": "ledger_generateChangeBlock",
"params": [
"qlc_3du37ycreqgse861rcx8qkkpscdttc99ro834zhwuftrtmhbnidnmrkyz4xr",
"qlc_17mppebrj5kocjtr9i1wfxa1ooc9xqtgyqbemgr8wsjxck1xmcppp9abciaf",
"e61fac2893c6efc3b42f7ad82f12c704ae1bee6d4195d997b1d7e440f8caaa82af612f95865dd961880c2ba6bca56ca97ad28e7c54c117dfcdb758d4de9a4174"
]
}
{
"jsonrpc": "2.0",
"id": 2,
"error": {
"code": -32000,
"message": "invalid representative[qlc_17mppebrj5kocjtr9i1wfxa1ooc9xqtgyqbemgr8wsjxck1xmcppp9abciaf]"
}
}if you want to set a representative to a account, but the representative's account does not exist on gqlc chain, it will return this error.
please open account for the representative or use a new representative.
- example
{
"jsonrpc": "2.0",
"id": 1,
"method": "pledge_getPledgeData"
}
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32000,
"message": "parameter is nil"
}
}This error indicates that the method need parameters ,but request not supplied.
please check the document for the correct parameters
- example
{
"jsonrpc": "2.0",
"id": 1,
"method": "ledger_accountHistoryTopn",
"params": [
"qlc_3hw8s1zubhxsykfsq5x7kh6eyibas9j3ga86ixd7pnqwes1cmt9mqqrngap4",
-1
]
}
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32000,
"message": "err count"
}
}This error often appears in the query interface with pagination. as a rule, the count means number to return, it should be greater than 0, and offset means the index where to start, it should be greater than or equal to 0 or omitted
- example
{
"jsonrpc": "2.0",
"id": 1,
"method": "ledger_tokenInfoById",
"params": [
"a7e8fa30c063e96a489a47bc43909505bd86735da4a109dca28be936118a8582"
]
}
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32000,
"message": "can not find token a7e8fa30c063e96a489a47bc43909505bd86735da4a109dca28be936118a8582"
}
}when you send a transaction or query token info , if return this error, it indicates that the token not exist on the gqlc chain, please check whether token name or token hash is correct.
- example
{
"jsonrpc": "2.0",
"id": 2,
"method": "ledger_generateSendBlock",
"params": [
{
"from": "qlc_18f1pbm1hb56ujmx1c9bjyp5wnwmcdxygajkh5cb5dmayddtfps9a5hiooue",
"tokenName": "QLC",
"to": "qlc_3du37ycreqgse861rcx8qkkpscdttc99ro834zhwuftrtmhbnidnmrkyz4xr",
"amount": "20000000000000000"
},
"d127d488ba18cfc6454f1e04a5bc96218c7461e879b268188018cf99432c22191676b313888e55547583c01c6f500ad547edf4ef5d2c9bb06e663d5481d9aad6"
]
}
{
"jsonrpc": "2.0",
"id": 2,
"error": {
"code": -32000,
"message": "pov sync is not finished, please check it"
}
}This error indicates that pov status is not ready yet. please wait a minute or check the connection status of the node
- example
{
"jsonrpc": "2.0",
"id": 1,
"methods": "ledger_chain",
"param": [
"c50f886056d289f77f889bfd4e70f3b334e04c11e499605c161d420a8933b739",
10
]
}
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32600,
"message": "invalid request"
}
}This error indicates that received message isn't a valid request. please check whether if request message with a invalid ID or the keyword is not correct
in the example, methods should be modified to method
- example:
{
"jsonrpc": "2.0",
"id": 18,
"method": "chain_invalidmethod"
}
{
"jsonrpc": "2.0",
"id": 18,
"error": {
"code": -32601,
"message": "the method chain_invalidmethod does not exist/is not available"
}
}This error indicates that the called method does not exist, please check whether the method name is correct
- example
{
"jsonrpc": "2.0",
"id": 1,
"method": "ledger_chain",
"params": [
"c50f886056d289f77f889bfd4e70f3b334e04c11e499605c161d420a8933b739",
"500"
]
}
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32602,
"message": "invalid argument 1: json: cannot unmarshal string into Go value of type int"
}
}This error indicates that unable to decode supplied parameters. please check whether the parameters type is correct
in the example, the second parameter shoud be a int , but a string is supplied
- example
{
"jsonrpc": "2.0",
"id": 1,
"method": "ledger_chain",
"params": [
"c50f886056d289f77f889bfd4e70f3b334e04c11e499605c161d420a8933b739"
]
}
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32602,
"message": "missing value for required argument 0"
}
}This error indicates an invalid number of parameters. please check whether the number of parameters is correct.
in the example, actually requires two parameters, but only one is supplied
- example
{
"jsonrpc": "2.0",
"id": 18,
"method": "ledger_chain",
"params: [
"c50f886056d289f77f889bfd4e70f3b334e04c11e499605c161d420a8933b739",
500
]
}
{
"jsonrpc": "2.0",
"id": null,
"error": {
"code": -32700,
"message": "parse error"
}
}
This error indicates that invalid JSON was received by the server. please check whether the request message is a accurate json format.
in the example , params missing a quote, so it's not a legal json format
QLC Chain Team