# Make Directory for Iotex Server and Data
mkdir -p /var/lib/iotex
mkdir -p /var/lib/iotex/etc
mkdir -p /var/lib/iotex/data
mkdir -p /var/lib/iotex/log
# Make Directory for Configuration
mkdir -p /root/configuration
echo "
---
network:
# externalHost: SET YOUR EXTERNAL IP HERE (e.g., 12.34.56.78)
externalPort: 4689
bootstrapNodes:
- /dns4/bootnode-0.mainnet.iotex.one/tcp/4689/p2p/12D3KooWPfQDF8ASjd4r7jS9e7F1wn6zod7Mf4ERr8etoY6ctQp5
- /dns4/bootnode-1.mainnet.iotex.one/tcp/4689/p2p/12D3KooWN4TQ1CWRA7yvJdQCdti1qARLXXu2UEHJfycn3XbnAnRh
- /dns4/bootnode-2.mainnet.iotex.one/tcp/4689/p2p/12D3KooWSiktocuUke16bPoW9zrLawEBaEc1UriaPRwm82xbr2BQ
- /dns4/bootnode-3.mainnet.iotex.one/tcp/4689/p2p/12D3KooWEsmwaorbZX3HRCnhkMPjMAHzwu3om1pdGrtVm2QaM35n
- /dns4/bootnode-4.mainnet.iotex.one/tcp/4689/p2p/12D3KooWHRcgNim4Nau73EEu7aKJZRZPZ21vQ7BE3fG6vENXkduB
- /dns4/bootnode-5.mainnet.iotex.one/tcp/4689/p2p/12D3KooWGeHkVDQQFxXpTX1WpPhuuuWYTxPYDUTmaLWWSYx5rmUY
chain:
# If you are a delegate, make sure producerPrivKey is the key for the
# operator address you have registered.
# producerPrivKey: SET YOUR PRIVATE KEY HERE (e.g.,
# 96f0aa5e8523d6a28dc35c927274be4e931e74eaa720b418735debfcbfe712b8)
enableStakingIndexer: true
chainDBPath: "/var/lib/iotex/data/chain.db"
trieDBPatchFile: "/var/lib/iotex/data/trie.db.patch"
trieDBPath: "/var/lib/iotex/data/archive.db"
stakingPatchDir: "/var/lib/iotex/data"
indexDBPath: "/var/lib/iotex/data/index.db"
blobStoreDBPath: "/var/lib/iotex/data/blob.db"
bloomfilterIndexDBPath: "/var/lib/iotex/data/bloomfilter.index.db"
candidateIndexDBPath: "/var/lib/iotex/data/candidate.index.db"
stakingIndexDBPath: "/var/lib/iotex/data/staking.index.db"
contractStakingIndexDBPath: "/var/lib/iotex/data/contractstaking.index.db"
enableArchiveMode: true
maxCacheSize: 1000
committee:
gravityChainAPIs:
# Please change the Infura key to your key (e.g.,
# https://mainnet.infura.io/v3/YOUR_KEY)
- {YOUR_L1_RPC_HERE}
numOfRetries: 20
paginationSize: 255
cacheSize: 1000
gravityChainDB:
dbPath: "/var/lib/iotex/data/poll.db"
numRetries: 8
actPool:
minGasPrice: "1000000000000"
store:
datadir: "/var/lib/iotex/data/actpool.cache"
api:
gasStation:
defaultGas: 1000000000000
consensus:
scheme: ROLLDPOS
rollDPoS:
fsm:
unmatchedEventTTL: 3s
unmatchedEventInterval: 100ms
acceptBlockTTL: 4s
acceptProposalEndorsementTTL: 2s
acceptLockEndorsementTTL: 2s
delay: 10s
consensusDBPath: "/var/lib/iotex/data/consensus.db"
blockSync:
interval: 2s
bufferSize: 400
maxRepeat: 3
repeatDecayStep: 3
log:
zap:
level: info
encoding: json
disableStacktrace: true
outputPaths: ["stderr", "stdout"]
errorOutputPaths: ["stderr"]
stderrRedirectFile: /var/lib/iotex/log/s.log
stdLogRedirect: true
" > /root/configuration/general_config.yaml
cd /var/lib/iotex
# Multiple Data Files (Block, Blob Storage, Indexing Files)
nohup curl -LO https://storage.googleapis.com/blockchain-golden/archive/iotex-data.tar.gz & disown
# Check the status of download
tail -f /var/lib/iotex/nohup.out
# When done downloading - unpack.
tar -xzf iotex-data.tar.gz
cd /var/lib/iotex/data
# Download State / Address Database
nohup curl -LO https://storage.googleapis.com/blockchain-golden/archive/archive.db & disown
# The State Database download will take a long time as it is uncompressed
# Check the status of State Database download
tail -f /var/lib/iotex/data/nohup.out
# Clone the Repository
cd /root
git clone https://github.com/iotexproject/iotex-core.git
cd iotex-core
# Checkout the Archive node branch
git checkout origin/archive
# Build binary
make build
# Copy Server
cp ./bin/server /var/lib/iotex/server
curl -H "Content-Type: application/json" -X POST --data \
'{"jsonrpc":"2.0", "method":"eth_blockNumber", "params":[], "id":1}' \
http://localhost:15014
# Response should look similar to the below
{"jsonrpc":"2.0","id":1,"result":"0x202c35d"}