Skip to content

Commit 3d2afd7

Browse files
Seonpyo KimHoOngEe
Seonpyo Kim
authored andcommitted
Add newly implemented RPCs to spec file
1 parent 300c541 commit 3d2afd7

File tree

1 file changed

+159
-0
lines changed

1 file changed

+159
-0
lines changed

spec/JSON-RPC.md

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,11 @@ When `Transaction` is included in any response, there will be an additional fiel
323323
* [mempool_getTransactionResultsByTracker](#mempool_getTransactionResultsByTracker)
324324
* [mempool_getPendingTransactions](#mempool_getpendingtransactions)
325325
* [mempool_getPendingTransactionsCount](#mempool_getpendingtransactionscount)
326+
* [mempool_getBannedAccounts](#mempool_getbannedaccounts)
327+
* [mempool_unbanAccounts](#mempool_unbanaccounts)
328+
* [mempool_banAccounts](#mempool_banaccounts)
329+
* [mempool_registerImmuneAccounts](#mempool_registerimmuneaccounts)
330+
* [mempool_getRegisteredImmuneAccounts](#mempool_getregisteredimmuneaccounts)
326331
***
327332
* [engine_getCoinbase](#engine_getcoinbase)
328333
* [engine_getBlockReward](#engine_getblockreward)
@@ -1803,6 +1808,160 @@ Returns a count of the transactions that have insertion_timestamps within the gi
18031808

18041809
[Back to **List of methods**](#list-of-methods)
18051810

1811+
## mempool_banAccounts
1812+
Register accounts to the mempool's banned account list. The mempool would not import the transactions from the users on the list.
1813+
1814+
### Params
1815+
1. prisoner_list: `PlatformAccount[]`
1816+
1817+
### Returns
1818+
`null`
1819+
1820+
Errors: `Invalid params`
1821+
1822+
### Request Example
1823+
```
1824+
curl \
1825+
-H 'Content-Type: application/json' \
1826+
-d '{"jsonrpc": "2.0", "method": "mempool_getBannedAccounts", "params": [], "id": null}' \
1827+
localhost:8080
1828+
```
1829+
1830+
### Response Example
1831+
```
1832+
{
1833+
"jsonrpc": "2.0",
1834+
"result": null,
1835+
"id": null
1836+
}
1837+
```
1838+
1839+
[Back to **List of methods**](#list-of-methods)
1840+
1841+
## mempool_unbanAccounts
1842+
Release accounts from the mempool's banned account list.
1843+
1844+
### Params
1845+
1. trusty_list: `PlatformAccount[]`
1846+
1847+
### Returns
1848+
`null`
1849+
1850+
Errors: `Invalid params`
1851+
1852+
### Request Example
1853+
```
1854+
curl \
1855+
-H 'Content-Type: application/json' \
1856+
-d '{"jsonrpc": "2.0", "method": "mempool_unbanAccounts", "params": [["tccq9h7vnl68frvqapzv3tujrxtxtwqdnxw6yamrrgd"]], "id": null}' \
1857+
localhost:8080
1858+
```
1859+
1860+
### Response Example
1861+
```
1862+
{
1863+
"jsonrpc": "2.0",
1864+
"result": null,
1865+
"id": null
1866+
}
1867+
```
1868+
1869+
[Back to **List of methods**](#list-of-methods)
1870+
1871+
## mempool_getBannedAccounts
1872+
Returns accounts banned for propagating transactions which cause syntax errors or runtime errors.
1873+
1874+
### Params
1875+
No parameters
1876+
1877+
### Returns
1878+
`PlatformAddress[]`
1879+
1880+
Error: `Invalid params`
1881+
1882+
### Request Example
1883+
```
1884+
curl \
1885+
-H 'Content-Type: application/json' \
1886+
-d '{"jsonrpc": "2.0", "method": "mempool_getBannedAccounts", "params": [], "id": null}' \
1887+
localhost:8080
1888+
```
1889+
1890+
### Response Example
1891+
```
1892+
{
1893+
"jsonrpc": "2.0",
1894+
"result": [
1895+
"tccq9h7vnl68frvqapzv3tujrxtxtwqdnxw6yamrrgd"
1896+
],
1897+
"id": null
1898+
}
1899+
```
1900+
1901+
[Back to **List of methods**](#list-of-methods)
1902+
1903+
## mempool_registerImmuneAccounts
1904+
Register accounts immune from getting banned. The trasactions from these accounts would never be rejected for the reason they are malicious.
1905+
1906+
### Params
1907+
1. immune_user_list: `PlatformAccount[]`
1908+
1909+
### Returns
1910+
`null`
1911+
1912+
Error: `Invalid params`
1913+
1914+
### Request Example
1915+
```
1916+
curl \
1917+
-H 'Content-Type: application/json' \
1918+
-d '{"jsonrpc": "2.0", "method": "mempool_registerImmuneAccounts", "params": [["tccq9h7vnl68frvqapzv3tujrxtxtwqdnxw6yamrrgd"]], "id": null}' \
1919+
localhost:8080
1920+
```
1921+
1922+
### Response Example
1923+
```
1924+
{
1925+
"jsonrpc": "2.0",
1926+
"result": null,
1927+
"id": null
1928+
}
1929+
```
1930+
1931+
[Back to **List of methods**](#list-of-methods)
1932+
1933+
## mempool_getRegisteredImmuneAccounts
1934+
Gets immune accounts registered by `mempool_registerImmuneAccounts`.
1935+
1936+
### Params
1937+
No parameters
1938+
1939+
### Returns
1940+
`PlatformAccount[]`
1941+
1942+
Error: `Invalid params`
1943+
1944+
### Request Example
1945+
```
1946+
curl \
1947+
-H 'Content-Type: application/json' \
1948+
-d '{"jsonrpc": "2.0", "method": "mempool_getImmuneAccounts", "params": [], "id": null}' \
1949+
localhost:8080
1950+
```
1951+
1952+
### Response Example
1953+
```
1954+
{
1955+
"jsonrpc": "2.0",
1956+
"result": [
1957+
"tccq9h7vnl68frvqapzv3tujrxtxtwqdnxw6yamrrgd"
1958+
],
1959+
"id": null
1960+
}
1961+
```
1962+
1963+
[Back to **List of methods**](#list-of-methods)
1964+
18061965
## engine_getCoinbase
18071966
Gets coinbase's account id.
18081967

0 commit comments

Comments
 (0)