> ## Documentation Index
> Fetch the complete documentation index at: https://voltaire.tevm.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# primitives/NodeInfo

> Auto-generated API documentation

[**@tevm/voltaire**](../index.mdx)

***

[@tevm/voltaire](../index.mdx) / primitives/NodeInfo

# primitives/NodeInfo

## Type Aliases

### NodeInfoType

> **NodeInfoType** = `object`

Defined in: [src/primitives/NodeInfo/NodeInfoType.ts:17](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/NodeInfo/NodeInfoType.ts#L17)

Node information structure from admin\_nodeInfo RPC method

Contains metadata about the local Ethereum node including:

* Network identity (enode, ID, IP)
* Protocol information
* Chain state (genesis, head, difficulty)
* Listening ports

#### See

[https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-admin#admin-nodeinfo](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-admin#admin-nodeinfo)

#### Properties

##### enode

> `readonly` **enode**: [`PeerIdType`](PeerId.mdx#peeridtype)

Defined in: [src/primitives/NodeInfo/NodeInfoType.ts:19](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/NodeInfo/NodeInfoType.ts#L19)

Enode URL of the node

##### id

> `readonly` **id**: `string`

Defined in: [src/primitives/NodeInfo/NodeInfoType.ts:21](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/NodeInfo/NodeInfoType.ts#L21)

Node ID (hex-encoded public key)

##### ip

> `readonly` **ip**: `string`

Defined in: [src/primitives/NodeInfo/NodeInfoType.ts:23](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/NodeInfo/NodeInfoType.ts#L23)

External IP address

##### listenAddr

> `readonly` **listenAddr**: `string`

Defined in: [src/primitives/NodeInfo/NodeInfoType.ts:25](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/NodeInfo/NodeInfoType.ts#L25)

Listen address (IP:PORT)

##### name

> `readonly` **name**: `string`

Defined in: [src/primitives/NodeInfo/NodeInfoType.ts:27](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/NodeInfo/NodeInfoType.ts#L27)

Client identifier (e.g., "Geth/v1.10.26-stable/linux-amd64/go1.19.5")

##### ports

> `readonly` **ports**: `object`

Defined in: [src/primitives/NodeInfo/NodeInfoType.ts:29](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/NodeInfo/NodeInfoType.ts#L29)

Network ports

###### discovery

> `readonly` **discovery**: `number`

UDP discovery port

###### listener

> `readonly` **listener**: `number`

TCP listener port

##### protocols

> `readonly` **protocols**: `object`

Defined in: [src/primitives/NodeInfo/NodeInfoType.ts:36](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/NodeInfo/NodeInfoType.ts#L36)

Protocol-specific information

###### Index Signature

\[`protocol`: `string`]: `unknown`

Other protocols (snap, les, etc.)

###### eth?

> `readonly` `optional` **eth**: `object`

Ethereum protocol info (if supported)

###### eth.config

> `readonly` **config**: `Record`\<`string`, `unknown`>

Chain configuration

###### eth.difficulty

> `readonly` **difficulty**: [`BrandedUint`](Uint.mdx#brandeduint)

Total difficulty of the chain

###### eth.genesis

> `readonly` **genesis**: [`BlockHashType`](BlockHash.mdx#blockhashtype)

Genesis block hash

###### eth.head

> `readonly` **head**: [`BlockHashType`](BlockHash.mdx#blockhashtype)

Current head block hash

###### eth.network

> `readonly` **network**: [`NetworkIdType`](NetworkId.mdx#networkidtype)

Network ID

## Variables

### NodeInfo

> `const` **NodeInfo**: `object`

Defined in: [src/primitives/NodeInfo/index.ts:22](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/NodeInfo/index.ts#L22)

#### Type Declaration

##### from()

> **from**: (`value`) => [`NodeInfoType`](#nodeinfotype)

Create NodeInfo from RPC response object

###### Parameters

###### value

`any`

Node info object from admin\_nodeInfo

###### Returns

[`NodeInfoType`](#nodeinfotype)

Node information

###### Throws

If value is not a valid node info object

###### Example

```javascript theme={null}
import * as NodeInfo from './primitives/NodeInfo/index.js';
const nodeInfo = NodeInfo.from(rpcResponse);
console.log(nodeInfo.name);     // "Geth/v1.10.26-stable"
console.log(nodeInfo.protocols.eth?.network); // NetworkId
```

##### getProtocol()

> **getProtocol**: (`nodeInfo`, `protocolName`) => `unknown`

###### Parameters

###### nodeInfo

`any`

###### protocolName

`string`

###### Returns

`unknown`

## Functions

### \_getProtocol()

> **\_getProtocol**(`this`, `protocolName`): `unknown`

Defined in: [src/primitives/NodeInfo/getProtocol.js:16](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/NodeInfo/getProtocol.js#L16)

Get protocol information by name

#### Parameters

##### this

[`NodeInfoType`](#nodeinfotype)

##### protocolName

`string`

Protocol name (e.g., "eth", "snap")

#### Returns

`unknown`

Protocol information or undefined

#### Example

```javascript theme={null}
import * as NodeInfo from './primitives/NodeInfo/index.js';
const nodeInfo = NodeInfo.from(rpcResponse);
const ethProtocol = NodeInfo._getProtocol.call(nodeInfo, "eth");
console.log(ethProtocol?.network); // NetworkId
```

***

### from()

> **from**(`value`): [`NodeInfoType`](#nodeinfotype)

Defined in: [src/primitives/NodeInfo/from.js:23](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/NodeInfo/from.js#L23)

Create NodeInfo from RPC response object

#### Parameters

##### value

`any`

Node info object from admin\_nodeInfo

#### Returns

[`NodeInfoType`](#nodeinfotype)

Node information

#### Throws

If value is not a valid node info object

#### Example

```javascript theme={null}
import * as NodeInfo from './primitives/NodeInfo/index.js';
const nodeInfo = NodeInfo.from(rpcResponse);
console.log(nodeInfo.name);     // "Geth/v1.10.26-stable"
console.log(nodeInfo.protocols.eth?.network); // NetworkId
```

***

### getProtocol()

> **getProtocol**(`nodeInfo`, `protocolName`): `unknown`

Defined in: [src/primitives/NodeInfo/index.ts:13](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/NodeInfo/index.ts#L13)

#### Parameters

##### nodeInfo

`any`

##### protocolName

`string`

#### Returns

`unknown`
