Important dependencies:
Library and CLI to work with the ETH keystore file:
- Parse the private key using the keystore password
- Use the private key to get shares for operators
- Build the payload for the transaction
If you want to run a compiled version (easier option then CLI)
- Go to the releases section: https://github.com/bloxapp/ssv-keys/releases
- Select the latest release for the specific version of the CLI:
vX.Y.Z-v1
- for the first version of the contract,vX.Y.Z-v2
- for second etc. Example:v0.0.1-v1
orv0.0.1-v2
. - Download the native executable for your operating system:
ssv-keys-lin
- for Ubuntu Linuxssv-keys-mac
- for MacOSssv-keys.exe
- for Windows
- Open terminal and change the directory to where you downloaded the executable. For instance, on MacOS you can:
cd ~/Downloads
- (Mac and Linux) Make sure that the executable has permissions to run by running:
chmod 777 ./ssv-keys-mac
- Now you can run it:
./ssv-keys-mac
- If your operating system prevents you from running the executable you can open it from the file manager (Finder in case of MacOS), right click on it, and click the
Open
menu. Once open click theOpen
orallow
button when you are asked to do so. After this go back to the console and try to run it again.
This installation requires NodeJS on your machine. You can download it here.
Once you have installed NodeJS, follow instructions:
git clone https://github.com/bloxapp/ssv-keys.git
cd ssv-keys
npm install -g yarn
yarn install
yarn cli --help
- For regular CLI usage you will be running the command as:
yarn cli ...
- Follow installation instructions.
Help on available actions:
yarn cli --help
Help on a specific action:
yarn cli <action> --help
Input parameters:
- keystore (ks) = Path to keystore json file
- password (ps) = Keystore password
- operators (op) = Comma-separated list of the operator keys
- output-format (of) = Format of the result (abi or raw)
yarn cli shares --keystore=src/lib/EthereumKeyStore/__tests__/test.keystore.json --password=testtest --operators=...,...,... --output-format=raw
Output: Shares and path to file holding the shares
Input parameters:
- keystore (ks) = Path to keystore json file
- password (ps) = Keystore password
- operators (op) = Comma-separated list of the operator keys
- operator-ids (oid) = Comma-separated list of the operator ids (same sequence as operators)
- ssv-amount (ssv) = SSV Token amount fee required for this transaction in Wei
yarn cli shares --private-key=... -op=...,...,...,... --output=./shares.json
Output: Transaction payload and path to file holding the transaction payload
To run an example of a NodeJS project containing all the code snippets to build the share and transaction payload, simply follow these instructions!
cd examples/node
yarn install
To run a JavaScript example:
yarn start:js
To run a TypeScript example:
yarn start:ts
Go to the example folder and then install all the dependencies:
cd examples/browser
yarn install
Start the web app:
yarn start
Open the developer console to see how it works in a browser environment.
yarn dev:cli ...
yarn cli ...
yarn lint
yarn test
In watch mode during development
yarn test --watchAll
Build TypeScript into JavaScript
yarn build
Build for NodeJs using esbuild
yarn esbuild
Build everything
yarn build-all
- Make it possible to use a specific number of signers (Currently with a default of 4). Read: From Crash to Byzantine Consensus with 2f + 1 Processes
MIT License