-
Notifications
You must be signed in to change notification settings - Fork 14
How to join Mainnet
To run a EpiK node, your computer must have:
- macOS or Linux installed. Windows is supported with wsl2.
- 8-core CPU and 16 GiB RAM. Models with support for Intel SHA Extensions (AMD since Zen microarchitecture, or Intel since Ice Lake) will significantly speed things up.
- Enough space to store the current EpiK chain (preferably on an 1000G SSD).
You will need the following software installed to install and run EpiK.
Building EpiK requires some system dependencies, usually provided by your distribution.
- Install ubuntu 18.04 LTS for Windows First.(https://www.microsoft.com/store/productId/9N9TNGVNDL3Q)
- Operate the same as ubuntu.
sudo apt install mesa-opencl-icd ocl-icd-opencl-dev gcc git bzr jq pkg-config curl clang build-essential hwloc libhwloc-dev wget -y && sudo apt upgrade -y
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm; sudo yum install -y git gcc bzr jq pkgconfig clang llvm mesa-libGL-devel opencl-headers ocl-icd ocl-icd-devel hwloc-devel
-
XCode Command Line Tools
EpiK requires that XCode CLI tools be installed before building the EpiK binaries.
Check if you already have the tools:
xcode-select -p
Install Xcode if Xcode is not install:
xcode-select --install
-
Install Homebrew We recommend that MacOS users use Homebrew to install each of the necessary packages.
brew install go bzr jq pkg-config rustup hwloc
Install rustup. The easiest way to install it is:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
To build EpiK, you need a working installation of Go 1.16.
git clone https://github.com/EpiK-Protocol/go-epik.git
cd go-epik/
git submodule update --init
make all
sudo make install
If you are in China, check out the specific tips.
-
Speed up proof parameter download for first boot. Running EpiK requires the download of chain's proof parameters which are large files which by default are hosted outside of China and very slow to download there. Set the following environment variable before node start:
export IPFS_GATEWAY=https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/
-
Speed up Go module download during builds. Building EpiK requires downloading a few Go modules. These are usually hosted on Github, which has very low bandwidth from China. Setting the following variable before running EpiK:
export GOPROXY=https://goproxy.cn
Nodes that have participated in the Testnet need to reinitialize the miner after deleting the Testnet data. Delete existing Testnet data:
rm -rf ~/.epik
rm -rf ~/. epikminer
The node with EPIK_PATH
, EPIK_STORAGE_PATH
is set in the environment variable. The node data is stored under the corresponding path, and the corresponding folder is deleted:
rm -rf $EPIK_PATH
rm -rf $EPIK_STORAGE_PATH
The default configuration file is ``$EPIK_PATH/config.toml(when the
EPIK_PATH` environment variable is not configured, the file address is `~/.epik/config.toml`).
The libP2P configuration of nodes in the configuration file is uncommented and modified as follows:
ListenAddresses
network ports are configured as fixed ports, and the default can be configured as 1347
;
Announceurls changes the public_ip
of the AnnounceAddresses to a node's public network IP.
eg:
[Libp2p]
ListenAddresses = ["/ip4/0.0.0.0/tcp/1347", "/ip6/::/tcp/1347"]
AnnounceAddresses = ["/ip4/public_ip/tcp/1347"]
# NoAnnounceAddresses = []
# ConnMgrLow = 150
# ConnMgrHigh = 180
# ConnMgrGrace = "20s"
#
Epik will automatically sync to the latest chain head by fetching the block headers from the current head down to the last synced epoch. Due to the large amount of data on the Mainnet, chain data can be loaded from the snapshot.
epik daemon --import-snapshot https://snapshot.epik-protocol.io/latest.car
Nodes support the separation of hot and cold storage of data. Hot and cold nodes are separated to avoid synchronization problems caused by poor I/O performance when there is a large amount of data. But hot and cold separation requires high machine configuration, especially memory and IO.
To run a EpiK node with split ebable, your computer must have:
- 8-core/16-core CPU(16-core recommands). Models with support for Intel SHA Extensions (AMD since Zen microarchitecture, or Intel since Ice Lake) will significantly speed things up.
- 32 GiB RAM or higher.
- Enough space to store the current EpiK chain (preferably on an 1000G SSD).
By default, data is not separated by hot and cold. To support separation, configuration is required:
[Chainstore]
EnableSplitstore = true
[Chainstore.Splitstore]
ColdStoreType = "universal"
HotStoreType = "badger"
MarkSetType = "map"
HotStoreMessageRetention = 5
HotStoreFullGCFrequency = 1
If you intend to use the discard coldstore, your also need to add the following:
[Chainstore.Splitstore]
ColdStoreType = "discard"
In general you should not have to use the discard store, unless you are running a network assistive node (like a bootstrapper or booster) or have very constrained hardware with not enough disk space to maintain a coldstore, even with garbage collection. It is also appropriate for small nodes that are simply watching the chain.
Warning: Using the discard store for a general purpose node is discouraged, unless you really know what you are doing. Use it at your own risk.
Launch EpiK daemon firstly via screen.
apt install screen
screen -S epik
epik daemon
Download the EpiK Portal wallet, and create an account. Click the wallet name at the top left corner to get the tEPK private key, import the wallet on the node by following instructions:
screen -S verify
./epik wallet import /path/to/epik/private_key
epik-miner init --nosync
Find your miner ID
The miner's default configuration file is ``$EPIK_MINER_PATH/config.toml(when the
EPIK_MINER_PATH` environment variable is not configured, the file address is `~/.epikminer/config.toml`).
The libP2P configuration of nodes in the configuration file is uncommented and modified as follows:
ListenAddresses
network ports are configured as fixed ports, and the default can be configured as 2458
;
Announceurls changes the public_ip
of the AnnounceAddresses to a node's public network IP.
Notice:After the miner is configured with public network IP, other nodes can retrieve data from the node, and the miner can obtain the Retrieve reward.
eg:
[Libp2p]
ListenAddresses = ["/ip4/0.0.0.0/tcp/2458", "/ip6/::/tcp/2458"]
AnnounceAddresses = ["/ip4/public_ip/tcp/2458"]
# NoAnnounceAddresses = []
# ConnMgrLow = 150
# ConnMgrHigh = 180
# ConnMgrGrace = "20s"
#
By default, Miner synchronizes and deal data from all domain experts on the chain. Miners can specify certain domain experts that need to be synchronized:
[Dealmaking]
# ConsiderOnlineStorageDeals = true
# ConsiderOfflineStorageDeals = true
# ConsiderOnlineRetrievalDeals = true
# ConsiderOfflineRetrievalDeals = true
# PieceCidBlocklist = []
# ExpectedSealDuration = "24h0m0s"
# PublishMsgPeriod = "1h0m0s"
# MaxDealsPerPublishMsg = 8
# Filter = ""
# RetrievalFilter = ""
# MaxOngoingServedRetrievals = 32
AutoDealExperts = ["f01000"]
Tips:AutoDealExperts
is an array of strings that miners can specify domain expert ids to synchronize.
epik-miner run
Change coinbase address
# {Coinbase} is a wallet address to receive miner reward
epik-miner actor set-coinbase --really-do-it {Coinbase}
Add enough mining collateral for each miner, at least 1000tEPK.
fxxxxx - miner address
epik client mining-pledge add [--from=<address>] fxxxxx 1000epk
Withdraw mining collateral belonging to the pledgor. Miner will lose all power if remaining collateral is less than 1000tEPK.
fxxxxx - miner address
epik client mining-pledge withdraw [--from=<address>] fxxxxx 301.9epk
Retrieving data from remote miners requires collateral for traffic. Retrieval doesn't cost any tEPK. Miners also need to pledge tokens when encapsulating data.
- Add
Any amount is OK, 1 tEPK 10 MiB a day, refreshed the next day. Binding your miner address, separated by commas, and using the bound address as data collateral when the miner encapsulates data. If the address is only the address of the data index, there is no need to bind the miner. The block miner must bind the retrieval data address, otherwise the data cannot be encapsulated to increase computing power
epik client retrieve-pledge [--from=<address>] --miner=<minerId> 200epk
- Bind miners(optional)
If more than one Miner address is newly bound, the traffic consumed by the miner encapsulating data after the binding will also be deducted from that address.
epik client retrieve-bind [--from=<address>] minerId1 minerId2 ...
- Apply for withdrawal
- Withdrawable in 3 days.
- Lose traffic immediately.
epik client retrieve-apply [--from=<address>] 95.5epk
- Withdraw
epik client retrieve-withdraw [--from=<address>] 95.5epk
You need to restart the node after changing the configuration.
#start node
epik daemon
#start miner
epik-miner run