You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 6, 2020. It is now read-only.
_Defined in [index.ts:112](https://github.com/ethereumjs/ethereumjs-blockchain/blob/c93b4dd/src/index.ts#L112)_
79
+
_Defined in [index.ts:155](https://github.com/ethereumjs/ethereumjs-blockchain/blob/ca7662a/src/index.ts#L155)_
80
80
81
81
Creates new Blockchain object
82
82
83
-
This constructor receives an object with different options, all of them are optional:
84
-
85
-
-`opts.chain`**([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)\|[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number))** The chain for the block \[default: 'mainnet'\]
86
-
-`opts.hardfork`**[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Hardfork for the block \[default: null, block number-based behavior\]
87
-
-`opts.common`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Alternatively pass a Common instance (ethereumjs-common) instead of setting chain/hardfork directly
88
-
-`opts.db` - Database to store blocks and metadata. Should be a [levelup](https://github.com/rvagg/node-levelup) instance.
89
-
-`opts.validate` - this the flag to validate blocks (e.g. Proof-of-Work), latest HF rules supported: `Constantinople`.
90
-
91
83
**Deprecation note**:
92
84
93
-
The old separated DB constructor parameters `opts.blockDB` and `opts.detailsDB` from before the Geth DB-compatible `v3.0.0` release are deprecated and continued usage is discouraged. When provided `opts.blockDB` will be used as `opts.db` and `opts.detailsDB` is ignored. On the storage level the DB formats are not compatible and it is not possible to load an old-format DB state into a post-`v3.0.0``Blockchain` object.
85
+
The old separated DB constructor parameters `opts.blockDB` and `opts.detailsDb` from before the Geth DB-compatible `v3.0.0` release are deprecated and continued usage is discouraged. When provided `opts.blockDB` will be used as `opts.db` and `opts.detailsDB` is ignored. On the storage level the DB formats are not compatible and it is not possible to load an old-format DB state into a post-`v3.0.0``Blockchain` object.
|`Default value` opts |[BlockchainOptions](../interfaces/blockchainoptions.md)| {} |An object with the options that this constructor takes. See [BlockchainOptions](../interfaces/blockchainoptions.md). |
100
92
101
93
**Returns:**[Blockchain](blockchain.md)
102
94
@@ -110,7 +102,7 @@ The old separated DB constructor parameters `opts.blockDB` and `opts.detailsDB`
110
102
111
103
**● db**: _`any`_
112
104
113
-
_Defined in [index.ts:105](https://github.com/ethereumjs/ethereumjs-blockchain/blob/c93b4dd/src/index.ts#L105)_
105
+
_Defined in [index.ts:148](https://github.com/ethereumjs/ethereumjs-blockchain/blob/ca7662a/src/index.ts#L148)_
114
106
115
107
---
116
108
@@ -120,7 +112,7 @@ _Defined in [index.ts:105](https://github.com/ethereumjs/ethereumjs-blockchain/b
120
112
121
113
**● dbManager**: _`DBManager`_
122
114
123
-
_Defined in [index.ts:106](https://github.com/ethereumjs/ethereumjs-blockchain/blob/c93b4dd/src/index.ts#L106)_
115
+
_Defined in [index.ts:149](https://github.com/ethereumjs/ethereumjs-blockchain/blob/ca7662a/src/index.ts#L149)_
124
116
125
117
---
126
118
@@ -130,7 +122,7 @@ _Defined in [index.ts:106](https://github.com/ethereumjs/ethereumjs-blockchain/b
130
122
131
123
**● ethash**: _`any`_
132
124
133
-
_Defined in [index.ts:107](https://github.com/ethereumjs/ethereumjs-blockchain/blob/c93b4dd/src/index.ts#L107)_
125
+
_Defined in [index.ts:150](https://github.com/ethereumjs/ethereumjs-blockchain/blob/ca7662a/src/index.ts#L150)_
134
126
135
127
---
136
128
@@ -140,7 +132,7 @@ _Defined in [index.ts:107](https://github.com/ethereumjs/ethereumjs-blockchain/b
140
132
141
133
**● validate**: _`boolean`_
142
134
143
-
_Defined in [index.ts:112](https://github.com/ethereumjs/ethereumjs-blockchain/blob/c93b4dd/src/index.ts#L112)_
135
+
_Defined in [index.ts:155](https://github.com/ethereumjs/ethereumjs-blockchain/blob/ca7662a/src/index.ts#L155)_
144
136
145
137
A flag indicating if this Blockchain validates blocks or not.
146
138
@@ -154,7 +146,7 @@ A flag indicating if this Blockchain validates blocks or not.
154
146
155
147
**get meta**(): `object`
156
148
157
-
_Defined in [index.ts:175](https://github.com/ethereumjs/ethereumjs-blockchain/blob/c93b4dd/src/index.ts#L175)_
149
+
_Defined in [index.ts:210](https://github.com/ethereumjs/ethereumjs-blockchain/blob/ca7662a/src/index.ts#L210)_
158
150
159
151
Returns an object with metadata about the Blockchain. It's defined for backwards compatibility.
160
152
@@ -170,7 +162,7 @@ Returns an object with metadata about the Blockchain. It's defined for backwards
_Defined in [index.ts:957](https://github.com/ethereumjs/ethereumjs-blockchain/blob/c93b4dd/src/index.ts#L957)_
315
+
_Defined in [index.ts:992](https://github.com/ethereumjs/ethereumjs-blockchain/blob/ca7662a/src/index.ts#L992)_
324
316
325
317
Iterates through blocks starting at the specified iterator head and calls the onBlock function on each block. The current location of an iterator head can be retrieved using the `getHead()` method.
326
318
@@ -342,7 +334,7 @@ Iterates through blocks starting at the specified iterator head and calls the on
0 commit comments