Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
add stats handling

See merge request in3/ts/in3!75
  • Loading branch information
simon-jentzsch committed Mar 10, 2020
2 parents 8596ce6 + fe2cdad commit 260d971
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"ethereumjs-util": "6.1.0",
"ethereumjs-vm": "4.1.1",
"ethjs-util": "0.1.4",
"in3-common": "^2.1.3",
"in3-common": "^2.1.4",
"merkle-patricia-tree": "^2.3.1",
"multihashing-async": "^0.5.1",
"protons": "^1.0.1"
Expand Down
4 changes: 4 additions & 0 deletions src/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,10 @@ async function handleRequest(request: RPCRequest[], node: IN3NodeConfig, conf: I
// append the in3-config
const in3: IN3RPCRequestConfig = {} as any

// handle as internal?
if (typeof (conf.stats) === 'boolean' && !conf.stats)
(in3 as any).noStats = true

// only if the node supports chainId, we add it, because if the node is a simple remote-server it might refuse the request with additional keys
if (conf.chainId && canMultiChain(node))
in3.chainId = conf.chainId
Expand Down
3 changes: 3 additions & 0 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ export interface IN3Config {
* example: 0x387a8233c96e1fc0ad5e284353276177af2186e7afa85296f106336e376669f7
*/
key?: any

/** if false, the requests will not be included in the public metrics, but handled as internal */
stats?: boolean
/**
* if true the config will be adjusted depending on the request
*/
Expand Down

0 comments on commit 260d971

Please sign in to comment.