transit

command
v0.23.4-rest-events Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2022 License: AGPL-3.0 Imports: 1 Imported by: 0

README

Transit Bootstrap scripts

The transit script facilitates nodes uploading their public keys to dapper servers.

It also then handles securely receiving their RB Keys and network metadata after bootstrap data is created.

For consensus nodes, it is used to pull the root block and private RB keys, sign the root block, and send the vote to dapper servers where it is used to generate the root QC for a new spork.

Server token

The server token is needed with the -t flag for all commands. It authenticates the script to the server so that only trusted parties with the token may upload their node info and be included in the bootstrap data.

Usage

$ transit push -t ${server-token} -d ${bootstrap-dir} -r ${flow-role}
$ transit pull -t ${server-token} -d ${bootstrap-dir} -r ${flow-role}
Push

Running transit push will perform the following actions:

  1. Create a Transit Keypair with libsodium and write it to
    • transit-key.pub.<id>
    • transit-key.priv.<id>
  2. Upload the node's public files to the server
    • transit-key.pub.<id>
    • node-info.pub.<id>.json
Pull

After bootstrapping, running transit pull will:

  1. Fetch the following files:

    • dkg-data.pub.json
    • node-infos.pub.json
    • root-protocol-snapshot.json
    • execution-state [dir]
    • random-beacon.priv.json.<id>.enc
  2. Decrypt random-beacon.priv.json.<id>.enc using the transit keys

    • random-beacon.priv.json
Wrapping Responses

The transit script also has wrap for the other end of the connection. This function takes a private random-beacon key and wraps it with the corresponding transit key, which can then be sent back to the node.

$ transit wrap -i ${ID} -r ${flow-role}

The wrap function:

  1. Takes in random-beacon.priv.json and produces
    • random-beacon.priv.json.<id>.enc
  2. Uploads random-beacon.priv.json.<id>.enc to the server

Consensus nodes

The transit script has two commands which are only used by consensus nodes:

$ transit pull-root-block -t ${server-token} -d ${bootstrap-dir}
$ transit generate-root-block-vote -t ${server-token} -d ${bootstrap-dir}
$ transit push-root-block-vote -t ${server-token} -d ${bootstrap-dir} -v ${vote-file}
Pull Root Block and Random Beacon Key

Running transit pull-root-block will perform the following actions:

  1. Fetch the root block for the upcoming spork and write it to <bootstrap-dir>/public-root-information/root-block.json
  2. Fetch the random beacon key random-beacon.priv.json.<id>.enc and decrypt it using the transit keys
Sign Root Block

After the root block and random beacon key have been fetched, running transit generate-root-block-vote will:

  1. Create a combined signature over the root block using the node's private staking key and private random beacon key.
  2. Store the resulting vote to the file <bootstrap-dir>/private-root-information/private-node-info_<node_id>/root-block-vote.json
Upload Vote

Once a vote has been generated, running transit push-root-block-vote will upload the vote file to the server.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL