Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

feat: add and run linter #131

Merged
merged 6 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ jobs:
- <<: *setup_kurtosis
- run: kurtosis run ${PWD}

lint:
executor: ubuntu_vm
steps:
- checkout
- <<: *setup_kurtosis
- run: kurtosis lint ${PWD}

run_starlark_arm64:
executor: ubuntu_vm
resource_class: arm.medium
Expand Down Expand Up @@ -68,18 +75,17 @@ workflows:
jobs:
# -- PR check jobs ------------------------------------------
- run_starlark:
context:
# This pulls in KurtosisBot's Github token, so that we can read from our private repos
- github-user
filters:
branches:
ignore:
- main
- run_starlark_arm64:
context:
# This pulls in KurtosisBot's Github token, so that we can read from our private repos
- github-user
filters:
branches:
ignore:
- main
- lint:
filters:
branches:
ignore:
- main
54 changes: 41 additions & 13 deletions main.star
Original file line number Diff line number Diff line change
@@ -1,18 +1,46 @@
participant_network = import_module("github.com/kurtosis-tech/eth-network-package/src/participant_network.star")
input_parser = import_module("github.com/kurtosis-tech/eth-network-package/package_io/input_parser.star")
participant_network = import_module(
"github.com/kurtosis-tech/eth-network-package/src/participant_network.star"
)
input_parser = import_module(
"github.com/kurtosis-tech/eth-network-package/package_io/input_parser.star"
)

static_files = import_module("github.com/kurtosis-tech/eth-network-package/static_files/static_files.star")
genesis_constants = import_module("github.com/kurtosis-tech/eth-network-package/src/prelaunch_data_generator/genesis_constants/genesis_constants.star")
static_files = import_module(
"github.com/kurtosis-tech/eth-network-package/static_files/static_files.star"
)
genesis_constants = import_module(
"github.com/kurtosis-tech/eth-network-package/src/prelaunch_data_generator/genesis_constants/genesis_constants.star"
)

def run(plan, args = {}):
args_with_right_defaults = input_parser.get_args_with_default_values(args)

num_participants = len(args_with_right_defaults.participants)
network_params = args_with_right_defaults.network_params
parallel_keystore_generation = args_with_right_defaults.parallel_keystore_generation
def run(plan, args={}):
args_with_right_defaults = input_parser.get_args_with_default_values(args)

plan.print("Launching participant network with {0} participants and the following network params {1}".format(num_participants, network_params))
all_participants, cl_genesis_timestamp, genesis_validators_root = participant_network.launch_participant_network(plan, args_with_right_defaults.participants, network_params, args_with_right_defaults.global_client_log_level, parallel_keystore_generation)
num_participants = len(args_with_right_defaults.participants)
network_params = args_with_right_defaults.network_params
parallel_keystore_generation = args_with_right_defaults.parallel_keystore_generation

plan.print("NODE JSON RPC URI: '{0}:{1}'".format(all_participants[0].el_client_context.ip_addr, all_participants[0].el_client_context.rpc_port_num))
return all_participants, cl_genesis_timestamp, genesis_validators_root
plan.print(
"Launching participant network with {0} participants and the following network params {1}".format(
num_participants, network_params
)
)
(
all_participants,
cl_genesis_timestamp,
genesis_validators_root,
) = participant_network.launch_participant_network(
plan,
args_with_right_defaults.participants,
network_params,
args_with_right_defaults.global_client_log_level,
parallel_keystore_generation,
)

plan.print(
"NODE JSON RPC URI: '{0}:{1}'".format(
all_participants[0].el_client_context.ip_addr,
all_participants[0].el_client_context.rpc_port_num,
)
)
return all_participants, cl_genesis_timestamp, genesis_validators_root
36 changes: 18 additions & 18 deletions package_io/constants.star
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
EL_CLIENT_TYPE = struct(
geth="geth",
erigon="erigon",
nethermind="nethermind",
besu="besu",
reth="reth",
ethereumjs="ethereumjs"
geth="geth",
erigon="erigon",
nethermind="nethermind",
besu="besu",
reth="reth",
ethereumjs="ethereumjs",
)

CL_CLIENT_TYPE = struct(
lighthouse="lighthouse",
teku="teku",
nimbus="nimbus",
prysm="prysm",
lodestar="lodestar"
lighthouse="lighthouse",
teku="teku",
nimbus="nimbus",
prysm="prysm",
lodestar="lodestar",
)

GLOBAL_CLIENT_LOG_LEVEL = struct(
info="info",
error="error",
warn="warn",
debug="debug",
trace="trace",
info="info",
error="error",
warn="warn",
debug="debug",
trace="trace",
)

VALIDATING_REWARDS_ACCOUNT = "0x878705ba3f8Bc32FCf7F4CAa1A35E72AF65CF766"
MAX_ENR_ENTRIES = 20
MAX_ENODE_ENTRIES = 20

GENESIS_VALIDATORS_ROOT_PLACEHOLDER = "GENESIS_VALIDATORS_ROOT_PLACEHOLDER"
GENESIS_VALIDATORS_ROOT_PLACEHOLDER = "GENESIS_VALIDATORS_ROOT_PLACEHOLDER"

DEFAULT_SNOOPER_IMAGE = "parithoshj/json_rpc_snoop:v1.0.0-x86"

ARCHIVE_MODE = True
ARCHIVE_MODE = True
Loading