This repository has been archived by the owner on Nov 22, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = crlf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## Data Layer Mirror Sync | ||
## make sure to set the run as user by replacing USERNAME with your username | ||
|
||
[Unit] | ||
Description=Data Layer Mirror Sync Service | ||
After=network.target | ||
|
||
[Service] | ||
# assumes that the built executable and appsettings.json is in /usr/local/bin/DlMirrorSync/ | ||
WorkingDirectory=/usr/local/bin/dlsync | ||
|
||
# modify as appropriate to use the dll | ||
ExecStart=/usr/local/bin/dlsync/DlMirrorSync /home/USERNAME/.chia/mainnet/config/config.yaml | ||
#ExecStart=/usr/bin/dotnet /path/to/your/app/DlMirrorSync.dll | ||
|
||
Restart=always | ||
# Restart service after 10 seconds if the dotnet service crashes: | ||
RestartSec=10 | ||
KillSignal=SIGINT | ||
SyslogIdentifier=dotnet-DlMirrorSync | ||
User=USERNAME | ||
Environment=ASPNETCORE_ENVIRONMENT=Production | ||
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
# run with bash install.sh (not sh install.sh) | ||
|
||
set -o errexit | ||
|
||
# Create the destination directory if it doesn't exist | ||
sudo mkdir -p /usr/local/bin/dlsync | ||
# and copy the standa lone binarty to it | ||
sudo cp -r ./publish/standalone/linux-x64/* /usr/local/bin/dlsync/ | ||
|
||
# Get the directory of the current script | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
|
||
# Get the username of the logged in user | ||
# the service will run as the installing user | ||
# change this line to run as a different user | ||
USERNAME=$(whoami) | ||
|
||
# Replace all instances of 'USERNAME' with the runas user's name | ||
|
||
# in 'dlsync.service' and save as '/etc/systemd/system/dlsync.service' | ||
sudo sed "s/USERNAME/$USERNAME/g" "$DIR/dlsync.service" > "/etc/systemd/system/dlsync.service" | ||
sudo systemctl start dlsync | ||
sudo systemctl start dlsync | ||
sudo systemctl enable dlsync |