-
Notifications
You must be signed in to change notification settings - Fork 27
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
State-bridge #488
Conversation
There was a problem hiding this 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?
Sure. I didn't really think of this as something to merge the way it is anyway. i just had it in |
e280a6d
to
cefd511
Compare
cefd511
to
6f59862
Compare
Got it. Lemme see what I can do about moving it so it compiles correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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 callportal_stateStore
to store each new piece of content in the node.if
numNodes = 2
, the StateBridge script will callportal_stateStore
to store each new piece of content in the FIRST node.if
numNodes > 2
, the StateBridge script will callportal_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.