diff --git a/Proton Chain - Hyperion Guide.pdf b/Proton Chain - Hyperion Guide.pdf new file mode 100644 index 0000000..1f84ff0 Binary files /dev/null and b/Proton Chain - Hyperion Guide.pdf differ diff --git a/README.md b/README.md index 2c05da2..5f7019a 100644 --- a/README.md +++ b/README.md @@ -1,54 +1,250 @@ -# PROTON MAINNET - -## Chain ID - -``` -384da888112027f0321850a169f737c33e53b388aad48b5adace4bab97f437e0 -``` - -## Genesis - -``` -{ - "initial_timestamp": "2020-04-22T17:00:00", - "initial_key": "EOS5XPRJt1zUiLH98rtDLj9TnPi52DLQ7gTZbkRvBGJXLv6ak6Cdq", - "initial_configuration": { - "max_block_net_usage": 1048576, - "target_block_net_usage_pct": 1000, - "max_transaction_net_usage": 524288, - "base_per_transaction_net_usage": 12, - "net_usage_leeway": 500, - "context_free_discount_net_usage_num": 20, - "context_free_discount_net_usage_den": 100, - "max_block_cpu_usage": 200000, - "target_block_cpu_usage_pct": 2500, - "max_transaction_cpu_usage": 150000, - "min_transaction_cpu_usage": 100, - "max_transaction_lifetime": 3600, - "deferred_trx_expiration_window": 600, - "max_transaction_delay": 3888000, - "max_inline_action_size": 4096, - "max_inline_action_depth": 6, - "max_authority_depth": 6, - "max_ram_size": 34359738368 - } -} -``` -## P2P endpoints - -``` -p2p-peer-address = proton.cryptolions.io:9876 -p2p-peer-address = proton.eu.eosamsterdam.net:9103 -p2p-peer-address = proton.lynxsweden.org:9576 -p2p-peer-address = p2p-proton.eosarabia.net:9876 -p2p-peer-address = peer1.proton.pink.gg:48011 -p2p-peer-address = proton-p2p.eos.barcelona:9850 -p2p-peer-address = proton.lynxsweden.org:9576 -p2p-peer-address = proton.eosdublin.io:9877 -p2p-peer-address = peer.proton.alohaeos.com:9876 -p2p-peer-address = peer1-proton.eosphere.io:9876 -p2p-peer-address = proton.eosvenezuela.io:9777 -p2p-peer-address = p2p.proton.eostribe.io:19880 +# Welcome to the PROTON MainNet [manual node installation] + +Chain ID: 384da888112027f0321850a169f737c33e53b388aad48b5adace4bab97f437e0 +Based on tag: 2.0.5 + +Please join out PROTON MainNet Telegram channel +Network Monitor: https://monitor.protonchain.com/ + + +! This repo is for manual installation. + +**Proton is a protocol built on top of the EOSIO consensus layer that allows verified user identity and applications to generate signature requests (transactions) that can be pushed to signers (wallets) for authentication and signature creation. These signature requests can be used today to authenticate and sign cryptographic payments. The same architecture will be used in future version to initiate and track pending fiat transactions** + +To start a Proton TestNet node you need install EOSIO software. You can compile from sources or install from precompiled binaries: + +# 1. Installing +--------------------------------------------------- + +# 1.1 Installing from sources + +A. Create folder, download sources, compile and install: + +``` +mkdir /opt/EOSIO +cd /opt/EOSIO + +git clone https://github.com/eosio/eos --recursive +cd eos + +git checkout v2.0.5 +git submodule update --init --recursive + +./scripts/eosio_build.sh -P -y +./scripts/eosio_install.sh +``` + +B. Copy binaries to keep old versions and make sym link to latest: + +``` +mkdir /opt/bin +mkdir /opt/bin/v2.0.5 +cp /opt/EOSIO/eos/build/programs/nodeos/nodeos /opt/bin/v2.0.5/ +cp /opt/EOSIO/eos/build/programs/cleos/cleos /opt/bin/v2.0.5/ +cp /opt/EOSIO/eos/build/programs/keosd/keosd /opt/bin/v2.0.5/ +ln -sf /opt/bin/v2.0.5 /opt/bin/bin +``` + +So /opt/bin/bin will point to latest binaries + + +# 1.2 Installing from precompiled binaries + +A. Download the latest version of EOSIO for your OS from: +https://github.com/EOSIO/eos/releases/tag/v2.0.5 +For example, for ubuntu 18.04 you need to download deb eosio_2.0.5-1-ubuntu-18.04_amd64.deb +To install it you can use apt: +``` +apt install ./eosio_2.0.5-1-ubuntu-18.04_amd64.deb +``` +It will download all dependencies and install EOSIO to /usr/opt/eosio/v2.0.5 +B. Copy binaries to keep old versions and make sym link to latest: + +``` + mkdir /opt/bin + mkdir /opt/bin/v2.0.5 + cp /usr/opt/eosio/v2.0.5/bin/nodeos /opt/bin/v2.0.5/ + cp /usr/opt/eosio/v2.0.5/bin/cleos /opt/bin/v2.0.5/ + cp /usr/opt/eosio/v2.0.5/bin/keosd /opt/bin/v2.0.5/ + ln -sf /opt/bin/v2.0.5/ /opt/bin/bin +``` + +So /opt/bin/bin will be point to latest binaries + +--------------------------------------------------------- +# 2. Update software to new version + +# 2.1 Update sources + +``` +cd /opt/EOSIO/eos +git checkout -f +git branch -f +git pull +git checkout v2.0.5 +git submodule update --init --recursive + + +./scripts/eosio_build.sh -P -y +./scripts/eosio_uninstall.sh +./scripts/eosio_install.sh + +mkdir /opt/bin/v2.0.5 +cp /opt/EOSIO/eos/build/programs/nodeos/nodeos /opt/bin/v2.0.5/ +cp /opt/EOSIO/eos/build/programs/cleos/cleos /opt/bin/v2.0.5/ +cp /opt/EOSIO/eos/build/programs/keosd/keosd /opt/bin/v2.0.5/ +ln -sf /opt/bin/v2.0.5 /opt/bin/bin +``` + +# 2.2 Update binaries +To upgrade precompiled installation pleasse folow the same steps as in 1.2 (Installation from precompiled) + +------------------------------------------------------------------ + +# 3. Install PROTON MainNet node [manual] + +``` + mkdir /opt/ProtonMainNet + cd /opt/ProtonMainNet + git clone https://github.com/ProtonProtocol/proton.start.git ./ + +``` + +- In case you use a different data-dir folders -> edit all paths in files cleos.sh, start.sh, stop.sh, config.ini, Wallet/start_wallet.sh, Wallet/stop_wallet.sh + +- The first thing you will need to do is download the Wallet(the link will be soon) and create a new PROTON mainnet account. + +- To register as Block Producer you should go to the Permission Portal login and request permission to regproduse + when you got this permission and you finish prepare node you can run command + ``` + ./cleos.sh system regproducer YOU_ACCOUNT PUBKEY "URL" LOCATION -p YOU_ACCOUNT + ``` + +- If non BP node: use the same config, just comment out rows with producer-name and signature-provider + +- Edit config.ini: + - server address: p2p-server-address = ENRT_YOUR_NODE_EXTERNAL_IP_ADDRESS:9876 + + - if BP: your producer name: producer-name = YOUR_BP_NAME + - if BP: add producer keypair for signing blocks (this pub key should be used in regproducer action): + signature-provider = YOUR_PUB_KEY_HERE=KEY:YOUR_PRIV_KEY_HERE + - replace p2p-peer-address list with fresh generated on monitor site: https://monitor.protonchain.com/#p2p + - Check chain-state-db-size-mb value in config, it should be not bigger than you have RAM: + chain-state-db-size-mb = 16384 + +- Open TCP Ports (8888, 9876) on your firewall/router + + +- Start wallet, run +``` +cd /opt/ProtonMainNet +./Wallet/start_wallet.sh +``` + +**First run should be with --delete-all-blocks and --genesis-json** +``` +cd /opt/ProtonMainNet/protonNode +./start.sh --delete-all-blocks --genesis-json genesis.json +``` +Check logs stderr.txt if node is running ok. + + +- Create your wallet file +``` +./cleos.sh wallet create --to-file pass.tx +``` +Your password will be in pass.txt it will be used when unlock wallet + + +- Unlock your wallet +``` +./cleos.sh wallet unlock +``` +enter the wallet password. + + +- Import your key +``` +./cleos.sh wallet import +``` +Enter your private key + + + +- Check if you can access you node using link http://you_server:8888/v1/chain/get_info (Example) + + +============================================================================================== + +# 4.1 Restore/Start from Backup + Download latest block and state archive for your OS from http://backup.cryptolions.io/ProtonMainNet/ + + ``` + wget http://backup.cryptolions.io/ProtonMainNet/ubuntu18/latest-blocks.tar.gz + wget http://backup.cryptolions.io/ProtonMainNet/ubuntu18/latest-state.tar.gz + ``` + After downloaded extract their + ``` + tar xzvf blocks-latest.tar.gz -C . + tar xzvf state-latest.tar.gz -C . + ``` + You got two folders block and state. + Ater that go to **NODE** folder, and remove files from folder blocks and state + ``` + cd /opt/ProtonMainNet/protonNode + rm blocks/* + rm state/* + ``` + After that go where you extracted archive and move file from folder + ``` + mv ~/blocks/* /opt/ProtonMainNet/protonNode/blocks/ + mv ~/state/* /opt/ProtonMainNet/protonNode/state/ + ``` + After files moved start your NODE + ``` + ./start.sh + ``` +# 4.2 Restore/Start from Snapshots + Download latest snapshot from http://backup.cryptolions.io/ProtonMainNet/snapshots/ to snapshots folder in your **NODE** directory + ``` + cd /opt/protonMainNet/protonNode/snapshots/ + wget http://backup.cryptolions.io/ProtonMainNet/snapshots/latest-snapshot.bin + ``` + after it downloaded run `start.sh` script with option `--snapshot` and snapshot file path + ``` + cd /opt/ProtonMainNet/protonNode + ./start.sh --snapshot /opt/ProtonMainNet/protonNode/snapshots/latest-snapshot.bin + ``` + --- + +# Other Tools/Examples + +- Cleos commands: + +Send XPR +``` +./cleos.sh transfer "1.0000 XPR" "test memo text" +``` +Get Balance +``` +./cleos.sh get currency balance eosio.token +``` +Create account +``` +./cleos.sh system newaccount --stake-net "10.0000 XPR" --stake-cpu "10.0000 XPR" --buy-ram-bytes 4096 +``` +List registered producers (-l ) +``` +./cleos.sh get table eosio eosio producers -l 100 +``` +List your last action (use -h to get help, do not work now, works with history node only) +``` +./cleos.sh get actions +``` + +List staked/delegated +``` +./cleos.sh system listbw ``` ## PROTON API @@ -63,10 +259,33 @@ https://api.proton.alohaeos.com https://proton.eosphere.io https://proton.eosvenezuela.io https://api.proton.eostribe.io +http://proton.greymass.com +https://proton.eoscafeblock.com +https://proton.eosio.cr ``` -## Monitor +**Network Monitor** https://monitor.protonchain.com/ +https://proton.eosio.online/ + +**Hyperion History** +https://proton.cryptolions.io/v2/docs +https://proton.eosusa.news/v2/docs/index.html +https://proton-hyperion.eoscafeblock.com/v2/docs/index.html + +**Block Explorers** +https://proton.bloks.io/ + +**Permissions** +https://permission.protonchain.com + +-------------- + +# Backups +### Full(blocks and states): + * [Ubuntu 18](http://backup.cryptolions.io/ProtonMainNet/ubuntu18/) + +### Snapshot: + * [Snapshots](http://backup.cryptolions.io/ProtonMainNet/snapshots/) -## Hyperion -https://proton.cryptolions.io/v2/docs +-------------- diff --git a/Wallet/start_wallet.sh b/Wallet/start_wallet.sh new file mode 100755 index 0000000..0c9fbf6 --- /dev/null +++ b/Wallet/start_wallet.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +################################################################################ +# Proton tools +# +# +# Created by http://CryptoLions.io +# +# https://github.com/ProtonProtocol/proton.start +# +############################################################################### + +NODEOSBINDIR="/opt/bin/bin" +DATADIR="/opt/ProtonMainNet/Wallet" +WALLET_HOST="127.0.0.1" +WALLET_POSRT="3000" + + +$DATADIR/stop_wallet.sh +$NODEOSBINDIR/keosd --config-dir $DATADIR --wallet-dir $DATADIR --unix-socket-path $DATADIR/keosd.sock --http-server-address $WALLET_HOST:$WALLET_POSRT "$@" > $DATADIR/stdout.txt 2> $DATADIR/stderr.txt & echo $! > $DATADIR/wallet.pid + diff --git a/Wallet/stop_wallet.sh b/Wallet/stop_wallet.sh new file mode 100755 index 0000000..f26fc6e --- /dev/null +++ b/Wallet/stop_wallet.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +################################################################################ +# Proton tools +# +# +# Created by http://CryptoLions.io +# +# https://github.com/ProtonProtocol/proton.start +# +############################################################################### + +DIR="/opt/ProtonMainNet/Wallet" + + if [ -f $DIR"/wallet.pid" ]; then + pid=$(cat $DIR"/wallet.pid") + echo $pid + kill $pid + rm -r $DIR"/wallet.pid" + + echo -ne "Stoping Wallet" + + while true; do + [ ! -d "/proc/$pid/fd" ] && break + echo -ne "." + sleep 1 + done + echo -ne "\rWallet stopped. \n" + + fi diff --git a/protonNode/cleos.sh b/protonNode/cleos.sh new file mode 100755 index 0000000..0929917 --- /dev/null +++ b/protonNode/cleos.sh @@ -0,0 +1,22 @@ +#!/bin/bash +################################################################################ +# Proton tools +# +# +# Created by CryptoLions.io +# +# https://github.com/ProtonProtocol/proton.start +# +############################################################################### + +NODEOSBINDIR="/opt/bin/bin" + +WALLETHOST="127.0.0.1" +NODEHOST="127.0.0.1" +NODEPORT="8888" +WALLETPORT="3000" + + + +$NODEOSBINDIR/cleos -u http://$NODEHOST:$NODEPORT --wallet-url http://$WALLETHOST:$WALLETPORT "$@" + diff --git a/protonNode/config.ini b/protonNode/config.ini new file mode 100644 index 0000000..9759837 --- /dev/null +++ b/protonNode/config.ini @@ -0,0 +1,130 @@ +################################################################################ +# Proton tools +# +# Created by http://CryptoLions.io +# +# https://github.com/ProtonProtocol/proton.start +# +# +################################################################################ + + + ###########--producer--######################### + # + #agent-name = AGENT_NAME + #plugin = eosio::producer_plugin + #producer-name = BP_NAME + #signature-provider = PUB =KEY: PRIV + # + ############################################################### + + + http-server-address = 0.0.0.0:8888 + p2p-listen-endpoint = 0.0.0.0:9876 + p2p-server-address = DOMAIN_OR_IP:9876 + + chain-state-db-size-mb = 16384 + reversible-blocks-db-size-mb = 1024 + + contracts-console = true + + p2p-max-nodes-per-host = 100 + + chain-threads = 8 + http-threads = 6 + #wasm-runtime = wabt + http-validate-host = false + verbose-http-errors = true + abi-serializer-max-time-ms = 2000 + + #produce-time-offset-us = 250000 + last-block-time-offset-us = -300000 + # eosio2.0 + http-max-response-time-ms = 100 + #Only!! for performance eosio 2.0+ + eos-vm-oc-compile-threads = 4 + eos-vm-oc-enable = 1 + wasm-runtime = eos-vm-jit + #END + + + # Safely shut down node when free space + chain-state-db-guard-size-mb = 128 + reversible-blocks-db-guard-size-mb = 2 + + + access-control-allow-origin = * + access-control-allow-headers = Origin, X-Requested-With, Content-Type, Accept + # access-control-allow-headers = + # access-control-max-age = + # access-control-allow-credentials = false + + + # actor-whitelist = + # actor-blacklist = + # contract-whitelist = + # contract-blacklist = + # filter-on = + + + # SSL + # Filename with https private key in PEM format. Required for https (eosio::http_plugin) + # https-server-address = + # Filename with the certificate chain to present on https connections. PEM format. Required for https. (eosio::http_plugin) + # https-certificate-chain-file = + # Filename with https private key in PEM format. Required for https (eosio::http_plugin) + # https-private-key-file = + + ########################################################################### + # State History (For 1.8.0-rc1+ add to start params --disable-replay-opts ) + # plugin = eosio::state_history_plugin + # state-history-dir = state-history + # trace-history = true + # chain-state-history = true + # state-history-endpoint = 0.0.0.0:8080 + # debug mode info (https://github.com/EOSIO/eos/pull/7298) + # #trace-history-debug-mode + ############################################################################ + + allowed-connection = any + + # allowed-connection = specified + # peer-private-key = ["!!NEW_KEY_PUB!!","!!NEW_KEY_PRIV!!"] #create new key for private peers + # peer-key = "!![PUBKEY]!!" + + + max-clients = 150 + connection-cleanup-period = 30 + sync-fetch-span = 2000 + enable-stale-production = false + + + pause-on-startup = false + max-irreversible-block-age = -1 + txn-reference-block-lag = 0 + + + + # peer-key = + # peer-private-key = + + plugin = eosio::producer_plugin + #plugin = eosio::producer_api_plugin + plugin = eosio::chain_plugin + plugin = eosio::chain_api_plugin + +#p2p-peer-address = +p2p-peer-address = proton.cryptolions.io:9876 +p2p-peer-address = proton.eu.eosamsterdam.net:9103 +p2p-peer-address = proton.lynxsweden.org:9576 +p2p-peer-address = p2p-proton.eosarabia.net:9876 +p2p-peer-address = peer1.proton.pink.gg:48011 +p2p-peer-address = proton-p2p.eos.barcelona:9850 +p2p-peer-address = proton.lynxsweden.org:9576 +p2p-peer-address = proton.eosdublin.io:9877 +p2p-peer-address = peer.proton.alohaeos.com:9876 +p2p-peer-address = peer1-proton.eosphere.io:9876 +p2p-peer-address = proton.eosvenezuela.io:9777 +p2p-peer-address = p2p.proton.eostribe.io:19880 +p2p-peer-address = proton.greymass.com:19875 +p2p-peer-address = proton.eosio.cr:9879 diff --git a/protonNode/genesis.json b/protonNode/genesis.json new file mode 100644 index 0000000..36f2622 --- /dev/null +++ b/protonNode/genesis.json @@ -0,0 +1,24 @@ +{ + "initial_timestamp": "2020-04-22T17:00:00", + "initial_key": "EOS5XPRJt1zUiLH98rtDLj9TnPi52DLQ7gTZbkRvBGJXLv6ak6Cdq", + "initial_configuration": { + "max_block_net_usage": 1048576, + "target_block_net_usage_pct": 1000, + "max_transaction_net_usage": 524288, + "base_per_transaction_net_usage": 12, + "net_usage_leeway": 500, + "context_free_discount_net_usage_num": 20, + "context_free_discount_net_usage_den": 100, + "max_block_cpu_usage": 200000, + "target_block_cpu_usage_pct": 2500, + "max_transaction_cpu_usage": 150000, + "min_transaction_cpu_usage": 100, + "max_transaction_lifetime": 3600, + "deferred_trx_expiration_window": 600, + "max_transaction_delay": 3888000, + "max_inline_action_size": 4096, + "max_inline_action_depth": 6, + "max_authority_depth": 6, + "max_ram_size": 34359738368 + } +} diff --git a/protonNode/start.sh b/protonNode/start.sh new file mode 100755 index 0000000..3dc75d9 --- /dev/null +++ b/protonNode/start.sh @@ -0,0 +1,24 @@ +#!/bin/bash +################################################################################ +# Proton tools +# +# Created by CryptoLions.io +# +# https://github.com/ProtonProtocol/proton.start +# +# +############################################################################### + + +NODEOSBINDIR="/opt/bin/bin" +DATADIR="/opt/ProtonMainNet/protonNode" + +$DATADIR/stop.sh +echo -e "Starting Nodeos \n"; + +ulimit -n 65535 +ulimit -s 64000 + + +$NODEOSBINDIR/nodeos --data-dir $DATADIR --config-dir $DATADIR "$@" > $DATADIR/stdout.txt 2> $DATADIR/stderr.txt & echo $! > $DATADIR/nodeos.pid + diff --git a/protonNode/stop.sh b/protonNode/stop.sh new file mode 100755 index 0000000..d82c8ff --- /dev/null +++ b/protonNode/stop.sh @@ -0,0 +1,36 @@ +#!/bin/bash +################################################################################ +# Proton tools +# +# Created by CryptoLions.io +# +# https://github.com/ProtonProtocol/proton.start +# +############################################################################### + +DIR="/opt/ProtonMainNet/protonNode" + + if [ -f $DIR"/nodeos.pid" ]; then + pid=`cat $DIR"/nodeos.pid"` + echo $pid + kill $pid + + + echo -ne "Stoping Nodeos" + + while true; do + [ ! -d "/proc/$pid/fd" ] && break + echo -ne "." + sleep 1 + done + rm -r $DIR"/nodeos.pid" + + DATE=$(date -d "now" +'%Y_%m_%d-%H_%M') + if [ ! -d $DIR/logs ]; then + mkdir $DIR/logs + fi + tar -pcvzf $DIR/logs/stderr-$DATE.txt.tar.gz stderr.txt stdout.txt + + + echo -ne "\rNodeos Stopped. \n" + fi