Skip to content

Instantly share code, notes, and snippets.

@kentbull
Last active November 30, 2024 00:04
Show Gist options
  • Save kentbull/36f7fa15829e2956dac2a4fa4c01ac47 to your computer and use it in GitHub Desktop.
Save kentbull/36f7fa15829e2956dac2a4fa4c01ac47 to your computer and use it in GitHub Desktop.
Sample Witness Initialization and Creation Script
# Cryptographic Salt (seed) generation - kli salt
kli salt
# Sample Output ->
# 0ACrH43dd6hmqrX3-708BFBl
# Setting of required environment variables for sample commands below
export WIT_NAME=witness-01
export WIT_SALT=0ACrH43dd6hmqrX3-708BFBl
export CONFIG_DIR=$HOME/witnesses/witness-01/
export CONFIG_FILE=main/sample-witness-config.json
# Witness Keystore Initialization - kli init
# Assumes
kli init --nopasscode \
--name $WIT_NAME \
--salt $WIT_SALT \
--config-dir $CONFIG_DIR \
--config-file main/$WIT_CONFIG_FILE
# Additional configuration variables for the witness
export WIT_TCP_PORT=5632
export WIT_HTTP_PORT=5642
# Witness Start without TLS - kli witness start
kli witness start \
--name $WIT_NAME \
--alias $WIT_NAME \
-T ${WIT_TCP_PORT:-5632} \
-H ${WIT_HTTP_PORT:-5642} \
--config-dir $CONFIG_DIR \
--config-file $WIT_CONFIG_FILE
# And a sample witness configuration file (located above at $HOME/witnesses/witness-01/keri/cf/main/sample-witness-config.json
{
"dt": "2024-11-29T16:00:00.000000+00:00",
"witness-01": {
"dt": "2024-11-29T16:00:00.000000+00:00",
"curls": [
"tcp://<my-domain-name-or-IP-address>:5632/",
"http://<my-domain-name-or-IP-address>:5642/"
]
},
"iurls": [
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment