HomeCoinsyearn.finance (YFI)Self-Hosting Web3 Services. Web3 has brought a new way to… | by...

Self-Hosting Web3 Services. Web3 has brought a new way to… | by Marco Worms | Yearn | Mar, 2022

- Advertisement -


Self-Hosting Web3 Services. Web3 has brought a new way to… | by Marco Worms | Yearn | Mar, 2022

Web3 has brought a new way to communicate with applications: apps are no longer hosted by centralized server providers but rather on blockchains, which are decentralized systems. Apps built on top of decentralized foundations are resilient to downtime and censorship, but there is an issue: serving the app interface to the users using the web browser often relies on centralized entities.

In this article we’ll learn how to self-host app interfaces for core crypto and Yearn services, so if official websites are down by any reason you can actually serve the website for yourself since the blockchain is never down!

A quick intro to these concepts:

  • Front-end is the name given to the portion of the application that is seen by the user, like a website or a mobile app.
  • Back-end is the name given to the portion of the application that is not seen by the user. Many front-end actions rely on back-end to process.

In Web3 the blockchain manages to decentralize the back-end, but the front-end will still be served to the user using the default centralized method:

  • User requests browser to go to a page (example http://yearn.finance)
  • Browser requests DNS for the IP of this address (13.227.124.73)
  • Browser requests the files for the IP

And if any of these two happens:

DNS doesn’t resolve your domain to an IP address
or
IP address doesn’t serve you the front-end files

You won’t be able to see the front-end in order to click stuff and communicate with the back-end. In order to be able to use Web3 services without these concerns you can self-host the front-end and workaround both the “DNS resolution” and the “IP-not-online” problem at the same time!

Self-Hosting Web3 Services. Web3 has brought a new way to… | by Marco Worms | Yearn | Mar, 2022

Self-hosting a website in web3 means the front-end will work even when the default front-end provider is down. This cuts many middlemen that exist in the middle of the way of your machine reaching the front-end files! It’s a win/win relationship for the individual and the service that if you know how to do it you can back up the services that are essential to you:

  • The individual gains more resiliency accessing the service even when conditions to reach the front-end are bad
  • The server that delivers front-end files receives fewer requests, which helps it not get congested
  • The local version of the app will be frozen in a specific version. If this version works well for the individual it’s great to have a backup so if the live front-end breaks any feature you can still access the working version

In order to self-host a service, we’ll have to go through the developer documentation of how to download, set up, and run a local environment for each app.

After running it locally, instead of accessing the default website URL in the browser, we will instead use something like “localhost:application” and it will work just fine! The “application” is a number that often defaults to 3000

Self-Hosting Web3 Services. Web3 has brought a new way to… | by Marco Worms | Yearn | Mar, 2022

To Windows users: Depending on the service it might be easier to use Linux instead of Windows, but if you have windows don’t worry, many services work fine out-of-the-box, and for the ones that don’t you can use WSL (Windows Subsystem for Linux). A Virtual Machine is also a good alternative, you can install a common Linux distribution such as Ubuntu or Debian which often has many resources to get around errors. If you have unexpected errors on Windows it’s recommended to try running on Mac/Linux instead.

To Mac/Linux users: If any command show unexpected errors try running them using the keyword sudo before, like sudo command, this forces the command to be run as administrator and sometimes your default permissions are not the same as the admin ones.

On unexpected errors: Read carefully through the repository readme! If nothing works, Google is your best friend.

If everything went correct but on-chain transactions fail: There is a file called .env used by projects to configure default keys. There you can find places to add project keys for services like Infura and The Graph, some of the apps might require you to use your own keys, in order to grab a key you have to create an account at the service website!

After running a service in order to run it again: You can skip any git clone and yarn install and other key configuration steps, you usually just have to cd (change directory) into the project’s folder again and run yarn start

After running a service in order to run another: You’ll have to either close the terminal window OR shutdown the execution yourself: to do this use “Ctrl+C” and you can exit the project folder with the command cd ..



Source link

- Advertisement -
Mr Bitcointe
Mr Bitcointehttps://www.bitcointe.com/
“Fact You Need To Know About Cryptocurrency - The first Bitcoin purchase was for pizza.” ― Mohsin Jameel
462FansLike
76FollowersFollow
4,567FollowersFollow
5,261FollowersFollow
1,580FollowersFollow
2,230SubscribersSubscribe

Most Popular

bitcoin
Bitcoin (BTC) $ 23,095.19
ethereum
Ethereum (ETH) $ 1,676.37
tether
Tether (USDT) $ 1.00
bitcoin-cash
Bitcoin Cash (BCH) $ 135.18
litecoin
Litecoin (LTC) $ 58.83
eos
EOS (EOS) $ 1.17
okb
OKB (OKB) $ 18.07
tezos
Tezos (XTZ) $ 1.79
leo-token
LEO Token (LEO) $ 4.75
cardano
Cardano (ADA) $ 0.507335
monero
Monero (XMR) $ 156.67
stellar
Stellar (XLM) $ 0.121936
chainlink
Chainlink (LINK) $ 8.59
huobi-token
Huobi (HT) $ 4.34
tron
TRON (TRX) $ 0.068785
usd-coin
USD Coin (USDC) $ 1.00
dash
Dash (DASH) $ 53.04
neo
NEO (NEO) $ 11.01
iota
IOTA (MIOTA) $ 0.327
nem
NEM (XEM) $ 0.049659
zcash
Zcash (ZEC) $ 76.58
maker
Maker (MKR) $ 1,072.39
paxos-standard
Pax Dollar (USDP) $ 1.00
ethereum-classic
Ethereum Classic (ETC) $ 36.41
vechain
VeChain (VET) $ 0.030178
true-usd
TrueUSD (TUSD) $ 1.00
ftx-token
FTX (FTT) $ 29.75
kucoin-shares
KuCoin (KCS) $ 10.53
waves
Waves (WAVES) $ 5.83