Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: fetch reward min blocks #101

Merged
merged 9 commits into from
Dec 22, 2023

Conversation

andreabadesso
Copy link
Collaborator

@andreabadesso andreabadesso commented Dec 8, 2023

Fixes #95

Acceptance Criteria

  • We should fetch the reward_min_blocks from the fullnode and use it instead of an env variable

Security Checklist

  • Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.

@andreabadesso andreabadesso self-assigned this Dec 8, 2023
@andreabadesso andreabadesso added the enhancement New feature or request label Dec 8, 2023
@andreabadesso andreabadesso force-pushed the refactor/fetch-reward-min-blocks branch from be1f187 to 126c3be Compare December 8, 2023 15:49
@andreabadesso andreabadesso force-pushed the refactor/fetch-reward-min-blocks branch from 126c3be to 575fb3e Compare December 8, 2023 15:51
Copy link
Member

@r4mmer r4mmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The data from the fullnode is used with the name rewardMinBlocks but it is set on the initial state as minRewardBlocks, but I could not find where one is converted to the other.

export const getFullnodeHttpUrl = () => {
const protocol = USE_SSL ? 'https://' : 'http://';

return `${protocol}${FULLNODE_HOST}/v1a/`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the wallet-service runs on nodejs we can use path.join to safely join the url parts.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated it to use URL in dfe48c8

@andreabadesso
Copy link
Collaborator Author

The data from the fullnode is used with the name rewardMinBlocks but it is set on the initial state as minRewardBlocks, but I could not find where one is converted to the other.

Refactored it to use rewardMinBlocks in 7c4e900

@andreabadesso andreabadesso changed the base branch from chore/monorepo-pt3 to dev December 18, 2023 03:45
@andreabadesso andreabadesso changed the base branch from dev to chore/monorepo-pt3 December 18, 2023 03:46
@andreabadesso andreabadesso merged commit 332c92a into chore/monorepo-pt3 Dec 22, 2023
@andreabadesso andreabadesso deleted the refactor/fetch-reward-min-blocks branch December 22, 2023 15:33
andreabadesso added a commit that referenced this pull request Jan 12, 2024
* chore: added workflow to deploy the daemon

* chore: added deploy script to the wallet-service

* chore: removed tests from tsconfig

* chore: updated daemon's Dockerfile to use yarn

* feat: fetching reward_min_blocks from the fullnode's API

* refactor: removed BLOCK_REWARD_LOCK from config

* refactor: renamed minRewardBlocks to rewardMinBlocks

* refactor: using URL instead of manually creating the urls
andreabadesso added a commit that referenced this pull request Jan 15, 2024
* chore: added workflow to deploy the daemon

* chore: added deploy script to the wallet-service

* chore: removed tests from tsconfig

* chore: updated daemon's Dockerfile to use yarn

* feat: fetching reward_min_blocks from the fullnode's API

* refactor: removed BLOCK_REWARD_LOCK from config

* refactor: renamed minRewardBlocks to rewardMinBlocks

* refactor: using URL instead of manually creating the urls
andreabadesso added a commit that referenced this pull request Jan 15, 2024
* chore: added workflow to deploy the daemon

* chore: added deploy script to the wallet-service

* chore: removed tests from tsconfig

* chore: updated daemon's Dockerfile to use yarn

* feat: fetching reward_min_blocks from the fullnode's API

* refactor: removed BLOCK_REWARD_LOCK from config

* refactor: renamed minRewardBlocks to rewardMinBlocks

* refactor: using URL instead of manually creating the urls
andreabadesso added a commit that referenced this pull request Feb 8, 2024
* chore: added workflow to deploy the daemon

* chore: added deploy script to the wallet-service

* chore: removed tests from tsconfig

* chore: updated daemon's Dockerfile to use yarn

* feat: fetching reward_min_blocks from the fullnode's API

* refactor: removed BLOCK_REWARD_LOCK from config

* refactor: renamed minRewardBlocks to rewardMinBlocks

* refactor: using URL instead of manually creating the urls
andreabadesso added a commit that referenced this pull request Feb 8, 2024
* chore: removed old service files

* chore: added package changes

* chore: initial project structure

* feat: added sync machine to the project with mocked services

* feat: added services

* feat: added services, utils and types

* feat: added websocket actor

* feat: added LRU cache and md5hash

* chore: basic eslintrc

* fix: added voided guard to check if a transaction is already voided before processing it

* tests: added multiple tests for db methods

* chore: removed tests from tslint and added sequelize to dependencies

* refactor: moved guards and actions to separate files and improved readability

* tests: 100% coverage on guards

* chore: added sequelizerc

* feat: throw if storing event lower than current

* chore: removed seeders as they're no longer needed

* chore: added daemon to a workspace

* chore: moved tsconfig to daemon workspace

* chore: added CI to pull_request as well

* chore: moved remaining files

* chore: added wallet-service as a package

* chore: removed .serverless from git

* chore: updated github workflow to setup the environment

* chore: updated daemon package with reliable-integrations

* chore: removed wallet-service's webpack from git

* chore: rollback CI workflow

* chore: renamed daemon service name

* chore: CI workflow setting up databases and running with nix

* tests: fixed failing test that does not make sense anymore

* chore: updated aws-sdk to v3

* chore: added workflow to deploy the daemon

* chore: added deploy script to the wallet-service

* chore: updated daemon's Dockerfile to use yarn

* chore: updated nodejs on codebuild

* chore: enabling corepack

* chore: force yarn version to 3.4.1

* refactor: fetch reward min blocks (#101)

* chore: added workflow to deploy the daemon

* chore: added deploy script to the wallet-service

* chore: removed tests from tsconfig

* chore: updated daemon's Dockerfile to use yarn

* feat: fetching reward_min_blocks from the fullnode's API

* refactor: removed BLOCK_REWARD_LOCK from config

* refactor: renamed minRewardBlocks to rewardMinBlocks

* refactor: using URL instead of manually creating the urls

* fix: issues from last rebase

* tests: mocking fetchRewardMinBlocks

* tests: mocking reward min blocks and fix fullnode URL

* chore: re-added tests

* feat: healthcheck API (#110)

 feat: daemon healthcheck (#111)

---------

Co-authored-by: Luis Helder <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants