-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat: bootnode mode #97
Conversation
List Test Configuration like this:
|
@@ -20,7 +20,7 @@ class ValidatorDockerComposeYaml extends DockerComposeYaml { | |||
volumes: [`${bdkPath}/validator${validatorNum}/data/:/data`], | |||
entrypoint: [ | |||
'/bin/sh', '-c', | |||
`geth init --datadir /data /data/genesis.json; geth --datadir /data --networkid ${chainId} --nodiscover --verbosity 3 --syncmode full --nousb --mine --miner.threads 1 --miner.gasprice 0 --emitcheckpoints --http --http.addr 0.0.0.0 --http.port 8545 --http.corsdomain "*" --http.vhosts "*" --ws --ws.addr 0.0.0.0 --ws.port 8546 --ws.origins "*" --http.api admin,trace,db,eth,debug,miner,net,shh,txpool,personal,web3,quorum,istanbul,qbft --ws.api admin,trace,db,eth,debug,miner,net,shh,txpool,personal,web3,quorum,istanbul,qbft --port ${peerPort} `, | |||
`geth init --datadir /data /data/genesis.json; geth --datadir /data --networkid ${chainId} --verbosity 3 --syncmode full --nousb --mine --miner.threads 1 --miner.gasprice 0 --emitcheckpoints --http --http.addr 0.0.0.0 --http.port 8545 --http.corsdomain "*" ${(bootnode) ? '--bootnodes '.concat(nodeEncode) : ''} --http.vhosts "*" --ws --ws.addr 0.0.0.0 --ws.port 8546 --ws.origins "*" --http.api admin,trace,db,eth,debug,miner,net,shh,txpool,personal,web3,quorum,istanbul,qbft --ws.api admin,trace,db,eth,debug,miner,net,shh,txpool,personal,web3,quorum,istanbul,qbft --port ${peerPort} `, |
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.
after delete nodiscover
, is it still comply with static node standard?
and we should make this entrypoint more beautiful
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.
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.
${(bootnode) ? '--bootnodes '.concat(nodeEncode) : '--nodiscover'}
src/quorum/command/network/create.ts
Outdated
Object.values(isbootNodeList).forEach((item: any) => { | ||
item.forEach((node: any) => { | ||
bootNodeList[node] = true |
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.
use flat() to save a foreach
loop
Object.values(isbootNodeList).flat().forEach(node => {
bootNodeList[node] = true
})
src/quorum/command/network/create.ts
Outdated
const nodelist = [] | ||
for (let i = 0; i < validatorNumber; i += 1) { | ||
nodelist.push( | ||
{ | ||
title: `validator${i}`, | ||
value: `${i}`, | ||
}, | ||
) | ||
} | ||
for (let i = 0; i < memberNumber; i += 1) { | ||
nodelist.push( | ||
{ | ||
title: `member${i}`, | ||
value: `${i + validatorNumber}`, | ||
}, | ||
) | ||
} |
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.
I think nodelist use Array.from()
can much more prettier?
const createNode = (type: string, index: number, offset = 0) => ({
title: `${type}${index}`,
value: `${index + offset}`,
})
const nodelist = [
...Array.from({ length: validatorNumber }, (_, i) => createNode('validator', i)),
...Array.from({ length: memberNumber }, (_, i) => createNode('member', i, validatorNumber)),
]
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.
It's a optional fix
@@ -18,6 +18,8 @@ export interface NetworkCreateType { | |||
validatorNumber: number | |||
memberNumber: number | |||
alloc: AllocType[] | |||
isBootNode: boolean | |||
bootNodeList: any[] |
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.
bootNodeList: any[] -> boolean[]
* refactor: replace all then to promise (#96) * feat: bootnode mode (#97) * feat: bootnode mode * feat: assign specified node to be bootnode * fix: remove console log * fix: eslink and test * fix: adjust for pr comments * feat: optimize create network process (#100) * feat: transform bdk ui to quorum dashboard (#99) * feat: bdk ui dashboard * fix: modify reviewed code * fix(ui): network info json location --------- Co-authored-by: kidneyweak <kidneyweak@gmail.com> * fix: modify ui to dashboard (#101) * update: 2.1.0 bdk dashboard * fix(ca): promise catch test error (#103) --------- Co-authored-by: Chengwei-Lin <39145342+LinXJ1204@users.noreply.github.com> Co-authored-by: JakeKuo <jake0627a1@gmail.com> Co-authored-by: PianoChicken <pianochicken1996@gmail.com>
PULL REQUEST
Before
說明 (Description)
相關問題 (Linked Issues)
貢獻種類 (Type of change)
測試環境 (Test Configuration):
檢查清單 (Checklist):
我已完成以上清單,並且同意遵守 Code of Conduct
I have completed the checklist and agree to abide by the code of conduct.