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

State-bridge #488

Merged
merged 14 commits into from
Oct 26, 2023
Merged

State-bridge #488

merged 14 commits into from
Oct 26, 2023

Conversation

ScottyPoi
Copy link
Collaborator

Bridge script to generage state network content

from packages/cli
run npx ts-node --esm scripts/bridgeThread.ts

This will request new block data every 12 seconds using a (free) Alchemy API_KEY, then spin up a worker_thread to request any additional data (proofs, etc.) and generate state_network content.

Without any additional options, the script will simply log statistics about the content.

Pass in cli options to pump data into a devnet
--devnet=true
--numNodes
--port

the "port" options refers to the RPC port number of the first node, and assumes that a devnet will consist of nodes at consecutive ports incrementing from this. It defaults to 8545.

If numNodes = 1, the StateBridge script will call portal_stateStore to store each new piece of content in the node.

if numNodes = 2, the StateBridge script will call portal_stateStore to store each new piece of content in the FIRST node.

if numNodes > 2, the StateBridge script will call portal_stateGossip for each new piece of content, alternating which node is being called with each new block. This would simulate a network of "bootnodes" each producing a share of content to pump into the network.

Copy link
Collaborator

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

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

Will review this more throughout today. But one comment is stateBridge.ts should be in cli/scripts and not part of our source code for the cli, right?

@ScottyPoi
Copy link
Collaborator Author

Will review this more throughout today. But one comment is stateBridge.ts should be in cli/scripts and not part of our source code for the cli, right?

Sure. I didn't really think of this as something to merge the way it is anyway. i just had it in cli/src so that it would automatically compile with npm run build

@ScottyPoi ScottyPoi marked this pull request as draft October 25, 2023 21:44
@acolytec3 acolytec3 mentioned this pull request Oct 26, 2023
7 tasks
@acolytec3
Copy link
Collaborator

6f59862

Got it. Lemme see what I can do about moving it so it compiles correctly.

@acolytec3 acolytec3 marked this pull request as ready for review October 26, 2023 18:18
Copy link
Collaborator

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

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

LGTM

@acolytec3 acolytec3 merged commit 705d192 into master Oct 26, 2023
4 checks passed
@acolytec3 acolytec3 deleted the state-bridge branch October 26, 2023 18:55
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