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

Generator v0.1.7 #108

Closed
wants to merge 19 commits into from
Closed

Generator v0.1.7 #108

wants to merge 19 commits into from

Conversation

wanwiset25
Copy link
Collaborator

No description provided.

@wanwiset25 wanwiset25 requested a review from liam-lai December 15, 2023 07:24
@@ -0,0 +1,175 @@
const crypto = require('crypto');
Copy link
Collaborator

Choose a reason for hiding this comment

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

All comparation in js, best practice use === matching with type.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, updated

Comment on lines 23 to 25
port = 20303+i-1
rpcport = 8545+i-1
wsport= 9555+i-1
Copy link
Collaborator

Choose a reason for hiding this comment

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

why -1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

because 'i' starts at 1 in this loop.

Copy link
Collaborator

Choose a reason for hiding this comment

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

then can you start with 20302?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure, just thought it's easier to read when number is the same as start port

var config_env = `
INSTANCE_NAME=subnet${subnet_id}
PRIVATE_KEY=${private_key}
BOOTNODES=enode://cc566d1033f21c7eb0eb9f403bb651f3949b5f63b40683917\
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this bootnode constant

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess so. It doesn't matter what value we use here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't get that... so any value will do? Then just put 000

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just tested 0000 and aaaaa. It doesn't work. Seems it has to be a correct address format but any valid addr will work.

Comment on lines 116 to 126
switch (config.parentnet.network){
case 'devnet':
url='https://devnetstats.apothem.network/devnet'
break
case 'testnet':
url='https://erpc.apothem.network/'
break
case 'mainnet':
url='https://devnetstats.apothem.network/mainnet' //confirm url
break
default:
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you make json config for those mapping and import here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

easier to change and expand

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, updated.

"validators": validators,
"gap": 450,
"epoch": 900,
"xdcparentnet": "https://devnetstats.apothem.network/devnet",
Copy link
Collaborator

Choose a reason for hiding this comment

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

need to make this as variable right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

huh I never noticed this is fixed. Anyways in new CSC galaxy moved this config to different file. Will change next PR.

@@ -0,0 +1,41 @@


Copy link
Collaborator

Choose a reason for hiding this comment

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

why 2 new lines?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed

Comment on lines +98 to +102
var official_urls = {
'devnet':'https://devnetstats.apothem.network/devnet' ,
'testnet':'https://erpc.apothem.network/' ,
'mainnet': 'https://devnetstats.apothem.network/mainnet' //confirm url
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is not what I mean, have a json config put those values in, and read it. Like this way: https://github.com/XinFinOrg/XDC-blockchain-monitor/blob/main/config.json#L27

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmm, I don't know, that creates more files. We don't have that many constants and the object is a form of json.

@liam-lai
Copy link
Collaborator

please rebase your commits also

@wanwiset25
Copy link
Collaborator Author

use another PR
#110

@wanwiset25 wanwiset25 closed this Dec 18, 2023
@wanwiset25 wanwiset25 deleted the generator-v0.1.7 branch December 18, 2023 10:52
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