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
1 parent
6812631
commit 8462131
Showing
11 changed files
with
193 additions
and
4 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,7 @@ | ||
network=snowblossom | ||
|
||
# the node your client will query for balances | ||
node_host=localhost | ||
|
||
# wallet storage location (back this up!) | ||
wallet_path=wallets/mainnet |
File renamed without changes.
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,20 @@ | ||
network=snowblossom | ||
|
||
# the node your miner will query for block templates, mempool, and submissions | ||
node_host=localhost | ||
|
||
# the location where "snow" files are stored | ||
snow_path=snow/mainnet | ||
|
||
# automatically generate mining snow files. | ||
# CAUTION! INTENSIVE! You may wish to torrent larger ones instead. | ||
# torrents: https://snowblossom.org/snowfields/index.html | ||
auto_snow=true | ||
|
||
# pick an address (at random for now)from this wallet to mine to | ||
mine_to_wallet=wallets/mainnet | ||
# or mine to address | ||
#mine_to_address= | ||
|
||
# number of cpu threads to commit to PoW | ||
#threads=1 |
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,8 @@ | ||
network=snowblossom | ||
|
||
# database | ||
db_type=rocksdb | ||
db_path=db/mainnet | ||
|
||
# port to serve on | ||
service_port=2339 |
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
45 changes: 45 additions & 0 deletions
45
examples/scripts/install/sample5-install-node-mainnet-service-systemd-latest-release.sh
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,45 @@ | ||
#!/bin/bash | ||
if [[ $EUID -ne 0 ]]; then | ||
echo "This script requires root!" | ||
exit 1 | ||
fi | ||
|
||
snowblossom_home=/var/snowblossom | ||
latest_release=`wget -qO - https://api.github.com/repos/snowblossomcoin/snowblossom/releases` | ||
release_name=`echo "$latest_release" | grep -Po -m 1 '"name": "\K.*?(?=")'` | ||
release_tag=`echo "$latest_release" | grep -Po -m 1 '"tag_name": "\K.*?(?=")'` | ||
|
||
echo "Installing snowblossom $release_name $release_tag in $snowblossom_home" | ||
|
||
# install openjdk-8-jdk and bazel | ||
echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" > /etc/apt/sources.list.d/snowblossom-bazel.list | ||
wget -qO - https://bazel.build/bazel-release.pub.gpg | apt-key add - | ||
apt-get update | ||
apt-get -yq install git openjdk-8-jdk bazel | ||
|
||
# create and switch to user | ||
useradd --home-dir /var/snowblossom/ --create-home --system snowblossom | ||
su - snowblossom <<EOF | ||
# download source code | ||
mkdir -p "$snowblossom_home/source" && cd "$snowblossom_home/source" | ||
git clone -b $release_tag https://github.com/snowblossomcoin/snowblossom.git | ||
# build snowblossom | ||
cd snowblossom | ||
bazel build :all | ||
# copy sample config files | ||
cp --no-clobber --recursive "$snowblossom_home/source/snowblossom/examples/configs" "$snowblossom_home/" | ||
chmod 750 -R "$snowblossom_home/configs" | ||
EOF | ||
|
||
# install systemd service | ||
cp "$snowblossom_home/source/snowblossom/examples/systemd/snowblossom-node-mainnet.service" /etc/systemd/system/ | ||
systemctl daemon-reload | ||
# startup automatically at boot | ||
systemctl enable snowblossom-node-mainnet.service | ||
# start | ||
systemctl restart snowblossom-node-mainnet.service | ||
journalctl -f -u snowblossom-node-mainnet.service |
49 changes: 49 additions & 0 deletions
49
examples/scripts/install/sample6-install-miner-mainnet-service-systemd-latest-release.sh
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,49 @@ | ||
#!/bin/bash | ||
if [[ $EUID -ne 0 ]]; then | ||
echo "This script requires root!" | ||
exit 1 | ||
fi | ||
|
||
snowblossom_home=/var/snowblossom | ||
latest_release=`wget -qO - https://api.github.com/repos/snowblossomcoin/snowblossom/releases` | ||
release_name=`echo "$latest_release" | grep -Po -m 1 '"name": "\K.*?(?=")'` | ||
release_tag=`echo "$latest_release" | grep -Po -m 1 '"tag_name": "\K.*?(?=")'` | ||
|
||
echo "Installing snowblossom $release_name $release_tag in $snowblossom_home" | ||
|
||
# install openjdk-8-jdk and bazel | ||
echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" > /etc/apt/sources.list.d/snowblossom-bazel.list | ||
wget -qO - https://bazel.build/bazel-release.pub.gpg | apt-key add - | ||
apt-get update | ||
apt-get -yq install git openjdk-8-jdk bazel | ||
|
||
# create and switch to user | ||
useradd --home-dir /var/snowblossom/ --create-home --system snowblossom | ||
su - snowblossom <<EOF | ||
# download source code | ||
mkdir -p "$snowblossom_home/source" && cd "$snowblossom_home/source" | ||
git clone -b $release_tag https://github.com/snowblossomcoin/snowblossom.git | ||
# build snowblossom | ||
cd snowblossom | ||
bazel build :all | ||
# copy sample config files | ||
cp --no-clobber --recursive "$snowblossom_home/source/snowblossom/examples/configs" "$snowblossom_home/" | ||
chmod 750 -R "$snowblossom_home/configs" | ||
# run wallet once to generate addresses for miner to send to | ||
cd "$snowblossom_home" | ||
$snowblossom_home/source/snowblossom/bazel-bin/SnowBlossomClient configs/client-mainnet.conf | ||
EOF | ||
|
||
# install systemd service | ||
cp "$snowblossom_home/source/snowblossom/examples/systemd/snowblossom-miner-mainnet.service" /etc/systemd/system/ | ||
systemctl daemon-reload | ||
# startup automatically at boot | ||
systemctl enable snowblossom-miner-mainnet.service | ||
# start | ||
systemctl restart snowblossom-miner-mainnet.service | ||
journalctl -f -u snowblossom-miner-mainnet.service |
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,38 @@ | ||
#!/bin/bash | ||
if [[ $EUID -ne 0 ]]; then | ||
echo "This script requires root!" | ||
exit 1 | ||
fi | ||
|
||
|
||
snowblossom_home=/var/snowblossom | ||
|
||
|
||
echo | ||
while true; do | ||
echo -ne "\r"`date`" Checking for block." | ||
trigger_blockhash=`wget -qO - https://blockexplorer.com/api/block-index/523000 | grep -Po 'blockHash":"\K([^"]*)'` | ||
if [ -z trigger_blockhash ]; then | ||
echo $trigger_blockhash | ||
echo "IT'S TIME!" | ||
break | ||
fi | ||
sleep 5s | ||
done | ||
|
||
|
||
# switch to user | ||
su - snowblossom <<EOF | ||
cd "$snowblossom_home/source/snowblossom/ | ||
# set start hash | ||
# build snowblossom | ||
bazel build :all | ||
EOF | ||
|
||
# Start! | ||
systemctl start snowblossom-node-mainnet.service | ||
systemctl start snowblossom-miner-mainnet.service | ||
journalctl -f -u snowblossom-miner-mainnet.service |
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,11 @@ | ||
[Unit] | ||
Description=Snowblossom Miner - mainnet | ||
After=network.target | ||
|
||
[Service] | ||
WorkingDirectory=/var/snowblossom | ||
ExecStart=/var/snowblossom/source/snowblossom/bazel-bin/SnowBlossomMiner configs/miner-mainnet.conf | ||
User=snowblossom | ||
|
||
[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,11 @@ | ||
[Unit] | ||
Description=Snowblossom Node - mainnet | ||
After=network.target | ||
|
||
[Service] | ||
WorkingDirectory=/var/snowblossom | ||
ExecStart=/var/snowblossom/source/snowblossom/bazel-bin/SnowBlossomNode configs/node-mainnet.conf | ||
User=snowblossom | ||
|
||
[Install] | ||
WantedBy=multi-user.target |