Signature service
- Clone the repository
cd $(go env GOPATH)/src/github.com
git clone https://github.com/spike-engine/spike-signature-server.git
cd spike-signature-server
- Install all the dependencies
go mod tidy
- Make build
go build -o spike-signature-server ./main.go
- Update Config
cp config.toml.example config.toml
- Run
./spike-signature-server start
- Config file localtion.
By default, spike-signature-server reads configuration from config.toml under the current folder. If it is not created, you may copy from config.config.example. If you need to specify the config file, you may set the enviornment as follows:
export SPIKE_SIGNATURE_CONFIG=~/spike_home/config-signature.toml
- keystore file.
If spike-signature-server cannot find keystore file with walletFile config under folder with walletFolder config, you can use spike-signature-server cli generate one.(example: ./spike-signature-server wallet add) You also can replace it with your own keystore file if needed. - Machine ID
To run multiple signature services, you may assign each server a different machine ID with machineId config.
- Link server into system binary path
sudo ln ./spike-signature-server /usr/local/bin
- Copy config file into spike home
sudo mkdir -p /etc/spike/
sudo cp ./config.toml /etc/spike/config-signature.toml
- Startup script
sudo vim /etc/systemd/system/spike-signature-server.service
Specify the path to the binary
[Service]
ExecStart=/usr/local/bin/spike-signature-server start
Environment=SPIKE_SIGNATURE_CONFIG=/etc/spike/config-signature.toml
Restart=always
RestartSec=5
sudo systemctl daemon-reload
sudo systemctl start spike-signature-server
Check Program Exec Log
sudo journalctl -u spike-signature-server.service -f