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

Homi has new flag *nodekey-dir #2105

Merged
merged 5 commits into from
Feb 6, 2024
Merged

Homi has new flag *nodekey-dir #2105

merged 5 commits into from
Feb 6, 2024

Conversation

ian0371
Copy link
Contributor

@ian0371 ian0371 commented Feb 5, 2024

Proposed changes

New flags {c,p,e}n-nodekey-dir has been added to homi. See further comments for a sample input.
With the flags, homi uses the given keys for nodes instead of generating random keys.

Priority for CN keys: cn-nodekey-dir > mnemonic > randomly generated nodekeys
Priority for PN,EN keys: {p,e}n-nodekey-dir > randomly generated nodekeys
(fyi, see mnemonic flag from #1813)

Types of changes

Please put an x in the boxes related to your change.

  • Bugfix
  • New feature or enhancement
  • Others

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING GUIDELINES doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Further comments

How to test:

  1. Create keys
#!/bin/bash
NUM_CN=1
NUM_PN=2
NUM_EN=4

mkdir -p keys
for i in $(seq 1 $NUM_CN); do
    xxd -l 32 -c 32 -p /dev/urandom | tr -d '\n' > keys/nodekey$i
done

mkdir -p keys_pn
for i in $(seq 1 $NUM_PN); do
    xxd -l 32 -c 32 -p /dev/urandom | tr -d '\n' > keys_pn/nodekey$i
done

mkdir -p keys_en
for i in $(seq 1 $NUM_EN); do
    xxd -l 32 -c 32 -p /dev/urandom | tr -d '\n' > keys_en/nodekey$i
done
  1. Run homi
homi --cn-num 1 --pn-num 2 --en-num 4 --cn-nodekey-dir keys/ --pn-nodekey-dir keys_pn/ --en-nodekey-dir keys_en/ docker
  1. Run network
cd homi-output
docker compose up

blukat29
blukat29 previously approved these changes Feb 5, 2024
@ian0371 ian0371 merged commit 6525d19 into klaytn:dev Feb 6, 2024
11 checks passed
@ian0371 ian0371 deleted the homi-nodekey branch February 6, 2024 07:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants