Files
linea-monorepo/operations
kyzooghost a5119c43b0 Feat/husky lint (#431)
* add poc husky lint script

* test commit change

* undo test change

* test change

* undo test change

* test

* test

* test

* test

* do

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* refactor to pre-commit to NodeJS script

* add logs for demo

* small refactor of pre-commit.js

* add shebang to pre-commit

* add other folders to husky script

* added postman to pre-commit

* remove test md change

* add comments for pre-commit.js

* adjust lint:fix scripts

* Update .husky/pre-commit.js

Co-authored-by: The Dark Jester <thedarkjester@users.noreply.github.com>
Signed-off-by: kyzooghost <73516204+kyzooghost@users.noreply.github.com>

---------

Signed-off-by: kyzooghost <73516204+kyzooghost@users.noreply.github.com>
Co-authored-by: The Dark Jester <thedarkjester@users.noreply.github.com>
2024-12-20 23:34:59 +11:00
..
2024-07-31 18:17:20 +02:00
2024-12-20 23:34:59 +11:00
2024-07-31 18:17:20 +02:00

synctx

Generated by oclif

Sync pending transactions from source to target node. Supports both Besu and Geth clients.

How Does It Work

The tool grabs pending transactions in the txpool for both the source and target node. Then, it compares the pending transactions in both pools to determine which transactions we need to sync, as some transactions are already persisted in the target node. The comparison is performmed on the transaction hash. To perform the actual sync, the tool will batch send transactions in groups of 10 (controlled by the --concurrency flag) to help with performance. The batch transactions are sent asynchronously, but the controlling concurrent loop is synchronous.

Install

  1. Download and extract the zip on the release page. Each release contains multiple distributions. Find the distribution that works for your machine type.
  2. When unzipping the release contents, a synctx folder is extracted which contains the command line entrypoint inside the bin directory.
  3. Move the extracted content to a path of your choosing, such as /usr/local/synctx
  4. Edit your PATH variable to include synctx, PATH="$PATH:/usr/local/synctx/bin make sure to persist this change in your .profile | .bash_profile | .zsh_profile
  5. Run synctx --help to confirm that the install has completed successfully.

Docker

As an alternative to downloading the distribution, you can also run the tool via Docker. This builds the distribution inside the image and exposes synctx as an entrypoint. From there, you may simply run docker run synctx:latest --help

Building the image can be done with docker build . -t synctx:latest

How To Sync

To sync transactions between nodes, first make sure you have port-forwarded to the necessary Kubernetes services or pods. kubectl port-forward {service|pod}/{service_name|pod_name}

How to port-forward in K8s

Then provide the source and target nodes, where the source node is the node pending transactions will be synced from.
synctx -s http://localhost:8500 -t http://localhost:8501

To perform a dry run and verify if the corrent nodes are targetted, include the --dry-run flag.
synctx -s http://localhost:8500 -t http://localhost:8501 --dry-run

Ethstats

Mainnet Testnet

Local Development

It is highly recommended to read the official docs of oclif as it is used to generate the CLI.

To run the tool against your local changes (without constantly building it), run ./bin/dev.js

Commands

synctx

USAGE
  $ synctx -s <value> -t <value> [--dry-run] [--local] [-c <value>]

CONFIG FLAGS
  -c, --concurrency=<value>  [default: 10] number of concurrent batch requests
  --dry-run                  enable dry run
  --local                    enable local run, provide only forwarded ports

NODE FLAGS
  -s, --source=<value>  (required) source node to sync from
  -t, --target=<value>  (required) target node to sync to

EXAMPLES
  $ synctx  --source=8500 --target=8501 --local

  $ synctx  --source=http://geth-archive-1:8545 --target=http://geth-validator-1:8545 --concurrency=10

See code: dist/index.ts

synctx help [COMMANDS]

Display help for synctx.

USAGE
  $ synctx help [COMMANDS] [-n]

ARGUMENTS
  COMMANDS  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for synctx.

See code: @oclif/plugin-help