Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
node/state: Refactor node pkg -> nodebuilder and split services into …
…modules (#997) * refactor: implement better node pkg structuring for node/state pkg * refactor: rename node/config pkg to node/node * refactor(node/state): Use fx annotation from #923 * refactor(node/state): use constructor from state pkg directly * fix: review suggestions * refactor(node): state module improvements and PR review in the form of a PR (#90) * refactor(node): state module improvements * Move settings, opts and config out of `node/node` back to `node` * `state` pkg module improvements * Absorb Config and options from `node/key` pkg * Don't use core.Config on Module constructor and take from the DI instead * Use node Type and Config on Module constructor * first steps towarads `core` pkg modulazation * chore(swamp): fix linter by shortening import alias * refactor: moving header to subpackage * refactor: moving share components to share subpackage * chore: basic linting * refactor/chore: renaming services and methods to satisfy linter * refactor: moving node construction to node/module.go * refactor: rpc and core subpackages * refactor: building node in /node/module.go, rpc and core fixes for tests * refactor: modularized daser and simplified node/module.go * refactor: passing configs by ref to actually modify node.Config, moving p2p opts, removing config_opts, renaming files to match new scheme * refactor(node): move some global node options to their respective node modules * refactor: unexporting moduleOpts and fields * refactor: variadic options for modules * refactor: removing lifecycle hooks * refactor: renaming node to nodebuilder * refactor: implementing review comments * fix: renaming test directories to nodebuilder * refactor: config setters separated from options, writing config to env for persisting options during initialization * refactor: minor review comments (cleaning clutter to get to the juicy stuff) * refactor: exporting share.Discovery, providing it directly, removing Full and Light availability constructors in nodebuilder/share * refactor: providing header service directly in module * refactor: making InitStore invoke directly without returning a function, removing dead code * fix: fixing issue where flags do not persist when init is called twice Co-authored-by: renaynay <[email protected]> * chore: removing dead code * refactor: deferring setting node config during flag parsing * refactor: collapsing switch in DefaultConfig * refactor: removing nodebuilder/daser/daser.go * refactor: fx lifecycle in for core/remote * chore: imports * refactor: removing all setters, moving checks to construction * refactor: adding cfg.ValidateBasic to each nodebuilder module * refactor: moving core sanity checks to cfg.ValidateBasic and populating default conf * fix: replacing IP on sanity check * renaming to sanitizeIP Co-authored-by @Wondertan Co-authored-by: Ryan <[email protected]> Co-authored-by: renaynay <[email protected]> * Fix issues with config persistence / invoking validation on config (#95) * fix config * make sure to save config before starting node, otherwise all overrides are lost * chore: lint * refactor|test(nodebuilder/tests): update fraud tests to use new nodebuilder configuration functionality * refactor(nodebuilder/header): adapt Fraud (with syncer) to refactoring changes * refactor(nodebuilder/header): restore logic that syncer fails with Warn if no chain head * fix(tests): fixing TestFraudProofSyncing * fix(cmd): not persisting config with flags on start * refactor(nodebuilder): consistent baseComponents, adding back daser proxy constructor, renaming Loader to ConfigLoader * lint: fixing goimports after rebase * refactor: implement better node pkg structuring for node/state pkg * refactor: rename node/config pkg to node/node * refactor(node/state): Use fx annotation from #923 * refactor(node/state): use constructor from state pkg directly * fix: review suggestions * refactor(node): state module improvements and PR review in the form of a PR (#90) * refactor(node): state module improvements * Move settings, opts and config out of `node/node` back to `node` * `state` pkg module improvements * Absorb Config and options from `node/key` pkg * Don't use core.Config on Module constructor and take from the DI instead * Use node Type and Config on Module constructor * first steps towarads `core` pkg modulazation * chore(swamp): fix linter by shortening import alias * refactor: moving header to subpackage * refactor: moving share components to share subpackage * chore: basic linting * refactor/chore: renaming services and methods to satisfy linter * refactor: moving node construction to node/module.go * refactor: rpc and core subpackages * refactor: building node in /node/module.go, rpc and core fixes for tests * refactor: modularized daser and simplified node/module.go * refactor: passing configs by ref to actually modify node.Config, moving p2p opts, removing config_opts, renaming files to match new scheme * refactor(node): move some global node options to their respective node modules * refactor: unexporting moduleOpts and fields * refactor: variadic options for modules * refactor: removing lifecycle hooks * refactor: renaming node to nodebuilder * refactor: implementing review comments * fix: renaming test directories to nodebuilder * refactor: config setters separated from options, writing config to env for persisting options during initialization * refactor: minor review comments (cleaning clutter to get to the juicy stuff) * refactor: exporting share.Discovery, providing it directly, removing Full and Light availability constructors in nodebuilder/share * refactor: providing header service directly in module * refactor: making InitStore invoke directly without returning a function, removing dead code * fix: fixing issue where flags do not persist when init is called twice Co-authored-by: renaynay <[email protected]> * chore: removing dead code * refactor: deferring setting node config during flag parsing * refactor: collapsing switch in DefaultConfig * refactor: removing nodebuilder/daser/daser.go * refactor: fx lifecycle in for core/remote * chore: imports * refactor: removing all setters, moving checks to construction * refactor: adding cfg.ValidateBasic to each nodebuilder module * refactor: moving core sanity checks to cfg.ValidateBasic and populating default conf * fix: replacing IP on sanity check * renaming to sanitizeIP Co-authored-by @Wondertan Co-authored-by: Ryan <[email protected]> Co-authored-by: renaynay <[email protected]> * Fix issues with config persistence / invoking validation on config (#95) * fix config * make sure to save config before starting node, otherwise all overrides are lost * chore: lint * refactor|test(nodebuilder/tests): update fraud tests to use new nodebuilder configuration functionality * refactor(nodebuilder/header): adapt Fraud (with syncer) to refactoring changes * refactor(nodebuilder/header): restore logic that syncer fails with Warn if no chain head * fix(tests): fixing TestFraudProofSyncing * fix(cmd): not persisting config with flags on start * refactor(nodebuilder): consistent baseComponents, adding back daser proxy constructor, renaming Loader to ConfigLoader * lint: fixing goimports after rebase * chore(docs): removing multiline todo from godoc comment for new gofmt compliance * fix(test): Fixing rpc test from rebase * refactor(nodebuilder/fraud): Move fraud-related constructors into separate module * refactor(service/rpc): Wrap port parsing error * refactor(nodebuilder|service): Wrap config error messages with pkg name * refactor(nodebuilder): cfg.ValidateBasic -> cfg.Validate * refactor(nodebuilder): Move refresh routing period check into config validation and fix err check in rpc/config * refactor(das | nodebuilder/p2p): apply suggestions from @Wondertan approval review * fix(cmd): replace logger in cmd after rebase/merge conflict issues * refactor(cmd): set context with config at end of parsing, not in every individual flag parsing func * refactor(cmd): simplify returns in flags_p2p Co-authored-by: Ryan <[email protected]> Co-authored-by: Hlib Kanunnikov <[email protected]> Co-authored-by: renaynay <[email protected]>
- Loading branch information