manual removed files
@@ -1,14 +0,0 @@
|
||||
<h1> TFGrid Advanced </h1>
|
||||
|
||||
In this section, we delve into sophisticated topics and powerful functionalities that empower you to harness the full potential of TFGrid 3.0. Whether you're an experienced user seeking to deepen your understanding or a trailblazer venturing into uncharted territories, this manual is your gateway to mastering advanced concepts on the ThreeFold Grid.
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
|
||||
- [Token Transfer Keygenerator](./token_transfer_keygenerator.md)
|
||||
- [Cancel Contracts](./cancel_contracts.md)
|
||||
- [Contract Bills Reports](./contract_bill_report.md)
|
||||
- [Listing Free Public IPs](./list_public_ips.md)
|
||||
- [Redis](./grid3_redis.md)
|
||||
- [IPFS](./ipfs/ipfs_toc.md)
|
||||
- [IPFS on a Full VM](./ipfs/ipfs_fullvm.md)
|
||||
- [IPFS on a Micro VM](./ipfs/ipfs_microvm.md)
|
@@ -1,48 +0,0 @@
|
||||
<h1> Cancel Contracts </h1>
|
||||
|
||||
<h2>Table of Contents </h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Using the Dashboard](#using-the-dashboard)
|
||||
- [Using GraphQL and Polkadot UI](#using-graphql-and-polkadot-ui)
|
||||
- [Using grid3\_client\_ts](#using-grid3_client_ts)
|
||||
|
||||
***
|
||||
|
||||
## Introduction
|
||||
|
||||
We present different methods to delete contracts on the TFGrid.
|
||||
|
||||
## Using the Dashboard
|
||||
|
||||
To cancel contracts with the Dashboard, consult the [Contracts List](../../dashboard/deploy/your_contracts.md) documentation.
|
||||
|
||||
## Using GraphQL and Polkadot UI
|
||||
|
||||
From the QraphQL service execute the following query.
|
||||
|
||||
```
|
||||
query MyQuery {
|
||||
|
||||
nodeContracts(where: {twinId_eq: TWIN_ID, state_eq: Created}) {
|
||||
contractId
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
replace `TWIN_ID` with your twin id. The information should be available on the [Dashboard](../../dashboard/dashboard.md).
|
||||
|
||||
Then from [polkadot UI](https://polkadot.js.org/apps/), add the tfchain endpoint to development.
|
||||
|
||||

|
||||
|
||||
Go to `Extrinsics`, choose the `smartContract` module and `cancelContract` extrinsic and use the IDs from GraphQL to execute the cancelation.
|
||||
|
||||

|
||||
|
||||
## Using grid3_client_ts
|
||||
|
||||
In order to use the `grid3_client_ts` module, it is essential to first clone our official mono-repo containing the module and then navigate to it. If you are looking for a quick and efficient way to cancel contracts, we offer a code-based solution that can be found [here](https://github.com/threefoldtech/tfgrid-sdk-ts/blob/development/packages/grid_client/scripts/delete_all_contracts.ts).
|
||||
|
||||
To make the most of `grid_client`, we highly recommend following our [Grid-Client guide](https://github.com/threefoldtech/tfgrid-sdk-ts/blob/development/packages/grid_client/README.md) for a comprehensive overview of the many advanced capabilities offered by this powerful tool. With features like contract creation, modification, and retrieval, `grid_client` provides an intuitive and easy-to-use solution for managing your contracts effectively.
|
@@ -1,63 +0,0 @@
|
||||
<h1> Contract Bills Reports </h1>
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Contract Billing Report (GraphQL)](#contract-billing-report-graphql)
|
||||
- [Consumption](#consumption)
|
||||
|
||||
***
|
||||
|
||||
## Introduction
|
||||
|
||||
Now you can check the billing rate of your contracts directly from the `Contracts` tab in the Dashboard.
|
||||
|
||||
> It takes an hour for the contract to display the billing rate (Until it reaches the first billing cycle).
|
||||
|
||||
The `Billing Rate` is displayed in `TFT/Hour`
|
||||
|
||||

|
||||
|
||||
## Contract Billing Report (GraphQL)
|
||||
|
||||
- you need to find the contract ID
|
||||
- ask the graphql for the consumption
|
||||
|
||||
> example query for all contracts
|
||||
|
||||
```graphql
|
||||
query MyQuery {
|
||||
contractBillReports {
|
||||
contractId
|
||||
amountBilled
|
||||
discountReceived
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
And for a specific contract
|
||||
|
||||
```graphql
|
||||
query MyQuery {
|
||||
contractBillReports(where: { contractId_eq: 10 }) {
|
||||
amountBilled
|
||||
discountReceived
|
||||
contractId
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Consumption
|
||||
|
||||
```graphql
|
||||
query MyQuery {
|
||||
consumptions(where: { contractId_eq: 10 }) {
|
||||
contractId
|
||||
cru
|
||||
sru
|
||||
mru
|
||||
hru
|
||||
nru
|
||||
}
|
||||
}
|
||||
```
|
@@ -1,46 +0,0 @@
|
||||
<h1> Redis </h1>
|
||||
|
||||
<h2> Table of Contents </h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Install Redis](#install-redis)
|
||||
- [Linux](#linux)
|
||||
- [MacOS](#macos)
|
||||
- [Run Redis](#run-redis)
|
||||
|
||||
***
|
||||
|
||||
## Introduction
|
||||
|
||||
Redis is an open-source, in-memory data structure store that is widely used as a caching layer, message broker, and database. It is known for its speed, versatility, and support for a wide range of data structures. Redis is designed to deliver high-performance data access by storing data in memory, which allows for fast read and write operations. It supports various data types, including strings, lists, sets, hashes, and more, and provides a rich set of commands for manipulating and querying the data.
|
||||
|
||||
Redis is widely used in various use cases, including caching, session management, real-time analytics, leaderboards, task queues, and more. Its simplicity, speed, and flexibility make it a popular choice for developers who need a fast and reliable data store for their applications. In Threefold's ecosystem context, Redis can be used as a backend mechanism to communicate with the nodes on the ThreeFold Grid using the Reliable Message Bus.
|
||||
|
||||
|
||||
|
||||
## Install Redis
|
||||
|
||||
### Linux
|
||||
|
||||
If you don't find Redis in your Linux distro's package manager, check the [Redis downloads](https://redis.io/download) page for the source code and installation instructions.
|
||||
|
||||
### MacOS
|
||||
|
||||
On MacOS, [Homebrew](https://brew.sh/) can be used to install Redis. The steps are as follow:
|
||||
|
||||
```
|
||||
brew update
|
||||
brew install redis
|
||||
```
|
||||
|
||||
Alternatively, it can be built from source, using the same [download page](https://redis.io/download/) as shown above.
|
||||
|
||||
|
||||
|
||||
## Run Redis
|
||||
|
||||
You can launch the Redis server with the following command:
|
||||
|
||||
```
|
||||
redis-server
|
||||
```
|
@@ -1,39 +0,0 @@
|
||||
<h1> Transferring TFT Between Stellar and TFChain</h1>
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
|
||||
- [Usage](#usage)
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Stellar to TFChain](#stellar-to-tfchain)
|
||||
- [TFChain to Stellar](#tfchain-to-stellar)
|
||||
|
||||
***
|
||||
|
||||
## Usage
|
||||
|
||||
This document will explain how you can transfer TFT from Tfchain to Stellar and back.
|
||||
|
||||
For more information on TFT bridges, read [this documentation](../threefold_token/tft_bridges/tft_bridges.md).
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [Stellar wallet](../threefold_token/storing_tft/storing_tft.md)
|
||||
|
||||
- [Account on TFChain (use TF Dashboard to create one)](../dashboard/wallet_connector.md)
|
||||
|
||||

|
||||
|
||||
## Stellar to TFChain
|
||||
|
||||
You can deposit to Tfchain using the bridge page on the TF Dashboard, click deposit:
|
||||
|
||||

|
||||
|
||||
## TFChain to Stellar
|
||||
|
||||
You can bridge back to stellar using the bridge page on the dashboard, click withdraw:
|
||||
|
||||

|
||||
|
||||
A withdrawfee of 1 TFT will be taken, so make sure you send a larger amount as 1 TFT.
|
||||
The amount withdrawn from TFChain will be sent to your Stellar wallet.
|
Before Width: | Height: | Size: 224 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 121 KiB |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 151 KiB |
@@ -1,190 +0,0 @@
|
||||
<h1> IPFS on a Full VM</h1>
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Deploy a Full VM](#deploy-a-full-vm)
|
||||
- [Create a Root-Access User](#create-a-root-access-user)
|
||||
- [Set a Firewall](#set-a-firewall)
|
||||
- [Additional Ports](#additional-ports)
|
||||
- [Install IPFS](#install-ipfs)
|
||||
- [Set IPFS](#set-ipfs)
|
||||
- [Final Verification](#final-verification)
|
||||
- [Questions and Feedback](#questions-and-feedback)
|
||||
|
||||
***
|
||||
|
||||
## Introduction
|
||||
|
||||
In this ThreeFold guide, we explore how to set an IPFS node on a Full VM using the ThreeFold Playground.
|
||||
|
||||
## Deploy a Full VM
|
||||
|
||||
We start by deploying a full VM on the ThreeFold Playground.
|
||||
|
||||
* Go to the [Threefold Playground](https://playground.grid.tf/#/)
|
||||
* Deploy a full VM (Ubuntu 20.04) with an IPv4 address and at least the minimum specs
|
||||
* IPv4 Address
|
||||
* Minimum vcores: 1vcore
|
||||
* Minimum MB of RAM: 1024GB
|
||||
* Minimum storage: 50GB
|
||||
* After deployment, note the VM IPv4 address
|
||||
* Connect to the VM via SSH
|
||||
* ```
|
||||
ssh root@VM_IPv4_address
|
||||
```
|
||||
|
||||
## Create a Root-Access User
|
||||
|
||||
We create a root-access user. Note that this step is optional.
|
||||
|
||||
* Once connected, create a new user with root access (for this guide we use "newuser")
|
||||
* ```
|
||||
adduser newuser
|
||||
```
|
||||
* You should now see the new user directory
|
||||
* ```
|
||||
ls /home
|
||||
```
|
||||
* Give sudo capacity to the new user
|
||||
* ```
|
||||
usermod -aG sudo newuser
|
||||
```
|
||||
* Switch to the new user
|
||||
* ```
|
||||
su - newuser
|
||||
```
|
||||
* Create a directory to store the public key
|
||||
* ```
|
||||
mkdir ~/.ssh
|
||||
```
|
||||
* Give read, write and execute permissions for the directory to the new user
|
||||
* ```
|
||||
chmod 700 ~/.ssh
|
||||
```
|
||||
* Add the SSH public key in the file **authorized_keys** and save it
|
||||
* ```
|
||||
nano ~/.ssh/authorized_keys
|
||||
```
|
||||
* Exit the VM
|
||||
* ```
|
||||
exit
|
||||
```
|
||||
* Reconnect with the new user
|
||||
* ```
|
||||
ssh newuser@VM_IPv4_address
|
||||
```
|
||||
|
||||
## Set a Firewall
|
||||
|
||||
We set a firewall to monitor and control incoming and outgoing network traffic. To do so, we will define predetermined security rules. As a firewall, we will be using [Uncomplicated Firewall](https://wiki.ubuntu.com/UncomplicatedFirewall) (ufw).
|
||||
For our security rules, we want to allow SSH, HTTP and HTTPS (443 and 8443).
|
||||
We thus add the following rules:
|
||||
* Allow SSH (port 22)
|
||||
* ```
|
||||
sudo ufw allow ssh
|
||||
```
|
||||
* Allow port 4001
|
||||
* ```
|
||||
sudo ufw allow 4001
|
||||
```
|
||||
* To enable the firewall, write the following:
|
||||
* ```
|
||||
sudo ufw enable
|
||||
```
|
||||
* To see the current security rules, write the following:
|
||||
* ```
|
||||
sudo ufw status verbose
|
||||
```
|
||||
You now have enabled the firewall with proper security rules for your IPFS deployment.
|
||||
|
||||
### Additional Ports
|
||||
|
||||
We provided the basic firewall ports for your IPFS instance. There are other more advanced configurations possible.
|
||||
If you want to access your IPFS node remotely, you can allow **port 5001**. This will allow anyone to access your IPFS node. Make sure that you know what you are doing if you go this route. You should, for example, restrict which external IP address can access port 5001.
|
||||
If you want to run your deployment as a gateway node, you should allow **port 8080**. Read the IPFS documentation for more information on this.
|
||||
If you want to run pubsub capabilities, you need to allow **port 8081**. For more information, read the [IPFS documentation](https://blog.ipfs.tech/25-pubsub/).
|
||||
|
||||
## Install IPFS
|
||||
|
||||
We install the [IPFS Kubo binary](https://docs.ipfs.tech/install/command-line/#install-official-binary-distributions).
|
||||
* Download the binary
|
||||
* ```
|
||||
wget https://dist.ipfs.tech/kubo/v0.24.0/kubo_v0.24.0_linux-amd64.tar.gz
|
||||
```
|
||||
* Unzip the file
|
||||
* ```
|
||||
tar -xvzf kubo_v0.24.0_linux-amd64.tar.gz
|
||||
```
|
||||
* Change directory
|
||||
* ```
|
||||
cd kubo
|
||||
```
|
||||
* Run the install script
|
||||
* ```
|
||||
sudo bash install.sh
|
||||
```
|
||||
* Verify that IPFS Kubo is properly installed
|
||||
* ```
|
||||
ipfs --version
|
||||
```
|
||||
|
||||
## Set IPFS
|
||||
|
||||
We initialize IPFS and run the IPFS daemon.
|
||||
|
||||
* Initialize IPFS
|
||||
* ```
|
||||
ipfs init --profile server
|
||||
```
|
||||
* Increase the storage capacity (optional)
|
||||
* ```
|
||||
ipfs config Datastore.StorageMax 30GB
|
||||
```
|
||||
* Run the IPFS daemon
|
||||
* ```
|
||||
ipfs daemon
|
||||
```
|
||||
* Set an Ubuntu systemd service to keep the IPFS daemon running after exiting the VM
|
||||
* ```
|
||||
sudo nano /etc/systemd/system/ipfs.service
|
||||
```
|
||||
* Enter the systemd info
|
||||
* ```
|
||||
[Unit]
|
||||
Description=IPFS Daemon
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/local/bin/ipfs daemon --enable-gc
|
||||
Group=newuser
|
||||
Restart=always
|
||||
Environment="IPFS_PATH=/home/newuser/.ipfs"
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
* Enable the service
|
||||
* ```
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable ipfs
|
||||
sudo systemctl start ipfs
|
||||
```
|
||||
* Verify that the IPFS daemon is properly running
|
||||
* ```
|
||||
sudo systemctl status ipfs
|
||||
```
|
||||
## Final Verification
|
||||
We reboot and reconnect to the VM and verify that IPFS is properly running as a final verification.
|
||||
* Reboot the VM
|
||||
* ```
|
||||
sudo reboot
|
||||
```
|
||||
* Reconnect to the VM
|
||||
* ```
|
||||
ssh newuser@VM_IPv4_address
|
||||
```
|
||||
* Check that the IPFS daemon is running
|
||||
* ```
|
||||
ipfs swarm peers
|
||||
```
|
||||
## Questions and Feedback
|
||||
If you have any questions or feedback, please let us know by either writing a post on the [ThreeFold Forum](https://forum.threefold.io/), or by chatting with us on the [TF Grid Tester Community](https://t.me/threefoldtesting) Telegram channel.
|
@@ -1,167 +0,0 @@
|
||||
<h1> IPFS on a Micro VM</h1>
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Deploy a Micro VM](#deploy-a-micro-vm)
|
||||
- [Install the Prerequisites](#install-the-prerequisites)
|
||||
- [Set a Firewall](#set-a-firewall)
|
||||
- [Additional Ports](#additional-ports)
|
||||
- [Install IPFS](#install-ipfs)
|
||||
- [Set IPFS](#set-ipfs)
|
||||
- [Set IPFS with zinit](#set-ipfs-with-zinit)
|
||||
- [Final Verification](#final-verification)
|
||||
- [Questions and Feedback](#questions-and-feedback)
|
||||
|
||||
***
|
||||
|
||||
## Introduction
|
||||
|
||||
In this ThreeFold guide, we explore how to set an IPFS node on a micro VM using the ThreeFold Playground.
|
||||
|
||||
## Deploy a Micro VM
|
||||
|
||||
We start by deploying a micro VM on the ThreeFold Playground.
|
||||
|
||||
* Go to the [Threefold Playground](https://playground.grid.tf/#/)
|
||||
* Deploy a micro VM (Ubuntu 22.04) with an IPv4 address
|
||||
* IPv4 Address
|
||||
* Minimum vcores: 1vcore
|
||||
* Minimum MB of RAM: 1024MB
|
||||
* Minimum storage: 50GB
|
||||
* After deployment, note the VM IPv4 address
|
||||
* Connect to the VM via SSH
|
||||
* ```
|
||||
ssh root@VM_IPv4_address
|
||||
```
|
||||
|
||||
## Install the Prerequisites
|
||||
|
||||
We install the prerequisites before installing and setting IPFS.
|
||||
|
||||
* Update Ubuntu
|
||||
* ```
|
||||
apt update
|
||||
```
|
||||
* Install nano and ufw
|
||||
* ```
|
||||
apt install nano && apt install ufw -y
|
||||
```
|
||||
|
||||
## Set a Firewall
|
||||
|
||||
We set a firewall to monitor and control incoming and outgoing network traffic. To do so, we will define predetermined security rules. As a firewall, we will be using [Uncomplicated Firewall](https://wiki.ubuntu.com/UncomplicatedFirewall) (ufw).
|
||||
|
||||
For our security rules, we want to allow SSH, HTTP and HTTPS (443 and 8443).
|
||||
|
||||
We thus add the following rules:
|
||||
|
||||
* Allow SSH (port 22)
|
||||
* ```
|
||||
ufw allow ssh
|
||||
```
|
||||
* Allow port 4001
|
||||
* ```
|
||||
ufw allow 4001
|
||||
```
|
||||
* To enable the firewall, write the following:
|
||||
* ```
|
||||
ufw enable
|
||||
```
|
||||
|
||||
* To see the current security rules, write the following:
|
||||
* ```
|
||||
ufw status verbose
|
||||
```
|
||||
|
||||
You have enabled the firewall with proper security rules for your IPFS deployment.
|
||||
|
||||
### Additional Ports
|
||||
|
||||
We provided the basic firewall ports for your IPFS instance. There are other more advanced configurations possible.
|
||||
|
||||
If you want to access your IPFS node remotely, you can allow **port 5001**. This will allow anyone to access your IPFS node. Make sure that you know what you are doing if you go this route. You should, for example, restrict which external IP address can access port 5001.
|
||||
|
||||
If you want to run your deployment as a gateway node, you should allow **port 8080**. Read the IPFS documentation for more information on this.
|
||||
|
||||
If you want to run pubsub capabilities, you need to allow **port 8081**. For more information, read the [IPFS documentation](https://blog.ipfs.tech/25-pubsub/).
|
||||
|
||||
## Install IPFS
|
||||
|
||||
We install the [IPFS Kubo binary](https://docs.ipfs.tech/install/command-line/#install-official-binary-distributions).
|
||||
|
||||
* Download the binary
|
||||
* ```
|
||||
wget https://dist.ipfs.tech/kubo/v0.24.0/kubo_v0.24.0_linux-amd64.tar.gz
|
||||
```
|
||||
* Unzip the file
|
||||
* ```
|
||||
tar -xvzf kubo_v0.24.0_linux-amd64.tar.gz
|
||||
```
|
||||
* Change directory
|
||||
* ```
|
||||
cd kubo
|
||||
```
|
||||
* Run the install script
|
||||
* ```
|
||||
bash install.sh
|
||||
```
|
||||
* Verify that IPFS Kubo is properly installed
|
||||
* ```
|
||||
ipfs --version
|
||||
```
|
||||
|
||||
## Set IPFS
|
||||
|
||||
We initialize IPFS and run the IPFS daemon.
|
||||
|
||||
* Initialize IPFS
|
||||
* ```
|
||||
ipfs init --profile server
|
||||
```
|
||||
* Increase the storage capacity (optional)
|
||||
* ```
|
||||
ipfs config Datastore.StorageMax 30GB
|
||||
```
|
||||
* Run the IPFS daemon
|
||||
* ```
|
||||
ipfs daemon
|
||||
```
|
||||
|
||||
## Set IPFS with zinit
|
||||
|
||||
We set the IPFS daemon with zinit. This will make sure that the IPFS daemon starts at each VM reboot or if it stops functioning momentarily.
|
||||
|
||||
* Create the yaml file
|
||||
* ```
|
||||
nano /etc/zinit/ipfs.yaml
|
||||
```
|
||||
* Set the execution command
|
||||
* ```
|
||||
exec: /usr/local/bin/ipfs daemon
|
||||
```
|
||||
* Run the IPFS daemon with the zinit monitor command
|
||||
* ```
|
||||
zinit monitor ipfs
|
||||
```
|
||||
* Verify that the IPFS daemon is running
|
||||
* ```
|
||||
ipfs swarm peers
|
||||
```
|
||||
|
||||
## Final Verification
|
||||
|
||||
We reboot and reconnect to the VM and verify that IPFS is properly running as a final verification.
|
||||
|
||||
* Reboot the VM
|
||||
* ```
|
||||
reboot -f
|
||||
```
|
||||
* Reconnect to the VM and verify that the IPFS daemon is running
|
||||
* ```
|
||||
ipfs swarm peers
|
||||
```
|
||||
|
||||
## Questions and Feedback
|
||||
|
||||
If you have any questions or feedback, please let us know by either writing a post on the [ThreeFold Forum](https://forum.threefold.io/), or by chatting with us on the [TF Grid Tester Community](https://t.me/threefoldtesting) Telegram channel.
|
@@ -1,6 +0,0 @@
|
||||
<h1>IPFS and ThreeFold</h1>
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
|
||||
- [IPFS on a Full VM](./ipfs_fullvm.md)
|
||||
- [IPFS on a Micro VM](./ipfs_microvm.md)
|
@@ -1,22 +0,0 @@
|
||||
<h1> Listing Public IPs </h1>
|
||||
|
||||
<h2>Table of Contents </h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Example](#example)
|
||||
|
||||
***
|
||||
|
||||
## Introduction
|
||||
|
||||
Listing public IPs can be done by asking graphQL for all IPs that has `contractId = 0`
|
||||
|
||||
## Example
|
||||
|
||||
```graphql
|
||||
query MyQuery {
|
||||
publicIps(where: {contractId_eq: 0}) {
|
||||
ip
|
||||
}
|
||||
}
|
||||
```
|
@@ -1,88 +0,0 @@
|
||||
|
||||
<h1> Transfer TFT Between Networks by Using the Keygenerator </h1>
|
||||
|
||||
<h2>Table of Contents </h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Keypair](#keypair)
|
||||
- [Stellar to TFChain](#stellar-to-tfchain)
|
||||
- [Alternative Transfer to TF Chain](#alternative-transfer-to-tf-chain)
|
||||
- [TFChain to Stellar](#tfchain-to-stellar)
|
||||
|
||||
***
|
||||
|
||||
## Introduction
|
||||
|
||||
Using this method, only transfer is possible between accounts that are generated in the same manner and that are yours. Please find the keygen tooling for it below.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
### Keypair
|
||||
|
||||
- ed25519 keypair
|
||||
- Go installed on your local computer
|
||||
|
||||
Create a keypair with the following tool: <https://github.com/threefoldtech/tfchain_tft/tree/main/tfchain_bridge/tools/keygen>
|
||||
|
||||
```sh
|
||||
go build .
|
||||
./keygen
|
||||
```
|
||||
|
||||
### Stellar to TFChain
|
||||
|
||||
Create a Stellar wallet from the key that you generated.
|
||||
Transfer the TFT from your wallet to the bridge address. A deposit fee of 1 TFT will be taken, so make sure you send a larger amount as 1 TFT.
|
||||
|
||||
Bridge addresses :
|
||||
|
||||
- On Mainnet: `GBNOTAYUMXVO5QDYWYO2SOCOYIJ3XFIP65GKOQN7H65ZZSO6BK4SLWSC` on [Stellar Mainnet](https://stellar.expert/explorer/public).
|
||||
- On testnet: `GA2CWNBUHX7NZ3B5GR4I23FMU7VY5RPA77IUJTIXTTTGKYSKDSV6LUA4` on [Stellar MAINnet](https://stellar.expert/explorer/public)
|
||||
|
||||
The amount deposited on TF Chain minus 1 TFT will be transferred over the bridge to the TFChain account.
|
||||
|
||||
Effect will be the following :
|
||||
|
||||
- Transferred TFTs from Stellar will be sent to a Stellar vault account representing all tokens on TFChain
|
||||
- TFTs will be minted on the TFChain for the transferred amount
|
||||
|
||||
### Alternative Transfer to TF Chain
|
||||
|
||||
We also enabled deposits to TF Grid objects. Following objects can be deposited to:
|
||||
|
||||
- Twin
|
||||
- Farm
|
||||
- Node
|
||||
- Entity
|
||||
|
||||
To deposit to any of these objects, a memo text in format `object_objectID` must be passed on the deposit to the bridge wallet. Example: `twin_1`.
|
||||
|
||||
To deposit to a TF Grid object, this object **must** exists. If the object is not found on chain, a refund is issued.
|
||||
|
||||
## TFChain to Stellar
|
||||
|
||||
Create a TFChain account from the key that you generated. (TF Chain raw seed).
|
||||
Browse to :
|
||||
|
||||
- For mainnet: <https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Ftfchain.grid.tf#/accounts>
|
||||
- For testnet: <https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Ftfchain.test.grid.tf#/accounts>
|
||||
- For Devnet: https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Ftfchain.dev.grid.tf#/accounts
|
||||
|
||||
-> Add Account -> Click on mnemonic and select `Raw Seed` -> Paste raw TF Chain seed.
|
||||
|
||||
Select `Advanced creation options` -> Change `keypair crypto type` to `Edwards (ed25519)`. Click `I have saved my mnemonic seed safely` and proceed.
|
||||
|
||||
Choose a name and password and proceed.
|
||||
|
||||
Browse to the [extrinsics](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Ftfchain.test.grid.tf#/extrinsics) <!--- or [Devnet](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Ftfchain.dev.grid.tf#/extrinsics) -->, select tftBridgeModule and extrinsic: `swap_to_stellar`. Provide your Bridge substrate address and the amount to transfer. Sign using your password.
|
||||
Again, a withdrawfee of 1 TFT will be taken, so make sure you send an amount larger than 1 TFT.
|
||||
|
||||
The amount withdrawn from TFChain will be sent to your Stellar wallet.
|
||||
|
||||
Behind the scenes, following will happen:
|
||||
|
||||
- Transferred TFTs from Stellar will be sent from the Stellar vault account to the user's Stellar account
|
||||
- TFTs will be burned on the TFChain for the transferred amount
|
||||
|
||||
Example: 
|
@@ -1,15 +0,0 @@
|
||||
<h1> Computer and IT Basics </h1>
|
||||
|
||||
Welcome to the *Computer and IT Basics* section of the ThreeFold Manual!
|
||||
|
||||
In this section, tailored specifically for system administrators, we'll delve into fundamental concepts and tools that form the backbone of managing and securing infrastructure. Whether you're a seasoned sysadmin or just starting your journey, these basics are essential for navigating the intricacies of the ThreeFold Grid.
|
||||
|
||||
<h2> Table of Contents </h2>
|
||||
|
||||
- [CLI and Scripts Basics](./cli_scripts_basics.md)
|
||||
- [Docker Basics](./docker_basics.md)
|
||||
- [Git and GitHub Basics](./git_github_basics.md)
|
||||
- [Firewall Basics](./firewall_basics/firewall_basics.md)
|
||||
- [UFW Basics](./firewall_basics/ufw_basics.md)
|
||||
- [Firewalld Basics](./firewall_basics/firewalld_basics.md)
|
||||
- [File Transfer](./file_transfer.md)
|
@@ -1,458 +0,0 @@
|
||||
<h1>Docker Basic Commands</h1>
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Basic Commands](#basic-commands)
|
||||
- [Install Docker Desktop and Docker Engine](#install-docker-desktop-and-docker-engine)
|
||||
- [Remove completely Docker](#remove-completely-docker)
|
||||
- [List containers](#list-containers)
|
||||
- [Pull an image](#pull-an-image)
|
||||
- [Push an image](#push-an-image)
|
||||
- [Inspect and pull an image with GHCR](#inspect-and-pull-an-image-with-ghcr)
|
||||
- [See a docker image (no download)](#see-a-docker-image-no-download)
|
||||
- [Build a container](#build-a-container)
|
||||
- [List all available docker images](#list-all-available-docker-images)
|
||||
- [Run a container](#run-a-container)
|
||||
- [Run a new command in an existing container](#run-a-new-command-in-an-existing-container)
|
||||
- [Bash shell into container](#bash-shell-into-container)
|
||||
- [Pass arguments with a bash script and a Dockerfile](#pass-arguments-with-a-bash-script-and-a-dockerfile)
|
||||
- [Copy files from a container to the local computer](#copy-files-from-a-container-to-the-local-computer)
|
||||
- [Delete all the containers, images and volumes](#delete-all-the-containers-images-and-volumes)
|
||||
- [Kill all the Docker processes](#kill-all-the-docker-processes)
|
||||
- [Output full logs for all containers](#output-full-logs-for-all-containers)
|
||||
- [Resources Usage](#resources-usage)
|
||||
- [Examine containers with size](#examine-containers-with-size)
|
||||
- [Examine disks usage](#examine-disks-usage)
|
||||
- [Wasted Resources](#wasted-resources)
|
||||
- [Prune the Docker logs](#prune-the-docker-logs)
|
||||
- [Prune the Docker containers](#prune-the-docker-containers)
|
||||
- [Remove unused and untagged local container images](#remove-unused-and-untagged-local-container-images)
|
||||
- [Clean up and delete all unused container images](#clean-up-and-delete-all-unused-container-images)
|
||||
- [Clean up container images based on a given timeframe](#clean-up-container-images-based-on-a-given-timeframe)
|
||||
- [Command Combinations](#command-combinations)
|
||||
- [Kill all running containers](#kill-all-running-containers)
|
||||
- [Stop all running containers](#stop-all-running-containers)
|
||||
- [Delete all stopped containers](#delete-all-stopped-containers)
|
||||
- [Delete all images](#delete-all-images)
|
||||
- [Update and stop a container in a crash-loop](#update-and-stop-a-container-in-a-crash-loop)
|
||||
- [References](#references)
|
||||
|
||||
***
|
||||
|
||||
## Introduction
|
||||
|
||||
We present here a quick introduction to Docker. We cover basic commands, as well as command combinations. Understanding the following should give system administrators confidence when it comes to using Docker efficiently.
|
||||
|
||||
The following can serve as a quick reference guide when deploying workloads on the ThreeFold Grid and using Docker in general.
|
||||
|
||||
We invite the readers to consult the [official Docker documentation](https://docs.docker.com/) for more information.
|
||||
|
||||
|
||||
|
||||
## Basic Commands
|
||||
|
||||
### Install Docker Desktop and Docker Engine
|
||||
|
||||
You can install [Docker Desktop](https://docs.docker.com/get-docker/) and [Docker Engine](https://docs.docker.com/engine/install/) for Linux, MAC and Windows. Follow the official Docker documentation for the details.
|
||||
|
||||
Note that the quickest way to install Docker Engine is to use the convenience script:
|
||||
|
||||
```
|
||||
curl -fsSL https://get.docker.com -o get-docker.sh
|
||||
sudo sh get-docker.sh
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Remove completely Docker
|
||||
|
||||
To completely remove docker from your machine, you can follow these steps:
|
||||
|
||||
* List the docker packages
|
||||
* ```
|
||||
dpkg -l | grep -i docker
|
||||
```
|
||||
* Purge and autoremove docker
|
||||
* ```
|
||||
apt-get purge -y docker-engine docker docker.io docker-ce docker-ce-cli docker-compose-plugin
|
||||
apt-get autoremove -y --purge docker-engine docker docker.io docker-ce docker-compose-plugin
|
||||
```
|
||||
* Remove the docker files and folders
|
||||
* ```
|
||||
rm -rf /var/lib/docker /etc/docker
|
||||
rm /etc/apparmor.d/docker
|
||||
groupdel docker
|
||||
rm -rf /var/run/docker.sock
|
||||
```
|
||||
|
||||
You can also use the command **whereis docker** to see if any Docker folders and files remain. If so, remove them with
|
||||
|
||||
|
||||
|
||||
### List containers
|
||||
|
||||
* List only running containers
|
||||
* ```
|
||||
docker ps
|
||||
```
|
||||
* List all containers (running + stopped)
|
||||
* ```
|
||||
docker ps -a
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Pull an image
|
||||
|
||||
To pull an image from [Docker Hub](https://hub.docker.com/):
|
||||
|
||||
* Pull an image
|
||||
* ```
|
||||
docker pull <image_name>
|
||||
```
|
||||
* Pull an image with the tag
|
||||
* ```
|
||||
docker pull <image_name>:tag
|
||||
```
|
||||
* Pull all tags of an image
|
||||
* ```
|
||||
docker pull <image_name> -a
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Push an image
|
||||
|
||||
To pull an image to [Docker Hub](https://hub.docker.com/):
|
||||
|
||||
* Push an image
|
||||
* ```
|
||||
docker push <image_name>
|
||||
```
|
||||
* Push an image with the tag
|
||||
* ```
|
||||
docker push <image_name>:tag
|
||||
```
|
||||
* Push all tags of an image
|
||||
* ```
|
||||
docker pull <image_name> -a
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Inspect and pull an image with GHCR
|
||||
|
||||
* Inspect the docker image
|
||||
* ```
|
||||
docker inspect ghcr.io/<repository>/<image>:<tag>
|
||||
```
|
||||
* Pull the docker image
|
||||
* ```
|
||||
docker pull ghcr.io/<repository>/<image>:<tag>
|
||||
```
|
||||
|
||||
|
||||
|
||||
### See a docker image (no download)
|
||||
|
||||
If you want to see a docker image without downloading the image itself, you can use Quay's [Skopeo tool](https://github.com/containers/skopeo), a command line utility that performs various operations on container images and image repositories.
|
||||
|
||||
```
|
||||
docker run --rm quay.io/skopeo/stable list-tags docker://ghcr.io/<repository>/<image>
|
||||
```
|
||||
|
||||
Make sure to write the proper information for the repository and the image.
|
||||
|
||||
To install Skopeo, read [this documentation](https://github.com/containers/skopeo/blob/main/install.md).
|
||||
|
||||
|
||||
|
||||
|
||||
### Build a container
|
||||
|
||||
Use **docker build** to build a container based on a Dockerfile
|
||||
|
||||
* Build a container based on current directory Dockerfile
|
||||
* ```
|
||||
docker build .
|
||||
```
|
||||
* Build a container and store the image with a given name
|
||||
* Template
|
||||
* ```
|
||||
docker build -t "<image_name>:<tag>"
|
||||
```
|
||||
* Example
|
||||
* ```
|
||||
docker build -t newimage:latest
|
||||
```
|
||||
* Build a docker container without using the cache
|
||||
* ```
|
||||
docker build --no-cache
|
||||
```
|
||||
|
||||
|
||||
|
||||
### List all available docker images
|
||||
|
||||
```
|
||||
docker images
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Run a container
|
||||
|
||||
To run a container based on an image, use the command **docker run**.
|
||||
|
||||
* Run an image
|
||||
* ```
|
||||
docker run <image_name>
|
||||
```
|
||||
* Run an image in the background (run and detach)
|
||||
* ```
|
||||
docker run -d <image_name>
|
||||
```
|
||||
* Run an image with CLI input
|
||||
* ```
|
||||
docker run -it <image_name>
|
||||
```
|
||||
|
||||
You can combine arguments, e.g. **docker run -itd**.
|
||||
|
||||
You can also specify the shell, e.g. **docker run -it <image_name> /bin/bash**
|
||||
|
||||
|
||||
|
||||
### Run a new command in an existing container
|
||||
|
||||
To run a new command in an existing container, use **docker exec**.
|
||||
|
||||
* Execute interactive shell on the container
|
||||
* ```
|
||||
docker exec -it <container_name> sh
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Bash shell into container
|
||||
|
||||
* Bash shell into a container
|
||||
* ```
|
||||
docker exec -i -t /bin/bash
|
||||
```
|
||||
* Bash shell into a container with root
|
||||
* ```
|
||||
docker exec -i -t -u root /bin/bash
|
||||
```
|
||||
|
||||
Note: if bash is not available, you can use `/bin/sh`
|
||||
|
||||
|
||||
|
||||
### Pass arguments with a bash script and a Dockerfile
|
||||
|
||||
You can do the following to pass arguments with a bash script and a Dockerfile.
|
||||
|
||||
```sh
|
||||
# script_example.sh
|
||||
#!/bin/sh
|
||||
|
||||
echo This is the domain: $env_domain
|
||||
echo This is the name: $env_name
|
||||
echo This is the password: $env_password
|
||||
|
||||
```
|
||||
* File `Dockerfile`
|
||||
|
||||
```Dockerfile
|
||||
FROM ubuntu:latest
|
||||
|
||||
ARG domain
|
||||
|
||||
ARG name
|
||||
|
||||
ARG password
|
||||
|
||||
ENV env_domain $domain
|
||||
|
||||
ENV env_name $name
|
||||
|
||||
ENV env_password $password
|
||||
|
||||
COPY script_example.sh .
|
||||
|
||||
RUN chmod +x /script_example.sh
|
||||
|
||||
CMD ["/script_example.sh"]
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Copy files from a container to the local computer
|
||||
|
||||
```
|
||||
docker cp <container_id>:<file_path> <file_path_destination>
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Delete all the containers, images and volumes
|
||||
|
||||
* To delete all containers:
|
||||
* ```
|
||||
docker compose rm -f -s -v
|
||||
```
|
||||
|
||||
* To delete all images:
|
||||
* ```
|
||||
docker rmi -f $(docker images -aq)
|
||||
```
|
||||
|
||||
* To delete all volumes:
|
||||
* ```
|
||||
docker volume rm $(docker volume ls -qf dangling=true)
|
||||
```
|
||||
|
||||
* To delete all containers, images and volumes:
|
||||
* ```
|
||||
docker compose rm -f -s -v && docker rmi -f $(docker images -aq) && docker volume rm $(docker volume ls -qf dangling=true)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Kill all the Docker processes
|
||||
|
||||
* To kill all processes:
|
||||
* ```
|
||||
killall Docker && open /Applications/Docker.app
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Output full logs for all containers
|
||||
|
||||
The following command output the full logs for all containers in the file **containers.log**:
|
||||
|
||||
```
|
||||
docker compose logs > containers.log
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Resources Usage
|
||||
|
||||
### Examine containers with size
|
||||
|
||||
```
|
||||
docker ps -s
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Examine disks usage
|
||||
|
||||
* Basic mode
|
||||
* ```
|
||||
docker system df
|
||||
```
|
||||
* Verbose mode
|
||||
* ```
|
||||
docker system df -v
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Wasted Resources
|
||||
|
||||
### Prune the Docker logs
|
||||
|
||||
```
|
||||
docker system prune
|
||||
```
|
||||
|
||||
### Prune the Docker containers
|
||||
|
||||
You can use the prune function to delete all stopped containers:
|
||||
|
||||
```
|
||||
docker container prune
|
||||
```
|
||||
|
||||
### Remove unused and untagged local container images
|
||||
|
||||
The following is useful if you want to clean up local filesystem:
|
||||
|
||||
```
|
||||
docker image prune
|
||||
```
|
||||
|
||||
### Clean up and delete all unused container images
|
||||
|
||||
```
|
||||
docker image prune -a
|
||||
```
|
||||
|
||||
### Clean up container images based on a given timeframe
|
||||
|
||||
To clean up container images created X hours ago, you can use the following template (replace <X> with a number):
|
||||
|
||||
```
|
||||
docker image prune -a --force --filter "until=<X>h"
|
||||
```
|
||||
|
||||
To clean up container images created before a given date, you can use the following template (replace <date> with the complete date):
|
||||
|
||||
```
|
||||
docker image prune -a --force --filter "until=<date>"
|
||||
```
|
||||
|
||||
Note: An example of a complete date would be `2023-01-04T00:00:00`
|
||||
|
||||
|
||||
|
||||
## Command Combinations
|
||||
|
||||
### Kill all running containers
|
||||
|
||||
```
|
||||
docker kill $(docker ps -q)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Stop all running containers
|
||||
|
||||
```
|
||||
docker stop $(docker ps -a -q)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Delete all stopped containers
|
||||
|
||||
```
|
||||
docker rm $(docker ps -a -q)
|
||||
```
|
||||
|
||||
|
||||
### Delete all images
|
||||
|
||||
```
|
||||
docker rmi $(docker images -q)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Update and stop a container in a crash-loop
|
||||
|
||||
```
|
||||
docker update –restart=no && docker stop
|
||||
```
|
||||
|
||||
|
||||
|
||||
## References
|
||||
|
||||
* Docker Manual - https://docs.docker.com/
|
||||
* Code Notary - https://codenotary.com/blog/extremely-useful-docker-commands
|
@@ -1,271 +0,0 @@
|
||||
<h1>File Transfer</h1>
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [SCP](#scp)
|
||||
- [File transfer with IPv4](#file-transfer-with-ipv4)
|
||||
- [File transfer with IPv6](#file-transfer-with-ipv6)
|
||||
- [Rsync](#rsync)
|
||||
- [File transfer](#file-transfer)
|
||||
- [Adjust reorganization of files and folders before running rsync](#adjust-reorganization-of-files-and-folders-before-running-rsync)
|
||||
- [Automate backup with rsync](#automate-backup-with-rsync)
|
||||
- [Parameters --checksum and --ignore-times with rsync](#parameters---checksum-and---ignore-times-with-rsync)
|
||||
- [Trailing slashes with rsync](#trailing-slashes-with-rsync)
|
||||
- [SFTP](#sftp)
|
||||
- [SFTP on the Terminal](#sftp-on-the-terminal)
|
||||
- [SFTP Basic Commands](#sftp-basic-commands)
|
||||
- [SFTP File Transfer](#sftp-file-transfer)
|
||||
- [SFTP with FileZilla](#sftp-with-filezilla)
|
||||
- [Install FileZilla](#install-filezilla)
|
||||
- [Add a Private Key](#add-a-private-key)
|
||||
- [FileZilla SFTP Connection](#filezilla-sftp-connection)
|
||||
- [Questions and Feedback](#questions-and-feedback)
|
||||
|
||||
***
|
||||
|
||||
## Introduction
|
||||
|
||||
Deploying on the TFGrid with tools such as the Playground and Terraform is easy and it's also possible to quickly transfer files between local machine and VMs deployed on 3Nodes on the TFGrid. In this section, we cover different ways to transfer files between local and remote machines.
|
||||
|
||||
## SCP
|
||||
|
||||
### File transfer with IPv4
|
||||
|
||||
* From local to remote, write the following on the local terminal:
|
||||
* ```
|
||||
scp <path_to_local_file>/<filename> <remote_username>@<remote_IPv4_address>:/<remote_username>/<path_to_remote_file>/<filename>
|
||||
```
|
||||
* From remote to local, you can write the following on the local terminal (more secure):
|
||||
* ```
|
||||
scp <remote_username>@<remote_IPv4_address>:/<remote_username>/<path_to_remote_file>/<filename> <path_to_local_file>/<file>
|
||||
* From remote to local, you can also write the following on the remote terminal:
|
||||
* ```
|
||||
scp <path_to_remote_file>/<file> <local_user>@<local_IPv4_address>:/<local_username>/<path_to_local_file>/<filename>
|
||||
|
||||
### File transfer with IPv6
|
||||
|
||||
For IPv6, it is similar to IPv4 but you need to add `-6` after scp and add `\[` before and `\]` after the IPv6 address.
|
||||
|
||||
## Rsync
|
||||
|
||||
### File transfer
|
||||
|
||||
[rsync](https://rsync.samba.org/) is a utility for efficiently transferring and synchronizing files between a computer and a storage drive and across networked computers by comparing the modification times and sizes of files.
|
||||
|
||||
We show here how to transfer files between two computers. Note that at least one of the two computers must be local. This will transfer the content of the source directory into the destination directory.
|
||||
|
||||
* From local to remote
|
||||
* ```
|
||||
rsync -avz --progress --delete /path/to/local/directory/ remote_user@<remote_host_or_ip>:/path/to/remote/directory
|
||||
```
|
||||
* From remote to local
|
||||
* ```
|
||||
rsync -avz --progress --delete remote_user@<remote_host_or_ip>:/path/to/remote/directory/ /path/to/local/directory
|
||||
```
|
||||
|
||||
Here is short description of the parameters used:
|
||||
|
||||
* **-a**: archive mode, preserving the attributes of the files and directories
|
||||
* **-v**: verbose mode, displaying the progress of the transfer
|
||||
* **-z**: compress mode, compressing the data before transferring
|
||||
* **--progress** tells rsync to print information showing the progress of the transfer
|
||||
* **--delete** tells rsync to delete files that aren't on the sending side
|
||||
|
||||
### Adjust reorganization of files and folders before running rsync
|
||||
|
||||
[rsync-sidekick](https://github.com/m-manu/rsync-sidekick) propagates changes from source directory to destination directory. You can run rsync-sidekick before running rsync. Make sure that [Go is installed](#install-go).
|
||||
|
||||
* Install rsync-sidekick
|
||||
* ```
|
||||
sudo go install github.com/m-manu/rsync-sidekick@latest
|
||||
```
|
||||
* Reorganize the files and folders with rsync-sidekick
|
||||
* ```
|
||||
rsync-sidekick /path/to/local/directory/ username@IP_Address:/path/to/remote/directory
|
||||
```
|
||||
|
||||
* Transfer and update files and folders with rsync
|
||||
* ```
|
||||
sudo rsync -avz --progress --delete --log-file=/path/to/local/directory/rsync_storage.log /path/to/local/directory/ username@IP_Address:/path/to/remote/directory
|
||||
```
|
||||
|
||||
### Automate backup with rsync
|
||||
|
||||
We show how to automate file transfers between two computers using rsync.
|
||||
|
||||
* Create the script file
|
||||
* ```
|
||||
nano rsync_backup.sh
|
||||
```
|
||||
* Write the following script with the proper paths. Here the log is saved in the same directory.
|
||||
* ```
|
||||
# filename: rsync_backup.sh
|
||||
#!/bin/bash
|
||||
|
||||
sudo rsync -avz --progress --delete --log-file=/path/to/local/directory/rsync_storage.log /path/to/local/directory/ username@IP_Address:/path/to/remote/directory
|
||||
```
|
||||
* Give permission
|
||||
* ```
|
||||
sudo chmod +x /path/to/script/rsync_backup.sh
|
||||
```
|
||||
* Set a cron job to run the script periodically
|
||||
* Copy your .sh file to **/root**:
|
||||
```
|
||||
sudo cp path/to/script/rsync_backup.sh /root
|
||||
```
|
||||
* Open the cron file
|
||||
* ```
|
||||
sudo crontab -e
|
||||
```
|
||||
* Add the following to run the script everyday. For this example, we set the time at 18:00PM
|
||||
* ```
|
||||
0 18 * * * /root/rsync_backup.sh
|
||||
```
|
||||
|
||||
### Parameters --checksum and --ignore-times with rsync
|
||||
|
||||
Depending on your situation, the parameters **--checksum** or **--ignore-times** can be quite useful. Note that adding either parameter will slow the transfer.
|
||||
|
||||
* With **--ignore time**, you ignore both the time and size of each file. This means that you transfer all files from source to destination.
|
||||
* ```
|
||||
rsync --ignore-time source_folder/ destination_folder
|
||||
```
|
||||
* With **--checksum**, you verify with a checksum that the files from source and destination are the same. This means that you transfer all files that have a different checksum compared source to destination.
|
||||
* ```
|
||||
rsync --checksum source_folder/ destination_folder
|
||||
```
|
||||
|
||||
### Trailing slashes with rsync
|
||||
|
||||
rsync does not act the same whether you use or not a slash ("\/") at the end of the source path.
|
||||
|
||||
* Copy content of **source_folder** into **destination_folder** to obtain the result: **destination_folder/source_folder_content**
|
||||
* ```
|
||||
rsync source_folder/ destination_folder
|
||||
```
|
||||
* Copy **source_folder** into **destination_folder** to obtain the result: **destination_folder/source_folder/source_folder_content**
|
||||
* ```
|
||||
rsync source_folder destination_folder
|
||||
```
|
||||
|
||||
|
||||
|
||||
## SFTP
|
||||
|
||||
### SFTP on the Terminal
|
||||
|
||||
Using SFTP for file transfer on the terminal is very quick since the SSH connection is already enabled by default when deploying workloads on the TFGrid.
|
||||
|
||||
If you can use the following command to connect to a VM on the TFGrid:
|
||||
|
||||
```
|
||||
ssh root@VM_IP
|
||||
```
|
||||
|
||||
Then, it means you can use SFTP to access the same VM:
|
||||
|
||||
```
|
||||
sftp root@VM_IP
|
||||
```
|
||||
|
||||
Once in the server via SFTP, you can use the command line to get all the commands with `help` or `?`:
|
||||
|
||||
```
|
||||
help
|
||||
```
|
||||
|
||||
### SFTP Basic Commands
|
||||
|
||||
Here are some common commands for SFTP.
|
||||
|
||||
| Command | Function |
|
||||
| --------------------------- | ----------------------------------- |
|
||||
| bye | Quit sftp |
|
||||
| cd path | Change remote directory to 'path' |
|
||||
| help | Display this help text |
|
||||
| pwd | Display remote working directory |
|
||||
| lpwd | Print local working directory |
|
||||
| ls [-1afhlnrSt] [path] | Display remote directory listing |
|
||||
| mkdir path | Create remote directory |
|
||||
| put [-afpR] local [remote] | Upload file |
|
||||
| get [-afpR] remote [local] | Download file |
|
||||
| quit | Quit sftp |
|
||||
| rm path | Delete remote file |
|
||||
| rmdir path | Remove remote directory |
|
||||
| version | Show SFTP version |
|
||||
| !command | Execute 'command' in local shell |
|
||||
|
||||
|
||||
### SFTP File Transfer
|
||||
|
||||
Using SFTP to transfer a file from the local machine to the remote VM is as simple as the following line:
|
||||
|
||||
```
|
||||
put /local/path/file
|
||||
```
|
||||
|
||||
This will transfer the file in the current user home directory of the remote VM.
|
||||
|
||||
To transfer the file in a given directory, use the following:
|
||||
|
||||
```
|
||||
put /local/path/file /remote/path/
|
||||
```
|
||||
|
||||
To transfer a file from the remote VM to the local machine, you can use the command `get`:
|
||||
|
||||
```
|
||||
get /remote/path/file /local/path
|
||||
```
|
||||
|
||||
To transfer (`get` or `put`) all the files within a directory, use the `-r` argument, as shown in the following example
|
||||
|
||||
```
|
||||
get -r /remote/path/to/directory /local/path
|
||||
```
|
||||
|
||||
## SFTP with FileZilla
|
||||
|
||||
[FileZilla](https://filezilla-project.org/) is a free and open-source, cross-platform FTP application, consisting of FileZilla Client and FileZilla Server.
|
||||
|
||||
It is possible to use FileZilla Client to transfer files between your local machine and a remote VM on the TFGrid.
|
||||
|
||||
Since SSH is set, the user basically only needs to add the private key in FileZilla and enter the VM credentials to connect using SFTP in FileZilla.
|
||||
|
||||
### Install FileZilla
|
||||
|
||||
FileZilla is available on Linux, MAC and Windows on the [FileZilla website](https://filezilla-project.org/download.php?type=client). Simply follow the steps to properly download and install FileZilla Client.
|
||||
|
||||
### Add a Private Key
|
||||
|
||||
To prepare a connection using FileZilla, you need to add the private key of the SSH key pair.
|
||||
|
||||
Simply add the file `id_rsa` in **SFTP**.
|
||||
|
||||
- Open FileZilla Client
|
||||
- Go to **Edit** -> **Settings** -> **Connection** -> **SFTP**
|
||||
- Then click on **Add key file...**
|
||||
- Search the `id.rsa` file usually located in `~/.ssh/id_rsa`
|
||||
- Click on **OK**
|
||||
|
||||
### FileZilla SFTP Connection
|
||||
|
||||
You can set a connection between your local machine and a remote 3Node with FileZilla by using **root** as **Username** and the VM IP address as **Host**.
|
||||
|
||||
- Enter the credentials
|
||||
- Host
|
||||
- `VM_IP_Address`
|
||||
- Username
|
||||
- `root`
|
||||
- Password
|
||||
- As set by the user. Can be empty.
|
||||
- Port
|
||||
- `22`
|
||||
- Click on **Quickconnect**
|
||||
|
||||
You can now transfer files between the local machine and the remote VM with FileZilla.
|
||||
|
||||
## Questions and Feedback
|
||||
|
||||
If you have any questions, you can ask the ThreeFold community for help on the [ThreeFold Forum](http://forum.threefold.io/) or on the [ThreeFold Grid Tester Community](https://t.me/threefoldtesting) on Telegram.
|
@@ -1,8 +0,0 @@
|
||||
<h1> Firewall Basics </h1>
|
||||
|
||||
In this section, we cover the basic information concerning Firewall uses on Linux, most notably, we give basic commands and information on UFW and Firewalld.
|
||||
|
||||
<h2> Table of Contents </h2>
|
||||
|
||||
- [UFW Basics](./ufw_basics.md)
|
||||
- [Firewalld Basics](./firewalld_basics.md)
|
@@ -1,149 +0,0 @@
|
||||
<h1>Firewalld Basic Commands</h1>
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Firewalld Basic Commands](#firewalld-basic-commands)
|
||||
- [Install Firewalld](#install-firewalld)
|
||||
- [See the Status of Firewalld](#see-the-status-of-firewalld)
|
||||
- [Enable Firewalld](#enable-firewalld)
|
||||
- [Stop Firewalld](#stop-firewalld)
|
||||
- [Start Firewalld](#start-firewalld)
|
||||
- [Disable Firewalld](#disable-firewalld)
|
||||
- [Mask Firewalld](#mask-firewalld)
|
||||
- [Unmask Firewalld](#unmask-firewalld)
|
||||
- [Add a Service to Firewalld](#add-a-service-to-firewalld)
|
||||
- [Remove a Service to Firewalld](#remove-a-service-to-firewalld)
|
||||
- [Remove the Diles of a Service to Firewalld](#remove-the-diles-of-a-service-to-firewalld)
|
||||
- [See if a Service is Available](#see-if-a-service-is-available)
|
||||
- [Reload Firewalld](#reload-firewalld)
|
||||
- [Display the Services and the Open Ports for the Public Zone](#display-the-services-and-the-open-ports-for-the-public-zone)
|
||||
- [Display the Open Ports by Services and Port Numbers](#display-the-open-ports-by-services-and-port-numbers)
|
||||
- [Add a Port for tcp](#add-a-port-for-tcp)
|
||||
- [Add a Port for udp](#add-a-port-for-udp)
|
||||
- [Add a Port for tcp and udp](#add-a-port-for-tcp-and-udp)
|
||||
- [References](#references)
|
||||
|
||||
|
||||
## Introduction
|
||||
|
||||
We present a quick introduction to [firewalld](https://firewalld.org/), a free and open-source firewall management tool for Linux operating systems. This guide can be useful for users of the TFGrid deploying on full and micro VMs as well as other types of deployment.
|
||||
|
||||
## Firewalld Basic Commands
|
||||
|
||||
### Install Firewalld
|
||||
|
||||
* ```
|
||||
apt install firewalld -y
|
||||
```
|
||||
### See the Status of Firewalld
|
||||
|
||||
* ```
|
||||
firewall-cmd --state
|
||||
```
|
||||
### Enable Firewalld
|
||||
|
||||
* ```
|
||||
systemctl enablefirewalld
|
||||
```
|
||||
### Stop Firewalld
|
||||
|
||||
* ```
|
||||
systemctl stop firewalld
|
||||
```
|
||||
### Start Firewalld
|
||||
|
||||
* ```
|
||||
systemctl start firewalld
|
||||
```
|
||||
### Disable Firewalld
|
||||
|
||||
* ```
|
||||
systemctl disable firewalld
|
||||
```
|
||||
### Mask Firewalld
|
||||
|
||||
* ```
|
||||
systemctl mask --now firewalld
|
||||
```
|
||||
### Unmask Firewalld
|
||||
|
||||
* ```
|
||||
systemctl unmask --now firewalld
|
||||
```
|
||||
### Add a Service to Firewalld
|
||||
|
||||
* Temporary
|
||||
* ```
|
||||
firewall-cmd --add-service=<service_name>
|
||||
```
|
||||
* Permanent
|
||||
* ```
|
||||
firewall-cmd --add-service=<service_name> --permanent
|
||||
```
|
||||
|
||||
### Remove a Service to Firewalld
|
||||
|
||||
* Temporary
|
||||
* ```
|
||||
firewall-cmd --remove-service=<service_name>
|
||||
```
|
||||
* Permanent
|
||||
* ```
|
||||
firewall-cmd --remove-service=<service_name> --permanent
|
||||
```
|
||||
|
||||
### Remove the Diles of a Service to Firewalld
|
||||
|
||||
* ```
|
||||
rm -f /etc/firewalld/services/<service_name>.xml*
|
||||
```
|
||||
|
||||
### See if a Service is Available
|
||||
|
||||
* ```
|
||||
firewall-cmd --info-service=<service_name>
|
||||
```
|
||||
|
||||
### Reload Firewalld
|
||||
|
||||
* ```
|
||||
firewall-cmd --reload
|
||||
```
|
||||
|
||||
### Display the Services and the Open Ports for the Public Zone
|
||||
|
||||
* ```
|
||||
firewall-cmd --list-all --zone=public
|
||||
```
|
||||
|
||||
### Display the Open Ports by Services and Port Numbers
|
||||
|
||||
* By services
|
||||
* ```
|
||||
firewall-cmd --list-services
|
||||
```
|
||||
* By port numbers
|
||||
* ```
|
||||
firewall-cmd --list-ports
|
||||
```
|
||||
|
||||
### Add a Port for tcp
|
||||
|
||||
* ```
|
||||
firewall-cmd --zone=public --add-port=<port>/tcp
|
||||
```
|
||||
### Add a Port for udp
|
||||
|
||||
* ```
|
||||
firewall-cmd --zone=public --add-port=<port>/udp
|
||||
```
|
||||
### Add a Port for tcp and udp
|
||||
|
||||
* ```
|
||||
firewall-cmd --zone=public --add-port=<port>
|
||||
```
|
||||
|
||||
## References
|
||||
|
||||
ufw man pages - https://firewalld.org/documentation/man-pages/firewalld.html
|
@@ -1,256 +0,0 @@
|
||||
|
||||
<h1> Uncomplicated Firewall (ufw) Basic Commands</h1>
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Basic Commands](#basic-commands)
|
||||
- [Install ufw](#install-ufw)
|
||||
- [Enable ufw](#enable-ufw)
|
||||
- [Disable ufw](#disable-ufw)
|
||||
- [Reset ufw](#reset-ufw)
|
||||
- [Reload ufw](#reload-ufw)
|
||||
- [Deny Incoming Connections](#deny-incoming-connections)
|
||||
- [Allow Outgoing Connections](#allow-outgoing-connections)
|
||||
- [Allow a Specific IP address](#allow-a-specific-ip-address)
|
||||
- [Allow a Specific IP Address to a Given Port](#allow-a-specific-ip-address-to-a-given-port)
|
||||
- [Allow a Port for tcp](#allow-a-port-for-tcp)
|
||||
- [Allow a Port for tcp and udp](#allow-a-port-for-tcp-and-udp)
|
||||
- [Allow a Subnet to a Given Port](#allow-a-subnet-to-a-given-port)
|
||||
- [Deny an IP Address](#deny-an-ip-address)
|
||||
- [Block Incoming Connections to a Network Interface](#block-incoming-connections-to-a-network-interface)
|
||||
- [Delete a Rule with Number](#delete-a-rule-with-number)
|
||||
- [Get App Info](#get-app-info)
|
||||
- [Allow a Specific App](#allow-a-specific-app)
|
||||
- [References](#references)
|
||||
|
||||
|
||||
## Introduction
|
||||
|
||||
We present a quick introduction to [Uncomplicated Firewall (ufw)](https://firewalld.org/), a free and open-source firewall management tool for Linux operating systems. This guide can be useful for users of the TFGrid deploying on full and micro VMs as well as other types of deployment.
|
||||
|
||||
## Basic Commands
|
||||
|
||||
We show here basic commands to set a firewall on Linux with Uncomplicated Firewall (ufw).
|
||||
|
||||
### Install ufw
|
||||
|
||||
* Update
|
||||
* ```
|
||||
apt update
|
||||
```
|
||||
* Install ufw
|
||||
* ```
|
||||
apt install ufw
|
||||
```
|
||||
|
||||
### Enable ufw
|
||||
|
||||
* ```
|
||||
ufw enable
|
||||
``````
|
||||
|
||||
### Disable ufw
|
||||
|
||||
* ```
|
||||
ufw disable
|
||||
```
|
||||
|
||||
### Reset ufw
|
||||
|
||||
* ```
|
||||
ufw reset
|
||||
```
|
||||
|
||||
### Reload ufw
|
||||
|
||||
* ```
|
||||
ufw reload
|
||||
```
|
||||
|
||||
### Deny Incoming Connections
|
||||
|
||||
* ```
|
||||
ufw default deny incoming
|
||||
```
|
||||
|
||||
### Allow Outgoing Connections
|
||||
|
||||
* ```
|
||||
ufw default allow outgoing
|
||||
```
|
||||
### Allow a Specific IP address
|
||||
|
||||
* ```
|
||||
ufw allow from <IP_Address>
|
||||
```
|
||||
|
||||
### Allow a Specific IP Address to a Given Port
|
||||
|
||||
* ```
|
||||
ufw allow from <IP_Address> to any port <port>
|
||||
```
|
||||
|
||||
### Allow a Port for tcp
|
||||
|
||||
* ```
|
||||
ufw allow <port>/tcp
|
||||
```
|
||||
### Allow a Port for udp
|
||||
|
||||
* ```
|
||||
ufw allow <port>/udp
|
||||
```
|
||||
### Allow a Port for tcp and udp
|
||||
|
||||
* ```
|
||||
ufw allow <port>
|
||||
```
|
||||
|
||||
### Allow Ports: Examples
|
||||
|
||||
Here are some typical examples of ports to allow with ufw:
|
||||
|
||||
* Allow SSH (port 22)
|
||||
* ```
|
||||
ufw allow ssh
|
||||
```
|
||||
* Allow HTTP (port 80)
|
||||
* ```
|
||||
ufw allow http
|
||||
```
|
||||
* Allow HTTPS (port 443)
|
||||
* ```
|
||||
ufw allow https
|
||||
```
|
||||
* Allow mysql (port 3306)
|
||||
* ```
|
||||
ufw allow 3306
|
||||
```
|
||||
|
||||
### Allow Port Ranges
|
||||
|
||||
* Template
|
||||
* ```
|
||||
ufw allow <port_range_floor>:<port_range_ceiling>
|
||||
```
|
||||
* Example
|
||||
* ```
|
||||
ufw allow 6000:6005
|
||||
```
|
||||
|
||||
### Allow a Subnet
|
||||
|
||||
* ```
|
||||
ufw allow from <subnet>
|
||||
```
|
||||
|
||||
### Allow a Subnet to a Given Port
|
||||
|
||||
* ```
|
||||
ufw allow from <subnet> to any port <port>
|
||||
```
|
||||
|
||||
### Deny a Port
|
||||
|
||||
* ```
|
||||
ufw deny <port>
|
||||
```
|
||||
|
||||
### Deny an IP Address
|
||||
|
||||
* ```
|
||||
ufw deny <IP_Address>
|
||||
```
|
||||
|
||||
### Deny a Subnet
|
||||
|
||||
* ```
|
||||
ufw deny from <subnet>
|
||||
```
|
||||
|
||||
### Block Incoming Connections to a Network Interface
|
||||
|
||||
* ```
|
||||
ufw deny in on <network_interface> from <IP_Address>
|
||||
```
|
||||
|
||||
### Check Rules
|
||||
|
||||
Use **status** to check the current firewall configurations. Add **verbose** for more details.
|
||||
|
||||
* ```
|
||||
ufw status
|
||||
```
|
||||
* ```
|
||||
ufw status verbose
|
||||
```
|
||||
|
||||
### Check Rules (Numbered)
|
||||
|
||||
It can be useful to see the numbering of the rules, to remove more easily a rule for example.
|
||||
|
||||
* ```
|
||||
ufw status numbered
|
||||
```
|
||||
|
||||
### Delete a Rule with Number
|
||||
|
||||
It can be useful to see the numbering of the rules, to remove more easily a rule for example.
|
||||
|
||||
* ```
|
||||
ufw delete <rule_number>
|
||||
```
|
||||
|
||||
### Delete a Rule with the Rule Name and Parameters
|
||||
|
||||
You can also delete a rule by writing directly the rule name you used to add the rule.
|
||||
|
||||
* Template
|
||||
* ```
|
||||
ufw delete <rule_name> <rule_parameters>
|
||||
```
|
||||
* Example
|
||||
* ```
|
||||
ufw delete allow ssh
|
||||
```
|
||||
* ```
|
||||
ufw delete allow 22
|
||||
```
|
||||
|
||||
You can always check the current rules with **ufw status** to see if the rules are properly removed.
|
||||
|
||||
### List the Available Profiles Available
|
||||
|
||||
* ```
|
||||
ufw app list
|
||||
```
|
||||
|
||||
This command will give you the names of the apps present on the server. You can then use **ufw app info** to get information on the app, or allow the app with **ufw allow**
|
||||
|
||||
### Get App Info
|
||||
|
||||
* ```
|
||||
ufw app info <app_name>
|
||||
```
|
||||
|
||||
### Set ufw in Verbose Mode
|
||||
|
||||
* ```
|
||||
ufw verbose
|
||||
```
|
||||
|
||||
### Allow a Specific App
|
||||
|
||||
* Template
|
||||
* ```
|
||||
ufw allow "<app_name>"
|
||||
```
|
||||
* Example
|
||||
* ```
|
||||
ufw allow "NGINX Full"
|
||||
```
|
||||
|
||||
## References
|
||||
|
||||
ufw man pages - https://manpages.ubuntu.com/manpages/trusty/man8/ufw.8.html
|
@@ -1,450 +0,0 @@
|
||||
<h1> Git and GitHub Basics </h1>
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Install Git](#install-git)
|
||||
- [Install on Linux](#install-on-linux)
|
||||
- [Install on MAC](#install-on-mac)
|
||||
- [Install on Windows](#install-on-windows)
|
||||
- [Basic Commands](#basic-commands)
|
||||
- [Check Git version](#check-git-version)
|
||||
- [Clone a repository](#clone-a-repository)
|
||||
- [Clone a single branch](#clone-a-single-branch)
|
||||
- [Check all available branches](#check-all-available-branches)
|
||||
- [Check the current branch](#check-the-current-branch)
|
||||
- [Go to another branch](#go-to-another-branch)
|
||||
- [Add your changes to a local branch](#add-your-changes-to-a-local-branch)
|
||||
- [Push changes of a local branch to the remote Github branch](#push-changes-of-a-local-branch-to-the-remote-github-branch)
|
||||
- [Reverse modifications to a file where changes haven't been staged yet](#reverse-modifications-to-a-file-where-changes-havent-been-staged-yet)
|
||||
- [Download binaries from Github](#download-binaries-from-github)
|
||||
- [Resolve conflicts between branches](#resolve-conflicts-between-branches)
|
||||
- [Download all repositories of an organization](#download-all-repositories-of-an-organization)
|
||||
- [Revert a push commited with git](#revert-a-push-commited-with-git)
|
||||
- [Make a backup of a branch](#make-a-backup-of-a-branch)
|
||||
- [Revert to a backup branch](#revert-to-a-backup-branch)
|
||||
- [Start over local branch and pull remote branch](#start-over-local-branch-and-pull-remote-branch)
|
||||
- [Overwrite local files and pull remote branch](#overwrite-local-files-and-pull-remote-branch)
|
||||
- [Stash command and parameters](#stash-command-and-parameters)
|
||||
- [Code Editors](#code-editors)
|
||||
- [VS-Code](#vs-code)
|
||||
- [VS-Codium](#vs-codium)
|
||||
- [References](#references)
|
||||
|
||||
***
|
||||
|
||||
## Introduction
|
||||
|
||||
In this section, we cover basic commands and aspects of [GitHub](https://github.com/) and [Git](https://git-scm.com/).
|
||||
|
||||
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
|
||||
|
||||
GitHub is a platform and cloud-based service for software development and version control using Git, allowing developers to store and manage their code.
|
||||
|
||||
|
||||
|
||||
## Install Git
|
||||
|
||||
You can install git on MAC, Windows and Linux. You can consult Git's documentation learn how to [install git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
|
||||
|
||||
### Install on Linux
|
||||
|
||||
* Fedora distribution
|
||||
* ```
|
||||
dnf install git-all
|
||||
```
|
||||
* Debian-based distribution
|
||||
* ```
|
||||
apt install git-all
|
||||
```
|
||||
* Click [here](https://git-scm.com/download/linux) for other Linux distributions
|
||||
|
||||
### Install on MAC
|
||||
|
||||
* With Homebrew
|
||||
* ```
|
||||
brew install git
|
||||
```
|
||||
|
||||
### Install on Windows
|
||||
|
||||
You can download Git for Windows at [this link](https://git-scm.com/download/win).
|
||||
|
||||
|
||||
|
||||
## Basic Commands
|
||||
|
||||
### Check Git version
|
||||
|
||||
```
|
||||
git --version
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Clone a repository
|
||||
|
||||
```
|
||||
git clone <repository_url>
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Clone a single branch
|
||||
|
||||
```
|
||||
git clone <repository_url> --branch <branch> --single-branch <folder>
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Check all available branches
|
||||
|
||||
```
|
||||
git branch -r
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Check the current branch
|
||||
|
||||
```
|
||||
git branch
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Go to another branch
|
||||
|
||||
```
|
||||
git checkout <branch_name>
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Add your changes to a local branch
|
||||
|
||||
* Add all changes
|
||||
* ```
|
||||
git add .
|
||||
```
|
||||
* Add changes of a specific file
|
||||
* ```
|
||||
git add <path_to_file>/<file_name>
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Push changes of a local branch to the remote Github branch
|
||||
|
||||
To push changes to Github, you can use the following commands:
|
||||
|
||||
* ```
|
||||
git add .
|
||||
```
|
||||
* ```
|
||||
git commit -m "write your changes here in comment"
|
||||
```
|
||||
* ```
|
||||
git push
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Count the differences between two branches
|
||||
|
||||
Replace **branch1** and **branch2** with the appropriate branch names.
|
||||
|
||||
```
|
||||
git rev-list --count branch1..branch2
|
||||
```
|
||||
|
||||
### See the default branch
|
||||
|
||||
```
|
||||
git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Force a push
|
||||
|
||||
```
|
||||
git push --force
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Merge a branch to a different branch
|
||||
|
||||
* Checkout the branch you want to copy content TO
|
||||
* ```
|
||||
git checkout branch_name
|
||||
```
|
||||
* Merge the branch you want content FROM
|
||||
* ```
|
||||
git merge origin/dev_mermaid
|
||||
```
|
||||
* Push the changes
|
||||
* ```
|
||||
git push -u origin/head
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Clone completely one branch to another branch locally then push the changes to Github
|
||||
|
||||
For this example, we copy **branchB** into **branchA**.
|
||||
|
||||
* See available branches
|
||||
* ```
|
||||
git branch -r
|
||||
```
|
||||
* Go to **branchA**
|
||||
* ```
|
||||
git checkout branchA
|
||||
```
|
||||
* Copy **branchB** into **branchA**
|
||||
* ```
|
||||
git git reset --hard branchB
|
||||
```
|
||||
* Force the push
|
||||
* ```
|
||||
git push --force
|
||||
```
|
||||
|
||||
|
||||
|
||||
### The 3 levels of the command reset
|
||||
|
||||
* ```
|
||||
git reset --soft
|
||||
```
|
||||
* Bring the History to the Stage/Index
|
||||
* Discard last commit
|
||||
* ```
|
||||
git reset --mixed
|
||||
```
|
||||
* Bring the History to the Working Directory
|
||||
* Discard last commit and add
|
||||
* ```
|
||||
git reset --hard
|
||||
```
|
||||
* Bring the History to the Working Directory
|
||||
* Discard last commit, add and any changes you made on the codes
|
||||
|
||||
Note 1: If you're using **--hard**, make sure to run git status to verify that your directory is clean, otherwise you will lose your uncommitted changes.
|
||||
|
||||
Note 2: The argument **--mixed** is the default option, so **git reset** is equivalent to **git reset --mixed**.
|
||||
|
||||
|
||||
|
||||
### Reverse modifications to a file where changes haven't been staged yet
|
||||
|
||||
You can use the following to reverse the modifications of a file that hasn't been staged:
|
||||
|
||||
```
|
||||
git checkout <filename>
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Download binaries from Github
|
||||
|
||||
* Template:
|
||||
* ```
|
||||
wget -O <file_name> https://raw.githubusercontent.com/<user_name>/<repository>/<path_to_file>/<file_name>
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Resolve conflicts between branches
|
||||
|
||||
We show how to resolve conflicts in a development branch (e.g. **branch_dev**) and then merging the development branch into the main branch (e.g. **branch_main**).
|
||||
|
||||
* Clone the repo
|
||||
* ```
|
||||
git clone <repo_url>
|
||||
```
|
||||
* Pull changes and potential conflicts
|
||||
* ```
|
||||
git pull origin branch_main
|
||||
```
|
||||
* Checkout the development branch
|
||||
* ```
|
||||
git checkout branch_dev
|
||||
```
|
||||
* Resolve conflicts in a text editor
|
||||
* Save changes in the files
|
||||
* Add the changes
|
||||
* ```
|
||||
git add .
|
||||
```
|
||||
* Commit the changes
|
||||
* ```
|
||||
git commit -m "your message here"
|
||||
```
|
||||
* Push the changes
|
||||
* ```
|
||||
git push
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Download all repositories of an organization
|
||||
|
||||
* Log in to gh
|
||||
* ```
|
||||
gh auth login
|
||||
```
|
||||
* Clone all repositories. Replace <organization> with the organization in question.
|
||||
* ```
|
||||
gh repo list <organization> --limit 1000 | while read -r repo _; do
|
||||
gh repo clone "$repo" "$repo"
|
||||
done
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Revert a push commited with git
|
||||
|
||||
* Find the commit ID
|
||||
* ```
|
||||
git log -p
|
||||
```
|
||||
* Revert the commit
|
||||
* ```
|
||||
git revert <commit_ID>
|
||||
```
|
||||
* Push the changes
|
||||
* ```
|
||||
git push
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Make a backup of a branch
|
||||
|
||||
```
|
||||
git clone -b <branch_name> --single-branch /<path_to_repo>/<repo_name>.git
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Revert to a backup branch
|
||||
|
||||
* Checkout the branch you want to update (**branch**)
|
||||
* ```
|
||||
git checkout <branch>
|
||||
```
|
||||
* Do a reset of your current branch based on the backup branch
|
||||
* ```
|
||||
git reset --hard <backup_branch>
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Start over local branch and pull remote branch
|
||||
|
||||
To start over your local branch and pull the remote branch to your working environment, thus ignoring local changes in the branch, you can do the following:
|
||||
|
||||
```
|
||||
git fetch
|
||||
git reset --hard
|
||||
git pull
|
||||
```
|
||||
|
||||
Note that this will not work for untracked and new files. See below for untracked and new files.
|
||||
|
||||
|
||||
|
||||
### Overwrite local files and pull remote branch
|
||||
|
||||
This method can be used to overwrite local files. This will work even if you have untracked and new files.
|
||||
|
||||
* Save local changes on a stash
|
||||
* ```
|
||||
git stash --include-untracked
|
||||
```
|
||||
* Discard local changes
|
||||
* ```
|
||||
git reset --hard
|
||||
```
|
||||
* Discard untracked and new files
|
||||
* ```
|
||||
git clean -fd
|
||||
```
|
||||
* Pull the remote branch
|
||||
* ```
|
||||
git pull
|
||||
```
|
||||
|
||||
Then, to delete the stash, you can use **git stash drop**.
|
||||
|
||||
|
||||
|
||||
### Stash command and parameters
|
||||
|
||||
The stash command is used to record the current state of the working directory.
|
||||
|
||||
* Stash a branch (equivalent to **git stash push**)
|
||||
* ```
|
||||
git stash
|
||||
```
|
||||
* List the changes in the stash
|
||||
* ```
|
||||
git stash list
|
||||
```
|
||||
* Inspect the changes in the stash
|
||||
* ```
|
||||
git stash show
|
||||
```
|
||||
* Remove a single stashed state from the stash list and apply it on top of the current working tree state
|
||||
* ```
|
||||
git stash pop
|
||||
```
|
||||
* Apply the stash on top of the current working tree state without removing the state from the stash list
|
||||
* ```
|
||||
git stash apply
|
||||
```
|
||||
* Drop a stash
|
||||
* ```
|
||||
git stash drop
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Code Editors
|
||||
|
||||
There are many code editors that can work well when working with git.
|
||||
|
||||
### VS-Code
|
||||
|
||||
[VS-Code](https://code.visualstudio.com/)is a source-code editor made by Microsoft with the Electron Framework, for Windows, Linux and macOS.
|
||||
|
||||
To download VS-Code, visit their website and follow the given instructions.
|
||||
|
||||
### VS-Codium
|
||||
|
||||
[VS-Codium ](https://vscodium.com/) is a community-driven, freely-licensed binary distribution of Microsoft’s editor VS Code.
|
||||
|
||||
There are many ways to install VS-Codium. Visit the [official website](https://vscodium.com/#install) for more information.
|
||||
|
||||
* Install on MAC
|
||||
* ```
|
||||
brew install --cask vscodium
|
||||
```
|
||||
* Install on Linux
|
||||
* ```
|
||||
snap install codium --classic
|
||||
```
|
||||
* Install on Windows
|
||||
* ```
|
||||
choco install vscodium
|
||||
```
|
||||
|
||||
|
||||
|
||||
## References
|
||||
|
||||
Git Documentation - https://git-scm.com/docs/user-manual
|
Before Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 107 KiB |
Before Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 135 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 64 KiB |
@@ -1,4 +0,0 @@
|
||||
# Threefold Connect Basics Tutorial
|
||||
|
||||
* Create an account
|
||||
* Create a wallet
|
@@ -1,148 +0,0 @@
|
||||
<h1>ThreeFold Connect: Create a Threefold Connect Account and Wallet</h1>
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Download the ThreeFold Connect App](#download-the-threefold-connect-app)
|
||||
- [Create a ThreeFold Connect Account](#create-a-threefold-connect-account)
|
||||
- [Verify Your Email](#verify-your-email)
|
||||
- [Create a ThreeFold Connect Wallet](#create-a-threefold-connect-wallet)
|
||||
|
||||
***
|
||||
|
||||
## Introduction
|
||||
|
||||
The ThreeFold Connect app emerges as a dynamic and essential companion for individuals seeking seamless access to the ThreeFold ecosystem on the go. Available for free download on both iOS and Android mobile platforms, the TF Connect app ensures that users can effortlessly engage with the ThreeFold Grid, empowers users to manage their digital assets, engage in secure transactions, and explore decentralized financial opportunities, all within a unified mobile experience.
|
||||
|
||||
In this tutorial, we show you how to create a ThreeFold Connect account and wallet. The main steps are simple and you will be done in no time. If you have any questions, feel free to write a post on the [ThreeFold Forum](http://forum.threefold.io/).
|
||||
|
||||
## Download the ThreeFold Connect App
|
||||
|
||||
|
||||
The ThreeFold Connect app is available for [Android](https://play.google.com/store/apps/details?id=org.jimber.threebotlogin&hl=en&gl=US) and [iOS](https://apps.apple.com/us/app/threefold-connect/id1459845885).
|
||||
|
||||
- Note that for Android phones, you need at minimum Android 8.1
|
||||
- Note that for iOS phones, you need at minimum iOS 15
|
||||
|
||||
Either use the links above, or search for the ThreeFold Connect app on the App Store or the Google Play Store. Then install and open the app. If you want to leave a 5-star review of the app, no one here will stop you!
|
||||
|
||||

|
||||

|
||||
|
||||
When you try to open the app, if you get an error message such as: "Error in initialization in Flagsmith...", you might need to upgrade your phone to a newer software version (Android 8.1 and iOS 15).
|
||||
|
||||
***
|
||||
|
||||
## Create a ThreeFold Connect Account
|
||||
|
||||
Once you are in the app, you will see some introduction pages to help you familiarize with the TF Connect app. You will also be asked to read and accept ThreeFold's Terms and Conditions.
|
||||
|
||||

|
||||

|
||||
|
||||
You will then be asked to either *SIGN UP* or *RECOVER ACCOUNT*. To create a new account, click *SIGN UP*.
|
||||
|
||||

|
||||
|
||||
Then, choose a *ThreeFold Connect Id*. This 3bot ID will be used, as well as the seed phrase, when you want to recover an account. Choose wisely. And do not forget it! Here we will use TFExample, as an example.
|
||||
|
||||

|
||||
|
||||
Next, you need to add a valid email address. You will need to access your email and confirm the ThreeFold validation email to fully use the ThreeFold Connect app.
|
||||
|
||||

|
||||
|
||||
The next step is crucial! Make sure no one is around looking at your screen. You will be shown your seed phrase. Keep this in a secure and offline place. You will need the 3bot ID and the seed phrase to recover your account. This seed phrase is of utmost important. Do not lose it nor give it to anyone.
|
||||
|
||||

|
||||
|
||||
Once you've hit *Next*, you will be asked to write down 3 random words of your seed phrase. This is a necessary step to ensure you have taken the time to write down your seed phrase.
|
||||
|
||||

|
||||
|
||||
Then, you'll be asked to confirm your TF 3bot ID and the associated email.
|
||||
|
||||

|
||||
|
||||
Finally, you will be asked to choose a 4-digit pin. This will be needed to use the ThreeFold Connect app. If you ever forget this 4-digit pin, you will need to recover your account from your 3bot name and your seed phrase. You will need to confirm the new pin in the next step.
|
||||
|
||||

|
||||
|
||||
That's it! You've created your ThreeFold Connect account. You can press the hamburger menu on the top left to explore the ThreeFold Connect app.
|
||||
|
||||

|
||||
|
||||
In the next step, we will create a ThreeFold Connect wallet. You'll see, it's very simple!
|
||||
|
||||
But first, let's see how to verify your email.
|
||||
|
||||
***
|
||||
|
||||
## Verify Your Email
|
||||
|
||||
Once you've created your account, an email will be sent to the email address you've chosen in the account creation process. To verify your email, go on your email inbox and open the email sent by *info@openkyc.live* with the subject *Verify your email address*.
|
||||
|
||||
In this email, click on the link *Verify my email address*. This will lead you to a *login.threefold.me* link. The process should be automatic. Once this is done, you will receive a confirmation on screen, as well as on your phone.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
If, for some reason, you did not receive the verification email, simply click on *Verify* and another email will be sent.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
That's it! You've now created a ThreeFold Connect account.
|
||||
|
||||
All that is left to do is to create a ThreeFold Connect wallet. This is very simple.
|
||||
|
||||
Let's go!
|
||||
|
||||
***
|
||||
|
||||
## Create a ThreeFold Connect Wallet
|
||||
|
||||
To create a wallet, click on the ThreeFold Connect app menu, then choose *Wallet*.
|
||||
|
||||

|
||||
|
||||
Once you are in the section *Wallet*, click on *Create Initial Wallet*. If it doesn't work the first time, retry some more. If you have trouble creating a wallet, make sure your connection is reliable. You can try a couple of minutes later if it still doesn't work. With a reliable connection, there shouldn't be any problem. Contact TF Support if problems persist.
|
||||
|
||||

|
||||
|
||||
This is what you see when the TF Grid is initializing your wallet.
|
||||
|
||||

|
||||
|
||||
Once your wallet is initialized, you will see *No balance found for this wallet*. You can click on this button to enter the wallet.
|
||||
|
||||

|
||||
|
||||
Once inside your wallet, this is what you see.
|
||||
|
||||

|
||||
|
||||
We will now see where the Stellar and the TFChain addresses and secrets are to be found. We will also change the wallet name. To do so, click on the *encircled i* at the bottom right of the screen.
|
||||
|
||||
On this page, you can access your Stellar and TFChain addresses as well as your Stellar and TFChain secret keys.
|
||||
|
||||

|
||||
|
||||
To change the name of your wallet, click on the button next to *Wallet Name*. Here we use TFWalletExample. Note that you can also use alphanumeric characters.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
At the top of the section *Wallet*, we can see that the name has changed.
|
||||
|
||||

|
||||
|
||||
That's it! You now have a ThreeFold Connect account and wallet.
|
||||
This will be very useful for your TFT transactions on the ThreeFold ecosystem.
|
||||
|
||||
***
|
@@ -1,148 +0,0 @@
|
||||
<h1> Threefold Dashboard: Create Account and Transfer TFT </h1>
|
||||
|
||||
<h2> Table of Contents </h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Create Polkadot Extension Account](#create-polkadot-extension-account)
|
||||
- [Transfer TFT from Stellar Chain to TFChain](#transfer-tft-from-stellar-chain-to-tfchain)
|
||||
|
||||
## Introduction
|
||||
|
||||
For this section, we will create an account on the TFChain and transfer TFT from Stellar chain to TFChain. We will then be able to use the TFT and deploy workloads on the Threefold Playground.
|
||||
|
||||
## Create Polkadot Extension Account
|
||||
|
||||
Go to the Threefold Dashboard: [dashboard.grid.tf](https://dashboard.grid.tf/)
|
||||
|
||||
If you don't have the Polkadot extension installed on your browser, you will be able to click on the download link directly on the Threefold Dashboard page:
|
||||
|
||||

|
||||
|
||||
This link will lead you to the Polkadot extension download page: https://polkadot.js.org/extension/
|
||||
|
||||

|
||||
|
||||
Then, simply click on "Add to Chrome".
|
||||
|
||||

|
||||
|
||||
Then, confirm by clicking on "Add extension".
|
||||
|
||||

|
||||
|
||||
You can now access the extension by clicking on the browser's extension button on the top right of the screen, and by then clicking on *polkadot{.js} extension*:
|
||||
|
||||

|
||||
|
||||
Make sure to carefully read the Polkadot message then click on **Understood, let me continue**:
|
||||
|
||||

|
||||
|
||||
Then click on the **plus** symbol to create a new account:
|
||||
|
||||

|
||||
|
||||
For this next step, you should be very careful. Your seed phrase is your only access to your account. Make sure to keep a copy somewhere safe and offline.
|
||||
|
||||

|
||||
|
||||
After, choose a name for your account and a password:
|
||||
|
||||

|
||||
|
||||
Your account is now created. You can see it when you open the Polkadot extension on your browser:
|
||||
|
||||

|
||||
|
||||
Now, when you go on the [Threefold Dashboard](https://dashboard.grid.tf/), you can click on the **Connect** button on the top right corner:
|
||||
|
||||

|
||||
|
||||
You will then need to grant the Threefold Dashboard access to your Polkadot account.
|
||||
|
||||

|
||||
|
||||
Then, simply click on your account name to access the Threefold Dashboard:
|
||||
|
||||

|
||||
|
||||
Read and accept the Terms and Conditions
|
||||
|
||||

|
||||
|
||||
You will be asked to confirm the transaction, write your password and click on **Sign the transaction** to confirm.
|
||||
|
||||

|
||||
|
||||
Once you open your account, you can choose a relay for it then click on **Create**.
|
||||
|
||||

|
||||
|
||||
You will also be asked to confirm the transaction.
|
||||
|
||||

|
||||
|
||||
That's it! You've successfully created an account on the TFChain thanks to the Polkadot extension. You can now access the Threefold Dashboard.
|
||||
|
||||
On to the next section! Where we will transfer (or swap) TFT from the Stellar Chain on your Threefold Connect app wallet to the TFChain on the Threefold Dashboard.
|
||||
|
||||
You'll see, this is so easy thanks to the Threefold Dashboard configuration.
|
||||
|
||||
***
|
||||
|
||||
## Transfer TFT from Stellar Chain to TFChain
|
||||
|
||||
On the [Threefold Dashboard](https://dashboard.grid.tf/), click on the **Portal**, then click on **Swap**.
|
||||
|
||||
Make sure the chain **stellar** is selected. Then click **Deposit**, as we want to deposit TFT from the Stellar Chain to the TFChain.
|
||||
|
||||

|
||||
|
||||
Next, you will scan the QR code shown on the screen with the Threefold Connect app.
|
||||
|
||||
> Note that you can also manually enter the Stellar Chain address and the Twin ID.
|
||||
|
||||

|
||||
|
||||
To scan the QR code on the Threefold Connec app, follow those steps:
|
||||
|
||||
Click on the menu button:
|
||||
|
||||

|
||||
|
||||
Click on **Wallet**:
|
||||
|
||||

|
||||
|
||||
Then, click on **Send Coins**:
|
||||
|
||||

|
||||
|
||||
On the next page, select the **Stellar** chain, then click on **SCAN QR**:
|
||||
|
||||

|
||||
|
||||
|
||||
This will automatically write the correct address and twin ID.
|
||||
|
||||
You can now write the amount of TFT you wish to send, and then click **SEND**
|
||||
|
||||
> We recommend to try with a small amount of TFT first to make sure everything is OK.
|
||||
>
|
||||
> The transfer fees are of 1 TFT per transfer.
|
||||
|
||||

|
||||
|
||||
You will then simply need to confirm the transaction. It is a good opportunity to make sure everything is OK.
|
||||
|
||||

|
||||
|
||||
You should then receive your TFT on your Dashboard account within a few minutes.
|
||||
|
||||
You can see your TFT balance on the top of the screen. Here's an example of what it could look like:
|
||||
|
||||

|
||||
|
||||
> Note: You might need to refresh (reload) the webpage to see the new TFT added to the account.
|
||||
|
||||
That's it! You've swapped TFT from Stellar Chain to TFChain.
|
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
@@ -1,94 +0,0 @@
|
||||
<h1>TFT on Ethereum</h2>
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [TFT Ethereum-Stellar Bridge](#tft-ethereum-stellar-bridge)
|
||||
- [TFT and Metamask](#tft-and-metamask)
|
||||
- [Add TFT to Metamask](#add-tft-to-metamask)
|
||||
- [Buy TFT on Metamask](#buy-tft-on-metamask)
|
||||
- [Questions and Feedback](#questions-and-feedback)
|
||||
|
||||
***
|
||||
|
||||
## Introduction
|
||||
|
||||
The TFT Stellar-Ethereum bridge serves as a vital link between the Stellar and Ethereum blockchains, enabling the seamless transfer of TFT tokens between these two networks. This bridge enhances interoperability and expands the utility of TFT by allowing users to leverage the strengths of both platforms. With the bridge in place, TFT holders can convert their tokens from the Stellar network to the Ethereum network and vice versa, unlocking new possibilities for engagement with decentralized applications, smart contracts, and the vibrant Ethereum ecosystem. This bridge promotes liquidity, facilitates cross-chain transactions, and encourages collaboration between the Stellar and Ethereum communities.
|
||||
|
||||
***
|
||||
|
||||
## TFT Ethereum-Stellar Bridge
|
||||
|
||||
The easiest way to transfer TFT between Ethereum and Stellar is to use the [TFT Ethereum Bridge](https://bridge.eth.threefold.io). We present here the main steps on how to use this bridge.
|
||||
|
||||
When you go to the [TFT Ethereum-Stellar bridge website](https://bridge.eth.threefold.io/), connect your Ethereum wallet. Then the bridge will present a QR code which you scan with your Stellar wallet. This will populate a transaction with the bridge wallet as the destination and an encoded form of your Ethereum address as the memo. The bridge will scan the transaction, decode the Ethereum wallet address, and deliver newly minted TFT on Ethereum, minus the bridge fees.
|
||||
|
||||
For the reverse operation, going from Ethereum to Stellar, there is a smart contract interaction that burns TFT on Ethereum while embedding your Stellar wallet address. The bridge will scan that transaction and release TFT from its vault wallet to the specified Stellar address, again minus the bridge fees.
|
||||
|
||||
Note that the contract address for TFT on Ethereum is the following: `0x395E925834996e558bdeC77CD648435d620AfB5b`.
|
||||
|
||||
To see the ThreeFold Token on Etherscan, check [this link](https://etherscan.io/token/0x395E925834996e558bdeC77CD648435d620AfB5b).
|
||||
|
||||
***
|
||||
|
||||
## TFT and Metamask
|
||||
|
||||
The ThreeFold Token (TFT) is available on Ethereum.
|
||||
It is implemented as a wrapped asset with the following token address:
|
||||
|
||||
```
|
||||
0x395E925834996e558bdeC77CD648435d620AfB5b
|
||||
```
|
||||
|
||||
We present here the basic steps to add TFT to Metamask. We also show how to buy TFT Metamask. Finally, we present the simple steps to use the [TFT Ethereum Bridge](https://bridge.eth.threefold.io/).
|
||||
|
||||
|
||||
***
|
||||
|
||||
### Add TFT to Metamask
|
||||
|
||||
Open Metamask and import the ThreeFold Token. First click on `import tokens`:
|
||||
|
||||

|
||||
|
||||
Then, choose `Custom Token`:
|
||||
|
||||

|
||||
|
||||
To add the ThreeFold Token, paste its Ethereum address in the field `Token contract address field`. The address is the following:
|
||||
|
||||
```
|
||||
0x395E925834996e558bdeC77CD648435d620AfB5b
|
||||
```
|
||||
|
||||
Once you paste the TFT contract address, the parameter `Token symbol` should automatically be filled with `TFT`.
|
||||
|
||||
Click on the button `Add Custom Token`.
|
||||
|
||||

|
||||
|
||||
To confirm, click on the button `Import tokens`:
|
||||
|
||||

|
||||
|
||||
TFT is now added to Metamask.
|
||||
|
||||
***
|
||||
|
||||
### Buy TFT on Metamask
|
||||
|
||||
Liquidity is present on Ethereum so you can use the "Swap" functionality from Metamask directly or go to [Uniswap](https://app.uniswap.org/#/swap) to swap Ethereum, or any other token, to TFT.
|
||||
|
||||
When using Uniswap, paste the TFT token address in the field `Select a token` to select TFT on Ethereum. The TFT token address is the following:
|
||||
|
||||
```
|
||||
0x395E925834996e558bdeC77CD648435d620AfB5b
|
||||
```
|
||||
|
||||

|
||||
|
||||
***
|
||||
|
||||
## Questions and Feedback
|
||||
|
||||
If you have any question, feel free to write a post on the [Threefold Forum](https://forum.threefold.io/).
|
Before Width: | Height: | Size: 216 KiB |
Before Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 89 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 178 KiB |
Before Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 263 KiB |
Before Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 108 KiB |
Before Width: | Height: | Size: 136 KiB |
Before Width: | Height: | Size: 154 KiB |
Before Width: | Height: | Size: 245 KiB |
Before Width: | Height: | Size: 232 KiB |
Before Width: | Height: | Size: 179 KiB |
Before Width: | Height: | Size: 165 KiB |
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 119 KiB |
Before Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 109 KiB |
Before Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 155 KiB |
Before Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 225 KiB |
Before Width: | Height: | Size: 157 KiB |
Before Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 126 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 21 KiB |
@@ -1,216 +0,0 @@
|
||||
<h1>Threefold Token: Buy TFT on Lobstr</h1>
|
||||
|
||||
<div class="youtubeVideoWrapper">
|
||||
<iframe title="How to Buy TFT on Lobstr" width="560" height="315" src="https://www.youtube-nocookie.com/embed/1N15bKztiqk" frameborder="0" allowfullscreen="" sandbox="allow-same-origin allow-scripts allow-popups"></iframe>
|
||||
</div>
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Download the App and Create an Account](#download-the-app-and-create-an-account)
|
||||
- [Connect Your TF Connect App Wallet](#connect-your-tf-connect-app-wallet)
|
||||
- [Buy XLM with Fiat Currency](#buy-xlm-with-fiat-currency)
|
||||
- [Swap XLM for TFT](#swap-xlm-for-tft)
|
||||
|
||||
***
|
||||
|
||||
## Introduction
|
||||
|
||||
The Threefold token (TFT) is the utility token of the Threefold Grid, a decentralized and open-source project offering network, compute and storage capacity.
|
||||
|
||||
Threefold Tokens (TFT) are created (minted) by the ThreeFold Blockchain (TFChain) only when new Internet capacity is added to the ThreeFold Grid by farmers. For this reason, TFT is a pure utility token as minting is solely the result of farming on the Threefold Grid.
|
||||
|
||||
* To **farm** TFT, read the [complete farming guide](https://forum.threefold.io/t/threefold-farming-guide-part-1/2989).
|
||||
|
||||
* To **buy** TFT, follow this guide.
|
||||
|
||||
There are many ways to buy TFT:
|
||||
|
||||
* You can buy TFT on [Lobstr](https://lobstr.co/)
|
||||
|
||||
* You can buy TFT at [GetTFT.com](https://gettft.com/gettft/)
|
||||
|
||||
* You can buy TFT on [Pancake Swap](https://pancakeswap.finance/swap?inputCurrency=BNB&outputCurrency=0x8f0FB159380176D324542b3a7933F0C2Fd0c2bbf)
|
||||
|
||||
For the current guide, we will show how to buy TFT on the [Lobstr app](https://lobstr.co/).
|
||||
The process is simple.
|
||||
|
||||
Note that it is possible to do these steps without connecting the Lobstr wallet to the TF Connect App wallet. But doing this has a clear advantage: when we buy and swap on Lobstr, the TFT is directly accessible on the TF Connect app wallet.
|
||||
|
||||
Here we go!
|
||||
|
||||
***
|
||||
|
||||
## Download the App and Create an Account
|
||||
|
||||
Go on [www.lobstr.co](https://www.lobstr.co) and download the Lobstr app.
|
||||
You can download it for Android or iOS.
|
||||
|
||||

|
||||
|
||||
We will show here the steps for Android, but it is very similar with iOS.
|
||||
Once you've clicked on the Android button, you can click install on the Google Store page:
|
||||
|
||||

|
||||
|
||||
Once the app is downloaded, open it:
|
||||
|
||||

|
||||
|
||||
On the Lobstr app, click on **Create Account**:
|
||||
|
||||

|
||||
|
||||
You will then need to enter your email address:
|
||||
|
||||

|
||||
|
||||
Then, choose a safe password for your account:
|
||||
|
||||

|
||||
|
||||
Once this is done, you will need to verify your email.
|
||||
|
||||
Click on **Verify Email** and then go check your email inbox.
|
||||
|
||||

|
||||
|
||||
Simply click on **Verify Email** on the email you've received.
|
||||
|
||||

|
||||
|
||||
Once your email is verified, you can sign in to your Lobstr account:
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
***
|
||||
|
||||
## Connect Your TF Connect App Wallet
|
||||
|
||||
You will then need to either create a new wallet or connect an existing wallet.
|
||||
|
||||
Since we are working on the Threefold ecosystem, it is very easy and practical to simply connect your Threefold Connect app wallet. You can also create a new wallet.
|
||||
|
||||
Using the TF Connect wallet is very useful and quick. When you buy XLM and swap XLM tokens for TFTs, they will be directly available on your TF Connect app wallet.
|
||||
|
||||

|
||||
|
||||
To connect your TF Connect app wallet, you will need to find your Stellar address and chain secret key.
|
||||
This is very simple to do.
|
||||
|
||||
Click on **I have a public or secret key**.
|
||||
|
||||

|
||||
|
||||
As you can see on this next picture, you need the Stellar address and secret key to properly connect your TF Connect app wallet to Lobstr:
|
||||
|
||||

|
||||
|
||||
To find your Stellar address and secret key, go on the TF Connect app and select the **Wallet** section:
|
||||
|
||||

|
||||
|
||||
At the top of the section, click on the **copy** button to copy your Stellar Address:
|
||||
|
||||

|
||||
|
||||
Now, we will find the Stellar secret key.
|
||||
At the botton of the section, click on the encircled **i** button:
|
||||
|
||||

|
||||
|
||||
Next, click on the **eye** button to reveal your secret key:
|
||||
|
||||

|
||||
|
||||
You can now simply click on the **copy** button on the right:
|
||||
|
||||

|
||||
|
||||
That's it! You've now connected your TF Connect app wallet to your Lobstr account.
|
||||
|
||||
## Buy XLM with Fiat Currency
|
||||
|
||||
Now, all we need to do, is buy XLM and then swap it for TFT.
|
||||
It will be directly available in your TF Connect App wallet.
|
||||
|
||||
On the Lobstr app, click on the top right menu button:
|
||||
|
||||

|
||||
|
||||
Then, click on **Buy Crypto**:
|
||||
|
||||

|
||||
|
||||
By default, the crypto selected is XLM. This is alright for us as we will quickly swap the XLM for TFT.
|
||||
|
||||
On the Buy Crypto page, you can choose the type of Fiat currency you want.
|
||||
By default it is in USD. To select some othe fiat currency, you can click on **ALL** and see the available fiat currencies:
|
||||
|
||||

|
||||
|
||||
You can search or select the current you want for the transfer:
|
||||
|
||||

|
||||
|
||||
You will then need to decide how much XLM you want to buy. Note that there can be a minimum amount.
|
||||
Once you chose the desired amount, click on **Continue**.
|
||||
|
||||

|
||||
|
||||
Lobstr will then ask you to proceed to a payment method. In this case, it is Moonpay.
|
||||
Note that in some cases, your credit card won't accept Moonpay payments. You will simply need to confirm with them that you agree with transacting with Moonpay. This can be done by phone. Check with your bank and credit card company if this applies.
|
||||
|
||||

|
||||
|
||||
Once you've set up your Moonpay payment method, you will need to process and confirm the transaction:
|
||||
|
||||

|
||||

|
||||
|
||||
You will then see a processing window.
|
||||
This process is usually fast. Within a few minutes, you should receive your XLM.
|
||||
|
||||

|
||||
|
||||
Once the XLM is delivered, you will receive a notification:
|
||||
|
||||

|
||||
|
||||
When your transaction is complete, you will see this message:
|
||||
|
||||

|
||||
|
||||
On the Trade History page, you can choose to download the csv file version of your transaction:
|
||||
|
||||

|
||||
|
||||
That's it! You've bought XLM on Lobstr and Moonpay.
|
||||
|
||||
## Swap XLM for TFT
|
||||
|
||||
Now we want to swap the XLM tokens for the Threefold tokens (TFT).
|
||||
This is even easier than the previous steps.
|
||||
|
||||
Go to the Lobstr Home menu and select **Swap**:
|
||||
|
||||

|
||||
|
||||
On the **Swap** page, write "tft" and select the Threefold token:
|
||||
|
||||

|
||||
|
||||
Select the amount of XLM you want to swap. It is recommended to keep at least 1 XLM in your wallet for transaction fees.
|
||||
|
||||

|
||||
|
||||
Within a few seconds, you will receive a confirmation that your swap is completed:
|
||||
Note that the TFT is directly sent on your TF Connect app wallet.
|
||||
|
||||

|
||||
|
||||
That's it. You've swapped XLM for TFT.
|
||||
|
||||
You can now use your TFT to deploy workloads on the Threefold Grid.
|
@@ -1,6 +0,0 @@
|
||||
<h1> ThreeFold Token </h1>
|
||||
|
||||
<h2> Table of Contents </h2>
|
||||
|
||||
- [TFT on Lobstr](../TF_Token/tft_lobstr/tft_lobstr.html)
|
||||
- [TFT on Ethereum](../TF_Token/tft_ethereum/tft_ethereum.html)
|
Before Width: | Height: | Size: 330 KiB |
Before Width: | Height: | Size: 154 KiB |
Before Width: | Height: | Size: 223 KiB |
Before Width: | Height: | Size: 273 KiB |
Before Width: | Height: | Size: 206 KiB |