Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
🔨 Include mainnet and testnet genesis blocks within connector
Browse files Browse the repository at this point in the history
  • Loading branch information
sameersubudhi committed Apr 9, 2024
1 parent 32f4649 commit 76210b5
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ _Before_ submitting a pull request, please make sure the following is done:
Airbnb with the
[lisk extension](https://github.com/LiskHQ/eslint-config-lisk-base).
1. Format your code using [Prettier](https://prettier.io/). This can be performed manually
with `npm run format`.
with `yarn format`.
1. Submit a pull request via GitHub. Include issue numbers in the PR title, at
the end with: `Description - Closes #IssueNumber`.
1. Check that Jenkins CI tests pass (pull request turns green). First time
Expand Down
8 changes: 7 additions & 1 deletion services/blockchain-connector/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,10 @@ db_data
benchmark

# Data download directory
data
data/*
!data/00000000
data/00000000/*
!data/00000000/genesis_block.json
!data/01000000
data/01000000/*
!data/01000000/genesis_block.json
8 changes: 7 additions & 1 deletion services/blockchain-connector/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,10 @@ xunit-report.xml
db_data

# Data download directory
data
data/*
!data/00000000
data/00000000/*
!data/00000000/genesis_block.json
!data/01000000
data/01000000/*
!data/01000000/genesis_block.json
47 changes: 47 additions & 0 deletions services/blockchain-connector/data/00000000/genesis_block.json

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions services/blockchain-connector/data/01000000/genesis_block.json

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion services/blockchain-connector/shared/sdk/blocksUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,12 @@ const getGenesisBlockFromFS = async () => {
}

const block = await new Promise((resolve, reject) => {
readStream.pipe(parseStream.on('data', data => resolve(data)));
readStream.pipe(
parseStream.on('data', data => {
logger.info('Successfully read the genesis block from the FS.');
return resolve(data);
}),
);
parseStream.on('error', err => reject(err));
});

Expand Down

0 comments on commit 76210b5

Please sign in to comment.