Skip to content

Commit

Permalink
GitBook: [#29] No subject
Browse files Browse the repository at this point in the history
  • Loading branch information
f-r00t authored and gitbook-bot committed Jan 11, 2023
1 parent b47a282 commit e4f7b9f
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 45 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
* [⛏ Get started with mining](guides/mining/get-started-with-mining.md)
* [😎 Solo-mining Kryptokrona](guides/mining/CPU-Solo-Mining.md)
* [🍇 Mining with a SBC](guides/mining/Mining-with-SBC.md)
* [🧑🎓 🧑🎓 Mining Intro](guides/mining/Mining.md)
* [🧑🎓 Mining Intro](guides/mining/Mining.md)
* [📒 Notes](guides/mining/Optimizing-RPi-TurtleCoin-Mining.md)
* [🌊 Mining Pools](guides/mining/Pools.md)
* [🚚 Mining with XMRig](guides/mining/XMRIG-Guide.md)
* [🏊♂ 🏊♂ 🏊♂ Run a Mining Pool](guides/mining/run-a-mining-pool.md)
* [🏊♂ Run a Mining Pool](guides/mining/run-a-mining-pool.md)
* [📱 Mining on Android](guides/mining/mining-on-android.md)
* [🍯 Mining on HiveOS](guides/mining/mining-on-hiveos.md)
* [👛 Wallets](guides/wallets/README.md)
Expand All @@ -75,6 +75,6 @@
* [🚢 Deploy your own node](guides/kryptokrona/deploy-your-own-node.md)
* [🚢 Deploy your own full node](guides/kryptokrona/deploy-your-own-full-node.md)
* [🐦 Hugin API](guides/hugin-api/README.md)
* [🚢 Deploy Your Own Hugin API](guides/hugin-api/deploy-your-own-hugin-api.md)
* [Deploy Your Own Hugin API](guides/hugin-api/deploy-your-own-hugin-api.md)
* [🐦 Hugin Messenger](guides/hugin-messenger/README.md)
* [📱 How to use Hugin Mobile](guides/hugin-messenger/how-to-use-hugin-mobile.md)
6 changes: 2 additions & 4 deletions developer/hugin-api/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ title: Contribute

## Pull request

We appreciate all contributions whether it be small changes such as documentation of source code to major improvement of code.
The easiest way is to make a fork and then make a pull request into our main branch.
To make the PR go through make sure to include this information:
We appreciate all contributions whether it be small changes such as documentation of source code to major improvement of code. The easiest way is to make a fork and then make a pull request into our main branch. To make the PR go through make sure to include this information:

```
What does this PR do?
Expand All @@ -26,4 +24,4 @@ A pull request is approved if the GitHub Actions pipeline is marked green. Other

XKR: SEKReXXU9aJPiwjX2XkpbK8ACMWbUNXcYPxUVSiUYpNdhj8Z2snEy8CjjorZUNyswQNfzAmVWuGksU72Sf3Kq79Zd3fJWHq4Nyx

![Kryptokrona QR Code](../../assets/kryptokrona-sdk/qr-code.png)
![Kryptokrona QR Code](broken-reference)
2 changes: 1 addition & 1 deletion guides/hugin-messenger/how-to-use-hugin-mobile.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ After downloading the .apk-file, open it from your File-browser to start the ins

After installing the app, open it up and you will be greeted by this welcome screen:

<img src="../../.gitbook/assets/Screenshot_20220810-215508 (1) (2).png" alt="" data-size="original">
<img src="../../.gitbook/assets/Screenshot_20220810-215508 (1) (2) (1).png" alt="" data-size="original">

As a first time user, tap "Create new account" and follow the instructions. If you have had an account before, you may choose the "Restore account" option instead.

Expand Down
54 changes: 28 additions & 26 deletions guides/kryptokrona/deploy-your-own-full-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,96 +2,98 @@
title: Deploy your own full node
---

# Setup
# 🚢 Deploy your own full node

## Setup

Let’s head over to the repository https://github.com/kryptokrona/kryptokrona and download a latest release: https://github.com/kryptokrona/kryptokrona/releases

Unzip the directory to a directory such as `~/Projects` then use the terminal to navigate to the directory of kryptokrona-`<version>`.

# Installation
## Installation

First install Ansible locally.

## Mac using brew package manager:
### Mac using brew package manager:

- `brew install ansible`
- `brew install esolitos/ipa/sshpass`
* `brew install ansible`
* `brew install esolitos/ipa/sshpass`

## Ubuntu/Debian
### Ubuntu/Debian

```sh
```
sudo apt update
sudo apt install software-properties-common python3-jmespath
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install ansible
sudo apt install sshpass
```

## Windows using WSL
### Windows using WSL

Since Ansible can not run natively on Windows we need to use the subsystem for Linux in Windows. Please check out this tutorial on how to get it started: https://docs.ansible.com/ansible/latest/user_guide/windows_faq.html#windows-faq-ansible
Since Ansible can not run natively on Windows we need to use the subsystem for Linux in Windows. Please check out this tutorial on how to get it started: https://docs.ansible.com/ansible/latest/user\_guide/windows\_faq.html#windows-faq-ansible

# Verify
## Verify

Then we need to run the following to verify that our installation was successful:

`ansible --version`

# Configuration
## Configuration

So now that we have Ansible up and running on our OS we will start looking into what kind of configuration we need to do in order for us to provision our VPS with Kryptokrona.

If you have never heard what provisioning are it simply means “providing” or making something available. What Ansible does is to setup Infrastructure as Code (IaC) that we define what we need to install and what needs to be configured in code and thus we do not need to manually set this up and do this everytime we make a change or add something new. It does everything for us in one command when running it. This can be a huge time and energy saver. If something would have happen of a server or infrastructure we could just spin up a new environment very easily.

So let’s start by going into the ansible directory and open up the `prod.inventory` file (you can of course use your favorite text editor instead of Vim):

```
```
[vps]
<ip address/hostname here>
```

Now we see a block of [vps] and under it are the domain name followed by the `letsencrypt_email`, `domain_name` on the same row. This is all the hosts we are going to use. In this case we are just going to provision to one VPS. You could put the IP address there instead of `n1.vxo.nu` and remove additional lines if you don't use multiple VPS instances.
Now we see a block of \[vps] and under it are the domain name followed by the `letsencrypt_email`, `domain_name` on the same row. This is all the hosts we are going to use. In this case we are just going to provision to one VPS. You could put the IP address there instead of `n1.vxo.nu` and remove additional lines if you don't use multiple VPS instances.

If we would like to provision to two or multiple VPS we could just copy the first one and change the ip/hostname and Ansible would pick them all up and setup everything on those VPS as well.

So change `n1.xkr.nu` to your ip/hostname and the `letencrypt_email` and the `domain_name` and remove the second line `n2.xkr.nu`.
So change `n1.xkr.nu` to your ip/hostname and the `letencrypt_email` and the `domain_name` and remove the second line `n2.xkr.nu`.

Please bare in mind that fix the DNS settings *first* for this domain name and point to the VPS IP address a couple of hours before running this otherwise the certificate would not go through if it can not find that the DNS points to that domain name.
Please bare in mind that fix the DNS settings _first_ for this domain name and point to the VPS IP address a couple of hours before running this otherwise the certificate would not go through if it can not find that the DNS points to that domain name.

Also update `exporter_version` to the latest release over at https://github.com/prometheus/node_exporter/releases/
Also update `exporter_version` to the latest release over at https://github.com/prometheus/node\_exporter/releases/

So now save the file and we will start looking at `provision_vps.yml` file.

## Ansible Vault
### Ansible Vault

Before we start with the provisioning we need to edit the file in `ansible/group_vars/vps.yml` with your config. This information will be encrypted later. Leave out the alert configs according to the comments if you don't want to have the alert system in place.
Before we start with the provisioning we need to edit the file in `ansible/group_vars/vps.yml` with your config. This information will be encrypted later. Leave out the alert configs according to the comments if you don't want to have the alert system in place.

Then we need to encrypt the file:

- `ansible-vault encrypt ./group_vars/vps.yml`
* `ansible-vault encrypt ./group_vars/vps.yml`

Then save and put a password that you NEED to remember.

Then we need to use that password we set for the file itself and save that in a file on our host system. Do that by:

- `vim ~/kryptokrona.pwd`
* `vim ~/kryptokrona.pwd`

Then add that same password inside this file that we set for the `vps.yml` file and we will use this file to run the playbook.

Then save and exit:

- `:wq`
* `:wq`

Then open up the file `ansible.sh` and edit it and edit the line ssh-copy-id with your [email protected] and add an additional line with the second or more VPS instances. Just remember that we need to be ROOT to be able to run this. So don't use another user.

So now we can start provisioning by running our shell script:

- `sudo chmod +x ansible.sh`
- `./ansible.sh`
* `sudo chmod +x ansible.sh`
* `./ansible.sh`

# Common issues
## Common issues

### NGINX configuration breaks
#### NGINX configuration breaks

**Problem:** If you made some change in NGINX configuration and it breaks during setup, the next time it will not always be able to update it so it works again.\
**Solution:** SSH into the machine and change the configuration manually and restart the NGINX server. Check the logs with `journalctl -xe` if you don't find the issue right away.
**Solution:** SSH into the machine and change the configuration manually and restart the NGINX server. Check the logs with `journalctl -xe` if you don't find the issue right away.
18 changes: 10 additions & 8 deletions guides/kryptokrona/deploy-your-own-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,40 @@
title: Deploy your own node
---

# Get the script
# 🚢 Deploy your own node

## Get the script

First we need to get the shell script from the Kryptokrona repository. Go to https://github.com/kryptokrona/kryptokrona/tree/master and to the directory called deploy. Inside this directory you will find a `setup-node.sh` file. Download this file to your computer. Now we just have to modify this script with our own constant values. Open the file up in your favorite text editor.

```sh
```
DOMAIN="node.c1phx.com"
EMAIL="[email protected]"
```

Change these values to your own values and save the file.

# Upload script to VPS
## Upload script to VPS

Now we need to upload this to the VPS. We are going to go through how to set it up on a Ubuntu VPS server. You can either copy all the contents of this file and login to your VPS and create this file with nano/vim and save it as `setup-node.sh` or send it through scp.

```sh
```
scp ~/Downloads/setup-node.sh ubuntu@ip-address:/home/ubuntu/setup-node.sh
```

This will copy the file to the home directory of the user ubuntu. Now we just have to login to the VPS and set the executable permissions.

```sh
```
ssh ubuntu@ip-address
chmod +x setup.node.sh
```

# Run script
## Run script

Now we can run the file and it will take care of everything for us.

```sh
```
./setup-node.sh
```

This process will take a while since it will build the Kryptokrona core to a Docker Image.
This process will take a while since it will build the Kryptokrona core to a Docker Image.
12 changes: 9 additions & 3 deletions guides/mining/CPU-Solo-Mining.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Solo-mining Kryptokrona
# 😎 Solo-mining Kryptokrona

Solo-mining Kryptokrona means that you, alone, try to find the next block.\
**It is extremely hard, and not recommended** - try our [other guides](../../docs/guides/Mining/) if you want a more steady flow of TRTL.\
**It is extremely hard, and not recommended** - try our [other guides](../../docs/guides/Mining/) if you want a more steady flow of XKR.\
Solo-mining is limited to _only your CPU_.

If you're sure you want to solo mine, let's continue.
Expand All @@ -20,7 +20,7 @@ _Note_: If they aren't there, you'll have to compile it yourself:
* [Linux](https://kryptokrona.se/Kryptokrona-linux.zip)
* [OSX](https://kryptokrona.se/Kryptokrona-mac.zip)

Ensure **`Kryptokrona` is running and fully synced**.
Ensure **`Kryptokrona` is running and fully synced, or find a public node to use here**.

Go to your folder that has `miner.exe` in it and start a cmd prompt.

Expand All @@ -31,6 +31,12 @@ In Linux, you may be able to right click on your directory and "Open in" Termina
When it opens, type:\
`miner --address SEKR.. --threads 4 --scan-time 1 --log-level 3`

If you're using a remote node, you can add the following flag:

```
--daemon-address url.to.node:11898
```

Repace `SEKR..` with your Kryptokrona public address.\
We recommend setting the `--threads` option to half of how many you have. So if you have 12 threads in your CPU, set it to `6`.

Expand All @@ -44,7 +50,7 @@ Congratulations, you are now solo mining Kryptokrona from your CPU.

**Notes**

* `Kryptokrona` _must_ stay running for the miner to mine Kryptokrona.
* `Kryptokrona` _must_ stay running for the miner to mine Kryptokrona, unless you use a remote node.
* Be patient. Finding a block may happen within the first few hours of mining. It also may take a week. Or it may never happen.
* If you accidently close out `Kryptokrona` you can restart the miner by hitting Ctrl+C on your keyboard, then re-entering the miner command given above.
* You may have to adjust the amount of threads based on your PC's capabilities(half of how many your CPU has is recommended).

0 comments on commit e4f7b9f

Please sign in to comment.