Skip to content

Commit 53150c1

Browse files
authored
Merge pull request #1130 from ethereumjs/add-new-rpc-methods
Client: Add 6 new RPC methods
2 parents 5a86053 + a2e756b commit 53150c1

25 files changed

+5666
-15678
lines changed

package-lock.json

Lines changed: 4415 additions & 15557 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/client/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ to help contributors better understand how the project is organized.
307307
**Components**
308308

309309
- `Chain` [**In Progress**] This class represents the blockchain and is a wrapper around
310-
`ethereumjs-blockchain`. It handles creation of the data directory, provides basic blockchain operations
310+
`@ethereumjs/blockchain`. It handles creation of the data directory, provides basic blockchain operations
311311
and maintains an updated current state of the blockchain, including current height, total difficulty, and
312312
latest block.
313313
- `Server` This class represents a server that discovers new peers and handles incoming and dropped
@@ -328,11 +328,11 @@ to help contributors better understand how the project is organized.
328328
- `Handler` Subclasses of this class implements a protocol message handler. Handlers respond to incoming requests from peers.
329329
- `EthHandler` [**In Progress**] Handles incoming ETH requests
330330
- `LesHandler` [**In Progress**] Handles incoming LES requests
331-
- `Service` Subclasses of `Service` will implement specific functionality of a `Node`. For example, the `EthereumService` subclasses will synchronize the blockchain using the full or light sync protocols. Each service must specify which protocols it needs and define a `start()` and `stop()` function.
331+
- `Service` Subclasses of `Service` will implement specific functionality of a `Client`. For example, the `EthereumService` subclasses will synchronize the blockchain using the full or light sync protocols. Each service must specify which protocols it needs and define a `start()` and `stop()` function.
332332
- `FullEthereumService` [**In Progress**] Implementation of ethereum full sync.
333333
- `LightEthereumService` [**In Progress**] Implementation of ethereum light sync.
334334
- `WhisperService` [**Not Started**] Implementation of an ethereum whisper node.
335-
- `Node` [**In Progress**] Represents the top-level ethereum node, and is responsible for managing the lifecycle of included services.
335+
- `Client` [**In Progress**] Represents the top-level ethereum client, and is responsible for managing the lifecycle of included services.
336336
- `RPCManager` [**In Progress**] Implements an embedded JSON-RPC server to handle incoming RPC requests.
337337

338338
## Developer

packages/client/lib/rpc/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import * as modules from './modules'
99
/**
1010
* get all methods. e.g., getBlockByNumber in eth module
1111
* @private
12-
* @param {Object} mod
13-
* @return {string[]}
12+
* @param Object mod
13+
* @returns string[]
1414
*/
1515
function getMethodNames(mod: any): string[] {
1616
return Object.getOwnPropertyNames(mod.prototype)

packages/client/lib/rpc/modules/admin.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { bufferToHex } from 'ethereumjs-util'
2-
import { Chain } from '../../blockchain'
3-
import { EthProtocol } from '../../net/protocol'
4-
import { RlpxServer } from '../../net/server'
5-
import EthereumClient from '../../client'
6-
import { EthereumService } from '../../service'
72
import { getClientVersion } from '../../util'
83
import { middleware } from '../validation'
4+
import type { Chain } from '../../blockchain'
5+
import type { EthProtocol } from '../../net/protocol'
6+
import type { RlpxServer } from '../../net/server'
7+
import type EthereumClient from '../../client'
8+
import type { EthereumService } from '../../service'
99

1010
/**
1111
* admin_* RPC module
@@ -18,7 +18,7 @@ export class Admin {
1818

1919
/**
2020
* Create admin_* RPC module
21-
* @param {client} EthereumClient to which the module binds
21+
* @param client Client to which the module binds
2222
*/
2323
constructor(client: EthereumClient) {
2424
const service = client.services.find((s) => s.name === 'eth') as EthereumService
@@ -32,7 +32,7 @@ export class Admin {
3232
/**
3333
* Returns information about the currently running node.
3434
* see for reference: https://geth.ethereum.org/docs/rpc/ns-admin#admin_nodeinfo
35-
* @param {*} [params] An empty array
35+
* @param params An empty array
3636
*/
3737
async nodeInfo(_params: []) {
3838
const rlpxInfo = (this._client.server('rlpx') as RlpxServer).getRlpxInfo()

0 commit comments

Comments
 (0)