@feelyourprotocol/blockchain 8141.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +269 -0
- package/dist/cjs/blockchain.d.ts +372 -0
- package/dist/cjs/blockchain.d.ts.map +1 -0
- package/dist/cjs/blockchain.js +1105 -0
- package/dist/cjs/blockchain.js.map +1 -0
- package/dist/cjs/consensus/casper.d.ts +16 -0
- package/dist/cjs/consensus/casper.d.ts.map +1 -0
- package/dist/cjs/consensus/casper.js +28 -0
- package/dist/cjs/consensus/casper.js.map +1 -0
- package/dist/cjs/consensus/clique.d.ts +164 -0
- package/dist/cjs/consensus/clique.d.ts.map +1 -0
- package/dist/cjs/consensus/clique.js +520 -0
- package/dist/cjs/consensus/clique.js.map +1 -0
- package/dist/cjs/consensus/ethash.d.ts +29 -0
- package/dist/cjs/consensus/ethash.d.ts.map +1 -0
- package/dist/cjs/consensus/ethash.js +48 -0
- package/dist/cjs/consensus/ethash.js.map +1 -0
- package/dist/cjs/consensus/index.d.ts +5 -0
- package/dist/cjs/consensus/index.d.ts.map +1 -0
- package/dist/cjs/consensus/index.js +10 -0
- package/dist/cjs/consensus/index.js.map +1 -0
- package/dist/cjs/constructors.d.ts +13 -0
- package/dist/cjs/constructors.d.ts.map +1 -0
- package/dist/cjs/constructors.js +80 -0
- package/dist/cjs/constructors.js.map +1 -0
- package/dist/cjs/db/cache.d.ts +17 -0
- package/dist/cjs/db/cache.d.ts.map +1 -0
- package/dist/cjs/db/cache.js +38 -0
- package/dist/cjs/db/cache.js.map +1 -0
- package/dist/cjs/db/constants.d.ts +23 -0
- package/dist/cjs/db/constants.d.ts.map +1 -0
- package/dist/cjs/db/constants.js +54 -0
- package/dist/cjs/db/constants.js.map +1 -0
- package/dist/cjs/db/helpers.d.ts +9 -0
- package/dist/cjs/db/helpers.d.ts.map +1 -0
- package/dist/cjs/db/helpers.js +68 -0
- package/dist/cjs/db/helpers.js.map +1 -0
- package/dist/cjs/db/manager.d.ts +78 -0
- package/dist/cjs/db/manager.d.ts.map +1 -0
- package/dist/cjs/db/manager.js +203 -0
- package/dist/cjs/db/manager.js.map +1 -0
- package/dist/cjs/db/operation.d.ts +45 -0
- package/dist/cjs/db/operation.d.ts.map +1 -0
- package/dist/cjs/db/operation.js +110 -0
- package/dist/cjs/db/operation.js.map +1 -0
- package/dist/cjs/helpers.d.ts +19 -0
- package/dist/cjs/helpers.d.ts.map +1 -0
- package/dist/cjs/helpers.js +34 -0
- package/dist/cjs/helpers.js.map +1 -0
- package/dist/cjs/index.d.ts +7 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +33 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/types.d.ts +219 -0
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +3 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/esm/blockchain.d.ts +372 -0
- package/dist/esm/blockchain.d.ts.map +1 -0
- package/dist/esm/blockchain.js +1101 -0
- package/dist/esm/blockchain.js.map +1 -0
- package/dist/esm/consensus/casper.d.ts +16 -0
- package/dist/esm/consensus/casper.d.ts.map +1 -0
- package/dist/esm/consensus/casper.js +24 -0
- package/dist/esm/consensus/casper.js.map +1 -0
- package/dist/esm/consensus/clique.d.ts +164 -0
- package/dist/esm/consensus/clique.d.ts.map +1 -0
- package/dist/esm/consensus/clique.js +516 -0
- package/dist/esm/consensus/clique.js.map +1 -0
- package/dist/esm/consensus/ethash.d.ts +29 -0
- package/dist/esm/consensus/ethash.d.ts.map +1 -0
- package/dist/esm/consensus/ethash.js +44 -0
- package/dist/esm/consensus/ethash.js.map +1 -0
- package/dist/esm/consensus/index.d.ts +5 -0
- package/dist/esm/consensus/index.d.ts.map +1 -0
- package/dist/esm/consensus/index.js +5 -0
- package/dist/esm/consensus/index.js.map +1 -0
- package/dist/esm/constructors.d.ts +13 -0
- package/dist/esm/constructors.d.ts.map +1 -0
- package/dist/esm/constructors.js +76 -0
- package/dist/esm/constructors.js.map +1 -0
- package/dist/esm/db/cache.d.ts +17 -0
- package/dist/esm/db/cache.d.ts.map +1 -0
- package/dist/esm/db/cache.js +34 -0
- package/dist/esm/db/cache.js.map +1 -0
- package/dist/esm/db/constants.d.ts +23 -0
- package/dist/esm/db/constants.d.ts.map +1 -0
- package/dist/esm/db/constants.js +46 -0
- package/dist/esm/db/constants.js.map +1 -0
- package/dist/esm/db/helpers.d.ts +9 -0
- package/dist/esm/db/helpers.d.ts.map +1 -0
- package/dist/esm/db/helpers.js +61 -0
- package/dist/esm/db/helpers.js.map +1 -0
- package/dist/esm/db/manager.d.ts +78 -0
- package/dist/esm/db/manager.d.ts.map +1 -0
- package/dist/esm/db/manager.js +199 -0
- package/dist/esm/db/manager.js.map +1 -0
- package/dist/esm/db/operation.d.ts +45 -0
- package/dist/esm/db/operation.d.ts.map +1 -0
- package/dist/esm/db/operation.js +106 -0
- package/dist/esm/db/operation.js.map +1 -0
- package/dist/esm/helpers.d.ts +19 -0
- package/dist/esm/helpers.d.ts.map +1 -0
- package/dist/esm/helpers.js +30 -0
- package/dist/esm/helpers.js.map +1 -0
- package/dist/esm/index.d.ts +7 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/types.d.ts +219 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/tsconfig.prod.cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.prod.esm.tsbuildinfo +1 -0
- package/package.json +75 -0
- package/src/blockchain.ts +1353 -0
- package/src/consensus/casper.ts +33 -0
- package/src/consensus/clique.ts +633 -0
- package/src/consensus/ethash.ts +69 -0
- package/src/consensus/index.ts +5 -0
- package/src/constructors.ts +119 -0
- package/src/db/cache.ts +39 -0
- package/src/db/constants.ts +73 -0
- package/src/db/helpers.ts +81 -0
- package/src/db/manager.ts +243 -0
- package/src/db/operation.ts +152 -0
- package/src/helpers.ts +37 -0
- package/src/index.ts +12 -0
- package/src/types.ts +256 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { KeyEncoding, ValueEncoding } from '@feelyourprotocol/util';
|
|
2
|
+
import type { CacheMap } from './manager.ts';
|
|
3
|
+
export type DBTarget = (typeof DBTarget)[keyof typeof DBTarget];
|
|
4
|
+
export declare const DBTarget: {
|
|
5
|
+
readonly Heads: 0;
|
|
6
|
+
readonly HeadHeader: 1;
|
|
7
|
+
readonly HeadBlock: 2;
|
|
8
|
+
readonly HashToNumber: 3;
|
|
9
|
+
readonly NumberToHash: 4;
|
|
10
|
+
readonly TotalDifficulty: 5;
|
|
11
|
+
readonly Body: 6;
|
|
12
|
+
readonly Header: 7;
|
|
13
|
+
readonly CliqueSignerStates: 8;
|
|
14
|
+
readonly CliqueVotes: 9;
|
|
15
|
+
readonly CliqueBlockSigners: 10;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* DBOpData is a type which has the purpose of holding the actual data of the Database Operation.
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
21
|
+
export interface DBOpData {
|
|
22
|
+
type?: 'put' | 'del';
|
|
23
|
+
key: Uint8Array | string;
|
|
24
|
+
keyEncoding: KeyEncoding;
|
|
25
|
+
valueEncoding?: ValueEncoding;
|
|
26
|
+
value?: Uint8Array | object;
|
|
27
|
+
}
|
|
28
|
+
export type DatabaseKey = {
|
|
29
|
+
blockNumber?: bigint;
|
|
30
|
+
blockHash?: Uint8Array;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The DBOp class aids creating database operations which is used by `level` using a more high-level interface
|
|
34
|
+
*/
|
|
35
|
+
export declare class DBOp {
|
|
36
|
+
operationTarget: DBTarget;
|
|
37
|
+
baseDBOp: DBOpData;
|
|
38
|
+
cacheString: string | undefined;
|
|
39
|
+
private constructor();
|
|
40
|
+
static get(operationTarget: DBTarget, key?: DatabaseKey): DBOp;
|
|
41
|
+
static set(operationTarget: DBTarget, value: Uint8Array | object, key?: DatabaseKey): DBOp;
|
|
42
|
+
static del(operationTarget: DBTarget, key?: DatabaseKey): DBOp;
|
|
43
|
+
updateCache(cacheMap: CacheMap): void;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=operation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../src/db/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAazF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAE5C,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAA;AAE/D,eAAO,MAAM,QAAQ;;;;;;;;;;;;CAYX,CAAA;AAEV;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,CAAC,EAAE,KAAK,GAAG,KAAK,CAAA;IACpB,GAAG,EAAE,UAAU,GAAG,MAAM,CAAA;IACxB,WAAW,EAAE,WAAW,CAAA;IACxB,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,KAAK,CAAC,EAAE,UAAU,GAAG,MAAM,CAAA;CAC5B;AAGD,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,UAAU,CAAA;CACvB,CAAA;AAED;;GAEG;AACH,qBAAa,IAAI;IACR,eAAe,EAAE,QAAQ,CAAA;IACzB,QAAQ,EAAE,QAAQ,CAAA;IAClB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAEtC,OAAO;WAqDO,GAAG,CAAC,eAAe,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,WAAW,GAAG,IAAI;WAKvD,GAAG,CACf,eAAe,EAAE,QAAQ,EACzB,KAAK,EAAE,UAAU,GAAG,MAAM,EAC1B,GAAG,CAAC,EAAE,WAAW,GAChB,IAAI;WAcO,GAAG,CAAC,eAAe,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,WAAW,GAAG,IAAI;IAM9D,WAAW,CAAC,QAAQ,EAAE,QAAQ;CAYtC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { EthereumJSErrorWithoutCode, KeyEncoding, ValueEncoding } from '@feelyourprotocol/util';
|
|
2
|
+
import { HEADS_KEY, HEAD_BLOCK_KEY, HEAD_HEADER_KEY, bodyKey, hashToNumberKey, headerKey, numberToHashKey, tdKey, } from "./constants.js";
|
|
3
|
+
export const DBTarget = {
|
|
4
|
+
Heads: 0,
|
|
5
|
+
HeadHeader: 1,
|
|
6
|
+
HeadBlock: 2,
|
|
7
|
+
HashToNumber: 3,
|
|
8
|
+
NumberToHash: 4,
|
|
9
|
+
TotalDifficulty: 5,
|
|
10
|
+
Body: 6,
|
|
11
|
+
Header: 7,
|
|
12
|
+
CliqueSignerStates: 8,
|
|
13
|
+
CliqueVotes: 9,
|
|
14
|
+
CliqueBlockSigners: 10,
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The DBOp class aids creating database operations which is used by `level` using a more high-level interface
|
|
18
|
+
*/
|
|
19
|
+
export class DBOp {
|
|
20
|
+
constructor(operationTarget, key) {
|
|
21
|
+
this.operationTarget = operationTarget;
|
|
22
|
+
this.baseDBOp = {
|
|
23
|
+
key: '',
|
|
24
|
+
keyEncoding: KeyEncoding.Bytes,
|
|
25
|
+
valueEncoding: ValueEncoding.Bytes,
|
|
26
|
+
};
|
|
27
|
+
switch (operationTarget) {
|
|
28
|
+
case DBTarget.Heads: {
|
|
29
|
+
this.baseDBOp.key = HEADS_KEY;
|
|
30
|
+
this.baseDBOp.valueEncoding = ValueEncoding.JSON;
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
case DBTarget.HeadHeader: {
|
|
34
|
+
this.baseDBOp.key = HEAD_HEADER_KEY;
|
|
35
|
+
this.baseDBOp.keyEncoding = KeyEncoding.String;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
case DBTarget.HeadBlock: {
|
|
39
|
+
this.baseDBOp.key = HEAD_BLOCK_KEY;
|
|
40
|
+
this.baseDBOp.keyEncoding = KeyEncoding.String;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
case DBTarget.HashToNumber: {
|
|
44
|
+
this.baseDBOp.key = hashToNumberKey(key.blockHash);
|
|
45
|
+
this.cacheString = 'hashToNumber';
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
case DBTarget.NumberToHash: {
|
|
49
|
+
this.baseDBOp.key = numberToHashKey(key.blockNumber);
|
|
50
|
+
this.cacheString = 'numberToHash';
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
case DBTarget.TotalDifficulty: {
|
|
54
|
+
this.baseDBOp.key = tdKey(key.blockNumber, key.blockHash);
|
|
55
|
+
this.cacheString = 'td';
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
case DBTarget.Body: {
|
|
59
|
+
this.baseDBOp.key = bodyKey(key.blockNumber, key.blockHash);
|
|
60
|
+
this.cacheString = 'body';
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
case DBTarget.Header: {
|
|
64
|
+
this.baseDBOp.key = headerKey(key.blockNumber, key.blockHash);
|
|
65
|
+
this.cacheString = 'header';
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
static get(operationTarget, key) {
|
|
71
|
+
return new DBOp(operationTarget, key);
|
|
72
|
+
}
|
|
73
|
+
// set operation: note: value/key is not in default order
|
|
74
|
+
static set(operationTarget, value, key) {
|
|
75
|
+
const dbOperation = new DBOp(operationTarget, key);
|
|
76
|
+
dbOperation.baseDBOp.value = value;
|
|
77
|
+
dbOperation.baseDBOp.type = 'put';
|
|
78
|
+
if (operationTarget === DBTarget.Heads) {
|
|
79
|
+
dbOperation.baseDBOp.valueEncoding = ValueEncoding.JSON;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
dbOperation.baseDBOp.valueEncoding = ValueEncoding.Bytes;
|
|
83
|
+
}
|
|
84
|
+
return dbOperation;
|
|
85
|
+
}
|
|
86
|
+
static del(operationTarget, key) {
|
|
87
|
+
const dbOperation = new DBOp(operationTarget, key);
|
|
88
|
+
dbOperation.baseDBOp.type = 'del';
|
|
89
|
+
return dbOperation;
|
|
90
|
+
}
|
|
91
|
+
updateCache(cacheMap) {
|
|
92
|
+
if (this.cacheString !== undefined && cacheMap[this.cacheString] !== undefined) {
|
|
93
|
+
if (this.baseDBOp.type === 'put') {
|
|
94
|
+
this.baseDBOp.value instanceof Uint8Array &&
|
|
95
|
+
cacheMap[this.cacheString].set(this.baseDBOp.key, this.baseDBOp.value);
|
|
96
|
+
}
|
|
97
|
+
else if (this.baseDBOp.type === 'del') {
|
|
98
|
+
cacheMap[this.cacheString].del(this.baseDBOp.key);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
throw EthereumJSErrorWithoutCode('unsupported db operation on cache');
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../src/db/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEzF,OAAO,EACL,SAAS,EACT,cAAc,EACd,eAAe,EACf,OAAO,EACP,eAAe,EACf,SAAS,EACT,eAAe,EACf,KAAK,GACN,MAAM,gBAAgB,CAAA;AAMvB,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,KAAK,EAAE,CAAC;IACR,UAAU,EAAE,CAAC;IACb,SAAS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AA0B,CAAC,mCAAmC,CAAC,CAAA;YACvE,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Chain, Common, GenesisState } from '@feelyourprotocol/common';
|
|
2
|
+
/**
|
|
3
|
+
* Safe creation of a new Blockchain object awaiting the initialization function,
|
|
4
|
+
* encouraged method to use when creating a blockchain object.
|
|
5
|
+
*
|
|
6
|
+
* @param opts Constructor options, see {@link BlockchainOptions}
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Merkle genesis root
|
|
10
|
+
* @param genesisState
|
|
11
|
+
* @param common
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare function genGenesisStateRoot(genesisState: GenesisState, common: Common): Promise<Uint8Array>;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the genesis state root if chain is well known or an empty state's root otherwise
|
|
17
|
+
*/
|
|
18
|
+
export declare function getGenesisStateRoot(chainId: Chain, common: Common): Promise<Uint8Array>;
|
|
19
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAErE;;;;;GAKG;AAEH;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,UAAU,CAAC,CAOrB;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAG7F"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ChainGenesis } from '@feelyourprotocol/common';
|
|
2
|
+
import { genesisMPTStateRoot } from '@feelyourprotocol/mpt';
|
|
3
|
+
/**
|
|
4
|
+
* Safe creation of a new Blockchain object awaiting the initialization function,
|
|
5
|
+
* encouraged method to use when creating a blockchain object.
|
|
6
|
+
*
|
|
7
|
+
* @param opts Constructor options, see {@link BlockchainOptions}
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Merkle genesis root
|
|
11
|
+
* @param genesisState
|
|
12
|
+
* @param common
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export async function genGenesisStateRoot(genesisState, common) {
|
|
16
|
+
const genCommon = common.copy();
|
|
17
|
+
genCommon.setHardforkBy({
|
|
18
|
+
blockNumber: 0,
|
|
19
|
+
timestamp: genCommon.genesis().timestamp,
|
|
20
|
+
});
|
|
21
|
+
return genesisMPTStateRoot(genesisState);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Returns the genesis state root if chain is well known or an empty state's root otherwise
|
|
25
|
+
*/
|
|
26
|
+
export async function getGenesisStateRoot(chainId, common) {
|
|
27
|
+
const chainGenesis = ChainGenesis[chainId];
|
|
28
|
+
return chainGenesis !== undefined ? chainGenesis.stateRoot : genGenesisStateRoot({}, common);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAIrD;;;;;GAKG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,YAA0B,EAC1B,MAAc;IAEd,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,EAAE,CAAA;IAC/B,SAAS,CAAC,aAAa,CAAC;QACtB,WAAW,EAAE,CAAC;QACd,SAAS,EAAE,SAAS,CAAC,OAAO,EAAE,CAAC,SAAS;KACzC,CAAC,CAAA;IACF,OAAO,mBAAmB,CAAC,YAAY,CAAC,CAAA;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAc,EAAE,MAAc;IACtE,MAAM,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,CAAA;IAC1C,OAAO,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;AAC9F,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { Blockchain } from './blockchain.ts';
|
|
2
|
+
export { CasperConsensus, CliqueConsensus, EthashConsensus } from './consensus/index.ts';
|
|
3
|
+
export * from './constructors.ts';
|
|
4
|
+
export { DBOp, DBSaveLookups, DBSetBlockOrHeader, DBSetHashToNumber, DBSetTD, } from './db/helpers.ts';
|
|
5
|
+
export * from './helpers.ts';
|
|
6
|
+
export * from './types.ts';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACxF,cAAc,mBAAmB,CAAA;AACjC,OAAO,EACL,IAAI,EACJ,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,OAAO,GACR,MAAM,iBAAiB,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { Blockchain } from "./blockchain.js";
|
|
2
|
+
export { CasperConsensus, CliqueConsensus, EthashConsensus } from "./consensus/index.js";
|
|
3
|
+
export * from "./constructors.js";
|
|
4
|
+
export { DBOp, DBSaveLookups, DBSetBlockOrHeader, DBSetHashToNumber, DBSetTD, } from "./db/helpers.js";
|
|
5
|
+
export * from "./helpers.js";
|
|
6
|
+
export * from "./types.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACxF,cAAc,mBAAmB,CAAA;AACjC,OAAO,EACL,IAAI,EACJ,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,OAAO,GACR,MAAM,iBAAiB,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import type { Block, BlockHeader } from '@feelyourprotocol/block';
|
|
2
|
+
import type { Common, ConsensusAlgorithm, GenesisState } from '@feelyourprotocol/common';
|
|
3
|
+
import type { DB, DBObject } from '@feelyourprotocol/util';
|
|
4
|
+
import type { EventEmitter } from 'eventemitter3';
|
|
5
|
+
import type { Blockchain } from './index.ts';
|
|
6
|
+
export type OnBlock = (block: Block, reorg: boolean) => Promise<void> | void;
|
|
7
|
+
export type BlockchainEvent = {
|
|
8
|
+
deletedCanonicalBlocks: (data: Block[], resolve?: (result?: any) => void) => void;
|
|
9
|
+
};
|
|
10
|
+
export interface BlockchainInterface {
|
|
11
|
+
consensus: Consensus | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Adds a block to the blockchain.
|
|
14
|
+
*
|
|
15
|
+
* @param block - The block to be added to the blockchain.
|
|
16
|
+
*/
|
|
17
|
+
putBlock(block: Block): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Deletes a block from the blockchain. All child blocks in the chain are
|
|
20
|
+
* deleted and any encountered heads are set to the parent block.
|
|
21
|
+
*
|
|
22
|
+
* @param blockHash - The hash of the block to be deleted
|
|
23
|
+
*/
|
|
24
|
+
delBlock(blockHash: Uint8Array): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Returns a block by its hash or number.
|
|
27
|
+
*/
|
|
28
|
+
getBlock(blockId: Uint8Array | number | bigint): Promise<Block>;
|
|
29
|
+
/**
|
|
30
|
+
* Iterates through blocks starting at the specified iterator head and calls
|
|
31
|
+
* the onBlock function on each block.
|
|
32
|
+
*
|
|
33
|
+
* @param name - Name of the state root head
|
|
34
|
+
* @param onBlock - Function called on each block with params (block: Block,
|
|
35
|
+
* @param maxBlocks - optional maximum number of blocks to iterate through
|
|
36
|
+
* reorg: boolean)
|
|
37
|
+
*/
|
|
38
|
+
iterator(name: string, onBlock: OnBlock, maxBlocks?: number, releaseLockOnCallback?: boolean): Promise<number>;
|
|
39
|
+
/**
|
|
40
|
+
* Returns a shallow copy of the blockchain that may share state with the original
|
|
41
|
+
*/
|
|
42
|
+
shallowCopy(): BlockchainInterface;
|
|
43
|
+
/**
|
|
44
|
+
* Validates a block header, throwing if invalid. It is being validated against the reported `parentHash`.
|
|
45
|
+
* @param header - header to be validated
|
|
46
|
+
* @param height - If this is an uncle header, this is the height of the block that is including it
|
|
47
|
+
*/
|
|
48
|
+
validateHeader(header: BlockHeader, height?: bigint): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Returns the specified iterator head.
|
|
51
|
+
*
|
|
52
|
+
* @param name - Optional name of the iterator head (default: 'vm')
|
|
53
|
+
*/
|
|
54
|
+
getIteratorHead(name?: string): Promise<Block>;
|
|
55
|
+
/**
|
|
56
|
+
* Set header hash of a certain `tag`.
|
|
57
|
+
* When calling the iterator, the iterator will start running the first child block after the header hash currently stored.
|
|
58
|
+
* @param tag - The tag to save the headHash to
|
|
59
|
+
* @param headHash - The head hash to save
|
|
60
|
+
*/
|
|
61
|
+
setIteratorHead(tag: string, headHash: Uint8Array): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Gets total difficulty for a block specified by hash and number
|
|
64
|
+
*/
|
|
65
|
+
getTotalDifficulty?(hash: Uint8Array, number?: bigint): Promise<bigint>;
|
|
66
|
+
/**
|
|
67
|
+
* Returns the latest full block in the canonical chain.
|
|
68
|
+
*/
|
|
69
|
+
getCanonicalHeadBlock(): Promise<Block>;
|
|
70
|
+
/**
|
|
71
|
+
* Optional events emitter
|
|
72
|
+
*/
|
|
73
|
+
events?: EventEmitter<BlockchainEvent>;
|
|
74
|
+
}
|
|
75
|
+
export interface GenesisOptions {
|
|
76
|
+
/**
|
|
77
|
+
* The blockchain only initializes successfully if it has a genesis block. If
|
|
78
|
+
* there is no block available in the DB and a `genesisBlock` is provided,
|
|
79
|
+
* then the provided `genesisBlock` will be used as genesis. If no block is
|
|
80
|
+
* present in the DB and no block is provided, then the genesis block as
|
|
81
|
+
* provided from the `common` will be used.
|
|
82
|
+
*/
|
|
83
|
+
genesisBlock?: Block;
|
|
84
|
+
/**
|
|
85
|
+
* If you are using a custom chain {@link Common}, pass the genesis state.
|
|
86
|
+
*
|
|
87
|
+
* Pattern 1 (with genesis state see {@link GenesisState} for format):
|
|
88
|
+
*
|
|
89
|
+
* ```javascript
|
|
90
|
+
* {
|
|
91
|
+
* '0x0...01': '0x100', // For EoA
|
|
92
|
+
* }
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* Pattern 2 (with complex genesis state, containing contract accounts and storage).
|
|
96
|
+
* Note that in {@link AccountState} there are two
|
|
97
|
+
* accepted types. This allows to easily insert accounts in the genesis state:
|
|
98
|
+
*
|
|
99
|
+
* A complex genesis state with Contract and EoA states would have the following format:
|
|
100
|
+
*
|
|
101
|
+
* ```javascript
|
|
102
|
+
* {
|
|
103
|
+
* '0x0...01': '0x100', // For EoA
|
|
104
|
+
* '0x0...02': ['0x1', '0xRUNTIME_BYTECODE', [[storageKey1, storageValue1], [storageKey2, storageValue2]]] // For contracts
|
|
105
|
+
* }
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
genesisState?: GenesisState;
|
|
109
|
+
/**
|
|
110
|
+
* State root of the genesis state
|
|
111
|
+
*/
|
|
112
|
+
genesisStateRoot?: Uint8Array;
|
|
113
|
+
}
|
|
114
|
+
export type ConsensusDict = {
|
|
115
|
+
[consensusAlgorithm: ConsensusAlgorithm | string]: Consensus;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* This are the options that the Blockchain constructor can receive.
|
|
119
|
+
*/
|
|
120
|
+
export interface BlockchainOptions extends GenesisOptions {
|
|
121
|
+
/**
|
|
122
|
+
* Specify the chain and hardfork by passing a {@link Common} instance.
|
|
123
|
+
*
|
|
124
|
+
* If not provided this defaults to chain `mainnet` and hardfork `chainstart`
|
|
125
|
+
*
|
|
126
|
+
*/
|
|
127
|
+
common?: Common;
|
|
128
|
+
/**
|
|
129
|
+
* Set the HF to the fork determined by the head block and update on head updates.
|
|
130
|
+
*
|
|
131
|
+
* Note: for HFs where the transition is also determined by a total difficulty
|
|
132
|
+
* threshold (merge HF) the calculated TD is additionally taken into account
|
|
133
|
+
* for HF determination.
|
|
134
|
+
*
|
|
135
|
+
* Default: `false` (HF is set to whatever default HF is set by the {@link Common} instance)
|
|
136
|
+
*/
|
|
137
|
+
hardforkByHeadBlockNumber?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Database to store blocks and metadata.
|
|
140
|
+
* Can be any database implementation that adheres to the `DB` interface
|
|
141
|
+
*/
|
|
142
|
+
db?: DB<Uint8Array | string | number, Uint8Array | string | DBObject>;
|
|
143
|
+
/**
|
|
144
|
+
* This flag indicates if protocol-given consistency checks on
|
|
145
|
+
* block headers and included uncles and transactions should be performed,
|
|
146
|
+
* see Block#validate for details.
|
|
147
|
+
*
|
|
148
|
+
*/
|
|
149
|
+
validateBlocks?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Validate the consensus with the respective consensus implementation passed
|
|
152
|
+
* to `consensusDict` (see respective option) `CasperConsensus` (which effectively
|
|
153
|
+
* does nothing) is available by default.
|
|
154
|
+
*
|
|
155
|
+
* For the build-in validation classes the following validations take place.
|
|
156
|
+
* - 'pow' with 'ethash' algorithm (validates the proof-of-work)
|
|
157
|
+
* - 'poa' with 'clique' algorithm (verifies the block signatures)
|
|
158
|
+
* Default: `false`.
|
|
159
|
+
*/
|
|
160
|
+
validateConsensus?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Optional dictionary with consensus objects (adhering to the {@link Consensus} interface)
|
|
163
|
+
* if consensus validation is wished for certain consensus algorithms.
|
|
164
|
+
*
|
|
165
|
+
* Since consensus validation moved to the Ethereum consensus layer with Proof-of-Stake
|
|
166
|
+
* consensus is not validated by default. For `ConsensusAlgorithm.Ethash` and
|
|
167
|
+
* `ConsensusAlgorithm.Clique` consensus validation can be activated by passing in the
|
|
168
|
+
* respective consensus validation objects `EthashConsensus` or `CliqueConsensus`.
|
|
169
|
+
*
|
|
170
|
+
* ```ts
|
|
171
|
+
* import { CliqueConsensus, createBlockchain } from '@feelyourprotocol/blockchain'
|
|
172
|
+
* import type { ConsensusDict } from '@feelyourprotocol/blockchain'
|
|
173
|
+
*
|
|
174
|
+
* const consensusDict: ConsensusDict = {}
|
|
175
|
+
* consensusDict[ConsensusAlgorithm.Clique] = new CliqueConsensus()
|
|
176
|
+
* const blockchain = await createBlockchain({ common, consensusDict })
|
|
177
|
+
* ```
|
|
178
|
+
*
|
|
179
|
+
* Additionally it is possible to provide a fully custom consensus implementation.
|
|
180
|
+
* Note that this needs a custom `Common` object passed to the blockchain where
|
|
181
|
+
* the `ConsensusAlgorithm` string matches the string used here.
|
|
182
|
+
*/
|
|
183
|
+
consensusDict?: ConsensusDict;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Interface that a consensus class needs to implement.
|
|
187
|
+
*/
|
|
188
|
+
export interface Consensus {
|
|
189
|
+
algorithm: ConsensusAlgorithm | string;
|
|
190
|
+
/**
|
|
191
|
+
* Initialize genesis for consensus mechanism
|
|
192
|
+
* @param genesisBlock genesis block
|
|
193
|
+
*/
|
|
194
|
+
genesisInit(genesisBlock: Block): Promise<void>;
|
|
195
|
+
/**
|
|
196
|
+
* Set up consensus mechanism
|
|
197
|
+
*/
|
|
198
|
+
setup({ blockchain }: ConsensusOptions): Promise<void>;
|
|
199
|
+
/**
|
|
200
|
+
* Validate block consensus parameters
|
|
201
|
+
* @param block block to be validated
|
|
202
|
+
*/
|
|
203
|
+
validateConsensus(block: Block): Promise<void>;
|
|
204
|
+
validateDifficulty(header: BlockHeader): Promise<void>;
|
|
205
|
+
/**
|
|
206
|
+
* Update consensus on new block
|
|
207
|
+
* @param block new block
|
|
208
|
+
* @param commonAncestor common ancestor block header (optional)
|
|
209
|
+
* @param ancientHeaders array of ancestor block headers (optional)
|
|
210
|
+
*/
|
|
211
|
+
newBlock(block: Block, commonAncestor?: BlockHeader, ancientHeaders?: BlockHeader[]): Promise<void>;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Options when initializing a class that implements the Consensus interface.
|
|
215
|
+
*/
|
|
216
|
+
export interface ConsensusOptions {
|
|
217
|
+
blockchain: Blockchain;
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAClF,OAAO,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,MAAM,MAAM,OAAO,GAAG,CAA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