Dirk allows for import and export of slashing protection data using the slashing protection interchange format.
To export slashing protection data run Dirk with the --export-slashing-protection
flag. This command requires an additional parameter, --genesis-validators-root
, which is chain-specific and required to ensure that imports in to other signers can validate the data.
Dirk itself does not use the genesis-valdiators-root
information. It is recommended that a single instance of Dirk only ever be used for a single Ethereum 2 chain.
For example, a complete command to export slashing protection data may be:
dirk --export-slashing-protection --genesis-validators-root=0x04700007fabc8282644aed6d1c7c9e21d38a03a0c4ba193f3afe428824b3a673
The data is exported to the console. It can be exported to a file by adding the --slashing-protection-file
option with the required file as its value.
Note that Dirk must not be active when slashing protection data is imported. If an attempt to export slashing protection data is made against an active Dirk instance it will return an error.
To import slashing protection data run Dirk with the --import-slashing-protection
flag. This command requires the additional parameters --genesis-validators-root
as above and --slashing-protection-file
for the location of the exported data.
For example, a complete command to import slashing protection data may be:
dirk --import-slashing-protection --genesis-validators-root=0x04700007fabc8282644aed6d1c7c9e21d38a03a0c4ba193f3afe428824b3a673 --slashing-protection-file=protection.json
The value supplied by genesis-validators-root
must match that in the imported file.
If there is an attempt to import data that already exists in Dirk's slashing protection database it will only import the data if it is not older than the existing data. If it is older, the data will not be imported and a warning message printed. Existing entries in Dirk's slashing protection database that are not overwritten by the imported data will be retained.