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

Voting Key generation using typescript and multi file support #177

Merged
merged 24 commits into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fa72519
WIP Voting Key generation
fboucquez Mar 2, 2021
2c50839
Using root private key to sign the item
fboucquez Mar 2, 2021
c0a6d94
Added Gimre's vector tests
fboucquez Mar 2, 2021
c9eb9c0
Updated CHANGELOG.md
fboucquez Mar 2, 2021
f4a0457
Added 2.test-sign.json vector tests
fboucquez Mar 3, 2021
c631e13
Multi voting file support
fboucquez Mar 30, 2021
1bc94f3
Merge remote-tracking branch 'origin/dev' into native_voting_key_file
fboucquez May 11, 2021
070c7cc
Updated improvements
fboucquez May 11, 2021
a51bd07
fixed unit test
fboucquez May 11, 2021
181d971
Link command improvement. Unlinking old and linking up to 3 files
fboucquez May 14, 2021
0e1fad9
votingKeyDesiredLifetime rename
fboucquez May 14, 2021
2500a78
Merge remote-tracking branch 'origin/dev' into native_voting_key_file
fboucquez May 19, 2021
11d3b0a
Prettier to ignore generated files
fboucquez May 21, 2021
9a3157e
Merge branch 'dev' into native_voting_key_file
fboucquez May 21, 2021
3b62d86
Merge branch 'native_voting_key_file' of github.com:nemtech/symbol-bo…
fboucquez May 21, 2021
5c46791
Merge remote-tracking branch 'origin/dev' into native_voting_key_file
fboucquez May 24, 2021
e128b6c
Merge remote-tracking branch 'origin/dev' into native_voting_key_file
fboucquez May 27, 2021
36e2b4c
Merge remote-tracking branch 'origin/dev' into native_voting_key_file
fboucquez May 28, 2021
8416e08
Merge remote-tracking branch 'origin/dev' into native_voting_key_file
fboucquez May 31, 2021
45a9dac
Epoch is not resolved from the network when possible
fboucquez Jun 3, 2021
cd51e8a
Merge remote-tracking branch 'origin/dev' into native_voting_key_file
fboucquez Jun 8, 2021
fa5fed1
Feedback fixes
fboucquez Jun 14, 2021
a7207a3
Updated docs
fboucquez Jun 15, 2021
ea7c963
Update CHANGELOG.md
fboucquez Jun 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ The changelog format is based on [Keep a Changelog](https://keepachangelog.com/e
## [1.0.7] - NEXT
**Milestone**: Mainnet(1.0.1.0)

- Added multi voting key file support.
- Added `upgradeVotingKeys` command.

Copy link
Contributor

Choose a reason for hiding this comment

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

updateVotingKeys?

| Package | Version | Link |
| ---------------- | ------- | ------------------------------------------------------------------ |
| Symbol Bootstrap | v1.0.3 | [symbol-bootstrap](https://www.npmjs.com/package/symbol-bootstrap) |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ General users should install this tool like any other node module.
* [`symbol-bootstrap run`](docs/run.md) - It boots the network via docker using the generated `docker-compose.yml` file and configuration. The config and compose methods/commands need to be called before this method. This is just a wrapper for the `docker-compose up` bash call.
* [`symbol-bootstrap start`](docs/start.md) - Single command that aggregates config, compose and run in one line!
* [`symbol-bootstrap stop`](docs/stop.md) - It stops the docker-compose network if running (symbol-bootstrap started with --detached). This is just a wrapper for the `docker-compose down` bash call.
* [`symbol-bootstrap updateVotingKeys`](docs/updateVotingKeys.md) - It updates the voting files containing the voting keys when required.
* [`symbol-bootstrap verify`](docs/verify.md) - It tests the installed software in the current computer reporting if there is any missing dependency, invalid version, or software related issue.

<!-- commandsstop -->
Expand Down
2 changes: 1 addition & 1 deletion cmds/link-testnet-supernode-external-node.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
symbol-bootstrap link -t target/testnet-supernode --useKnownRestGateways $1 $2 $3 $4 $5 $6 $7
symbol-bootstrap link -t target/testnet-supernode --useKnownRestGateways --password 1111 $1 $2 $3 $4 $5 $6 $7
4 changes: 4 additions & 0 deletions cmds/stop-testnet-supernode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e
# docker rm -f $(docker ps -aq)
symbol-bootstrap stop -t target/testnet-supernode
3 changes: 3 additions & 0 deletions cmds/upgradeVotingKeys-testnet-supernode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
set -e
symbol-bootstrap upgradeVotingKeys -t target/testnet-supernode $1 $2 $3
3 changes: 0 additions & 3 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ OPTIONS
can be provided in the command line (--password=XXXX) or disabled in the
command line (--noPassword).

--pullImages It pulls the utility images from DockerHub when running the configuration.
It only affects alpha/dev docker images.

--report It generates reStructuredText (.rst) reports describing the configuration of
each node.

Expand Down
2 changes: 1 addition & 1 deletion docs/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ OPTIONS
line (--noPassword).

--pullImages
It pulls the utility images from DockerHub when running the configuration. It only affects alpha/dev docker images.
It pulls the images from DockerHub when running the configuration. It only affects alpha/dev docker images.

--report
It generates reStructuredText (.rst) reports describing the configuration of each node.
Expand Down
47 changes: 47 additions & 0 deletions docs/updateVotingKeys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
`symbol-bootstrap updateVotingKeys`
===================================

It updates the voting files containing the voting keys when required.

If the node's current voting file has an end epoch close to the current network epoch, this command will create a new 'private_key_treeX.dat' that continues the current file.

By default, bootstrap creates a new voting file once the current file reaches its last month. The current network epoch is resolved from the network or you can provide it with the `finalizationEpoch` param.

When a new voting file is created, Bootstrap will advise running the `link` command again.

* [`symbol-bootstrap updateVotingKeys`](#symbol-bootstrap-updatevotingkeys)

## `symbol-bootstrap updateVotingKeys`

It updates the voting files containing the voting keys when required.

```
USAGE
$ symbol-bootstrap updateVotingKeys

OPTIONS
-h, --help It shows the help of this command.

-t, --target=target [default: target] The target folder where the symbol-bootstrap network is
generated

-u, --user=user [default: current] User used to run docker images when creating the the voting
key files. "current" means the current user.

--finalizationEpoch=finalizationEpoch The network's finalization epoch. It can be retrieved from the /chain/info rest
endpoint. If not provided, the bootstrap known epoch is used.

DESCRIPTION
If the node's current voting file has an end epoch close to the current network epoch, this command will create a new
'private_key_treeX.dat' that continues the current file.

By default, bootstrap creates a new voting file once the current file reaches its last month. The current network
epoch is resolved from the network or you can provide it with the `finalizationEpoch` param.

When a new voting file is created, Bootstrap will advise running the `link` command again.

EXAMPLE
$ symbol-bootstrap updateVotingKeys
```

_See code: [src/commands/updateVotingKeys.ts](https://github.com/nemtech/symbol-bootstrap/blob/v1.0.7/src/commands/updateVotingKeys.ts)_
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"js-yaml": "^3.14.0",
"lodash": "^4.17.21",
"memorystream": "^0.3.1",
"noble-ed25519": "^1.0.3",
"node-forge": "^0.10.0",
"rxjs": "^6.6.3",
"semver": "^7.3.5",
Expand Down Expand Up @@ -100,8 +101,8 @@
"posttest": "eslint src/ test/ --ext .ts",
"oclif-doc": "oclif-dev manifest && oclif-dev readme --multi",
"prepack": "shx rm -rf lib && tsc -b && npm run oclif-doc",
"test": "nyc --reporter=lcov --extension .ts mocha -r ts-node/register --timeout 600000 --forbid-only \"test/**/*.test.ts\"",
"e2e": "nyc --reporter=lcov --extension .ts mocha -r ts-node/register --timeout 600000 --forbid-only \"test/**/*.e2e.ts\"",
"test": "nyc --reporter=lcov --extension .ts mocha -r ts-node/register --timeout 900000 --forbid-only \"test/**/*.test.ts\"",
"e2e": "nyc --reporter=lcov --extension .ts mocha -r ts-node/register --timeout 900000 --forbid-only \"test/**/*.e2e.ts\"",
"coveralls-report": "cat ./coverage/lcov.info | coveralls",
"version": "echo $npm_package_version",
"install-cli": "npm pack && npm i -g",
Expand Down
3 changes: 3 additions & 0 deletions presets/bootstrap/network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ harvestingName: 'harvest'
explorerUrl: http://localhost:90/
faucetUrl: http://localhost:100/
beneficiaryAddress: ''
votingKeyDesiredLifetime: 720
votingKeyDesiredFutureLifetime: 120
lastKnownNetworkEpoch: 1
restExtensions: 'accountLink, aggregate, lockHash, lockSecret, mosaic, metadata, multisig, namespace, receipts, restrictions, transfer'
nemesis:
mosaics:
Expand Down
Loading