Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Validator registration tool #645

Closed

Conversation

viquezclaudio
Copy link
Member

This NodeJS script is used to register validators for the Nimiq PoS chain The script itself is a nano node that will automatically connect to the Nimiq PoW chain and send the required validator registration transactions. Note: The Validator Account needs to have enough funds to pay the transaction

Pull request checklist

  • All tests pass. Demo project builds and runs.
  • I have resolved any merge conflicts.

@jsdanielh jsdanielh force-pushed the viquezcl/registration_tool branch from 5e14864 to 5d0f4ef Compare November 13, 2023 16:47
@viquezclaudio viquezclaudio force-pushed the viquezcl/registration_tool branch 2 times, most recently from cc5afef to 71cbe71 Compare November 13, 2023 19:22
@jsdanielh jsdanielh force-pushed the viquezcl/registration_tool branch from 71cbe71 to 11796d7 Compare November 13, 2023 19:27
clients/nodejs/validator-registration.js Show resolved Hide resolved
clients/nodejs/validator-registration.js Outdated Show resolved Hide resolved
clients/nodejs/validator-registration.js Outdated Show resolved Hide resolved
clients/nodejs/validator-registration.js Outdated Show resolved Hide resolved
clients/nodejs/validator-registration.js Outdated Show resolved Hide resolved
Comment on lines +304 to +337
let result = await $.client.sendTransaction(transaction);

console.log(' Transaction result: ');
console.log(result);

console.log(' Transaction hash: ');
console.log(transaction.hash().toHex());
Copy link
Member

Choose a reason for hiding this comment

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

Each further transaction sending should maybe fail, if a tx fails to send? E.g. if it reports as result.state === 'new'?

If the txs are all in the same block, their order is not guaranteed I think. Is the PoS genesis-generating script able to work with unsorted transactions?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question, since they are 0 value txns they should not fail..
The PoS generation script is able to work with unsorted transactions:
As part of the encoding that we created for the tx data, we are using 1 byte as "type" which is just a number to indicate the order of the registration txn. So the migration tool will look this number to sort the registration txns.

clients/nodejs/validator-registration.js Outdated Show resolved Hide resolved
clients/nodejs/validator-registration.js Outdated Show resolved Hide resolved
@viquezclaudio viquezclaudio force-pushed the viquezcl/registration_tool branch from 91766ef to 7cae0ec Compare April 4, 2024 15:16
@viquezclaudio viquezclaudio force-pushed the viquezcl/registration_tool branch 2 times, most recently from 57ca81b to 2c4c1a0 Compare April 8, 2024 14:31
@viquezclaudio viquezclaudio force-pushed the viquezcl/registration_tool branch from 2c4c1a0 to 8ccc144 Compare April 10, 2024 15:27
clients/nodejs/validator-registration.js Outdated Show resolved Hide resolved
This NodeJS script is used to register validators for the Nimiq PoS chain
The script itself is a nano node that will automatically connect to the Nimiq PoW chain
and send the required validator registration transactions.
Note: The Validator Account needs to have enough funds to pay the transactions
@viquezclaudio viquezclaudio force-pushed the viquezcl/registration_tool branch from 8ccc144 to 7d72573 Compare April 10, 2024 23:58
@jeffesquivels
Copy link
Member

jeffesquivels commented Apr 13, 2024

The tool discussed in this PR was moved to its own repository: https://github.com/nimiq/validator-registration-tool.

Closing the PR as it is no longer relevant for core-js.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants