A
A
ahantari2020-06-15 14:43:13
go
ahantari, 2020-06-15 14:43:13

How to issue this Json request in Goland?

Hi all! Please tell me how to issue this Json request in Goland so that it can be displayed in the terminal...

// Запрос 
    {
        "id": 1,
        "jsonrpc": "2.0",
        "method": "fetch-history",
        "params":
        {
            "address": "0x00fa2a5279f8f0fd2f0f9d3280ad70403f01f9d62f52373833",
            "beginTx": 1,
            "countTxs": 2
        }
    }
// Ответ
    {
        "id": 1,
        "result":
        [
            {
                "from": "InitialWalletTransaction",
                "to": "0x00fa2a5279f8f0fd2f0f9d3280ad70403f01f9d62f52373833",
                "value": 619328,
                "transaction": "d1f69192f26db7a1abdc2a0931d1a891e6967db1bd207c54c8af04e8ffd25fd5",
                "data": "",
                "timestamp": 1565049600,
                "type": "forging",
                "blockNumber": 1328547,
                "blockIndex": 24403,
                "signature": "",
                "publickey": "",
                "fee": 0,
                "realFee": 0,
                "nonce": 0,
                "intStatus": 101,
                "status": "ok"
            },
            {
                "from": "0x002a3e8f2714b25df4cab166a611834ebf4158daf5c2855886",
                "to": "0x00fa2a5279f8f0fd2f0f9d3280ad70403f01f9d62f52373833",
                "value": 1000000,
                "transaction": "592e362bd16e11efe576f1cdcdc04fee7f0180f7e999678a1d858a98e558f42a",
                "data": "",
                "timestamp": 1565045672,
                "type": "block",
                "blockNumber": 1328526,
                "blockIndex": 7,
                "signature": "3046022100e97406cc8527a0d88d5e80928d6e0da9aa2e442c7a5844370fb130dfc210678e022100bb8459d4ae56b980666049df910fb8ac1032286f83757470fb53d633e4150e92",
                "publickey": "3059301306072a8648ce3d020106082a8648ce3d0301070342000458f1c1b9c923cb1c52e35c35b647f80518e738eb69fe06cb2af77d7c2f0ab28cd0b8cab4231ac3b1aa61ec2d0c4ed8bd9714fac83513a170c5fe8bd3d970db7c",
                "fee": 0,
                "realFee": 0,
                "nonce": 14,
                "intStatus": 20,
                "status": "ok"
            }
        ]
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Kaznacheev, 2020-06-18
@Color

Goland won't help here. You need to implement a JSON-RPC handler (obviously) that does something under the hood and returns something.
It is also obvious that some kind of logic is needed that, upon request, will collect this response from somewhere, and return it either as a response over the network, or display it in the terminal.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question