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

local fake chain nodes #140

Merged
merged 32 commits into from
May 9, 2024
Merged

local fake chain nodes #140

merged 32 commits into from
May 9, 2024

Conversation

bitful-pannul
Copy link
Contributor

@bitful-pannul bitful-pannul commented Apr 26, 2024

Problem

fakenode networking not using internal components or chain indexing.

Solution

boot a fakechain in kit (foundry::anvil), and have kns_indexer conditionally index on local chain 31337 instead of optimism.

Docs Update

running instructions:
have updated kit and runtime PR branch
kit f --runtime-path ~/yo/runtime (will boot fakechain on port 8545 if doesn't exist and register fake.dev)
kit f --runtime-path ~/yo/runtime --fake-node-name second (registers second.dev)

Corresponding docs PR

Notes

simulation mode runtime flag for processes rather than during buildtime?

TODO in runtime:

  • check for existing names and reregister [x]

@bitful-pannul bitful-pannul marked this pull request as ready for review April 29, 2024 19:32
@nick1udwig
Copy link
Collaborator

In future, please clean up old branches! I was trying to get bp/realfakenode to work only to realize this branch is actually bp/realfakenodes with an s.

@nick1udwig
Copy link
Collaborator

Tue 14:35 http_server: running on port 8080
fake.dev > thread 'tokio-runtime-worker' panicked at /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/warp-0.3.7/src/server.rs:217:27:
                                                                                                                                                     error binding to 0.0.0.0:8080: error creating server listener: Address already in use (os error 98)
                                                                     note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

note I do not have 8080 occupied

@nick1udwig
Copy link
Collaborator

I think the problem is the ws_routing lines in this commit: kinode-dao/kinode@af877a0#diff-a42b3d9fdebb1ee94e80c9b7e50185e119aeb6cd4f4a9b251649b421f1f4c151R484

@nick1udwig
Copy link
Collaborator

Changing them to None again makes it boot fine.

Copy link
Collaborator

@nick1udwig nick1udwig left a comment

Choose a reason for hiding this comment

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

I'm surprised how little code had to change: very cool for such a big functionality unlock!

Added some comments, please address/discuss. Let's get the Kinode core PR working and then I'll test.

src/boot_fake_node/mod.rs Outdated Show resolved Hide resolved
src/boot_fake_node/mod.rs Outdated Show resolved Hide resolved
src/boot_fake_node/mod.rs Outdated Show resolved Hide resolved
src/boot_fake_node/mod.rs Outdated Show resolved Hide resolved
src/boot_fake_node/mod.rs Outdated Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
src/main.rs Show resolved Hide resolved
src/run_tests/mod.rs Outdated Show resolved Hide resolved
src/setup/mod.rs Outdated Show resolved Hide resolved
src/setup/mod.rs Outdated Show resolved Hide resolved
@bitful-pannul
Copy link
Contributor Author

bitful-pannul commented May 3, 2024

Tue 14:35 http_server: running on port 8080
fake.dev > thread 'tokio-runtime-worker' panicked at /home/nick/.cargo/registry/src/index.crates.io-6f17d22bba15001f/warp-0.3.7/src/server.rs:217:27:
                                                                                                                                                     error binding to 0.0.0.0:8080: error creating server listener: Address already in use (os error 98)
                                                                     note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

note I do not have 8080 occupied

fixed by: kinode-dao/kinode@c4227b4 !

Copy link
Collaborator

@nick1udwig nick1udwig left a comment

Choose a reason for hiding this comment

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

Going to test now

Cargo.toml Outdated Show resolved Hide resolved
src/chain/mod.rs Outdated Show resolved Hide resolved
src/chain/mod.rs Outdated Show resolved Hide resolved
src/chain/mod.rs Outdated Show resolved Hide resolved
src/chain/mod.rs Outdated Show resolved Hide resolved
src/run_tests/cleanup.rs Outdated Show resolved Hide resolved
src/chain/mod.rs Outdated Show resolved Hide resolved
src/run_tests/mod.rs Outdated Show resolved Hide resolved
src/run_tests/mod.rs Outdated Show resolved Hide resolved
src/run_tests/mod.rs Outdated Show resolved Hide resolved
@nick1udwig
Copy link
Collaborator

nick1udwig commented May 8, 2024

EDIT: Ignore; I was on wrong branch again 😔

nick@pop-os:~/git/kit (bp/realfakenode $=)$ kit f -r ~/git/kinode -p 8081
Compiling Kinode runtime...
Done compiling Kinode runtime.
network_router: online at 9001
error: unexpected argument '--network-router-port' found

  tip: to pass '--network-router-port' as a value, use '-- --network-router-port'

Usage: kinode --port <PORT> <home>

For more information, try '--help'.
Cleaning up "/tmp/kinode-fake-node"...
Done cleaning up "/tmp/kinode-fake-node".

@nick1udwig
Copy link
Collaborator

nick1udwig commented May 8, 2024

EDIT: Ignore; I was on wrong branch again 😔

nick@pop-os:~/git/core-tests (bp/fakechain *$=)$ kit t
ERROR src/main.rs:788: 
   0: TOML parse error at line 6, column 1
   0:   |
   0: 6 | [[tests]]
   0:   | ^^^^^^^^^
   0: missing field `network_router`
   0: 

Location:
   /home/nick/git/kit/src/run_tests/mod.rs:421

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   0: kit::run_tests::execute
      at src/run_tests/mod.rs:416

@nick1udwig
Copy link
Collaborator

nick1udwig commented May 8, 2024

EDIT: Ignore; I was on wrong branch again 😔
Maybe a bad merge to develop?

Copy link
Collaborator

@nick1udwig nick1udwig left a comment

Choose a reason for hiding this comment

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

Some small comments + the select question. Almost there!

src/chain/mod.rs Show resolved Hide resolved
src/chain/mod.rs Outdated Show resolved Hide resolved
src/chain/mod.rs Show resolved Hide resolved
src/chain/mod.rs Outdated Show resolved Hide resolved
src/run_tests/mod.rs Outdated Show resolved Hide resolved
@nick1udwig
Copy link
Collaborator

Really nice work @bitful-pannul . This is a huge step forward in functionality. More work to do to make it even coolers (e.g., making it possible/easy to send TXs, etc), but this is a big unlock

Copy link
Collaborator

@nick1udwig nick1udwig left a comment

Choose a reason for hiding this comment

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

🚀

@nick1udwig nick1udwig merged commit a18a97d into master May 9, 2024
@nick1udwig nick1udwig deleted the bp/realfakenodes branch May 9, 2024 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants