2

I am setting up a Hyperledger Sawtooth network. In /etc/sawtooth/validator.toml.example, I saw the following:

# A Curve ZMQ key pair are used to create a secured network based on side-band
# sharing of a single network key pair to all participating nodes.
# Note if the config file does not exist or these are not set, the network
# will default to being insecure.
network_public_key = 'wFMwoOt>yFqI/ek.G[tfMMILHWw#vXB[Sv}>l>i)'
network_private_key = 'r&oJ5aQDj4+V]p2:Lz70Eu0x#m%IwzBdP(}&hWM*'

Can anybody tell me how to create another keypair?

Martijn Dirkse
  • 543
  • 7
  • 16

1 Answers1

0

These are the ZMQ message keys used to securely communicate with other nodes.

If you've installed sawtooth already, python3 and python3-zmq would have been already installed and available in your system. Here's an example to create the keypair in Python:

import zmq
(public, secret) = zmq.curve_keypair()
print("network_public_key =", public.decode("utf-8"),
      "\nnetwork_private_key =", secret.decode("utf-8"))

Also, if you can use a compiled binary tool:

$ sudo apt-get install g++ libzmq3-dev
$ wget https://raw.githubusercontent.com/zeromq/libzmq/master/tools/curve_keygen.cpp
$ g++ curve_keygen.cpp -o curve_keygen -lzmq
$ ./curve_keygen

Copy the corresponding public key output to network_public_key and the private key output to network_private_key fields in /etc/sawtooth/validator.toml

The above was from my Sawtooth FAQ at https://sawtooth.hyperledger.org/faq/validator/#how-do-i-generate-the-network-public-key-and-network-private-key-in-validator-toml

Dan Anderson
  • 2,265
  • 1
  • 9
  • 20