Установка локальной версии ноды

Подготовка к установке

В настоящий момент Sei работает с языком программирования golang 1.18.3+. Вам необходимо установить golang на локальном компьютере, прежде чем переходить к следующему шагу.

Необходимо установить последний релиз из репозитария Sei. Скачать >>

git clone --depth 1 --branch <tag_name> https://github.com/sei-protocol/sei-chain.git

Необходимо заменить <tag_name> на номер релиза, который вы хотите установить. Например, 1.1.1beta.

Если во время установки появляется ошибка "Permission denied (publickey)" (доступ запрещен), убедитесь, что вы правильно сгенерировали SSH ключ и добавили его в свой аккаунт на github. Если после проверок ошибка продолжает появляться, необходимо обратиться к документу «отладочная информация».

Использование seid, встроенного инструмента Sei, является предпочтительным для запуска ноды на локальном компьютере.

Seid (встроенный инструмент)

Соберите и запустите Sei на локальном компьютере.

Сначала соберите программу

cd sei-chain
make install

Убедитесь, что seid доступен и добавлен при помощи GOPATH в PATH (1) или создан алиас имени (2).

1. Добавление GOPATH в PATH

export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

2. Создания алиаса для seid

Добавьте алиас seid в ваш установочный скрипт и выполните код под шелл аккаунтом:

// example on ubuntu
alias seid="/home/ubuntu/go/bin/seid"

Если вы устанавливали пакет ранее, у вас могли остаться временные файлы от старого пакета. Выполните следующую команду, чтобы сбросить состояние пакета:

sudo -S rm -r ~/.sei/
seid tendermint unsafe-reset-all

После выполнения команды должен появиться следующий текст, сообщающий, что предыдущие записи блокчейна были удалены:

4:22PM INF Removed all blockchain history dir=/Users/$username/.sei/data
4:22PM INF Generated private validator file keyFile=/Users/$username/.sei/config/priv_validator_key.json stateFile=/Users/$username/.sei-chain/data/priv_validator_state.json

Затем необходимо провести инициализацию сети. Это процесс создаст блок генезиса:

seid init $MONIKER --chain-id sei-chain

Если все прошло успешно, появится сообщение об успешном окончании инициализации:

{"app_message":{"auth":{"accounts":[],"params":{"max_memo_characters":"256","sig_verify_cost_ed25519":"590","sig_verify_cost_secp256k1":"1000","tx_sig_limit":"7","tx_size_cost_per_byte":"10"}},"bank":{"balances":[],"denom_metadata":[],"params":{"default_send_enabled":true,"send_enabled":[]},"supply":[]},"capability":{"index":"1","owners":[]},"crisis":{"constant_fee":{"amount":"1000","denom":"stake"}},"dex":{"lastEpoch":"0","longBookList":[],"params":{},"shortBookList":[],"twapList":[{"assetDenom":"luna","lastEpoch":"0","priceDenom":"stake","prices":["105"],"twapPrice":"105"},{"assetDenom":"luna","lastEpoch":"0","priceDenom":"ust","prices":["105"],"twapPrice":"105"}]},"distribution":{"delegator_starting_infos":[],"delegator_withdraw_infos":[],"fee_pool":{"community_pool":[]},"outstanding_rewards":[],"params":{"base_proposer_reward":"0.010000000000000000","bonus_proposer_reward":"0.040000000000000000","community_tax":"0.020000000000000000","withdraw_addr_enabled":true},"previous_proposer":"","validator_accumulated_commissions":[],"validator_current_rewards":[],"validator_historical_rewards":[],"validator_slash_events":[]},"epoch":{"epoch":{"current_epoch":"0","current_epoch_height":"0","current_epoch_start_time":"2022-05-15T23:24:58.835910Z","epoch_duration":"60s","genesis_time":"2022-05-15T23:24:58.835910Z"},"params":{}},"evidence":{"evidence":[]},"feegrant":{"allowances":[]},"genutil":{"gen_txs":[]},"gov":{"deposit_params":{"max_deposit_period":"172800s","min_deposit":[{"amount":"10000000","denom":"stake"}]},"deposits":[],"proposals":[],"starting_proposal_id":"1","tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"votes":[],"voting_params":{"voting_period":"172800s"}},"ibc":{"channel_genesis":{"ack_sequences":[],"acknowledgements":[],"channels":[],"commitments":[],"next_channel_sequence":"0","receipts":[],"recv_sequences":[],"send_sequences":[]},"client_genesis":{"clients":[],"clients_consensus":[],"clients_metadata":[],"create_localhost":false,"next_client_sequence":"0","params":{"allowed_clients":["06-solomachine","07-tendermint"]}},"connection_genesis":{"client_connection_paths":[],"connections":[],"next_connection_sequence":"0","params":{"max_expected_time_per_block":"30000000000"}}},"mint":{"minter":{"annual_provisions":"0.000000000000000000","inflation":"0.130000000000000000"},"params":{"blocks_per_year":"6311520","goal_bonded":"0.670000000000000000","inflation_max":"0.200000000000000000","inflation_min":"0.070000000000000000","inflation_rate_change":"0.130000000000000000","mint_denom":"stake"}},"params":null,"slashing":{"missed_blocks":[],"params":{"downtime_jail_duration":"600s","min_signed_per_window":"0.500000000000000000","signed_blocks_window":"100","slash_fraction_double_sign":"0.050000000000000000","slash_fraction_downtime":"0.010000000000000000"},"signing_infos":[]},"staking":{"delegations":[],"exported":false,"last_total_power":"0","last_validator_powers":[],"params":{"bond_denom":"stake","historical_entries":10000,"max_entries":7,"max_validators":100,"unbonding_time":"1814400s"},"redelegations":[],"unbonding_delegations":[],"validators":[]},"transfer":{"denom_traces":[],"params":{"receive_enabled":true,"send_enabled":true},"port_id":"transfer"},"upgrade":{},"vesting":{},"wasm":{"codes":[],"contracts":[],"gen_msgs":[],"params":{"code_upload_access":{"address":"","permission":"Everybody"},"instantiate_default_permission":"Everybody","max_wasm_code_size":"1228800"},"sequences":[]}},"chain_id":"seisei-chain","gentxs_dir":"","moniker":"demo","node_id":"5e145a4dff089c72e73fc63c45e036947d126150"}

Теперь необходимо создать и настроить свой аккаунт:

export ACCOUNT_NAME="YOUR_ACCOUNT_NAME_HERE"
seid keys add $ACCOUNT_NAME

Эти команды создадут новый аккаунт на локальном компьютере, а также выведут на экран адрес кошелька, публичный ключ и мнемофразу:

- name: $ACCOUNT_NAME
  type: local
  address: sei1ep9jyk9kydjz0fhadm7rzy6pc9ga7tdt4d26xn
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"Ai3obIQZXAmdgDSw7p1awFIPGK9b7cu/SfJM6nbc+hV/"}'
  mnemonic: ""


**Important** write this mnemonic phrase in a safe place.
It is the only way to recover your account if you ever forget your password.
some mnemonic words some mnemonic words some mnemonic words some mnemonic words some mnemonic words 
Store the shown account address into local env variable and add it as the genesis account to the chain:
export ACCOUNT_ADDRESS="ADDRESS_OF_YOUR_ACCOUNT"
seid add-genesis-account $ACCOUNT_ADDRESS 100000000000000000000usei

ADDRESS_OF_YOUR_ACCOUNTдолжен быть адресом кошелька, выведенным на экран после создания аккаунта (в нашем примере это seiep9jyk9kydjz0fhadm7rzy6pc9ga7tdt4d26xn)

Локальный стейкинг в блокчейне:

seid gentx $ACCOUNT_NAME 70000000000000000000usei --chain-id sei-chain

Затем необходимо запустить первую транзакцию (выполнить генезис):

seid collect-gentxs

На экране должны появится транзакции генезиса, похожие на текст ниже:

{"app_message":{"auth":{"accounts":[{"@type":"/cosmos.auth.v1beta1.BaseAccount","account_number":"0","address":"cosmos1njgca0khra0a6y4c4j6eckzwq4jtc24hvd0s2e","pub_key":null,"sequence":"0"},{"@type":"/cosmos.auth.v1beta1.BaseAccount","account_number":"0","address":"cosmos1ep9jyk9kydjz0fhadm7rzy6pc9ga7tdt4d26xn","pub_key":null,"sequence":"0"}],"params":{"max_memo_characters":"256","sig_verify_cost_ed25519":"590","sig_verify_cost_secp256k1":"1000","tx_sig_limit":"7","tx_size_cost_per_byte":"10"}},"bank":{"balances":[{"address":"cosmos1njgca0khra0a6y4c4j6eckzwq4jtc24hvd0s2e","coins":[{"amount":"100000000000000000000","denom":"stake"}]},{"address":"cosmos1ep9jyk9kydjz0fhadm7rzy6pc9ga7tdt4d26xn","coins":[{"amount":"100000000000000000000","denom":"stake"}]}],"denom_metadata":[],"params":{"default_send_enabled":true,"send_enabled":[]},"supply":[]},"capability":{"index":"1","owners":[]},"crisis":{"constant_fee":{"amount":"1000","denom":"stake"}},"dex":{"lastEpoch":"0","longBookList":[],"params":{},"shortBookList":[],"twapList":[{"assetDenom":"luna","lastEpoch":"0","priceDenom":"stake","prices":["105"],"twapPrice":"105"},{"assetDenom":"luna","lastEpoch":"0","priceDenom":"ust","prices":["105"],"twapPrice":"105"}]},"distribution":{"delegator_starting_infos":[],"delegator_withdraw_infos":[],"fee_pool":{"community_pool":[]},"outstanding_rewards":[],"params":{"base_proposer_reward":"0.010000000000000000","bonus_proposer_reward":"0.040000000000000000","community_tax":"0.020000000000000000","withdraw_addr_enabled":true},"previous_proposer":"","validator_accumulated_commissions":[],"validator_current_rewards":[],"validator_historical_rewards":[],"validator_slash_events":[]},"epoch":{"epoch":{"current_epoch":"0","current_epoch_height":"0","current_epoch_start_time":"2022-05-15T23:24:58.835910Z","epoch_duration":"60s","genesis_time":"2022-05-15T23:24:58.835910Z"},"params":{}},"evidence":{"evidence":[]},"feegrant":{"allowances":[]},"genutil":{"gen_txs":[{"auth_info":{"fee":{"amount":[],"gas_limit":"200000","granter":"","payer":""},"signer_infos":[{"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"Ai3obIQZXAmdgDSw7p1awFIPGK9b7cu/SfJM6nbc+hV/"},"sequence":"0"}]},"body":{"extension_options":[],"memo":"5e145a4dff089c72e73fc63c45e036947d126150@192.168.1.77:26656","messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","commission":{"max_change_rate":"0.010000000000000000","max_rate":"0.200000000000000000","rate":"0.100000000000000000"},"delegator_address":"cosmos1ep9jyk9kydjz0fhadm7rzy6pc9ga7tdt4d26xn","description":{"details":"","identity":"","moniker":"demo","security_contact":"","website":""},"min_self_delegation":"1","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"wYmGjeAUx9MOeO80b92Jg6FUuzmSwN1Xi1F42pLVHWM="},"validator_address":"cosmosvaloper1ep9jyk9kydjz0fhadm7rzy6pc9ga7tdtse702q","value":{"amount":"70000000000000000000","denom":"stake"}}],"non_critical_extension_options":[],"timeout_height":"0"},"signatures":["BtnsRzsdTGeNtAtRv2JrgCecfQEYusz9USliMf+8ShlS5qrVY7a3FUPDbfubJPNA1bExiKDzeIubqQFSlE5WzA=="]}]},"gov":{"deposit_params":{"max_deposit_period":"172800s","min_deposit":[{"amount":"10000000","denom":"stake"}]},"deposits":[],"proposals":[],"starting_proposal_id":"1","tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"votes":[],"voting_params":{"voting_period":"172800s"}},"ibc":{"channel_genesis":{"ack_sequences":[],"acknowledgements":[],"channels":[],"commitments":[],"next_channel_sequence":"0","receipts":[],"recv_sequences":[],"send_sequences":[]},"client_genesis":{"clients":[],"clients_consensus":[],"clients_metadata":[],"create_localhost":false,"next_client_sequence":"0","params":{"allowed_clients":["06-solomachine","07-tendermint"]}},"connection_genesis":{"client_connection_paths":[],"connections":[],"next_connection_sequence":"0","params":{"max_expected_time_per_block":"30000000000"}}},"mint":{"minter":{"annual_provisions":"0.000000000000000000","inflation":"0.130000000000000000"},"params":{"blocks_per_year":"6311520","goal_bonded":"0.670000000000000000","inflation_max":"0.200000000000000000","inflation_min":"0.070000000000000000","inflation_rate_change":"0.130000000000000000","mint_denom":"stake"}},"params":null,"slashing":{"missed_blocks":[],"params":{"downtime_jail_duration":"600s","min_signed_per_window":"0.500000000000000000","signed_blocks_window":"100","slash_fraction_double_sign":"0.050000000000000000","slash_fraction_downtime":"0.010000000000000000"},"signing_infos":[]},"staking":{"delegations":[],"exported":false,"last_total_power":"0","last_validator_powers":[],"params":{"bond_denom":"stake","historical_entries":10000,"max_entries":7,"max_validators":100,"unbonding_time":"1814400s"},"redelegations":[],"unbonding_delegations":[],"validators":[]},"transfer":{"denom_traces":[],"params":{"receive_enabled":true,"send_enabled":true},"port_id":"transfer"},"upgrade":{},"vesting":{},"wasm":{"codes":[],"contracts":[],"gen_msgs":[],"params":{"code_upload_access":{"address":"","permission":"Everybody"},"instantiate_default_permission":"Everybody","max_wasm_code_size":"1228800"},"sequences":[]}},"chain_id":"sei-chain","gentxs_dir":"/Users/cyson/.sei-chain/config/gentx","moniker":"demo","node_id":"5e145a4dff089c72e73fc63c45e036947d126150"}

На следующем шаге необходимо переопределить валюту, используемую для различных функций на usei:

cat ~/.sei/config/genesis.json | jq '.app_state["crisis"]["constant_fee"]["denom"]="usei"' > ~/.sei/config/tmp_genesis.json && mv ~/.sei/config/tmp_genesis.json ~/.sei/config/genesis.json
cat ~/.sei/config/genesis.json | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="usei"' > ~/.sei/config/tmp_genesis.json && mv ~/.sei/config/tmp_genesis.json ~/.sei/config/genesis.json
cat ~/.sei/config/genesis.json | jq '.app_state["mint"]["params"]["mint_denom"]="usei"' > ~/.sei/config/tmp_genesis.json && mv ~/.sei/config/tmp_genesis.json ~/.sei/config/genesis.json
cat ~/.sei/config/genesis.json | jq '.app_state["staking"]["params"]["bond_denom"]="usei"' > ~/.sei/config/tmp_genesis.json && mv ~/.sei/config/tmp_genesis.json ~/.sei/config/genesis.json
cat ~/.sei/config/genesis.json | jq '.app_state["distribution"]["params"]["community_tax"]="0.000000000000000000"' > ~/.sei/config/tmp_genesis.json && mv ~/.sei/config/tmp_genesis.json ~/.sei/config/genesis.json

Мы рекомендуем заменить настройки таймаута по умолчанию на приведенные ниже, чтобы замедлить создание блоков и улучшить визуализацию логов:

export CONFIG_PATH=$HOME/.sei/config/config.toml

# for linux machine, remove the '' after sed -i
sed -i '' 's/timeout_prevote =.*/timeout_prevote = "2000ms"/g' $CONFIG_PATH
sed -i '' 's/timeout_precommit =.*/timeout_precommit = "2000ms"/g' $CONFIG_PATH
sed -i '' 's/timeout_commit =.*/timeout_commit = "2000ms"/g' $CONFIG_PATH
sed -i '' 's/skip_timeout_commit =.*/skip_timeout_commit = false/g' $CONFIG_PATH

Теперь можно запускать блокчейн:

seid start

С момента запуска начнут появляться новые блоки.

Last updated