The core logic of blockchain node, including:
-
BlockchainMonitor
: Contains several eventslogs
: Emit when a new transaction's log is generatedremovedLogs
: Emit when the transaction has been rolled backnewHeads
: Emit when canonical chain changes
-
Indexer
andBloomBitsFilter
: Create bloom bits index for section -
Consensus
: Consensus engine implement -
Protocols
: P2P protocols, includerei-ethwire
andrei-consensus
-
Txpool
: Manage pending and queued transactions -
Sync
: Synchronize blocks -
TxSync
: Synchronize transactions -
Tracer
: Tracer provides an implementation of tracing blocks or transactions -
Contracts
: Some classes are used to interact with the smart contract -
Validation
: Contains the logic to verify the block -
Hardforks
: Contains logic related to the hard fork
npm install @rei-network/core
const node = await NodeFactory.createNode({
databasePath: "path/to/dataDir",
chain: "chainName",
mine: {
enable: true,
coinbase: "address1",
},
network: {
enable: true,
},
account: {
keyStorePath: "path/to/keystore",
unlock: [
["address1", "passphrase1"],
["address2", "passphrase2"],
],
},
});
await node.abort();