├── .gitattributes ├── docs ├── translations │ ├── cn │ │ ├── keys.md │ │ ├── README.md │ │ ├── what-is-gaia.md │ │ ├── validators │ │ │ ├── overview.md │ │ │ └── security.md │ │ ├── join-testnet.md │ │ ├── installation.md │ │ ├── genesis-state.md │ │ ├── launch │ │ │ ├── blog-2-cn.md │ │ │ └── blog-1-cn.md │ │ ├── join-mainnet.md │ │ └── ledger.md │ └── kr │ │ ├── keys.md │ │ ├── README.md │ │ ├── what-is-gaia.md │ │ ├── installation.md │ │ ├── ledger.md │ │ ├── validators │ │ ├── overview.md │ │ └── security.md │ │ ├── genesis.md │ │ └── join-testnet.md ├── cosmos-hub-image.jpg ├── validators │ ├── kms │ │ ├── ledger_1.jpg │ │ ├── ledger_2.jpg │ │ ├── kms.md │ │ └── kms_ledger.md │ ├── overview.md │ └── security.md ├── keys.md ├── README.md ├── what-is-gaia.md ├── join-testnet.md ├── installation.md ├── genesis-state.md ├── launch │ ├── blog-2-cn.md │ ├── blog-2-kr.md │ └── blog-1-cn.md ├── reproducible-builds.md ├── upgrade-node.md └── DOCS_README.md ├── networks ├── remote │ ├── ansible │ │ ├── .gitignore │ │ ├── roles │ │ │ ├── increase-openfiles │ │ │ │ ├── files │ │ │ │ │ ├── 50-fs.conf │ │ │ │ │ ├── 91-nofiles.conf │ │ │ │ │ └── limits.conf │ │ │ │ ├── handlers │ │ │ │ │ └── main.yml │ │ │ │ └── tasks │ │ │ │ │ └── main.yml │ │ │ ├── set-debug │ │ │ │ ├── files │ │ │ │ │ ├── sysconfig │ │ │ │ │ │ ├── gaiacli │ │ │ │ │ │ └── gaiad │ │ │ │ │ └── sysctl.d │ │ │ │ │ │ └── 10-procdump │ │ │ │ ├── handlers │ │ │ │ │ └── main.yaml │ │ │ │ └── tasks │ │ │ │ │ └── main.yml │ │ │ ├── extract-config │ │ │ │ ├── defaults │ │ │ │ │ └── main.yml │ │ │ │ └── tasks │ │ │ │ │ └── main.yml │ │ │ ├── add-lcd │ │ │ │ ├── defaults │ │ │ │ │ └── main.yml │ │ │ │ ├── handlers │ │ │ │ │ └── main.yml │ │ │ │ ├── tasks │ │ │ │ │ └── main.yml │ │ │ │ └── templates │ │ │ │ │ └── gaiacli.service.j2 │ │ │ ├── setup-fullnodes │ │ │ │ ├── defaults │ │ │ │ │ └── main.yml │ │ │ │ ├── handlers │ │ │ │ │ └── main.yml │ │ │ │ ├── files │ │ │ │ │ └── gaiad.service │ │ │ │ └── tasks │ │ │ │ │ └── main.yml │ │ │ ├── setup-validators │ │ │ │ ├── defaults │ │ │ │ │ └── main.yml │ │ │ │ ├── handlers │ │ │ │ │ └── main.yml │ │ │ │ ├── files │ │ │ │ │ └── gaiad.service │ │ │ │ └── tasks │ │ │ │ │ └── main.yml │ │ │ ├── start │ │ │ │ └── tasks │ │ │ │ │ └── main.yml │ │ │ ├── stop │ │ │ │ └── tasks │ │ │ │ │ └── main.yml │ │ │ ├── upgrade-gaiad │ │ │ │ ├── handlers │ │ │ │ │ └── main.yml │ │ │ │ └── tasks │ │ │ │ │ └── main.yml │ │ │ ├── setup-journald │ │ │ │ ├── handlers │ │ │ │ │ └── main.yml │ │ │ │ └── tasks │ │ │ │ │ └── main.yml │ │ │ ├── update-datadog-agent │ │ │ │ ├── handlers │ │ │ │ │ └── main.yml │ │ │ │ ├── files │ │ │ │ │ └── conf.d │ │ │ │ │ │ ├── prometheus.d │ │ │ │ │ │ └── conf.yaml │ │ │ │ │ │ ├── network.d │ │ │ │ │ │ └── conf.yaml │ │ │ │ │ │ ├── http_check.d │ │ │ │ │ │ └── conf.yaml │ │ │ │ │ │ └── process.d │ │ │ │ │ │ └── conf.yaml │ │ │ │ └── tasks │ │ │ │ │ └── main.yml │ │ │ ├── logzio │ │ │ │ ├── handlers │ │ │ │ │ └── main.yml │ │ │ │ ├── files │ │ │ │ │ └── journalbeat.service │ │ │ │ └── tasks │ │ │ │ │ └── main.yml │ │ │ ├── clear-config │ │ │ │ └── tasks │ │ │ │ │ └── main.yml │ │ │ ├── install-datadog-agent │ │ │ │ ├── handlers │ │ │ │ │ └── main.yml │ │ │ │ └── tasks │ │ │ │ │ └── main.yml │ │ │ └── remove-datadog-agent │ │ │ │ └── tasks │ │ │ │ └── main.yml │ │ ├── add-lcd.yml │ │ ├── set-debug.yml │ │ ├── clear-config.yml │ │ ├── extract-config.yml │ │ ├── increase-openfiles.yml │ │ ├── remove-datadog-agent.yml │ │ ├── upgrade-gaia.yml │ │ ├── start.yml │ │ ├── stop.yml │ │ ├── setup-journald.yml │ │ ├── setup-validators.yml │ │ ├── update-datadog-agent.yml │ │ ├── upgrade-gaiad.yml │ │ ├── setup-fullnodes.yml │ │ ├── install-datadog-agent.yml │ │ ├── status.yml │ │ ├── logzio.yml │ │ └── inventory │ │ │ └── digital_ocean.ini │ ├── terraform-app │ │ ├── .gitignore │ │ ├── files │ │ │ └── terraform.sh │ │ ├── infra │ │ │ ├── outputs.tf │ │ │ ├── variables.tf │ │ │ ├── lcd.tf │ │ │ ├── attachment.tf │ │ │ ├── lb.tf │ │ │ ├── instance.tf │ │ │ └── vpc.tf │ │ └── main.tf │ ├── terraform-aws │ │ ├── .gitignore │ │ ├── nodes │ │ │ ├── outputs.tf │ │ │ ├── variables.tf │ │ │ └── main.tf │ │ └── files │ │ │ └── terraform.sh │ └── terraform-do │ │ ├── .gitignore │ │ ├── files │ │ └── terraform.sh │ │ ├── cluster │ │ ├── outputs.tf │ │ ├── variables.tf │ │ └── main.tf │ │ ├── main.tf │ │ └── README.md ├── local │ ├── Makefile │ └── gaiadnode │ │ ├── Dockerfile │ │ └── wrapper.sh ├── list.sh ├── README.md ├── del-datadog.sh ├── add-datadog.sh ├── del-cluster.sh ├── upgrade-gaiad.sh ├── add-cluster.sh └── new-testnet.sh ├── .pending ├── improvements │ ├── rest │ │ ├── 4141-Fix-txs-encode- │ │ ├── 4129-Translate-doc-c │ │ ├── 2007-Return-200-status-code-on-empty-results │ │ └── 4123-Fix-typo-url-er │ ├── gaiad │ │ ├── 4343-Upgrade-toolcha │ │ ├── 4080-add-missing-inv │ │ ├── 4064-Remove-dep-and- │ │ ├── 4062-Remove-cmd-gaia │ │ └── 4042-Add-description │ └── gaiacli │ │ ├── 4227-Support-for-Ledger-App-1.5 │ │ └── 3426-remove-redundant-account-check ├── bugfixes │ ├── gaiad │ │ └── 4113-Fix-incorrect-G │ └── gaiacli │ │ ├── 4345-Improved-NanoX-detection │ │ ├── 3945-There-s-no-chec │ │ ├── 4190-Fix-redelegatio │ │ └── 4219-Empty-mnemonic- ├── breaking │ ├── rest │ │ ├── 3942-Support-query-t │ │ ├── 4049-update-tag │ │ ├── The-auth-accounts-ad │ │ └── 3715-Update-distribu │ ├── gaiacli │ │ ├── 40-rest-server-s---c │ │ ├── 4027-gaiad-and-gaiac │ │ ├── 3715-query-distr-rew │ │ ├── 4142-Turn-gaiacli-tx │ │ └── 4228-merge-gaiakeyutil-into-gaiacli │ └── gaiad │ │ ├── 3985-ValidatorPowerR │ │ ├── 4159-use-module-patt │ │ ├── 4272-Merge-gaiarepla │ │ └── 4027-gaiad-and-gaiac └── features │ └── gaiad │ ├── Update-Gaia-for-comm │ └── Add-migrate-command- ├── lcd_test └── testdata │ ├── state.tar.gz │ └── setup.sh ├── cli_test ├── doc.go └── README.md ├── contrib ├── gitian-keys │ ├── keys.txt │ └── README.md ├── get_node.sh ├── devtools │ ├── install-golangci-lint.sh │ └── Makefile ├── localnet-blocks-test.sh └── gitian-descriptors │ ├── gitian-linux.yml │ ├── gitian-darwin.yml │ └── gitian-windows.yml ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug-report.md │ └── feature-request.md └── PULL_REQUEST_TEMPLATE.md ├── .clog.yaml ├── .golangci.yml ├── .codecov.yml ├── .gitignore ├── dredd.yml ├── app ├── utils.go ├── app_test.go ├── benchmarks │ └── txsize_test.go └── params.go ├── cmd ├── gaiadebug │ ├── README.md │ └── hack.go ├── contract_tests │ └── main.go └── gaiad │ └── main.go ├── Dockerfile ├── docker-compose.yml ├── go.mod ├── README.md ├── CODE_OF_CONDUCT.md └── sims.mk /.gitattributes: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/translations/cn/keys.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /networks/remote/ansible/.gitignore: -------------------------------------------------------------------------------- 1 | *.retry 2 | files/* 3 | keys/* 4 | -------------------------------------------------------------------------------- /.pending/improvements/rest/4141-Fix-txs-encode-: -------------------------------------------------------------------------------- 1 | #4141 Fix /txs/encode endpoint -------------------------------------------------------------------------------- /.pending/bugfixes/gaiad/4113-Fix-incorrect-G: -------------------------------------------------------------------------------- 1 | #4113 Fix incorrect `$GOBIN` in `Install Go` -------------------------------------------------------------------------------- /.pending/improvements/rest/4129-Translate-doc-c: -------------------------------------------------------------------------------- 1 | #4129 Translate doc clients to chinese. -------------------------------------------------------------------------------- /networks/remote/ansible/roles/increase-openfiles/files/50-fs.conf: -------------------------------------------------------------------------------- 1 | fs.file-max=262144 2 | -------------------------------------------------------------------------------- /.pending/breaking/rest/3942-Support-query-t: -------------------------------------------------------------------------------- 1 | #3942 Update pagination data in txs query. 2 | -------------------------------------------------------------------------------- /.pending/improvements/gaiad/4343-Upgrade-toolcha: -------------------------------------------------------------------------------- 1 | #4343 Upgrade toolchain to Go 1.12.5. 2 | -------------------------------------------------------------------------------- /.pending/breaking/gaiacli/40-rest-server-s---c: -------------------------------------------------------------------------------- 1 | #40 rest-server's --cors option is now gone. 2 | -------------------------------------------------------------------------------- /.pending/bugfixes/gaiacli/4345-Improved-NanoX-detection: -------------------------------------------------------------------------------- 1 | #4345 Improved Ledger Nano X detection 2 | -------------------------------------------------------------------------------- /.pending/improvements/gaiad/4080-add-missing-inv: -------------------------------------------------------------------------------- 1 | #4080 add missing invariants during simulations -------------------------------------------------------------------------------- /.pending/breaking/gaiad/3985-ValidatorPowerR: -------------------------------------------------------------------------------- 1 | #3985 ValidatorPowerRank uses potential consensus power -------------------------------------------------------------------------------- /.pending/breaking/rest/4049-update-tag: -------------------------------------------------------------------------------- 1 | #4049 update tag MsgWithdrawValidatorCommission to match type -------------------------------------------------------------------------------- /.pending/improvements/gaiacli/4227-Support-for-Ledger-App-1.5: -------------------------------------------------------------------------------- 1 | #4227 Support for Ledger App v1.5 2 | -------------------------------------------------------------------------------- /docs/cosmos-hub-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa8x/gaia/master/docs/cosmos-hub-image.jpg -------------------------------------------------------------------------------- /networks/remote/ansible/roles/set-debug/files/sysconfig/gaiacli: -------------------------------------------------------------------------------- 1 | DAEMON_COREFILE_LIMIT='unlimited' 2 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/set-debug/files/sysconfig/gaiad: -------------------------------------------------------------------------------- 1 | DAEMON_COREFILE_LIMIT='unlimited' 2 | -------------------------------------------------------------------------------- /.pending/breaking/gaiad/4159-use-module-patt: -------------------------------------------------------------------------------- 1 | #4159 use module pattern and module manager for initialization -------------------------------------------------------------------------------- /.pending/bugfixes/gaiacli/3945-There-s-no-chec: -------------------------------------------------------------------------------- 1 | #3945 There's no check for chain-id in TxBuilder.SignStdTx -------------------------------------------------------------------------------- /networks/remote/ansible/roles/extract-config/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | TESTNET_NAME: remotenet 4 | 5 | -------------------------------------------------------------------------------- /.pending/improvements/gaiad/4064-Remove-dep-and-: -------------------------------------------------------------------------------- 1 | #4064 Remove `dep` and `vendor` from `doc` and `version`. 2 | -------------------------------------------------------------------------------- /docs/validators/kms/ledger_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa8x/gaia/master/docs/validators/kms/ledger_1.jpg -------------------------------------------------------------------------------- /docs/validators/kms/ledger_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa8x/gaia/master/docs/validators/kms/ledger_2.jpg -------------------------------------------------------------------------------- /lcd_test/testdata/state.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa8x/gaia/master/lcd_test/testdata/state.tar.gz -------------------------------------------------------------------------------- /networks/remote/ansible/roles/add-lcd/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | GAIACLI_ADDRESS: tcp://0.0.0.0:1317 4 | 5 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/setup-fullnodes/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | TESTNET_NAME: remotenet 4 | 5 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/setup-validators/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | TESTNET_NAME: remotenet 4 | 5 | -------------------------------------------------------------------------------- /.pending/improvements/gaiad/4062-Remove-cmd-gaia: -------------------------------------------------------------------------------- 1 | #4066 Fix 'ExportGenesisFile() incorrectly overwrites genesis' 2 | -------------------------------------------------------------------------------- /cli_test/doc.go: -------------------------------------------------------------------------------- 1 | package clitest 2 | 3 | // package clitest runs integration tests which make use of CLI commands. 4 | -------------------------------------------------------------------------------- /.pending/improvements/gaiacli/3426-remove-redundant-account-check: -------------------------------------------------------------------------------- 1 | #4068 Remove redundant account check on `gaiacli` 2 | -------------------------------------------------------------------------------- /.pending/improvements/rest/2007-Return-200-status-code-on-empty-results: -------------------------------------------------------------------------------- 1 | #2007 Return 200 status code on empty results 2 | -------------------------------------------------------------------------------- /.pending/improvements/rest/4123-Fix-typo-url-er: -------------------------------------------------------------------------------- 1 | #4123 Fix typo, url error and outdated command description of doc clients. -------------------------------------------------------------------------------- /.pending/bugfixes/gaiacli/4190-Fix-redelegatio: -------------------------------------------------------------------------------- 1 | #4190 Fix redelegations-from by using the correct params and query endpoint. 2 | -------------------------------------------------------------------------------- /.pending/bugfixes/gaiacli/4219-Empty-mnemonic-: -------------------------------------------------------------------------------- 1 | #4219 Return an error when an empty mnemonic is provided during key recovery. 2 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/increase-openfiles/files/91-nofiles.conf: -------------------------------------------------------------------------------- 1 | * soft nofile 262144 2 | * hard nofile 262144 3 | 4 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/increase-openfiles/files/limits.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | LimitNOFILE=infinity 3 | LimitMEMLOCK=infinity 4 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/set-debug/handlers/main.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: reload sysctl 4 | command: "/sbin/sysctl -p" 5 | -------------------------------------------------------------------------------- /.pending/breaking/gaiacli/4027-gaiad-and-gaiac: -------------------------------------------------------------------------------- 1 | #4027 gaiacli version command dooes not return the checksum of the go.sum file anymore. 2 | -------------------------------------------------------------------------------- /.pending/breaking/gaiacli/3715-query-distr-rew: -------------------------------------------------------------------------------- 1 | #3715 query distr rewards returns per-validator 2 | rewards along with rewards total amount. 3 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/start/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: start service 4 | service: "name={{service}} state=started" 5 | 6 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/stop/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: stop service 4 | service: "name={{service}} state=stopped" 5 | 6 | -------------------------------------------------------------------------------- /.pending/improvements/gaiad/4042-Add-description: -------------------------------------------------------------------------------- 1 | #4042 Update docs and scripts to include the correct `GO111MODULE=on` environment variable. 2 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/upgrade-gaiad/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: restart gaiad 4 | service: name=gaiad state=restarted 5 | 6 | -------------------------------------------------------------------------------- /networks/remote/ansible/add-lcd.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - hosts: all 4 | any_errors_fatal: true 5 | gather_facts: no 6 | roles: 7 | - add-lcd 8 | 9 | -------------------------------------------------------------------------------- /.pending/features/gaiad/Update-Gaia-for-comm: -------------------------------------------------------------------------------- 1 | Update Gaia for community pool spend proposals per Cosmos Hub governance proposal #7 "Activate the Community Pool" -------------------------------------------------------------------------------- /contrib/gitian-keys/keys.txt: -------------------------------------------------------------------------------- 1 | 04160004A8276E40BB9890FBE8A48AE5311D765A Alessio Treglia 2 | 237396563D09DCD65B122AE7EC1904F1389EF7E5 Karoly Albert Szabo 3 | -------------------------------------------------------------------------------- /networks/remote/ansible/set-debug.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - hosts: all 4 | any_errors_fatal: true 5 | gather_facts: no 6 | roles: 7 | - set-debug 8 | 9 | -------------------------------------------------------------------------------- /networks/remote/ansible/clear-config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - hosts: all 4 | any_errors_fatal: true 5 | gather_facts: no 6 | roles: 7 | - clear-config 8 | 9 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/increase-openfiles/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: reload systemctl 4 | systemd: name=systemd daemon_reload=yes 5 | 6 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/setup-journald/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: restart journald 4 | service: name=systemd-journald state=restarted 5 | 6 | -------------------------------------------------------------------------------- /networks/remote/terraform-app/.gitignore: -------------------------------------------------------------------------------- 1 | .terraform 2 | terraform.tfstate 3 | terraform.tfstate.backup 4 | terraform.tfstate.d 5 | .terraform.tfstate.lock.info 6 | -------------------------------------------------------------------------------- /networks/remote/terraform-aws/.gitignore: -------------------------------------------------------------------------------- 1 | .terraform 2 | terraform.tfstate 3 | terraform.tfstate.backup 4 | terraform.tfstate.d 5 | .terraform.tfstate.lock.info 6 | -------------------------------------------------------------------------------- /.pending/breaking/gaiad/4272-Merge-gaiarepla: -------------------------------------------------------------------------------- 1 | #4272 Merge gaiareplay functionality into gaiad replay. 2 | Drop `gaiareplay` in favor of new `gaiad replay` command. 3 | -------------------------------------------------------------------------------- /.pending/breaking/rest/The-auth-accounts-ad: -------------------------------------------------------------------------------- 1 | The `/auth/accounts/{address}` now returns a `height` in the response. The 2 | account is now nested under `account`. 3 | -------------------------------------------------------------------------------- /networks/local/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for the "gaiadnode" docker image. 2 | 3 | all: 4 | docker build --tag tendermint/gaiadnode gaiadnode 5 | 6 | .PHONY: all 7 | 8 | -------------------------------------------------------------------------------- /networks/remote/ansible/extract-config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - hosts: all 4 | any_errors_fatal: true 5 | gather_facts: no 6 | roles: 7 | - extract-config 8 | 9 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/setup-fullnodes/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: reload systemd 4 | systemd: name=gaiad enabled=yes daemon_reload=yes 5 | 6 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/setup-validators/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: reload systemd 4 | systemd: name=gaiad enabled=yes daemon_reload=yes 5 | 6 | -------------------------------------------------------------------------------- /networks/remote/terraform-do/.gitignore: -------------------------------------------------------------------------------- 1 | .terraform 2 | terraform.tfstate 3 | terraform.tfstate.backup 4 | terraform.tfstate.d 5 | .terraform.tfstate.lock.info 6 | 7 | -------------------------------------------------------------------------------- /.pending/breaking/gaiacli/4142-Turn-gaiacli-tx: -------------------------------------------------------------------------------- 1 | #4142 Turn gaiacli tx send's --from into a required argument. 2 | New shorter syntax: `gaiacli tx send FROM TO AMOUNT` 3 | -------------------------------------------------------------------------------- /.pending/features/gaiad/Add-migrate-command-: -------------------------------------------------------------------------------- 1 | Add `migrate` command to `gaiad` to provide the ability to migrate exported 2 | genesis state from one version to another. 3 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/update-datadog-agent/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: restart datadog-agent 4 | service: name=datadog-agent state=restarted 5 | 6 | -------------------------------------------------------------------------------- /networks/remote/ansible/increase-openfiles.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - hosts: all 4 | any_errors_fatal: true 5 | gather_facts: no 6 | roles: 7 | - increase-openfiles 8 | 9 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/set-debug/files/sysctl.d/10-procdump: -------------------------------------------------------------------------------- 1 | kernel.core_uses_pid = 1 2 | kernel.core_pattern = /tmp/core-%e-%s-%u-%g-%p-%t 3 | fs.suid_dumpable = 2 4 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # CODEOWNERS: https://help.github.com/articles/about-codeowners/ 2 | 3 | # Primary repo maintainers 4 | * @alessio @alexanderbez @rigelrozanski @jackzampolin -------------------------------------------------------------------------------- /networks/remote/ansible/remove-datadog-agent.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - hosts: all 4 | any_errors_fatal: true 5 | gather_facts: no 6 | roles: 7 | - remove-datadog-agent 8 | 9 | -------------------------------------------------------------------------------- /networks/remote/ansible/upgrade-gaia.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - hosts: all 4 | any_errors_fatal: true 5 | gather_facts: no 6 | roles: 7 | - upgrade-gaiad 8 | - add-lcd 9 | 10 | -------------------------------------------------------------------------------- /networks/remote/ansible/start.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - hosts: all 4 | any_errors_fatal: true 5 | gather_facts: no 6 | vars: 7 | - service: gaiad 8 | roles: 9 | - start 10 | 11 | -------------------------------------------------------------------------------- /networks/remote/ansible/stop.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - hosts: all 4 | any_errors_fatal: true 5 | gather_facts: no 6 | vars: 7 | - service: gaiad 8 | roles: 9 | - stop 10 | 11 | -------------------------------------------------------------------------------- /networks/remote/ansible/setup-journald.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | #DD_API_KEY 4 | 5 | - hosts: all 6 | any_errors_fatal: true 7 | gather_facts: no 8 | roles: 9 | - setup-journald 10 | 11 | -------------------------------------------------------------------------------- /.clog.yaml: -------------------------------------------------------------------------------- 1 | sections: 2 | breaking: Breaking Changes 3 | features: Features 4 | improvements: Improvements 5 | bugfixes: Bugfixes 6 | 7 | tags: 8 | - gaiad 9 | - gaiacli 10 | - rest 11 | -------------------------------------------------------------------------------- /networks/remote/ansible/setup-validators.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - hosts: all 4 | any_errors_fatal: true 5 | gather_facts: no 6 | roles: 7 | - increase-openfiles 8 | - setup-validators 9 | 10 | -------------------------------------------------------------------------------- /.pending/breaking/gaiacli/4228-merge-gaiakeyutil-into-gaiacli: -------------------------------------------------------------------------------- 1 | #4228 Merge gaiakeyutil functionality into gaiacli keys. 2 | Drop `gaiakeyutil` in favor of new `gaiacli keys parse` command. Syntax and semantic are preserved. 3 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/logzio/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: reload daemon 4 | command: "systemctl daemon-reload" 5 | 6 | - name: restart journalbeat 7 | service: name=journalbeat state=restarted 8 | 9 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/add-lcd/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: systemctl 4 | systemd: name=gaiacli enabled=yes daemon_reload=yes 5 | 6 | - name: restart gaiacli 7 | service: name=gaiacli state=restarted 8 | 9 | 10 | -------------------------------------------------------------------------------- /networks/remote/ansible/update-datadog-agent.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | #DD_API_KEY,TESTNET_NAME,CLUSTER_NAME required 4 | 5 | - hosts: all 6 | any_errors_fatal: true 7 | gather_facts: no 8 | roles: 9 | - update-datadog-agent 10 | 11 | -------------------------------------------------------------------------------- /networks/list.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # list - list the IPs of a set of nodes 3 | 4 | if [ $# -ne 1 ]; then 5 | echo "Usage: ./list.sh " 6 | exit 1 7 | fi 8 | set -eux 9 | 10 | export CLUSTER_NAME=$1 11 | 12 | make list 13 | 14 | -------------------------------------------------------------------------------- /networks/remote/ansible/upgrade-gaiad.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | # Required: BINARY 4 | # Optional: GENESISFILE, UNSAFE_RESET_ALL 5 | 6 | - hosts: all 7 | any_errors_fatal: true 8 | gather_facts: no 9 | roles: 10 | - upgrade-gaiad 11 | 12 | -------------------------------------------------------------------------------- /.pending/breaking/rest/3715-Update-distribu: -------------------------------------------------------------------------------- 1 | #3715 Update /distribution/delegators/{delegatorAddr}/rewards GET endpoint 2 | as per new specs. For a given delegation, the endpoint now returns the 3 | comprehensive list of validator-reward tuples along with the grand total. 4 | -------------------------------------------------------------------------------- /networks/remote/terraform-app/files/terraform.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Script to initialize a testnet settings on a server 3 | 4 | #Usage: terraform.sh 5 | 6 | #Add gaiad node number for remote identification 7 | echo "$2" > /etc/nodeid 8 | 9 | -------------------------------------------------------------------------------- /networks/remote/terraform-do/files/terraform.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Script to initialize a testnet settings on a server 3 | 4 | #Usage: terraform.sh 5 | 6 | #Add gaiad node number for remote identification 7 | echo "$2" > /etc/nodeid 8 | 9 | -------------------------------------------------------------------------------- /networks/README.md: -------------------------------------------------------------------------------- 1 | # Networks 2 | 3 | Here contains the files required for automated deployment of either local or remote testnets. 4 | 5 | Doing so is best accomplished using the `make` targets. For more information, see the 6 | [networks documentation](/docs/gaia/networks.md) 7 | -------------------------------------------------------------------------------- /networks/remote/ansible/setup-fullnodes.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | #GENESISFILE required 4 | #CONFIGFILE required 5 | #BINARY required 6 | 7 | - hosts: all 8 | any_errors_fatal: true 9 | gather_facts: no 10 | roles: 11 | - increase-openfiles 12 | - setup-fullnodes 13 | 14 | -------------------------------------------------------------------------------- /networks/del-datadog.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # del-datadog - aremove datadog agent from a set of nodes 3 | 4 | if [ $# -ne 1 ]; then 5 | echo "Usage: ./del-datadog.sh " 6 | exit 1 7 | fi 8 | set -eux 9 | 10 | export CLUSTER_NAME=$1 11 | 12 | make remove-datadog 13 | 14 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/update-datadog-agent/files/conf.d/prometheus.d/conf.yaml: -------------------------------------------------------------------------------- 1 | init_config: 2 | 3 | instances: 4 | - prometheus_url: http://127.0.0.1:26660 5 | metrics: 6 | - go* 7 | - mempool* 8 | - p2p* 9 | - process* 10 | - promhttp* 11 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/update-datadog-agent/files/conf.d/network.d/conf.yaml: -------------------------------------------------------------------------------- 1 | init_config: 2 | 3 | instances: 4 | - collect_connection_state: true 5 | excluded_interfaces: 6 | - lo 7 | - lo0 8 | collect_rate_metrics: true 9 | collect_count_metrics: true 10 | -------------------------------------------------------------------------------- /networks/remote/ansible/install-datadog-agent.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | #DD_API_KEY,TESTNET_NAME,CLUSTER_NAME required 4 | 5 | - hosts: all 6 | any_errors_fatal: true 7 | gather_facts: no 8 | roles: 9 | - setup-journald 10 | - install-datadog-agent 11 | - update-datadog-agent 12 | 13 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/clear-config/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Stop service 4 | service: name=gaiad state=stopped 5 | 6 | - name: Delete files 7 | file: "path={{item}} state=absent" 8 | with_items: 9 | - /usr/bin/gaiad 10 | - /home/gaiad/.gaiad 11 | - /home/gaiad/.gaiacli 12 | 13 | -------------------------------------------------------------------------------- /networks/add-datadog.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # add-datadog - add datadog agent to a set of nodes 3 | 4 | if [ $# -ne 2 ]; then 5 | echo "Usage: ./add-datadog.sh " 6 | exit 1 7 | fi 8 | set -eux 9 | 10 | export TESTNET_NAME=$1 11 | export CLUSTER_NAME=$2 12 | 13 | make install-datadog 14 | 15 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/install-datadog-agent/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: restart datadog-agent 4 | service: name=datadog-agent state=restarted 5 | 6 | - name: restart rsyslog 7 | service: name=rsyslog state=restarted 8 | 9 | - name: restart journald 10 | service: name=systemd-journald state=restarted 11 | -------------------------------------------------------------------------------- /networks/del-cluster.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # del-cluster - example make call to delete a set of nodes on an existing testnet in AWS 3 | 4 | if [ $# -ne 1 ]; then 5 | echo "Usage: ./add-cluster.sh " 6 | exit 1 7 | fi 8 | set -eux 9 | 10 | export CLUSTER_NAME=$1 11 | 12 | # Delete the AWS nodes 13 | make fullnodes-stop 14 | 15 | -------------------------------------------------------------------------------- /.pending/breaking/gaiad/4027-gaiad-and-gaiac: -------------------------------------------------------------------------------- 1 | #4027 gaiad version command does not return the checksum of the go.sum file shipped along with the source release tarball. 2 | Go modules feature guarantees dependencies reproducibility and as long as binaries are built via the Makefile shipped with the sources, no dependendencies can break such guarantee. 3 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/update-datadog-agent/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Set datadog.yaml config 4 | template: src=datadog.yaml.j2 dest=/etc/datadog-agent/datadog.yaml 5 | notify: restart datadog-agent 6 | 7 | - name: Set metrics config 8 | copy: src=conf.d/ dest=/etc/datadog-agent/conf.d/ 9 | notify: restart datadog-agent 10 | 11 | -------------------------------------------------------------------------------- /docs/keys.md: -------------------------------------------------------------------------------- 1 | # Keys 2 | 3 | See the [Tendermint specification](https://github.com/tendermint/tendermint/blob/master/docs/spec/blockchain/encoding.md#public-key-cryptography) for how we work with keys. 4 | 5 | See `gaiacli keys --help`. 6 | 7 | Also see the [testnet 8 | tutorial](./join-testnet). 9 | 10 | TODO: cleanup the UX and document this properly 11 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/remove-datadog-agent/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Stop datadog service 4 | failed_when: false 5 | service: name=datadog-agent state=stopped 6 | 7 | - name: Uninstall datadg-agent 8 | yum: name=datadog-agent state=absent 9 | 10 | - name: Remove datadog-agent folder 11 | file: path=/etc/datadog-agent state=absent 12 | 13 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/add-lcd/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Copy binary 4 | copy: 5 | src: "{{GAIACLI_BINARY}}" 6 | dest: /usr/bin/gaiacli 7 | mode: 0755 8 | notify: restart gaiacli 9 | 10 | - name: Copy service 11 | template: 12 | src: gaiacli.service.j2 13 | dest: /etc/systemd/system/gaiacli.service 14 | notify: systemctl 15 | 16 | -------------------------------------------------------------------------------- /docs/translations/kr/keys.md: -------------------------------------------------------------------------------- 1 | # 키 2 | 3 | 키 관리에 대해서는 [텐더민트 스펙](https://github.com/tendermint/tendermint/blob/master/docs/spec/blockchain/encoding.md#public-key-cryptography)을 확인하세요. 4 | 5 | `gaiacli keys --help` 명령어를 통해 추가 정보를 얻으실 수 있습니다. 6 | 7 | [테스트넷 투토리얼](https://github.com/cosmos/cosmos-sdk/tree/develop/cmd/gaia/testnets)에서 관련 정보를 확인하실 수 있습니다. 8 | 9 | 참고: 이 문서는 현재 작업중에 있습니다. 10 | -------------------------------------------------------------------------------- /networks/remote/ansible/status.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - hosts: all 4 | connection: local 5 | any_errors_fatal: true 6 | gather_facts: no 7 | 8 | tasks: 9 | - name: Gather status 10 | uri: 11 | body_format: json 12 | url: "http://{{ansible_host}}:26657/status" 13 | register: status 14 | 15 | - name: Print status 16 | debug: var=status.json.result 17 | 18 | -------------------------------------------------------------------------------- /networks/remote/terraform-aws/nodes/outputs.tf: -------------------------------------------------------------------------------- 1 | // The cluster name 2 | output "name" { 3 | value = "${var.name}" 4 | } 5 | 6 | // The list of cluster instance IDs 7 | output "instances" { 8 | value = ["${aws_instance.node.*.id}"] 9 | } 10 | 11 | // The list of cluster instance public IPs 12 | output "public_ips" { 13 | value = ["${aws_instance.node.*.public_ip}"] 14 | } 15 | 16 | -------------------------------------------------------------------------------- /networks/remote/ansible/logzio.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | #Note: You need to add LOGZIO_TOKEN variable with your API key. Like this: ansible-playbook -e LOGZIO_TOKEN=ABCXYZ123456 4 | 5 | - hosts: all 6 | any_errors_fatal: true 7 | gather_facts: no 8 | vars: 9 | - service: gaiad 10 | - JOURNALBEAT_BINARY: "{{lookup('env', 'GOPATH')}}/bin/journalbeat" 11 | roles: 12 | - logzio 13 | 14 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/update-datadog-agent/files/conf.d/http_check.d/conf.yaml: -------------------------------------------------------------------------------- 1 | init_config: 2 | 3 | instances: 4 | - name: gaiad 5 | url: http://localhost:26657/status 6 | timeout: 1 7 | content_match: '"latest_block_height": "0",' 8 | reverse_content_match: true 9 | 10 | - name: gaiacli 11 | url: http://localhost:1317/node_version 12 | timeout: 1 13 | 14 | -------------------------------------------------------------------------------- /networks/remote/terraform-aws/files/terraform.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Script to initialize a testnet settings on a server 3 | 4 | #Usage: terraform.sh 5 | 6 | #Add gaiad node number for remote identification 7 | REGION="$(($2 + 1))" 8 | RNODE="$(($3 + 1))" 9 | ID="$((${REGION} * 100 + ${RNODE}))" 10 | echo "$ID" > /etc/nodeid 11 | 12 | -------------------------------------------------------------------------------- /networks/local/gaiadnode/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.7 2 | MAINTAINER Greg Szabo 3 | 4 | RUN apk update && \ 5 | apk upgrade && \ 6 | apk --no-cache add curl jq file 7 | 8 | VOLUME [ /gaiad ] 9 | WORKDIR /gaiad 10 | EXPOSE 26656 26657 11 | ENTRYPOINT ["/usr/bin/wrapper.sh"] 12 | CMD ["start"] 13 | STOPSIGNAL SIGTERM 14 | 15 | COPY wrapper.sh /usr/bin/wrapper.sh 16 | 17 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/update-datadog-agent/files/conf.d/process.d/conf.yaml: -------------------------------------------------------------------------------- 1 | init_config: 2 | 3 | instances: 4 | - name: ssh 5 | search_string: ['ssh', 'sshd'] 6 | thresholds: 7 | critical: [1, 5] 8 | - name: gaiad 9 | search_string: ['gaiad'] 10 | thresholds: 11 | critical: [1, 1] 12 | - name: gaiacli 13 | search_string: ['gaiacli'] 14 | thresholds: 15 | critical: [1, 1] 16 | -------------------------------------------------------------------------------- /networks/remote/terraform-do/cluster/outputs.tf: -------------------------------------------------------------------------------- 1 | // The cluster name 2 | output "name" { 3 | value = "${var.name}" 4 | } 5 | 6 | // The list of cluster instance IDs 7 | output "instances" { 8 | value = ["${digitalocean_droplet.cluster.*.id}"] 9 | } 10 | 11 | // The list of cluster instance public IPs 12 | output "public_ips" { 13 | value = ["${digitalocean_droplet.cluster.*.ipv4_address}"] 14 | } 15 | 16 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/setup-fullnodes/files/gaiad.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=gaiad 3 | Requires=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Restart=on-failure 8 | User=gaiad 9 | Group=gaiad 10 | PermissionsStartOnly=true 11 | ExecStart=/usr/bin/gaiad start 12 | ExecReload=/bin/kill -HUP $MAINPID 13 | KillSignal=SIGTERM 14 | 15 | [Install] 16 | WantedBy=multi-user.target 17 | 18 | -------------------------------------------------------------------------------- /.golangci.yml: -------------------------------------------------------------------------------- 1 | linters: 2 | disable-all: true 3 | enable: 4 | - errcheck 5 | - golint 6 | - ineffassign 7 | - unconvert 8 | - misspell 9 | linters-settings: 10 | gocyclo: 11 | min-complexity: 11 12 | errcheck: 13 | ignore: fmt:.*,io/ioutil:^Read.*,github.com/spf13/cobra:MarkFlagRequired,github.com/spf13/viper:BindPFlag 14 | golint: 15 | min-confidence: 1.1 16 | run: 17 | tests: false 18 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/setup-validators/files/gaiad.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=gaiad 3 | Requires=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Restart=on-failure 8 | User=gaiad 9 | Group=gaiad 10 | PermissionsStartOnly=true 11 | ExecStart=/usr/bin/gaiad start 12 | ExecReload=/bin/kill -HUP $MAINPID 13 | KillSignal=SIGTERM 14 | 15 | [Install] 16 | WantedBy=multi-user.target 17 | 18 | -------------------------------------------------------------------------------- /networks/upgrade-gaiad.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # upgrade-gaiad - example make call to upgrade gaiad on a set of nodes in AWS 3 | # WARNING: Run it from the current directory - it uses relative paths to ship the binary and the genesis.json,config.toml files 4 | 5 | if [ $# -ne 1 ]; then 6 | echo "Usage: ./upgrade-gaiad.sh " 7 | exit 1 8 | fi 9 | set -eux 10 | 11 | export CLUSTER_NAME=$1 12 | 13 | make upgrade-gaiad 14 | 15 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/extract-config/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Fetch genesis.json 4 | fetch: "src=/home/gaiad/.gaiad/config/genesis.json dest={{GENESISFILE}} flat=yes" 5 | run_once: yes 6 | become: yes 7 | become_user: gaiad 8 | 9 | - name: Fetch config.toml 10 | fetch: "src=/home/gaiad/.gaiad/config/config.toml dest={{CONFIGFILE}} flat=yes" 11 | run_once: yes 12 | become: yes 13 | become_user: gaiad 14 | 15 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/set-debug/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Based on https://www.cyberciti.biz/tips/linux-core-dumps.html 3 | 4 | - name: Copy sysctl and sysconfig files to enable app and daemon core dumps 5 | file: src=. dest=/etc/ 6 | notify: reload sysctl 7 | 8 | - name: Enable debugging for all apps 9 | lineinfile: create=yes line="DAEMON_COREFILE_LIMIT='unlimited'" path=/etc/sysconfig/init regexp=^DAEMON_COREFILE_LIMIT= 10 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/add-lcd/templates/gaiacli.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=gaiacli 3 | Requires=network-online.target 4 | After=network-online.target 5 | 6 | [Service] 7 | Restart=on-failure 8 | User=gaiad 9 | Group=gaiad 10 | PermissionsStartOnly=true 11 | ExecStart=/usr/bin/gaiacli rest-server --laddr {{GAIACLI_ADDRESS}} 12 | ExecReload=/bin/kill -HUP $MAINPID 13 | KillSignal=SIGTERM 14 | 15 | [Install] 16 | WantedBy=multi-user.target 17 | 18 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/logzio/files/journalbeat.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=journalbeat 3 | #propagates activation, deactivation and activation fails. 4 | Requires=network-online.target 5 | After=network-online.target 6 | 7 | [Service] 8 | Restart=on-failure 9 | ExecStart=/usr/bin/journalbeat -c /etc/journalbeat/journalbeat.yml -path.home /usr/share/journalbeat -path.config /etc/journalbeat -path.data /var/lib/journalbeat -path.logs /var/log/journalbeat 10 | Restart=always 11 | 12 | [Install] 13 | WantedBy=multi-user.target 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/translations/cn/README.md: -------------------------------------------------------------------------------- 1 | # gaia文档 2 | 3 | 欢迎阅读`Gaia`文档。 `Gaia`是Cosmos Hub目前的应用程序名。 4 | 5 | ## 加入Cosmos Hub主网 6 | 7 | - [安装`gaia`程序](./installation.md) 8 | - [启动一个全节点并加入主网](./join-mainnet.md) 9 | - [升级成一个验证人节点](./validators/validator-setup.md) 10 | 11 | ## 加入Cosmos Hub公共测试网 12 | 13 | - [加入测试网](./join-testnet.md) 14 | 15 | ## 部署你自己的`gaia`测试网络 16 | 17 | - [部署你自己的`gaia`测试网](./deploy-testnet.md) 18 | 19 | ## 额外资源 20 | 21 | - [验证人介绍](./validators/overview.md) 22 | - [验证人问答](./validators/validator-faq.md) 23 | - [验证人安全性考量](./validators/security.md) 24 | -------------------------------------------------------------------------------- /networks/remote/terraform-app/infra/outputs.tf: -------------------------------------------------------------------------------- 1 | // The cluster name 2 | output "name" { 3 | value = "${var.name}" 4 | } 5 | 6 | // The list of cluster instance IDs 7 | output "instances" { 8 | value = ["${aws_instance.node.*.id}"] 9 | } 10 | 11 | #output "instances_count" { 12 | # value = "${length(aws_instance.node.*)}" 13 | #} 14 | 15 | // The list of cluster instance public IPs 16 | output "public_ips" { 17 | value = ["${aws_instance.node.*.public_ip}"] 18 | } 19 | 20 | // Name of the ALB 21 | output "lb_name" { 22 | value = "${aws_lb.lb.dns_name}" 23 | } 24 | 25 | -------------------------------------------------------------------------------- /contrib/get_node.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | VERSION=v11.15.0 4 | NODE_FULL=node-${VERSION}-linux-x64 5 | 6 | mkdir -p ~/.local/bin 7 | mkdir -p ~/.local/node 8 | wget http://nodejs.org/dist/${VERSION}/${NODE_FULL}.tar.gz -O ~/.local/node/${NODE_FULL}.tar.gz 9 | tar -xzf ~/.local/node/${NODE_FULL}.tar.gz -C ~/.local/node/ 10 | ln -s ~/.local/node/${NODE_FULL}/bin/node ~/.local/bin/node 11 | ln -s ~/.local/node/${NODE_FULL}/bin/npm ~/.local/bin/npm 12 | export PATH=~/.local/bin:$PATH 13 | npm i -g dredd@11.0.1 14 | ln -s ~/.local/node/${NODE_FULL}/bin/dredd ~/.local/bin/dredd 15 | -------------------------------------------------------------------------------- /docs/translations/kr/README.md: -------------------------------------------------------------------------------- 1 | # Gaia Documentation 2 | 3 | `Gaia` docs에 오신 것을 환영합니다. `Gaia` 는 코스모스 허브를 위한 코스모스 애플리케이션의 현재 명칭입니다. 4 | 5 | ## 코스모스 퍼블릭 테스트넷에 참가하세요 6 | 7 | - [`gaia` 애플리케이션 설치하기](./installation.md) 8 | - [풀노드를 세팅하고 현재 퍼블릭 테스트넷 참가하기](./join-testnet.md) 9 | - [벨리데이터 노드로 업그레이드 하기](./validators/validator-setup.md) 10 | 11 | ## 자체 `gaia` 테스트넷 세팅하기 12 | 13 | - [자체 `gaia` 테스트넷 세팅하기](./deploy-testnet.md) 14 | 15 | ## 추가 리소스 16 | 17 | - [밸리데이터에 대한 소개](./validators/overview.md) 18 | - [밸리데이터 FAQ](./validators/validator-faq.md) 19 | - [밸리데이터가 알아야할 보안](./validators/security.md) 20 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/install-datadog-agent/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove old datadog.yaml, if exist 4 | file: path=/etc/datadog-agent/datadog.yaml state=absent 5 | notify: restart datadog-agent 6 | 7 | - name: Download DataDog agent script 8 | get_url: url=https://raw.githubusercontent.com/DataDog/datadog-agent/master/cmd/agent/install_script.sh dest=/tmp/datadog-agent-install.sh mode=0755 9 | 10 | - name: Install DataDog agent 11 | command: "/tmp/datadog-agent-install.sh" 12 | environment: 13 | DD_API_KEY: "{{DD_API_KEY}}" 14 | DD_HOST_TAGS: "testnet:{{TESTNET_NAME}},cluster:{{CLUSTER_NAME}}" 15 | 16 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/increase-openfiles/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Based on: https://stackoverflow.com/questions/38155108/how-to-increase-limit-for-open-processes-and-files-using-ansible 3 | 4 | - name: Set sysctl File Limits 5 | copy: 6 | src: 50-fs.conf 7 | dest: /etc/sysctl.d 8 | 9 | - name: Set Shell File Limits 10 | copy: 11 | src: 91-nofiles.conf 12 | dest: /etc/security/limits.d 13 | 14 | - name: Set gaia filehandle Limits 15 | copy: 16 | src: limits.conf 17 | dest: "/lib/systemd/system/{{item}}.service.d" 18 | notify: reload systemctl 19 | with_items: 20 | - gaiad 21 | - gaiacli 22 | 23 | -------------------------------------------------------------------------------- /docs/translations/cn/what-is-gaia.md: -------------------------------------------------------------------------------- 1 | # Gaia是什么 2 | 3 | `gaia`是作为Cosmos SDK应用程序的Cosmos Hub的名称。它有两个主要的入口: 4 | 5 | + `gaiad` : Gaia的服务进程,运行着`gaia`程序的全节点。 6 | + `gaiacli` : Gaia的命令行界面,用于同一个Gaia的全节点交互。 7 | 8 | `gaia`基于Cosmos SDK构建,使用了如下模块: 9 | 10 | + `x/auth` : 账户和签名 11 | + `x/bank` : token转账 12 | + `x/staking` : 抵押逻辑 13 | + `x/mint` : 增发通胀逻辑 14 | + `x/distribution` : 费用分配逻辑 15 | + `x/slashing` : 处罚逻辑 16 | + `x/gov` : 治理逻辑 17 | + `x/ibc` : 跨链交易 18 | + `x/params` : 处理应用级别的参数 19 | 20 | > 关于Cosmos Hub : Cosmos Hub是第一个在Cosmos Network中上线的枢纽。枢纽的作用是用以跨链转账。如果区块链通过IBC协议连接到枢纽,它会自动获得对其它连接至枢纽的区块链的访问能力。Cosmos Hub是一个公开的PoS区块链。它的权益代币称为Atom。 21 | 22 | 接着,学习如何[安装Gaia](./installation.md) -------------------------------------------------------------------------------- /.codecov.yml: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # This codecov.yml is the default configuration for 4 | # all repositories on Codecov. You may adjust the settings 5 | # below in your own codecov.yml in your repository. 6 | # 7 | coverage: 8 | precision: 2 9 | round: down 10 | range: 70...100 11 | 12 | status: 13 | # Learn more at https://codecov.io/docs#yaml_default_commit_status 14 | project: 15 | default: 16 | threshold: 1% # allow this much decrease on project 17 | changes: false 18 | 19 | comment: 20 | layout: "header, diff" 21 | behavior: default # update if exists else create new 22 | 23 | ignore: 24 | - "docs" 25 | - "*.md" 26 | - "*.rst" 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OS 2 | .DS_Store 3 | *.swp 4 | *.swo 5 | *.swl 6 | *.swm 7 | *.swn 8 | .vscode 9 | .idea 10 | 11 | # Build 12 | vendor 13 | build 14 | tools/bin/* 15 | examples/build/* 16 | docs/_build 17 | docs/tutorial 18 | dist 19 | tools-stamp 20 | 21 | # Data - ideally these don't exist 22 | baseapp/data/* 23 | client/lcd/keys/* 24 | cmd/gaiacli/statik/statik.go 25 | mytestnet 26 | 27 | # Testing 28 | coverage.txt 29 | profile.out 30 | 31 | # Vagrant 32 | .vagrant/ 33 | *.box 34 | *.log 35 | vagrant 36 | 37 | # IDE 38 | .idea/ 39 | *.iml 40 | 41 | # Graphviz 42 | dependency-graph.png 43 | 44 | # Latex 45 | *.aux 46 | *.out 47 | *.synctex.gz 48 | contract_tests/* 49 | -------------------------------------------------------------------------------- /contrib/devtools/install-golangci-lint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | 5 | f_sha256() { 6 | local l_file 7 | l_file=$1 8 | python -sBc "import hashlib;print(hashlib.sha256(open('$l_file','rb').read()).hexdigest())" 9 | } 10 | 11 | installer="$(mktemp)" 12 | trap "rm -f ${installer}" EXIT 13 | 14 | GOBIN="${1}" 15 | VERSION="${2}" 16 | HASHSUM="${3}" 17 | CURL="$(which curl)" 18 | 19 | echo "Downloading golangci-lint ${VERSION} installer ..." >&2 20 | "${CURL}" -sfL "https://raw.githubusercontent.com/golangci/golangci-lint/${VERSION}/install.sh" > "${installer}" 21 | 22 | echo "Checking hashsum ..." >&2 23 | [ "${HASHSUM}" = "$(f_sha256 ${installer})" ] 24 | chmod +x "${installer}" 25 | 26 | echo "Launching installer ..." >&2 27 | exec "${installer}" -d -b "${GOBIN}" "${VERSION}" 28 | -------------------------------------------------------------------------------- /networks/remote/terraform-do/cluster/variables.tf: -------------------------------------------------------------------------------- 1 | variable "name" { 2 | description = "The cluster name, e.g remotenet" 3 | } 4 | 5 | variable "regions" { 6 | description = "Regions to launch in" 7 | type = "list" 8 | default = ["AMS2", "TOR1", "LON1", "NYC3", "SFO2", "SGP1", "FRA1"] 9 | } 10 | 11 | variable "ssh_private_file" { 12 | description = "SSH private key filename to use to connect to the nodes" 13 | type = "string" 14 | } 15 | 16 | variable "ssh_public_file" { 17 | description = "SSH public key filename to copy to the nodes" 18 | type = "string" 19 | } 20 | 21 | variable "instance_size" { 22 | description = "The instance size to use" 23 | default = "2gb" 24 | } 25 | 26 | variable "servers" { 27 | description = "Desired instance count" 28 | default = 4 29 | } 30 | 31 | -------------------------------------------------------------------------------- /docs/translations/kr/what-is-gaia.md: -------------------------------------------------------------------------------- 1 | # Gaia는 무엇인가요? 2 | 3 | 가이아(`gaia`)는 코스모스 허브의 코스모스 SDK 애플리케이션의 이름입니다. 가이아는 두개의 엔트리 포인트로 구성돼있습니다: 4 | 5 | - `gaiad`: 가이아 데몬, `gaia` 애플리케이션의 풀노드를 운영합니다. 6 | - `gaiacli`: 가이아 커맨드 라인 인터페이스는 유저가 가이아 풀노드와 소통할 수 있게 합니다. 7 | 8 | `gaia`는 코스모스 SDK의 다음 모듈들을 이용해 제작되었습니다: 9 | 10 | - `x/auth`: 계정 및 서명 11 | - `x/bank`: 토큰 전송 12 | - `x/staking`: 스테이킹 로직 13 | - `x/mint`: 인플레이션 로직 14 | - `x/distribution`: 수수료(보상) 분배 로직(fee distribution logic) 15 | - `x/slashing`: 슬래싱 로직 16 | - `x/gov`: 거버넌스 로직 17 | - `x/ibc`: 인터블록체인 전송 18 | - `x/params`: 앱레벨 파라미터 관리 19 | 20 | 21 | 22 | >코스모스 허브에 대해서: 코스모스 허브는 코스모스 네트워크의 최초 허브입니다. 허브는 블록체인 간 전송을 수행하는 역할을 합니다. IBC를 통해 특정 허브에 연결된 블록체인은 해당 허브에 연결되어있는 모든 블록체인과 함께 연결됩니다. 코스모스 허브는 지분증명 기반 퍼블릭 블록체인이며, 고유 토큰은 아톰(Atom)입니다. 다음은 Gaia를 [설치하는 방법](./installation.md)을 알아보겠습니다. -------------------------------------------------------------------------------- /dredd.yml: -------------------------------------------------------------------------------- 1 | color: true 2 | dry-run: null 3 | hookfiles: build/contract_tests 4 | language: go 5 | require: null 6 | server: make run-lcd-contract-tests 7 | server-wait: 5 8 | init: false 9 | custom: {} 10 | names: false 11 | only: [] 12 | reporter: [] 13 | output: [] 14 | header: [] 15 | sorted: false 16 | user: null 17 | inline-errors: false 18 | details: false 19 | method: [GET] 20 | loglevel: warning 21 | path: [] 22 | hooks-worker-timeout: 5000 23 | hooks-worker-connect-timeout: 1500 24 | hooks-worker-connect-retry: 500 25 | hooks-worker-after-connect-wait: 100 26 | hooks-worker-term-timeout: 5000 27 | hooks-worker-term-retry: 500 28 | hooks-worker-handler-host: 127.0.0.1 29 | hooks-worker-handler-port: 61321 30 | config: ./dredd.yml 31 | # This path accepts no variables 32 | blueprint: /tmp/contract_tests/swagger.yaml 33 | endpoint: 'http://127.0.0.1:8080' 34 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/upgrade-gaiad/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Copy binary 4 | copy: 5 | src: "{{BINARY}}" 6 | dest: /usr/bin/gaiad 7 | mode: 0755 8 | notify: restart gaiad 9 | 10 | - name: Copy new genesis.json file, if available 11 | when: "GENESISFILE is defined and GENESISFILE != ''" 12 | copy: 13 | src: "{{GENESISFILE}}" 14 | dest: /home/gaiad/.gaiad/config/genesis.json 15 | notify: restart gaiad 16 | 17 | - name: Download genesis.json URL, if available 18 | when: "GENESISURL is defined and GENESISURL != ''" 19 | get_url: 20 | url: "{{GENESISURL}}" 21 | dest: /home/gaiad/.gaiad/config/genesis.json 22 | force: yes 23 | notify: restart gaiad 24 | 25 | - name: Reset network 26 | when: UNSAFE_RESET_ALL | default(false) | bool 27 | command: "sudo -u gaiad gaiad unsafe-reset-all" 28 | notify: restart gaiad 29 | 30 | -------------------------------------------------------------------------------- /app/utils.go: -------------------------------------------------------------------------------- 1 | //nolint 2 | package app 3 | 4 | import ( 5 | "io" 6 | 7 | dbm "github.com/tendermint/tendermint/libs/db" 8 | "github.com/tendermint/tendermint/libs/log" 9 | 10 | bam "github.com/cosmos/cosmos-sdk/baseapp" 11 | sdk "github.com/cosmos/cosmos-sdk/types" 12 | "github.com/cosmos/cosmos-sdk/x/staking" 13 | ) 14 | 15 | // DONTCOVER 16 | 17 | // NewGaiaAppUNSAFE is used for debugging purposes only. 18 | // 19 | // NOTE: to not use this function with non-test code 20 | func NewGaiaAppUNSAFE(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, 21 | invCheckPeriod uint, baseAppOptions ...func(*bam.BaseApp), 22 | ) (gapp *GaiaApp, keyMain, keyStaking *sdk.KVStoreKey, stakingKeeper staking.Keeper) { 23 | 24 | gapp = NewGaiaApp(logger, db, traceStore, loadLatest, invCheckPeriod, baseAppOptions...) 25 | return gapp, gapp.keyMain, gapp.keyStaking, gapp.stakingKeeper 26 | } 27 | -------------------------------------------------------------------------------- /networks/add-cluster.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # add-cluster - example make call to add a set of nodes to an existing testnet in AWS 3 | # WARNING: Run it from the current directory - it uses relative paths to ship the binary and the genesis.json,config.toml files 4 | 5 | if [ $# -ne 4 ]; then 6 | echo "Usage: ./add-cluster.sh " 7 | exit 1 8 | fi 9 | set -eux 10 | 11 | # The testnet name is the same on all nodes 12 | export TESTNET_NAME=$1 13 | export CLUSTER_NAME=$2 14 | export REGION_LIMIT=$3 15 | export SERVERS=$4 16 | 17 | # Build the AWS full nodes 18 | rm -rf remote/ansible/keys 19 | make fullnodes-start 20 | 21 | # Save the private key seed words from the nodes 22 | SEEDFOLDER="${TESTNET_NAME}-${CLUSTER_NAME}-seedwords" 23 | mkdir -p "${SEEDFOLDER}" 24 | test ! -f "${SEEDFOLDER}/node0" && mv remote/ansible/keys/* "${SEEDFOLDER}" 25 | 26 | -------------------------------------------------------------------------------- /contrib/localnet-blocks-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CNT=0 4 | ITER=$1 5 | SLEEP=$2 6 | NUMBLOCKS=$3 7 | NODEADDR=$4 8 | 9 | if [ -z "$1" ]; then 10 | echo "Need to input number of iterations to run..." 11 | exit 1 12 | fi 13 | 14 | if [ -z "$2" ]; then 15 | echo "Need to input number of seconds to sleep between iterations" 16 | exit 1 17 | fi 18 | 19 | if [ -z "$3" ]; then 20 | echo "Need to input block height to declare completion..." 21 | exit 1 22 | fi 23 | 24 | if [ -z "$4" ]; then 25 | echo "Need to input node address to poll..." 26 | exit 1 27 | fi 28 | 29 | while [ ${CNT} -lt $ITER ]; do 30 | var=$(curl -s $NODEADDR:26657/status | jq -r '.result.sync_info.latest_block_height') 31 | echo "Number of Blocks: ${var}" 32 | if [ ! -z ${var} ] && [ ${var} -gt ${NUMBLOCKS} ]; then 33 | echo "Number of blocks reached, exiting success..." 34 | exit 0 35 | fi 36 | let CNT=CNT+1 37 | sleep $SLEEP 38 | done 39 | 40 | echo "Timeout reached, exiting failure..." 41 | exit 1 42 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Create a report to help us squash bugs! 4 | 5 | --- 6 | 7 | 12 | 13 | ## Summary of Bug 14 | 15 | 16 | 17 | ## Version 18 | 19 | 20 | 21 | ## Steps to Reproduce 22 | 23 | 24 | 25 | ____ 26 | 27 | #### For Admin Use 28 | 29 | - [ ] Not duplicate issue 30 | - [ ] Appropriate labels applied 31 | - [ ] Appropriate contributors tagged 32 | - [ ] Contributor assigned/self-assigned 33 | -------------------------------------------------------------------------------- /networks/local/gaiadnode/wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ## 4 | ## Input parameters 5 | ## 6 | BINARY=/gaiad/${BINARY:-gaiad} 7 | ID=${ID:-0} 8 | LOG=${LOG:-gaiad.log} 9 | 10 | ## 11 | ## Assert linux binary 12 | ## 13 | if ! [ -f "${BINARY}" ]; then 14 | echo "The binary $(basename "${BINARY}") cannot be found. Please add the binary to the shared folder. Please use the BINARY environment variable if the name of the binary is not 'gaiad' E.g.: -e BINARY=gaiad_my_test_version" 15 | exit 1 16 | fi 17 | BINARY_CHECK="$(file "$BINARY" | grep 'ELF 64-bit LSB executable, x86-64')" 18 | if [ -z "${BINARY_CHECK}" ]; then 19 | echo "Binary needs to be OS linux, ARCH amd64" 20 | exit 1 21 | fi 22 | 23 | ## 24 | ## Run binary with all parameters 25 | ## 26 | export GAIADHOME="/gaiad/node${ID}/gaiad" 27 | 28 | if [ -d "`dirname ${GAIADHOME}/${LOG}`" ]; then 29 | "$BINARY" --home "$GAIADHOME" "$@" | tee "${GAIADHOME}/${LOG}" 30 | else 31 | "$BINARY" --home "$GAIADHOME" "$@" 32 | fi 33 | 34 | chmod 777 -R /gaiad 35 | 36 | -------------------------------------------------------------------------------- /networks/remote/terraform-app/infra/variables.tf: -------------------------------------------------------------------------------- 1 | variable "name" { 2 | description = "The testnet name, e.g cdn" 3 | } 4 | 5 | variable "image_name" { 6 | description = "Image name" 7 | default = "CentOS Linux 7 x86_64 HVM EBS 1704_01" 8 | } 9 | 10 | variable "instance_type" { 11 | description = "The instance size to use" 12 | default = "t2.small" 13 | } 14 | 15 | variable "SERVERS" { 16 | description = "Number of servers in an availability zone" 17 | default = "1" 18 | } 19 | 20 | variable "max_zones" { 21 | description = "Maximum number of availability zones to use" 22 | default = "1" 23 | } 24 | 25 | variable "ssh_private_file" { 26 | description = "SSH private key file to be used to connect to the nodes" 27 | type = "string" 28 | } 29 | 30 | variable "ssh_public_file" { 31 | description = "SSH public key file to be used on the nodes" 32 | type = "string" 33 | } 34 | 35 | variable "certificate_arn" { 36 | description = "Load-balancer SSL certificate AWS ARN" 37 | type = "string" 38 | } 39 | 40 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/logzio/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Copy journalbeat binary 4 | copy: src="{{JOURNALBEAT_BINARY}}" dest=/usr/bin/journalbeat mode=0755 5 | notify: restart journalbeat 6 | 7 | - name: Create folders 8 | file: "path={{item}} state=directory recurse=yes" 9 | with_items: 10 | - /etc/journalbeat 11 | - /etc/pki/tls/certs 12 | - /usr/share/journalbeat 13 | - /var/log/journalbeat 14 | 15 | - name: Copy journalbeat config 16 | template: src=journalbeat.yml.j2 dest=/etc/journalbeat/journalbeat.yml mode=0600 17 | notify: restart journalbeat 18 | 19 | - name: Get server certificate for Logz.io 20 | get_url: "url=https://raw.githubusercontent.com/logzio/public-certificates/master/COMODORSADomainValidationSecureServerCA.crt force=yes dest=/etc/pki/tls/certs/COMODORSADomainValidationSecureServerCA.crt" 21 | 22 | - name: Copy journalbeat service config 23 | copy: src=journalbeat.service dest=/etc/systemd/system/journalbeat.service 24 | notify: 25 | - reload daemon 26 | - restart journalbeat 27 | 28 | -------------------------------------------------------------------------------- /networks/remote/terraform-aws/nodes/variables.tf: -------------------------------------------------------------------------------- 1 | variable "name" { 2 | description = "The testnet name, e.g cdn" 3 | } 4 | 5 | variable "image_name" { 6 | description = "Image name" 7 | default = "CentOS Linux 7 x86_64 HVM EBS 1704_01" 8 | } 9 | 10 | variable "instance_type" { 11 | description = "The instance size to use" 12 | default = "t2.small" 13 | } 14 | 15 | variable "region" { 16 | description = "AWS region to use" 17 | } 18 | 19 | variable "multiplier" { 20 | description = "Multiplier for node identification" 21 | } 22 | 23 | variable "execute" { 24 | description = "Set to false to disable the module" 25 | default = true 26 | } 27 | 28 | variable "SERVERS" { 29 | description = "Number of servers in an availability zone" 30 | default = "1" 31 | } 32 | 33 | variable "ssh_private_file" { 34 | description = "SSH private key file to be used to connect to the nodes" 35 | type = "string" 36 | } 37 | 38 | variable "ssh_public_file" { 39 | description = "SSH public key file to be used on the nodes" 40 | type = "string" 41 | } 42 | 43 | -------------------------------------------------------------------------------- /contrib/gitian-keys/README.md: -------------------------------------------------------------------------------- 1 | ## PGP keys of Gitian builders and Gaia Developers 2 | 3 | The file `keys.txt` contains fingerprints of the public keys of Gitian builders 4 | and active developers. 5 | 6 | The associated keys are mainly used to sign git commits or the build results 7 | of Gitian builds. 8 | 9 | The most recent version of each pgp key can be found on most PGP key servers. 10 | 11 | Fetch the latest version from the key server to see if any key was revoked in 12 | the meantime. 13 | To fetch the latest version of all pgp keys in your gpg homedir, 14 | 15 | ```sh 16 | gpg --refresh-keys 17 | ``` 18 | 19 | To fetch keys of Gitian builders and active core developers, feed the list of 20 | fingerprints of the primary keys into gpg: 21 | 22 | ```sh 23 | while read fingerprint keyholder_name; \ 24 | do gpg --keyserver hkp://subset.pool.sks-keyservers.net \ 25 | --recv-keys ${fingerprint}; done < ./keys.txt 26 | ``` 27 | 28 | Add your key to the list if you are a Gaia core developer or you have 29 | provided Gitian signatures for two major or minor releases of Gaia. 30 | -------------------------------------------------------------------------------- /networks/remote/terraform-do/cluster/main.tf: -------------------------------------------------------------------------------- 1 | resource "digitalocean_tag" "cluster" { 2 | name = "${var.name}" 3 | } 4 | 5 | resource "digitalocean_ssh_key" "cluster" { 6 | name = "${var.name}" 7 | public_key = "${file(var.ssh_public_file)}" 8 | } 9 | 10 | resource "digitalocean_droplet" "cluster" { 11 | name = "${var.name}-node${count.index}" 12 | image = "centos-7-x64" 13 | size = "${var.instance_size}" 14 | region = "${element(var.regions, count.index)}" 15 | ssh_keys = ["${digitalocean_ssh_key.cluster.id}"] 16 | count = "${var.servers}" 17 | tags = ["${digitalocean_tag.cluster.id}"] 18 | 19 | lifecycle = { 20 | prevent_destroy = false 21 | } 22 | 23 | connection { 24 | private_key = "${file(var.ssh_private_file)}" 25 | } 26 | 27 | provisioner "file" { 28 | source = "files/terraform.sh" 29 | destination = "/tmp/terraform.sh" 30 | } 31 | 32 | provisioner "remote-exec" { 33 | inline = [ 34 | "chmod +x /tmp/terraform.sh", 35 | "/tmp/terraform.sh ${var.name} ${count.index}", 36 | ] 37 | } 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /networks/remote/terraform-do/main.tf: -------------------------------------------------------------------------------- 1 | #Terraform Configuration 2 | 3 | variable "DO_API_TOKEN" { 4 | description = "DigitalOcean Access Token" 5 | } 6 | 7 | variable "TESTNET_NAME" { 8 | description = "Name of the testnet" 9 | default = "remotenet" 10 | } 11 | 12 | variable "SSH_PRIVATE_FILE" { 13 | description = "SSH private key file to be used to connect to the nodes" 14 | type = "string" 15 | } 16 | 17 | variable "SSH_PUBLIC_FILE" { 18 | description = "SSH public key file to be used on the nodes" 19 | type = "string" 20 | } 21 | 22 | variable "SERVERS" { 23 | description = "Number of nodes in testnet" 24 | default = "4" 25 | } 26 | 27 | provider "digitalocean" { 28 | token = "${var.DO_API_TOKEN}" 29 | } 30 | 31 | module "cluster" { 32 | source = "./cluster" 33 | name = "${var.TESTNET_NAME}" 34 | ssh_private_file = "${var.SSH_PRIVATE_FILE}" 35 | ssh_public_file = "${var.SSH_PUBLIC_FILE}" 36 | servers = "${var.SERVERS}" 37 | } 38 | 39 | 40 | output "public_ips" { 41 | value = "${module.cluster.public_ips}" 42 | } 43 | 44 | -------------------------------------------------------------------------------- /networks/remote/ansible/inventory/digital_ocean.ini: -------------------------------------------------------------------------------- 1 | # Ansible DigitalOcean external inventory script settings 2 | # 3 | 4 | [digital_ocean] 5 | 6 | # The module needs your DigitalOcean API Token. 7 | # It may also be specified on the command line via --api-token 8 | # or via the environment variables DO_API_TOKEN or DO_API_KEY 9 | # 10 | #api_token = 123456abcdefg 11 | 12 | 13 | # API calls to DigitalOcean may be slow. For this reason, we cache the results 14 | # of an API call. Set this to the path you want cache files to be written to. 15 | # One file will be written to this directory: 16 | # - ansible-digital_ocean.cache 17 | # 18 | cache_path = /tmp 19 | 20 | 21 | # The number of seconds a cache file is considered valid. After this many 22 | # seconds, a new API call will be made, and the cache file will be updated. 23 | # 24 | cache_max_age = 300 25 | 26 | # Use the private network IP address instead of the public when available. 27 | # 28 | use_private_network = False 29 | 30 | # Pass variables to every group, e.g.: 31 | # 32 | # group_variables = { 'ansible_user': 'root' } 33 | # 34 | group_variables = {} 35 | -------------------------------------------------------------------------------- /networks/new-testnet.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # new-testnet - example make call to create a new set of validator nodes in AWS 3 | # WARNING: Run it from the current directory - it uses relative paths to ship the binary 4 | 5 | if [ $# -ne 4 ]; then 6 | echo "Usage: ./new-testnet.sh " 7 | exit 1 8 | fi 9 | set -eux 10 | 11 | if [ -z "`file ../build/gaiad | grep 'ELF 64-bit'`" ]; then 12 | # Build the linux binary we're going to ship to the nodes 13 | make -C .. build-linux 14 | fi 15 | 16 | # The testnet name is the same on all nodes 17 | export TESTNET_NAME=$1 18 | export CLUSTER_NAME=$2 19 | export REGION_LIMIT=$3 20 | export SERVERS=$4 21 | 22 | # Build the AWS validator nodes and extract the genesis.json and config.toml from one of them 23 | rm -rf remote/ansible/keys 24 | make validators-start extract-config 25 | 26 | # Save the private key seed words from the validators 27 | SEEDFOLDER="${TESTNET_NAME}-${CLUSTER_NAME}-seedwords" 28 | mkdir -p "${SEEDFOLDER}" 29 | test ! -f "${SEEDFOLDER}/node0" && mv remote/ansible/keys/* "${SEEDFOLDER}" 30 | 31 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/setup-journald/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Disable journald rate-limiting 4 | lineinfile: "dest=/etc/systemd/journald.conf regexp={{item.regexp}} line='{{item.line}}'" 5 | with_items: 6 | - { regexp: "^#RateLimitInterval", line: "RateLimitInterval=0s" } 7 | - { regexp: "^#RateLimitBurst", line: "RateLimitBurst=0" } 8 | - { regexp: "^#SystemMaxFileSize", line: "SystemMaxFileSize=100M" } 9 | - { regexp: "^#SystemMaxUse", line: "SystemMaxUse=500M" } 10 | - { regexp: "^#SystemMaxFiles", line: "SystemMaxFiles=10" } 11 | notify: restart journald 12 | 13 | - name: Change logrotate to daily 14 | lineinfile: "dest=/etc/logrotate.conf regexp={{item.regexp}} line='{{item.line}}'" 15 | with_items: 16 | - { regexp: "^weekly", line: "daily" } 17 | - { regexp: "^#compress", line: "compress" } 18 | 19 | - name: Create journal directory for permanent logs 20 | file: path=/var/log/journal state=directory 21 | notify: restart journald 22 | 23 | - name: Set journal folder with systemd-tmpfiles 24 | command: "systemd-tmpfiles --create --prefix /var/log/journal" 25 | notify: restart journald 26 | 27 | -------------------------------------------------------------------------------- /cmd/gaiadebug/README.md: -------------------------------------------------------------------------------- 1 | # Gaiadebug 2 | 3 | Simple tool for simple debugging. 4 | 5 | We try to accept both hex and base64 formats and provide a useful response. 6 | 7 | Note we often encode bytes as hex in the logs, but as base64 in the JSON. 8 | 9 | ## Pubkeys 10 | 11 | The following give the same result: 12 | 13 | ``` 14 | gaiadebug pubkey TZTQnfqOsi89SeoXVnIw+tnFJnr4X8qVC0U8AsEmFk4= 15 | gaiadebug pubkey 4D94D09DFA8EB22F3D49EA17567230FAD9C5267AF85FCA950B453C02C126164E 16 | ``` 17 | 18 | ## Txs 19 | 20 | Pass in a hex/base64 tx and get back the full JSON 21 | 22 | ``` 23 | gaiadebug tx 24 | ``` 25 | 26 | ## Hack 27 | 28 | This is a command with boilerplate for using Go as a scripting language to hack 29 | on an existing Gaia state. 30 | 31 | Currently we have an example for the state of gaia-6001 after it 32 | [crashed](https://github.com/cosmos/cosmos-sdk/blob/master/cmd/gaia/testnets/STATUS.md#june-13-2018-230-est---published-postmortem-of-gaia-6001-failure). 33 | If you run `gaiadebug hack $HOME/.gaiad` on that 34 | state, it will do a binary search on the state history to find when the state 35 | invariant was violated. 36 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | - Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/gaia/blob/develop/CONTRIBUTING.md#pr-targeting)) 8 | 9 | - [ ] Linked to github-issue with discussion and accepted design OR link to spec that describes this work. 10 | - [ ] Wrote tests 11 | - [ ] Updated relevant documentation (`docs/`) 12 | - [ ] Added a relevant changelog entry: `clog add [section] [stanza] [message]` 13 | - [ ] Reviewed `Files changed` in the github PR explorer 14 | 15 | ______ 16 | 17 | For Admin Use: 18 | - Added appropriate labels to PR (ex. wip, ready-for-review, docs) 19 | - Reviewers Assigned 20 | - Squashed all commits, uses message "Merge PR #XYZ: [title]" ([coding standards](https://github.com/tendermint/coding/blob/master/README.md#merging-a-pr)) 21 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Cosmos Hub Documentation 2 | 3 | Welcome to the documentation of the **Cosmos Hub application: `gaia`**. 4 | 5 | ## What is Gaia? 6 | 7 | - [Gaia](./what-is-gaia.md) 8 | 9 | ## Join the Cosmos Hub Mainnet 10 | 11 | - [Install the `gaia` application](./installation.md) 12 | - [Set up a full node and join the mainnet](./join-mainnet.md) 13 | - [Upgrade to a validator node](./validators/validator-setup.md) 14 | 15 | ## Join the Cosmos Hub Public Testnet 16 | 17 | - [Join the testnet](./join-testnet.md) 18 | 19 | ## Setup Your Own `gaia` Testnet 20 | 21 | - [Setup your own `gaia` testnet](./deploy-testnet.md) 22 | 23 | ## Additional Resources 24 | 25 | - [Intro to validators](./validators/overview.md) 26 | - [Validator FAQ](./validators/validator-faq.md) 27 | - [Validator security considerations](./validators/security.md) 28 | - [Reproducible builds](./reproducible-builds.md) 29 | 30 | # Contribute 31 | 32 | See [this file](https://github.com/cosmos/gaia/blob/master/docs/DOCS_README.md) for details of the build process and 33 | considerations when making changes. 34 | 35 | # Version 36 | 37 | This documentation is built from the following commit: 38 | -------------------------------------------------------------------------------- /networks/remote/terraform-app/infra/lcd.tf: -------------------------------------------------------------------------------- 1 | resource "aws_lb_listener" "lb_listener_lcd" { 2 | load_balancer_arn = "${aws_lb.lb.arn}" 3 | port = "1317" 4 | protocol = "HTTPS" 5 | ssl_policy = "ELBSecurityPolicy-TLS-1-2-Ext-2018-06" 6 | certificate_arn = "${var.certificate_arn}" 7 | 8 | default_action { 9 | target_group_arn = "${aws_lb_target_group.lb_target_group_lcd.arn}" 10 | type = "forward" 11 | } 12 | } 13 | 14 | resource "aws_lb_listener_rule" "listener_rule_lcd" { 15 | listener_arn = "${aws_lb_listener.lb_listener_lcd.arn}" 16 | priority = "100" 17 | action { 18 | type = "forward" 19 | target_group_arn = "${aws_lb_target_group.lb_target_group_lcd.id}" 20 | } 21 | condition { 22 | field = "path-pattern" 23 | values = ["/"] 24 | } 25 | } 26 | 27 | resource "aws_lb_target_group" "lb_target_group_lcd" { 28 | name = "${var.name}lcd" 29 | port = "1317" 30 | protocol = "HTTP" 31 | vpc_id = "${aws_vpc.vpc.id}" 32 | tags { 33 | name = "${var.name}" 34 | } 35 | health_check { 36 | path = "/node_version" 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Simple usage with a mounted data directory: 2 | # > docker build -t gaia . 3 | # > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.gaiad:/root/.gaiad -v ~/.gaiacli:/root/.gaiacli gaia gaiad init 4 | # > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.gaiad:/root/.gaiad -v ~/.gaiacli:/root/.gaiacli gaia gaiad start 5 | FROM golang:alpine AS build-env 6 | 7 | # Set up dependencies 8 | ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python 9 | 10 | # Set working directory for the build 11 | WORKDIR /go/src/github.com/cosmos/gaia 12 | 13 | # Add source files 14 | COPY . . 15 | 16 | # Install minimum necessary dependencies, build Cosmos SDK, remove packages 17 | RUN apk add --no-cache $PACKAGES && \ 18 | make tools && \ 19 | make install 20 | 21 | # Final image 22 | FROM alpine:edge 23 | 24 | # Install ca-certificates 25 | RUN apk add --update ca-certificates 26 | WORKDIR /root 27 | 28 | # Copy over binaries from the build-env 29 | COPY --from=build-env /go/bin/gaiad /usr/bin/gaiad 30 | COPY --from=build-env /go/bin/gaiacli /usr/bin/gaiacli 31 | 32 | # Run gaiad by default, omit entrypoint to ease using container with gaiacli 33 | CMD ["gaiad"] 34 | -------------------------------------------------------------------------------- /docs/what-is-gaia.md: -------------------------------------------------------------------------------- 1 | # What is Gaia? 2 | 3 | `gaia` is the name of the Cosmos SDK application for the Cosmos Hub. It comes with 2 main entrypoints: 4 | 5 | - `gaiad`: The Gaia Daemon, runs a full-node of the `gaia` application. 6 | - `gaiacli`: The Gaia command-line interface, which enables interaction with a Gaia full-node. 7 | 8 | `gaia` is built on the Cosmos SDK using the following modules: 9 | 10 | - `x/auth`: Accounts and signatures. 11 | - `x/bank`: Token transfers. 12 | - `x/staking`: Staking logic. 13 | - `x/mint`: Inflation logic. 14 | - `x/distribution`: Fee distribution logic. 15 | - `x/slashing`: Slashing logic. 16 | - `x/gov`: Governance logic. 17 | - `x/ibc`: Inter-blockchain transfers. 18 | - `x/params`: Handles app-level parameters. 19 | 20 | >About the Cosmos Hub: The Cosmos Hub is the first Hub to be launched in the Cosmos Network. The role of a Hub is to facilitate transfers between blockchains. If a blockchain connects to a Hub via IBC, it automatically gains access to all the other blockchains that are connected to it. The Cosmos Hub is a public Proof-of-Stake chain. Its staking token is called the Atom. 21 | 22 | Next, learn how to [install Gaia](./installation.md). 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Create a proposal to request a feature 4 | 5 | --- 6 | 7 | 13 | 14 | ## Summary 15 | 16 | 17 | 18 | ## Problem Definition 19 | 20 | 24 | 25 | ## Proposal 26 | 27 | 28 | 29 | ____ 30 | 31 | #### For Admin Use 32 | 33 | - [ ] Not duplicate issue 34 | - [ ] Appropriate labels applied 35 | - [ ] Appropriate contributors tagged 36 | - [ ] Contributor assigned/self-assigned 37 | -------------------------------------------------------------------------------- /networks/remote/terraform-app/infra/attachment.tf: -------------------------------------------------------------------------------- 1 | # This is the reason why we can't separate nodes and load balancer creation into different modules. 2 | # https://github.com/hashicorp/terraform/issues/10857 3 | # In short: the list of instances coming from the nodes module is a generated variable 4 | # and it should be the input for the load-balancer generation. However when attaching the instances 5 | # to the load-balancer, aws_lb_target_group_attachment.count cannot be a generated value. 6 | 7 | #Instance Attachment (autoscaling is the future) 8 | resource "aws_lb_target_group_attachment" "lb_attach" { 9 | count = "${var.SERVERS*min(length(data.aws_availability_zones.zones.names),var.max_zones)}" 10 | target_group_arn = "${aws_lb_target_group.lb_target_group.arn}" 11 | target_id = "${element(aws_instance.node.*.id,count.index)}" 12 | port = 26657 13 | } 14 | 15 | resource "aws_lb_target_group_attachment" "lb_attach_lcd" { 16 | count = "${var.SERVERS*min(length(data.aws_availability_zones.zones.names),var.max_zones)}" 17 | target_group_arn = "${aws_lb_target_group.lb_target_group_lcd.arn}" 18 | target_id = "${element(aws_instance.node.*.id,count.index)}" 19 | port = 1317 20 | } 21 | 22 | -------------------------------------------------------------------------------- /docs/translations/cn/validators/overview.md: -------------------------------------------------------------------------------- 1 | # 验证人概览 2 | 3 | ## 介绍 4 | 5 | Cosmos Hub基于Tendermint,它依赖于一组负责在区块链中提交新区块的验证人。这些验证人通过广播投票来参与共识协议,投票包含由每个验证人的私钥签名的加密签名。 6 | 7 | 验证人候选者可以绑定他们自己的Atoms=,还能让token持有者将Atoms=“委托”或“抵押”给他们。Cosmos Hub将有100个验证人,但随着时间的推移,将根据预定义的时间表增加到300个验证人。验证人根据谁拥有最多的投票权来确定——拥有最多股权的前100名验证人候选者将成为Cosmos的验证人。 8 | 9 | 验证人及其委托人能通过执行Tendermint共识协议赚取Atom作为区块增发奖励和作为交易手续费的其他token。最初,交易费用将以Atom支付,但在将来,Cosmos生态中的任何token如果通过治理加入到白名单中,就能作为有效的交易手续费。请注意,验证人可以设置从他们的委托人身上收取的佣金作为额外奖励。 10 | 11 | 如果验证人双签,频繁下线或不参与治理,则可以削减其抵押的Atom(包括那些用户委托给他们的Atom)。处罚取决于违规的严重程度。 12 | 13 | 14 | ## 硬件 15 | 16 | 目前还没有合适的针对验证人密钥管理的云解决方案。这可能会等到2018年云解决方案SGX变得更加普及时才会有所改善。由于这个原因,验证人必须设置一个受限访问的物理操作。例如,安置在安全的数据中心。 17 | 18 | 验证人期望为他们的数据中心装备充足的电力,带宽及存储备份。期望有数个充足的对应光纤,防火墙还有路由的需求的网络设备,一台有着足够硬盘和容错能力的小型服务器。硬件可以先从低端的数据中心配置开始。 19 | 20 | 我们预计最初的网络需求是比较低的。当前的测试网络只需要极小的资源。之后,带宽,CPU和内存的需求将会随着网络的发展而增长。要存储数年区块链的历史信息的话,推荐配置足够大的的硬盘。 21 | 22 | 23 | ## 创建一个网站 24 | 25 | 建立一个专门的用以显示验证人信息网站,并在我们的[论坛](https://forum.cosmos.network/t/validator-candidates/127/3)上表明您想成为验证人的意图。这非常重要,因为委托人希望获得关于他们予以Atom委托的验证人的信息。 26 | 27 | 28 | ## 寻求法律建议 29 | 30 | 如果您打算成为一个验证人,请寻求法律建议 31 | 32 | 33 | ## 社区 34 | 35 | 在我们的社区聊天频道和论坛上讨论有关成为验证人的更多细节: 36 | 37 | + [Validator Chat](https://riot.im/app/#/room/#cosmos_validators:matrix.org) 38 | + [Validator Forum](https://forum.cosmos.network/c/validating) -------------------------------------------------------------------------------- /app/app_test.go: -------------------------------------------------------------------------------- 1 | package app 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/stretchr/testify/require" 8 | "github.com/tendermint/tendermint/libs/db" 9 | "github.com/tendermint/tendermint/libs/log" 10 | 11 | "github.com/cosmos/cosmos-sdk/codec" 12 | "github.com/cosmos/cosmos-sdk/simapp" 13 | 14 | abci "github.com/tendermint/tendermint/abci/types" 15 | ) 16 | 17 | func TestGaiadExport(t *testing.T) { 18 | db := db.NewMemDB() 19 | gapp := NewGaiaApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, 0) 20 | setGenesis(gapp) 21 | 22 | // Making a new app object with the db, so that initchain hasn't been called 23 | newGapp := NewGaiaApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, 0) 24 | _, _, err := newGapp.ExportAppStateAndValidators(false, []string{}) 25 | require.NoError(t, err, "ExportAppStateAndValidators should not have an error") 26 | } 27 | 28 | func setGenesis(gapp *GaiaApp) error { 29 | 30 | genesisState := simapp.NewDefaultGenesisState() 31 | stateBytes, err := codec.MarshalJSONIndent(gapp.cdc, genesisState) 32 | if err != nil { 33 | return err 34 | } 35 | 36 | // Initialize the chain 37 | gapp.InitChain( 38 | abci.RequestInitChain{ 39 | Validators: []abci.ValidatorUpdate{}, 40 | AppStateBytes: stateBytes, 41 | }, 42 | ) 43 | gapp.Commit() 44 | return nil 45 | } 46 | -------------------------------------------------------------------------------- /docs/translations/kr/installation.md: -------------------------------------------------------------------------------- 1 | ## Gaia 설치하기 2 | 3 | 이 가이드는 `gaiad`와 `gaiacli`를 엔트리포인트를 시스템에 설치하는 방법을 설명합니다. `gaiad`와 `gaiacli`가 설치된 서버를 통해 [풀노드](./join-testnet.md#run-a-full-node) 또는 [밸리데이터로](./validators/validator-setup.md)써 최신 테스트넷에 참가하실 수 있습니다. 4 | 5 | ### Go 설치하기 6 | 7 | 공식 [Go 문서](https://golang.org/doc/install)를 따라서 `go`를 설치하십시오. `$GOPATH`, 그리고 `$PATH`의 환경을 꼭 세팅하세요. 예시: 8 | 9 | ```bash 10 | mkdir -p $HOME/go/bin 11 | echo "export GOPATH=$HOME/go" >> ~/.bash_profile 12 | echo "export PATH=\$PATH:\$GOPATH/bin" >> ~/.bash_profile 13 | echo "export GO111MODULE=on" >> ~/.bash_profile 14 | source ~/.bash_profile 15 | ``` 16 | 17 | ::: tip 18 | 코스모스 SDK를 운영하기 위해서는 **Go 1.11.ㅎ+** 이상 버전이 필요합니다. 19 | ::: 20 | 21 | ### 바이너리 설치하기 22 | 23 | 다음은 최신 Gaia 버전을 설치하는 것입니다. 예시에서는 최신 스테이블 릴리즈가 포함되어있는 `master` 브랜치를 이용해 진행됩니다. 필요에 따라 `git checkout`을 통해 [최신 릴리즈](https://github.com/cosmos/cosmos-sdk/releases)가 설치되어있는지 확인하세요. 24 | 25 | ```bash 26 | git clone -b https://github.com/cosmos/gaia 27 | cd gaia && make install 28 | ``` 29 | 30 | > *참고*: 여기에서 문제가 발생한다면, Go의 최신 스테이블 버전이 설치되어있는지 확인하십시오. 31 | 32 | 위 절차를 따라하시면 `gaiad`와 `gaiacli` 바이너리가 설치될 것입니다. 설치가 잘 되어있는지 확인하십시오: 33 | 34 | 35 | ```bash 36 | $ gaiad version 37 | $ gaiacli version 38 | ``` 39 | 40 | ### 다음 절차 41 | 42 | 축하합니다! 이제 [퍼블릭 테스트넷](./join-testnet.md)에 참가하시거나 or [프라이빗 테스트넷](./deploy-testnet.md)을 운영하실 수 있습니다. 43 | -------------------------------------------------------------------------------- /app/benchmarks/txsize_test.go: -------------------------------------------------------------------------------- 1 | package app 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/tendermint/tendermint/crypto/secp256k1" 7 | 8 | "github.com/cosmos/gaia/app" 9 | 10 | sdk "github.com/cosmos/cosmos-sdk/types" 11 | "github.com/cosmos/cosmos-sdk/x/auth" 12 | "github.com/cosmos/cosmos-sdk/x/bank" 13 | ) 14 | 15 | // This will fail half the time with the second output being 173 16 | // This is due to secp256k1 signatures not being constant size. 17 | // nolint: vet 18 | func ExampleTxSendSize() { 19 | cdc := app.MakeCodec() 20 | var gas uint64 = 1 21 | 22 | priv1 := secp256k1.GenPrivKeySecp256k1([]byte{0}) 23 | addr1 := sdk.AccAddress(priv1.PubKey().Address()) 24 | priv2 := secp256k1.GenPrivKeySecp256k1([]byte{1}) 25 | addr2 := sdk.AccAddress(priv2.PubKey().Address()) 26 | coins := sdk.Coins{sdk.NewCoin("denom", sdk.NewInt(10))} 27 | msg1 := bank.MsgMultiSend{ 28 | Inputs: []bank.Input{bank.NewInput(addr1, coins)}, 29 | Outputs: []bank.Output{bank.NewOutput(addr2, coins)}, 30 | } 31 | fee := auth.NewStdFee(gas, coins) 32 | signBytes := auth.StdSignBytes("example-chain-ID", 33 | 1, 1, fee, []sdk.Msg{msg1}, "") 34 | sig, _ := priv1.Sign(signBytes) 35 | sigs := []auth.StdSignature{{nil, sig}} 36 | tx := auth.NewStdTx([]sdk.Msg{msg1}, fee, sigs, "") 37 | fmt.Println(len(cdc.MustMarshalBinaryBare([]sdk.Msg{msg1}))) 38 | fmt.Println(len(cdc.MustMarshalBinaryBare(tx))) 39 | // output: 80 40 | // 169 41 | } 42 | -------------------------------------------------------------------------------- /docs/translations/kr/ledger.md: -------------------------------------------------------------------------------- 1 | # 레저(Ledger) 나노 하드웨어 지갑 지원 2 | 3 | ### 레저 시드를 이용한 계정 키 관리 4 | 5 | 이제 `gaiacli` 가 레저(Ledger) 시드를 통한 계정 키 관리를 지원합니다. 해당 기능을 이용하시기 위해서는 다음이 필요합니다: 6 | 7 | - 이용하실 네트워크와 연결된 `gaiad` 인스턴스. 8 | - 사용하시는 `gaiad` 인스턴스와 연동된 `gaiacli` 인스턴스. 9 | - `ledger-cosmos` 앱이 설치된 레저 나노 기기. 10 | * 레저 기기에 코스모스 앱을 설치하기 위해서는 [`ledger-cosmos`](https://github.com/cosmos/ledger-cosmos/blob/master/docs/BUILD.md) 깃허브 레포지토리를 확인하세요. 11 | * 실전 운용 가능한 앱 버전은 추후 [레저 앱스토어](https://www.ledgerwallet.com/apps)를 통해 배포될 예정입니다. 12 | 13 | > **참고:** 코스모스 키는 [BIP 44 Hierarchical Deterministic wallet 스펙](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki)에 파생되었습니다. 관련 패스에 대한 정보는 [hd package](https://github.com/cosmos/cosmos-sdk/blob/develop/crypto/keys/hd/hdpath.go#L30)를 참고하세요. 14 | 15 | 코스모스 앱을 레저 기기에 성공적으로 설치하시고, `gaiacli` 에서 레저와 연결하는데 성공하셨다면 다음과 같이 레저 키를 생성하실 수 있습니다: 16 | 17 | ```bash 18 | $ gaiacli keys add {{ .Key.Name }} --ledger 19 | NAME: TYPE: ADDRESS: PUBKEY: 20 | {{ .Key.Name }} ledger cosmos1aw64xxr80lwqqdk8u2xhlrkxqaxamkr3e2g943 cosmospub1addwnpepqvhs678gh9aqrjc2tg2vezw86csnvgzqq530ujkunt5tkuc7lhjkz5mj629 21 | ``` 22 | 23 | 이 키는 레저가 연결되고 잠금 해제된 상태에서면 사용이 가능합니다. 해당 키를 이용해 코인을 전송하시려면 다음 명령을 실행하세요: 24 | 25 | 26 | ```bash 27 | $ gaiacli tx send { .Destination.AccAddr } 10000000uatom --from { .Key.Name } --chain-id=gaia-7000 28 | ``` 29 | 30 | 레저 기기에서 해당 트랜잭션을 검토하신 후 서명이 되었다면 트랜잭션 결과를 레저 기기에서 확인하실 수 있습니다. 31 | -------------------------------------------------------------------------------- /docs/validators/kms/kms.md: -------------------------------------------------------------------------------- 1 | # KMS - Key Management System 2 | 3 | [Tendermint KMS](https://github.com/tendermint/kms) is a key management service that allows separating key management from Tendermint nodes. In addition it provides other advantages such as: 4 | 5 | - Improved security and risk management policies 6 | - Unified API and support for various HSM (hardware security modules) 7 | - Double signing protection (software or hardware based) 8 | 9 | It is recommended that the KMS service runs in a separate physical hosts. 10 | 11 | ## Building 12 | 13 | Detailed build instructions can be found [here](https://github.com/tendermint/kms#installation). 14 | 15 | ::: tip 16 | When compiling the KMS, ensure you have enabled the applicable features: 17 | ::: 18 | 19 | | Backend | Recommended Command line | 20 | |-----------------------|---------------------------------------| 21 | | YubiHSM | ```cargo build --features yubihsm``` | 22 | | Ledger+Tendermint App | ```cargo build --features ledgertm``` | 23 | 24 | ## Configuration 25 | 26 | A KMS can be configured in various ways: 27 | 28 | ### Using a YubiHSM 29 | 30 | Detailed information on how to setup a KMS with YubiHSM2 can be found [here](https://github.com/tendermint/kms/blob/master/README.yubihsm.md) 31 | 32 | ### Using a Ledger device running the Tendermint app 33 | 34 | Detailed information on how to setup a KMS with Ledger Tendermint App can be found [here](kms_ledger.md) 35 | -------------------------------------------------------------------------------- /networks/remote/terraform-app/infra/lb.tf: -------------------------------------------------------------------------------- 1 | resource "aws_lb" "lb" { 2 | name = "${var.name}" 3 | subnets = ["${aws_subnet.subnet.*.id}"] 4 | security_groups = ["${aws_security_group.secgroup.id}"] 5 | tags { 6 | Name = "${var.name}" 7 | } 8 | # access_logs { 9 | # bucket = "${var.s3_bucket}" 10 | # prefix = "lblogs" 11 | # } 12 | } 13 | 14 | resource "aws_lb_listener" "lb_listener" { 15 | load_balancer_arn = "${aws_lb.lb.arn}" 16 | port = "443" 17 | protocol = "HTTPS" 18 | ssl_policy = "ELBSecurityPolicy-TLS-1-2-Ext-2018-06" 19 | certificate_arn = "${var.certificate_arn}" 20 | 21 | default_action { 22 | target_group_arn = "${aws_lb_target_group.lb_target_group.arn}" 23 | type = "forward" 24 | } 25 | } 26 | 27 | resource "aws_lb_listener_rule" "listener_rule" { 28 | listener_arn = "${aws_lb_listener.lb_listener.arn}" 29 | priority = "100" 30 | action { 31 | type = "forward" 32 | target_group_arn = "${aws_lb_target_group.lb_target_group.id}" 33 | } 34 | condition { 35 | field = "path-pattern" 36 | values = ["/"] 37 | } 38 | } 39 | 40 | resource "aws_lb_target_group" "lb_target_group" { 41 | name = "${var.name}" 42 | port = "26657" 43 | protocol = "HTTP" 44 | vpc_id = "${aws_vpc.vpc.id}" 45 | tags { 46 | name = "${var.name}" 47 | } 48 | health_check { 49 | path = "/health" 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /cmd/contract_tests/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/snikch/goodman/hooks" 6 | "github.com/snikch/goodman/transaction" 7 | ) 8 | 9 | func main() { 10 | // This must be compiled beforehand and given to dredd as parameter, in the meantime the server should be running 11 | h := hooks.NewHooks() 12 | server := hooks.NewServer(hooks.NewHooksRunner(h)) 13 | h.BeforeAll(func(t []*transaction.Transaction) { 14 | fmt.Println("Sleep 5 seconds before all modification") 15 | }) 16 | h.BeforeEach(func(t *transaction.Transaction) { 17 | fmt.Println("before each modification") 18 | }) 19 | h.Before("/version > GET", func(t *transaction.Transaction) { 20 | fmt.Println("before version TEST") 21 | }) 22 | h.Before("/node_version > GET", func(t *transaction.Transaction) { 23 | fmt.Println("before node_version TEST") 24 | }) 25 | h.BeforeEachValidation(func(t *transaction.Transaction) { 26 | fmt.Println("before each validation modification") 27 | }) 28 | h.BeforeValidation("/node_version > GET", func(t *transaction.Transaction) { 29 | fmt.Println("before validation node_version TEST") 30 | }) 31 | h.After("/node_version > GET", func(t *transaction.Transaction) { 32 | fmt.Println("after node_version TEST") 33 | }) 34 | h.AfterEach(func(t *transaction.Transaction) { 35 | fmt.Println("after each modification") 36 | }) 37 | h.AfterAll(func(t []*transaction.Transaction) { 38 | fmt.Println("after all modification") 39 | }) 40 | server.Serve() 41 | defer server.Listener.Close() 42 | fmt.Print(h) 43 | } 44 | -------------------------------------------------------------------------------- /docs/translations/cn/join-testnet.md: -------------------------------------------------------------------------------- 1 | # 加入公共测试网 2 | 3 | ::: 提示 当前测试网 4 | 请查看[testnet repo](https://github.com/cosmos/testnets)获取最新的公共测试网信息,包含了所使用的Cosmos-SDK的正确版本和genesis文件。 5 | ::: 6 | 7 | ::: 警告 8 | 你需要先完成[安装`gaia`](./installation.md) 9 | ::: 10 | 11 | ## 创建一个新节点 12 | 13 | > 注意:如果你在之前的测试网中运行过一个全节点,请跳至[升级之前的Testnet](#upgrading-from-previous-testnet)。 14 | 15 | 要创建一个新节点,主网的指令同样适用: 16 | 17 | + [加入mainnet](./join-mainnet.md) 18 | + [部署验证人节点](./validators/validator-setup.md) 19 | 20 | 只有SDK的版本和genesis文件不同。查看[testnet repo](https://github.com/cosmos/testnets) 21 | 获取测试网的信息,包括Cosmos-SDK正确的版本和genesis文件。 22 | 23 | 24 | ## 升级之前的Testnet 25 | 26 | 这些指令用以把运行过以前测试网络的全节点升级至最新的测试网络。 27 | 28 | ### 重置数据 29 | 30 | 首先,移除过期的文件并重置数据: 31 | 32 | ```bash 33 | rm $HOME/.gaiad/config/addrbook.json $HOME/.gaiad/config/genesis.json 34 | gaiad unsafe-reset-all 35 | ``` 36 | 37 | 你的节点现在处于原始状态并保留了最初的`priv_validator.json`文件和`config.toml`文件。如果之前你还有其他的哨兵节点或者全节点,你的节点仍然会连接他们,但是会失败,因为他们还没有升级。 38 | 39 | ::: 警告 40 | 确保每个节点有一个独一无二的`priv_validator.json`文件。不要从一个旧节点拷贝`priv_validator.json`到多个新的节点。运行两个有着相同`priv_validator.json`文件的节点会导致双签。 41 | ::: 42 | 43 | ### 升级软件 44 | 45 | 现在升级软件: 46 | 47 | ```bash 48 | cd $GOPATH/src/github.com/cosmos/cosmos-sdk 49 | git fetch --all && git checkout master 50 | make update_tools install 51 | ``` 52 | 53 | ::: 提示 54 | *注意*:如果在这一步出现问题,请检查是否安装了最新稳定版本的Go。 55 | ::: 56 | 57 | 注意这里我们使用的是包含最新稳定发布版本的`master`分支。请查看[testnet repo](https://github.com/cosmos/testnets)查看哪个版本的测试网需要哪一个Cosmos-SDK版本,在[SDK发布版](https://github.com/cosmos/cosmos-sdk/releases)中对应的详细信息。 58 | 59 | 你的全节点已经升级成功! -------------------------------------------------------------------------------- /lcd_test/testdata/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | PASSWORD="1234567890" 4 | ADDR="cosmos16xyempempp92x9hyzz9wrgf94r6j9h5f06pxxv" 5 | RECEIVER="cosmos17gx5vwpm0y2k59tw0x00ccug234n56cgltx2w2" 6 | VALIDATOR="cosmosvaloper16xyempempp92x9hyzz9wrgf94r6j9h5f2w4n2l" 7 | AMOUNT="1000000stake" 8 | CHAIN="lcd" 9 | PROPOSALID="2" 10 | HOME="/tmp/contract_tests/.gaiacli" 11 | SWAGGER='/tmp/contract_tests/swagger.yaml' 12 | 13 | # sleeping a whole second between each step is a conservative precaution 14 | # check lcd_test/testdata/state.tar.gz -> .gaiad/config/config.toml precommit_timeout = 500ms 15 | sleep 1s 16 | echo ${PASSWORD} | ./build/gaiacli tx gov submit-proposal --home ${HOME} --from ${ADDR} --chain-id ${CHAIN} --type text --title test --description test_description --deposit 10000stake --yes 17 | sleep 1s 18 | echo ${PASSWORD} | ./build/gaiacli tx gov deposit --home ${HOME} --from ${ADDR} --chain-id ${CHAIN} ${PROPOSALID} 1000000000stake --yes 19 | sleep 1s 20 | echo ${PASSWORD} | ./build/gaiacli tx gov vote --home ${HOME} --from ${ADDR} --yes --chain-id ${CHAIN} ${PROPOSALID} Yes 21 | sleep 1s 22 | HASH=$(echo ${PASSWORD} | ./build/gaiacli tx send --home ${HOME} ${ADDR} ${RECEIVER} ${AMOUNT} --yes --chain-id ${CHAIN} | awk '/txhash.*/{print $2}') 23 | sed -i.bak -e "s/BCBE20E8D46758B96AE5883B792858296AC06E51435490FBDCAE25A72B3CC76B/${HASH}/g" "${SWAGGER}" 24 | echo "Replaced dummy with actual transaction hash ${HASH}" 25 | sleep 1s 26 | echo ${PASSWORD} | ./build/gaiacli tx staking unbond --home ${HOME} --from ${ADDR} ${VALIDATOR} 100stake --yes --chain-id ${CHAIN} 27 | 28 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | gaiadnode0: 5 | container_name: gaiadnode0 6 | image: "tendermint/gaiadnode" 7 | ports: 8 | - "26656-26657:26656-26657" 9 | environment: 10 | - ID=0 11 | - LOG=${LOG:-gaiad.log} 12 | volumes: 13 | - ./build:/gaiad:Z 14 | networks: 15 | localnet: 16 | ipv4_address: 192.168.10.2 17 | 18 | gaiadnode1: 19 | container_name: gaiadnode1 20 | image: "tendermint/gaiadnode" 21 | ports: 22 | - "26659-26660:26656-26657" 23 | environment: 24 | - ID=1 25 | - LOG=${LOG:-gaiad.log} 26 | volumes: 27 | - ./build:/gaiad:Z 28 | networks: 29 | localnet: 30 | ipv4_address: 192.168.10.3 31 | 32 | gaiadnode2: 33 | container_name: gaiadnode2 34 | image: "tendermint/gaiadnode" 35 | environment: 36 | - ID=2 37 | - LOG=${LOG:-gaiad.log} 38 | ports: 39 | - "26661-26662:26656-26657" 40 | volumes: 41 | - ./build:/gaiad:Z 42 | networks: 43 | localnet: 44 | ipv4_address: 192.168.10.4 45 | 46 | gaiadnode3: 47 | container_name: gaiadnode3 48 | image: "tendermint/gaiadnode" 49 | environment: 50 | - ID=3 51 | - LOG=${LOG:-gaiad.log} 52 | ports: 53 | - "26663-26664:26656-26657" 54 | volumes: 55 | - ./build:/gaiad:Z 56 | networks: 57 | localnet: 58 | ipv4_address: 192.168.10.5 59 | 60 | networks: 61 | localnet: 62 | driver: bridge 63 | ipam: 64 | driver: default 65 | config: 66 | - 67 | subnet: 192.168.10.0/16 68 | 69 | -------------------------------------------------------------------------------- /app/params.go: -------------------------------------------------------------------------------- 1 | package app 2 | 3 | // Simulation parameter constants 4 | const ( 5 | StakePerAccount = "stake_per_account" 6 | InitiallyBondedValidators = "initially_bonded_validators" 7 | OpWeightDeductFee = "op_weight_deduct_fee" 8 | OpWeightMsgSend = "op_weight_msg_send" 9 | OpWeightSingleInputMsgMultiSend = "op_weight_single_input_msg_multisend" 10 | OpWeightMsgSetWithdrawAddress = "op_weight_msg_set_withdraw_address" 11 | OpWeightMsgWithdrawDelegationReward = "op_weight_msg_withdraw_delegation_reward" 12 | OpWeightMsgWithdrawValidatorCommission = "op_weight_msg_withdraw_validator_commission" 13 | OpWeightSubmitVotingSlashingTextProposal = "op_weight_submit_voting_slashing_text_proposal" 14 | OpWeightSubmitVotingSlashingCommunitySpendProposal = "op_weight_submit_voting_slashing_community_spend_proposal" 15 | OpWeightSubmitVotingSlashingParamChangeProposal = "op_weight_submit_voting_slashing_param_change_proposal" 16 | OpWeightMsgDeposit = "op_weight_msg_deposit" 17 | OpWeightMsgCreateValidator = "op_weight_msg_create_validator" 18 | OpWeightMsgEditValidator = "op_weight_msg_edit_validator" 19 | OpWeightMsgDelegate = "op_weight_msg_delegate" 20 | OpWeightMsgUndelegate = "op_weight_msg_undelegate" 21 | OpWeightMsgBeginRedelegate = "op_weight_msg_begin_redelegate" 22 | OpWeightMsgUnjail = "op_weight_msg_unjail" 23 | ) 24 | -------------------------------------------------------------------------------- /docs/translations/cn/validators/security.md: -------------------------------------------------------------------------------- 1 | # 验证人安全 2 | 3 | 我们鼓励每一个验证人候选者独立运行其操作,因为不同的设置增加了网络的抵抗能力。为了能按时启动主网,验证人候选者现在就应该开始设置了。 4 | 5 | 6 | ## 密钥管理 - HSM 7 | 8 | 让攻击者无法盗取验证人的密钥是至关重要的任务。如果可能发生盗取,这将会使委托给抵抗力脆弱的验证人的所有股权都处于风险之中。硬件安全模块是防范该风险的一个重要策略。 9 | 10 | 为了支持Cosmos Hub,HSM模块必须要支持`ed25519`签名。YubiHSM2支持了`ed25519`,我们期望在2017年12月时,能有一个可以使用的库。YubiHSM可以保护私钥但是不能确保它不会去重复签署一个区块。 11 | 12 | Tendermint团队也在为拓展Ledger Nano S应用以支持验证人签名做贡献。这个应用将会储存最近的区块,并能降低双重签名攻击的风险。 13 | 14 | 我们会在有更多关于密钥保存安全的可行的解决方案出现时更新这个文档。 15 | 16 | 17 | ## 哨兵节点(DDOS防御) 18 | 19 | 验证人有责任确保网络能够经受住DDOS攻击。 20 | 21 | 降低这种风险的一个推荐方案是验证人要在成为哨兵节点的网络拓扑结构上去精心搭建他们的网络结构。 22 | 23 | 因为验证人节点可以操作自身,也可以被其熟知的其它验证人运行,验证人节点应该只连接到其所信任的全节点上。一个验证人节点通常会运行在一个数据中心。大部分数据中心提供对主流云服务提供商的直接网络连接服务。验证人可以去连接云服务中上的哨兵节点。验证人节点直接连接到其哨兵节点,减缓了DDOS攻击带来的压力,还可以添加多个新的哨兵节点用以轮换来减轻已存在哨兵节点所遭受到的攻击。 24 | 25 | 哨兵节点能够迅速轮换或者改变它们的IP地址。因为与哨兵节点的连接是在私有的IP网段,基于因特网的攻击不可能直接骚扰到验证人节点。这将确保验证人区块的提交和投票总是能广播至网络中的其余节点。 26 | 27 | 你可以按照下面的指令去设置你的哨兵节点架构: 28 | 29 | 验证人节点必须编辑它们的config.toml文件: 30 | 31 | ```bash 32 | # Comma separated list of nodes to keep persistent connections to 33 | # Do not add private peers to this list if you don't want them advertised 34 | persistent_peers =[list of sentry nodes] 35 | 36 | # Set true to enable the peer-exchange reactor 37 | pex = false 38 | ``` 39 | 40 | 哨兵节点应该编辑它们的config.toml文件: 41 | 42 | ```bash 43 | # Comma separated list of peer IDs to keep private (will not be gossiped to other peers) 44 | private_peer_ids = "ipaddress of validator nodes" 45 | ``` 46 | 47 | ## 环境变量 48 | 49 | 默认情况下,具有以下前缀的大写环境变量将替换小写命令行标志: 50 | 51 | + `GA`(对应Gaia的标识) 52 | + `TM`(对应Tendermint的标识) 53 | + `BC`(对应democli或basecli的标识) 54 | 55 | 例如,环境变量`GA_CHAIN_ID`将映射到命令行标识`--chain-id`。注意,虽然显式命令行标识优先于环境变量,但环境变量优先于任何配置文件。因此,必须锁定环境,以便在CLI上将任何关键参数定义为标识或防止修改任何环境变量。 -------------------------------------------------------------------------------- /docs/translations/cn/installation.md: -------------------------------------------------------------------------------- 1 | ## 安装Gaia 2 | 3 | 本教程将详细说明如何在你的系统上安装`gaiad`和`gaiacli`。安装后,你可以作为[全节点](./join-mainnet.md)或是[验证人节点](./validators/validator-setup.md)加入到主网。 4 | 5 | ### 安装Go 6 | 7 | 按照[官方文档](https://golang.org/doc/install)安装`go`。记得设置环境变量`$GOPATH`,`$GOBIN`和`$PATH`: 8 | 9 | ```bash 10 | mkdir -p $HOME/go/bin 11 | echo "export GOPATH=$HOME/go" >> ~/.bash_profile 12 | echo "export PATH=\$PATH:\$GOPATH/bin" >> ~/.bash_profile 13 | echo "export GO111MODULE=on" >> ~/.bash_profile 14 | source ~/.bash_profile 15 | ``` 16 | 17 | ::: tip 18 | Cosmos SDK需要安装**Go 1.12+** 19 | ::: 20 | 21 | ### 安装二进制执行程序 22 | 23 | 接下来,安装最新版本的Gaia。需要确认您 `git checkout 了正确的[发布版本](https://github.com/cosmos/cosmos-sdk/releases)。 24 | 25 | ::: warning 26 | 对于主网,请确保你的版本大于或等于`v0.33.0` 27 | ::: 28 | 29 | ```bash 30 | git clone -b https://github.com/cosmos/gaia 31 | cd gaia && make install 32 | ``` 33 | 34 | > *注意*: 如果在这一步中出现问题,请检查你是否安装的是Go的最新稳定版本。 35 | 36 | 等`gaiad`和`gaiacli`可执行程序安装完之后,请检查: 37 | 38 | ```bash 39 | $ gaiad version --long 40 | $ gaiacli version --long 41 | ``` 42 | 43 | `gaiacli`的返回应该类似于: 44 | 45 | ``` 46 | cosmos-sdk: 0.33.0 47 | git commit: 7b4104aced52aa5b59a96c28b5ebeea7877fc4f0 48 | go.sum hash: d156153bd5e128fec3868eca9a1397a63a864edb5cfa0ac486db1b574b8eecfe 49 | build tags: netgo ledger 50 | go version go1.12 linux/amd64 51 | ``` 52 | 53 | ##### Build Tags 54 | 55 | build tags指定了可执行程序具有的特殊特性。 56 | 57 | | Build Tag | Description | 58 | | --------- | ----------------------------------------------- | 59 | | netgo | Name resolution will use pure Go code | 60 | | ledger | 支持Ledger设备(硬件钱包) | 61 | 62 | ### 接下来 63 | 然后你可以选择 加入[主网](./join-mainnet.md)、[公共测试网](./join-testnet.md) 或是 [创建私有测试网](./deploy-testnet.md)。 64 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/cosmos/gaia 2 | 3 | go 1.12 4 | 5 | require ( 6 | github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c // indirect 7 | github.com/cosmos/cosmos-sdk v0.28.2-0.20190718124356-a922dad3468b 8 | github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d // indirect 9 | github.com/go-kit/kit v0.9.0 // indirect 10 | github.com/golang/mock v1.3.1 // indirect 11 | github.com/gorilla/mux v1.7.3 // indirect 12 | github.com/magiconair/properties v1.8.1 // indirect 13 | github.com/mattn/go-isatty v0.0.8 // indirect 14 | github.com/onsi/ginkgo v1.8.0 // indirect 15 | github.com/onsi/gomega v1.5.0 // indirect 16 | github.com/otiai10/copy v1.0.1 17 | github.com/otiai10/curr v0.0.0-20190513014714-f5a3d24e5776 // indirect 18 | github.com/pelletier/go-toml v1.4.0 // indirect 19 | github.com/pkg/errors v0.8.1 20 | github.com/prometheus/common v0.6.0 // indirect 21 | github.com/prometheus/procfs v0.0.3 // indirect 22 | github.com/rakyll/statik v0.1.6 // indirect 23 | github.com/rcrowley/go-metrics v0.0.0-20190704165056-9c2d0518ed81 // indirect 24 | github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa 25 | github.com/spf13/afero v1.2.2 // indirect 26 | github.com/spf13/cobra v0.0.5 27 | github.com/spf13/viper v1.4.0 28 | github.com/stretchr/testify v1.3.0 29 | github.com/tendermint/go-amino v0.15.0 30 | github.com/tendermint/tendermint v0.32.1 31 | golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 // indirect 32 | golang.org/x/net v0.0.0-20190628185345-da137c7871d7 // indirect 33 | golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb // indirect 34 | golang.org/x/text v0.3.2 // indirect 35 | google.golang.org/appengine v1.4.0 // indirect 36 | google.golang.org/genproto v0.0.0-20190701230453-710ae3a149df // indirect 37 | google.golang.org/grpc v1.22.0 // indirect 38 | ) 39 | -------------------------------------------------------------------------------- /networks/remote/terraform-app/infra/instance.tf: -------------------------------------------------------------------------------- 1 | resource "aws_key_pair" "key" { 2 | key_name = "${var.name}" 3 | public_key = "${file(var.ssh_public_file)}" 4 | } 5 | 6 | data "aws_ami" "linux" { 7 | most_recent = true 8 | filter { 9 | name = "name" 10 | values = ["${var.image_name}"] 11 | } 12 | } 13 | 14 | resource "aws_instance" "node" { 15 | # depends_on = ["${element(aws_route_table_association.route_table_association.*,count.index)}"] 16 | count = "${var.SERVERS*min(length(data.aws_availability_zones.zones.names),var.max_zones)}" 17 | ami = "${data.aws_ami.linux.image_id}" 18 | instance_type = "${var.instance_type}" 19 | key_name = "${aws_key_pair.key.key_name}" 20 | associate_public_ip_address = true 21 | vpc_security_group_ids = [ "${aws_security_group.secgroup.id}" ] 22 | subnet_id = "${element(aws_subnet.subnet.*.id,count.index)}" 23 | availability_zone = "${element(data.aws_availability_zones.zones.names,count.index)}" 24 | 25 | tags { 26 | Environment = "${var.name}" 27 | Name = "${var.name}-${element(data.aws_availability_zones.zones.names,count.index)}" 28 | } 29 | 30 | volume_tags { 31 | Environment = "${var.name}" 32 | Name = "${var.name}-${element(data.aws_availability_zones.zones.names,count.index)}-VOLUME" 33 | } 34 | 35 | root_block_device { 36 | volume_size = 40 37 | } 38 | 39 | connection { 40 | user = "centos" 41 | private_key = "${file(var.ssh_private_file)}" 42 | timeout = "600s" 43 | } 44 | 45 | provisioner "file" { 46 | source = "files/terraform.sh" 47 | destination = "/tmp/terraform.sh" 48 | } 49 | 50 | provisioner "remote-exec" { 51 | inline = [ 52 | "chmod +x /tmp/terraform.sh", 53 | "sudo /tmp/terraform.sh ${var.name} ${count.index}", 54 | ] 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/setup-fullnodes/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Ensure keys folder exists locally 4 | file: path=keys state=directory 5 | connection: local 6 | run_once: true 7 | become: no 8 | 9 | - name: Create gaiad user 10 | user: name=gaiad home=/home/gaiad shell=/bin/bash 11 | 12 | - name: Copy binary 13 | copy: 14 | src: "{{BINARY}}" 15 | dest: /usr/bin 16 | mode: 0755 17 | 18 | - name: Copy service file 19 | copy: src=gaiad.service dest=/etc/systemd/system/gaiad.service mode=0755 20 | notify: reload systemd 21 | 22 | - name: Get node ID 23 | command: "cat /etc/nodeid" 24 | changed_when: false 25 | register: nodeid 26 | 27 | - name: gaiad init 28 | command: "/usr/bin/gaiad init --chain-id={{TESTNET_NAME}} --name=fullnode{{nodeid.stdout_lines[0]}}" 29 | become: yes 30 | become_user: gaiad 31 | register: initresult 32 | args: 33 | creates: /home/gaiad/.gaiad/config 34 | 35 | - name: Get wallet word seed from result of initial transaction locally 36 | when: initresult["changed"] 37 | shell: "echo '{{initresult.stdout}}' | python -c 'import json,sys ; print json.loads(\"\".join(sys.stdin.readlines()))[\"app_message\"][\"secret\"]'" 38 | changed_when: false 39 | register: walletkey 40 | connection: local 41 | 42 | - name: Write wallet word seed to local files 43 | when: initresult["changed"] 44 | copy: "content={{walletkey.stdout}} dest=keys/node{{nodeid.stdout_lines[0]}}" 45 | become: no 46 | connection: local 47 | 48 | - name: Copy genesis file 49 | copy: 50 | src: "{{GENESISFILE}}" 51 | dest: /home/gaiad/.gaiad/config/genesis.json 52 | become: yes 53 | become_user: gaiad 54 | 55 | - name: Copy config.toml file 56 | copy: 57 | src: "{{CONFIGFILE}}" 58 | dest: /home/gaiad/.gaiad/config/config.toml 59 | become: yes 60 | become_user: gaiad 61 | 62 | -------------------------------------------------------------------------------- /docs/translations/kr/validators/overview.md: -------------------------------------------------------------------------------- 1 | # 검증인(밸리데이터) 개요 2 | 3 | ## 소개 4 | 5 | [코스모스 허브](/introduction/cosmos-hub.md)는 [텐더민트](/introduction/tendermint.md) 기반으로 만들어졌으며 특정 검증인들이 블록체인에 새로운 블록을 기록하는 절차를 기반으로 설계되었습니다. 검증인들은 각 검증인들의 프라이빗키로 서명된 암호화된 표(votes)를 전파하면서 합의 프로토콜에 참여합니다. 6 | 7 | 검증인 후보는 본인들의 아톰을 자체적으로 위임하거나, 위임자들의 아톰을 위임받을 수 있습니다. 코스모스 허브는 100개의 검증인으로 시작하여 300개의 검증인으로 숫자를 늘려나갈 예정입니다. 검증인은 위임량에 따라서 정해지며, 상위 100위 검증인은 코스모스 검증인으로 선출됩니다. 8 | 9 | 검증인들과 위임자들은 텐더민트 합의 프로토콜에 참여하며 블록생성에 대한 보상을 지급받게 됩니다. 초기에 트랜잭션 수수료는 아톰으로 결제되지만, 거버넌스로 통과된 '화이트리스트 토큰'들이 수수료 토큰으로 이용될 수 있습니다. 추가적으로 검증인들은 본인의 검증인 서비스 제공에 대한 커미션을 측정할 수 있습니다. 10 | 11 | 만약 검증인이 이중서명(double sign)을 하거나, 자주 오프라인 되거나 또는 거버넌스에 참여하지 않는 경우, 그들의 아톰과 해당 검증인에게 위임된 아톰은 '슬래싱'당할 수 있습니다. 슬래싱 페널티는 악의적 행동의 중대성에 따라 비례합니다. 12 | 13 | ## 하드웨어 14 | 15 | 현재 검증인의 키 관리에 적합한 클라우드 솔루션은 없습니다. 앞으로 클라우드 SGX 도입이 되면서 조금 더 안전한 솔루션이 제공될 수 있을 것으로 기대되고 있습니다. 하지만 현재로써 클라우드 키 관리에 리스크가 있기 때문에 검증인들은 제한된 안전한 구역에 장비를 세팅하는 것을 추천합니다. 보안이 확보되는 특정 데이터 센터의 코로케이션(co-location) 같은 형태로 운영이 될 수 있습니다. 16 | 17 | 검증인들은 서버 장비가 운영되는 데이터센터에 스토리지 백업, 복수 회선, 그리고 전력 백업 등의 시스템이 갖춰져 있는 것을 확인해야 합니다. 광선, 방화벽, 스위칭 등 또한 중복되어있는 것을 추천드립니다. 하드웨어 성능에는 중저형 서버로 시작해도 충분할 것으로 예상되나, 충분한 검증과 테스팅을 실행하시는 것을 추천드립니다. 18 | 19 | 코스모스 생태계 초기의 네트워크 사용량은 크지 않을 것으로 예상되며, 현재 테스트넷은 대량의 리소스를 필요로 하지 않습니다. 하지만 네트워크가 성장하며 대역폭, CPU와 메모리 사용량이 높아질 것으로 예상됩니다. 추가적으로, 몇년의 블록체인 기록을 저장해야되기 때문에 대용량 하드드라이브를 이용하시는 것을 추천드립니다. 20 | 21 | ## 웹사이트 세팅하기 22 | 23 | 검증인의 고유 웹사이트를 만드시고, 코스모스 [포럼](https://forum.cosmos.network/t/validator-candidates-websites/127/3)을 통해서 검증인 참여 의사를 알려주십시오. 위임인들은 위임 대상 검증인에 대한 정보를 확인하려 할 수 있으니, 관련 정보를 기제해주시기 바랍니다. 24 | 25 | ## 법적 검토 26 | 27 | 검증인 사업을 운영하시기 전에 전문 법적 검토를 미리 받으실 것을 추천드립니다. 28 | 29 | ## 검증인 커뮤니티 30 | 31 | 추가적으로 검증인을 운영하는 것에 대한 질문과 정보는 검증인 커뮤니티 채팅방과 포럼을 이용하세요: 32 | 33 | * [검증인 채팅](https://riot.im/app/#/room/#cosmos_validators:matrix.org) 34 | * [검증인 포럼](https://forum.cosmos.network/c/validating) 35 | -------------------------------------------------------------------------------- /networks/remote/terraform-app/main.tf: -------------------------------------------------------------------------------- 1 | #Terraform Configuration 2 | 3 | variable "APP_NAME" { 4 | description = "Name of the application" 5 | } 6 | 7 | variable "SERVERS" { 8 | description = "Number of servers in an availability zone" 9 | default = "1" 10 | } 11 | 12 | variable "MAX_ZONES" { 13 | description = "Maximum number of availability zones to use" 14 | default = "4" 15 | } 16 | 17 | #See https://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region 18 | #eu-west-3 does not contain CentOS images 19 | variable "REGION" { 20 | description = "AWS Regions" 21 | default = "us-east-1" 22 | } 23 | 24 | variable "SSH_PRIVATE_FILE" { 25 | description = "SSH private key file to be used to connect to the nodes" 26 | type = "string" 27 | } 28 | 29 | variable "SSH_PUBLIC_FILE" { 30 | description = "SSH public key file to be used on the nodes" 31 | type = "string" 32 | } 33 | 34 | variable "CERTIFICATE_ARN" { 35 | description = "Load-balancer certificate AWS ARN" 36 | type = "string" 37 | } 38 | 39 | # ap-southeast-1 and ap-southeast-2 does not contain the newer CentOS 1704 image 40 | variable "image" { 41 | description = "AWS image name" 42 | default = "CentOS Linux 7 x86_64 HVM EBS 1703_01" 43 | } 44 | 45 | variable "instance_type" { 46 | description = "AWS instance type" 47 | default = "t2.large" 48 | } 49 | 50 | provider "aws" { 51 | region = "${var.REGION}" 52 | } 53 | 54 | module "nodes" { 55 | source = "infra" 56 | name = "${var.APP_NAME}" 57 | image_name = "${var.image}" 58 | instance_type = "${var.instance_type}" 59 | ssh_public_file = "${var.SSH_PUBLIC_FILE}" 60 | ssh_private_file = "${var.SSH_PRIVATE_FILE}" 61 | certificate_arn = "${var.CERTIFICATE_ARN}" 62 | SERVERS = "${var.SERVERS}" 63 | max_zones = "${var.MAX_ZONES}" 64 | } 65 | 66 | output "public_ips" { 67 | value = "${module.nodes.public_ips}", 68 | } 69 | 70 | output "lb_name" { 71 | value = "${module.nodes.lb_name}" 72 | } 73 | 74 | -------------------------------------------------------------------------------- /docs/translations/cn/genesis-state.md: -------------------------------------------------------------------------------- 1 | # Gaia 创世状态(Genesis State) 2 | 3 | Gaia 创世状态`GenesisState`由账户、各种模块状态和元数据组成,例如创世交易。 每个模块可以指定自己的`GenesisState`。 此外,每个模块可以指定自己的创世状态有效性验证、导入和导出功能。 4 | 5 | Gaia 创世状态定义如下: 6 | 7 | ```go 8 | type GenesisState struct { 9 | Accounts []GenesisAccount `json:"accounts"` 10 | AuthData auth.GenesisState `json:"auth"` 11 | BankData bank.GenesisState `json:"bank"` 12 | StakingData staking.GenesisState `json:"staking"` 13 | MintData mint.GenesisState `json:"mint"` 14 | DistrData distr.GenesisState `json:"distribution"` 15 | GovData gov.GenesisState `json:"gov"` 16 | SlashingData slashing.GenesisState `json:"slashing"` 17 | GenTxs []json.RawMessage `json:"gentxs"` 18 | } 19 | ``` 20 | 21 | 在 Gaia 的 ABCI`initChainer`定义中调用`initFromGenesisState`,它在内部调用每个模块的`InitGenesis`,提供它自己的`GenesisState`作为参数。 22 | 23 | ## 账户(Accounts) 24 | 25 | `GenesisState` 中的创世账户定义如下: 26 | 27 | ```go 28 | type GenesisAccount struct { 29 | Address sdk.AccAddress `json:"address"` 30 | Coins sdk.Coins `json:"coins"` 31 | Sequence uint64 `json:"sequence_number"` 32 | AccountNumber uint64 `json:"account_number"` 33 | 34 | // vesting account fields 35 | OriginalVesting sdk.Coins `json:"original_vesting"` // total vesting coins upon initialization 36 | DelegatedFree sdk.Coins `json:"delegated_free"` // delegated vested coins at time of delegation 37 | DelegatedVesting sdk.Coins `json:"delegated_vesting"` // delegated vesting coins at time of delegation 38 | StartTime int64 `json:"start_time"` // vesting start time (UNIX Epoch time) 39 | EndTime int64 `json:"end_time"` // vesting end time (UNIX Epoch time) 40 | } 41 | ``` 42 | 43 | 除序列号(nonce)和地址外,每个帐户还必须具有有效且唯一的账户编号。 44 | 45 | 账户也可能锁仓,此时他们必须提供必要的锁仓信息,锁仓帐户必须至少提供`OriginalVesting`和`EndTime`。如果还提供了`StartTime`,则该帐户将被视为“连续”锁仓帐户,其中按预定义的时间表锁仓 coins。 提供的`StartTime`必须小于`EndTime`,但可能是未来的时间。 换句话说,它不必等于创世时间。 在从新状态(未导出)开始的新链中,`OriginalVesting`必须小于或等于`Coins`。 46 | 47 | -------------------------------------------------------------------------------- /networks/remote/terraform-do/README.md: -------------------------------------------------------------------------------- 1 | # Terraform & Ansible 2 | 3 | WARNING: The Digital Ocean scripts are obsolete. They are here because they might still be useful for developers. 4 | 5 | Automated deployments are done using [Terraform](https://www.terraform.io/) to create servers on Digital Ocean then 6 | [Ansible](http://www.ansible.com/) to create and manage testnets on those servers. 7 | 8 | ## Prerequisites 9 | 10 | - Install [Terraform](https://www.terraform.io/downloads.html) and [Ansible](http://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) on a Linux machine. 11 | - Create a [DigitalOcean API token](https://cloud.digitalocean.com/settings/api/tokens) with read and write capability. 12 | - Install the python dopy package (`pip install dopy`) (This is necessary for the digitalocean.py script for ansible.) 13 | - Create SSH keys 14 | 15 | ``` 16 | export DO_API_TOKEN="abcdef01234567890abcdef01234567890" 17 | export TESTNET_NAME="remotenet" 18 | export SSH_PRIVATE_FILE="$HOME/.ssh/id_rsa" 19 | export SSH_PUBLIC_FILE="$HOME/.ssh/id_rsa.pub" 20 | ``` 21 | 22 | These will be used by both `terraform` and `ansible`. 23 | 24 | ## Create a remote network 25 | 26 | ``` 27 | make remotenet-start 28 | ``` 29 | 30 | Optionally, you can set the number of servers you want to launch and the name of the testnet (which defaults to remotenet): 31 | 32 | ``` 33 | TESTNET_NAME="mytestnet" SERVERS=7 make remotenet-start 34 | ``` 35 | 36 | ## Quickly see the /status endpoint 37 | 38 | ``` 39 | make remotenet-status 40 | ``` 41 | 42 | ## Delete servers 43 | 44 | ``` 45 | make remotenet-stop 46 | ``` 47 | 48 | ## Logging 49 | 50 | You can ship logs to Logz.io, an Elastic stack (Elastic search, Logstash and Kibana) service provider. You can set up your nodes to log there automatically. Create an account and get your API key from the notes on [this page](https://app.logz.io/#/dashboard/data-sources/Filebeat), then: 51 | 52 | ``` 53 | yum install systemd-devel || echo "This will only work on RHEL-based systems." 54 | apt-get install libsystemd-dev || echo "This will only work on Debian-based systems." 55 | 56 | go get github.com/mheese/journalbeat 57 | ansible-playbook -i inventory/digital_ocean.py -l remotenet logzio.yml -e LOGZIO_TOKEN=ABCDEFGHIJKLMNOPQRSTUVWXYZ012345 58 | ``` 59 | -------------------------------------------------------------------------------- /docs/translations/kr/genesis.md: -------------------------------------------------------------------------------- 1 | # Gaia 제네시스 스테이트 2 | 3 | Gaia의 제네시스 스테이트인 `GenesisState`는 계정 정보, 모듈 스테이트 그리고 제네시스 트랜잭션 같은 메타데이터 등으로 구성됩니다. 각 모듈은 각자의 `GenesisState`를 지정할 수 있습니다. 또한, 각 모듈은 각자의 제네시스 스테이트 검증, 임포트, 엑스포트 기능 등을 지정할 수 있습니다. 4 | 5 | Gaia 제네시스 스테이트는 다음과 같이 정의됩니다: 6 | 7 | ```go 8 | type GenesisState struct { 9 | Accounts []GenesisAccount `json:"accounts"` 10 | AuthData auth.GenesisState `json:"auth"` 11 | BankData bank.GenesisState `json:"bank"` 12 | StakingData staking.GenesisState `json:"staking"` 13 | MintData mint.GenesisState `json:"mint"` 14 | DistrData distr.GenesisState `json:"distr"` 15 | GovData gov.GenesisState `json:"gov"` 16 | SlashingData slashing.GenesisState `json:"slashing"` 17 | GenTxs []json.RawMessage `json:"gentxs"` 18 | } 19 | ``` 20 | 21 | ABCI `initChainer`에서는 Gaia의 `initFromGenesisState`를 기반으로 각 모듈의 `InitGenesis`를 호출해 각 모듈들의 `GenesisState`를 파라미터 값으로 불러옵니다. 22 | 23 | ## 계정 24 | 25 | `GenesisState`에서 제네시스 계정은 다음과 같이 정의됩니다: 26 | 27 | ```go 28 | type GenesisAccount struct { 29 | Address sdk.AccAddress `json:"address"` 30 | Coins sdk.Coins `json:"coins"` 31 | Sequence uint64 `json:"sequence_number"` 32 | AccountNumber uint64 `json:"account_number"` 33 | 34 | // vesting account fields 35 | OriginalVesting sdk.Coins `json:"original_vesting"` // total vesting coins upon initialization 36 | DelegatedFree sdk.Coins `json:"delegated_free"` // delegated vested coins at time of delegation 37 | DelegatedVesting sdk.Coins `json:"delegated_vesting"` // delegated vesting coins at time of delegation 38 | StartTime int64 `json:"start_time"` // vesting start time (UNIX Epoch time) 39 | EndTime int64 `json:"end_time"` // vesting end time (UNIX Epoch time) 40 | } 41 | ``` 42 | 43 | 각 계정은 시퀀스 수(sequence number (nonce))와 주소 외에도 유효한 고유 계정 번호를 보유해야 합니다. 44 | 45 | 만약 계정이 베스팅 계정인 경우, 필수 베스팅 정보가 제공되어야 합니다. 베스팅 계정은 최소 `OriginalVestin` 값과 `EndTime` 값이 정의되어야 합니다. 먄약 `StartTime`이 함께 정의된 경우, 계정은 "연속되는(continuous)" 베스팅 계정으로 처리되며, 지정된 스케줄 안에서 꾸준히 토큰을 언락합니다. 여기에서 `StartTime`의 값은 `EndTime`의 값 보다 작아야 하지만, `StartTime`의 값은 미래 값으로 지정할 수는 있습니다 (제네시스 시간과 동일하지 않아도 괜찮습니다). 새로운 스테이트(엑스포트 되지 않은 스테이트)에서 시작하는 체인의 경우, `OriginalVestin`의 값은 `Coins`의 값과 동일하거나 적어야 합니다. 46 | 47 | -------------------------------------------------------------------------------- /contrib/devtools/Makefile: -------------------------------------------------------------------------------- 1 | ### 2 | # Find OS and Go environment 3 | # GO contains the Go binary 4 | # FS contains the OS file separator 5 | ### 6 | ifeq ($(OS),Windows_NT) 7 | GO := $(shell where go.exe 2> NUL) 8 | FS := \\ 9 | else 10 | GO := $(shell command -v go 2> /dev/null) 11 | FS := / 12 | endif 13 | 14 | ifeq ($(GO),) 15 | $(error could not find go. Is it in PATH? $(GO)) 16 | endif 17 | 18 | GOPATH ?= $(shell $(GO) env GOPATH) 19 | GITHUBDIR := $(GOPATH)$(FS)src$(FS)github.com 20 | GOLANGCI_LINT_VERSION := v1.17.1 21 | GOLANGCI_LINT_HASHSUM := f5fa647a12f658924d9f7d6b9628d505ab118e8e049e43272de6526053ebe08d 22 | 23 | ### 24 | # Functions 25 | ### 26 | 27 | go_get = $(if $(findstring Windows_NT,$(OS)),\ 28 | IF NOT EXIST $(GITHUBDIR)$(FS)$(1)$(FS) ( mkdir $(GITHUBDIR)$(FS)$(1) ) else (cd .) &\ 29 | IF NOT EXIST $(GITHUBDIR)$(FS)$(1)$(FS)$(2)$(FS) ( cd $(GITHUBDIR)$(FS)$(1) && git clone https://github.com/$(1)/$(2) ) else (cd .) &\ 30 | ,\ 31 | mkdir -p $(GITHUBDIR)$(FS)$(1) &&\ 32 | (test ! -d $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && cd $(GITHUBDIR)$(FS)$(1) && git clone https://github.com/$(1)/$(2)) || true &&\ 33 | )\ 34 | cd $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && git fetch origin && git checkout -q $(3) 35 | 36 | go_install = $(call go_get,$(1),$(2),$(3)) && cd $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && $(GO) install 37 | 38 | mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) 39 | mkfile_dir := $(shell cd $(shell dirname $(mkfile_path)); pwd) 40 | 41 | ### 42 | # tools 43 | ### 44 | 45 | TOOLS_DESTDIR ?= $(GOPATH)/bin 46 | 47 | GOLANGCI_LINT = $(TOOLS_DESTDIR)/golangci-lint 48 | GOIMPORTS = $(TOOLS_DESTDIR)/goimports 49 | CLOG = $(TOOLS_DESTDIR)/clog 50 | RUNSIM = $(TOOLS_DESTDIR)/runsim 51 | 52 | all: tools 53 | 54 | tools: tools-stamp 55 | tools-stamp: $(GOIMPORTS) $(RUNSIM) 56 | touch $@ 57 | 58 | $(GOLANGCI_LINT): $(mkfile_dir)/install-golangci-lint.sh 59 | bash $(mkfile_dir)/install-golangci-lint.sh $(TOOLS_DESTDIR) $(GOLANGCI_LINT_VERSION) $(GOLANGCI_LINT_HASHSUM) 60 | 61 | $(GOIMPORTS): 62 | go get golang.org/x/tools/cmd/goimports@v0.0.0-20190628034336-212fb13d595e 63 | 64 | $(CLOG): 65 | go get github.com/cosmos/tools/cmd/clog/ 66 | 67 | $(RUNSIM): 68 | go get github.com/cosmos/tools/cmd/runsim/ 69 | 70 | golangci-lint: $(GOLANGCI_LINT) 71 | 72 | tools-clean: 73 | rm -f $(GOIMPORTS) $(CLOG) $(GOLANGCI_LINT) 74 | rm -f tools-stamp 75 | 76 | .PHONY: all tools tools-clean 77 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cosmos Hub 2 | ![banner](./docs/cosmos-hub-image.jpg) 3 | 4 | [![CircleCI](https://circleci.com/gh/cosmos/gaia/tree/master.svg?style=shield)](https://circleci.com/gh/cosmos/gaia/tree/master) 5 | [![codecov](https://codecov.io/gh/cosmos/gaia/branch/master/graph/badge.svg)](https://codecov.io/gh/cosmos/gaia) 6 | [![Go Report Card](https://goreportcard.com/badge/github.com/cosmos/gaia)](https://goreportcard.com/report/github.com/cosmos/gaia) 7 | [![license](https://img.shields.io/github/license/cosmos/gaia.svg)](https://github.com/cosmos/gaia/blob/master/LICENSE) 8 | [![LoC](https://tokei.rs/b1/github/cosmos/gaia)](https://github.com/cosmos/gaia) 9 | [![GolangCI](https://golangci.com/badges/github.com/cosmos/gaia.svg)](https://golangci.com/r/github.com/cosmos/gaia) 10 | [![riot.im](https://img.shields.io/badge/riot.im-JOIN%20CHAT-green.svg)](https://riot.im/app/#/room/#cosmos-sdk:matrix.org) 11 | 12 | This repository hosts `Gaia`, the first implementation of the Cosmos Hub. 13 | 14 | **Note**: Requires [Go 1.12+](https://golang.org/dl/) 15 | 16 | **DISCLAIMER**: The current version of Gaia running the Cosmos Hub (v0.34.x) is 17 | __NOT__ maintained in this repository. Gaia and the [Cosmos SDK](https://github.com/cosmos/cosmos-sdk/) 18 | have been recently split. All future versions of Gaia, including the next major 19 | upgrade, will be maintained in this repository. However, until the next major upgrade, 20 | Gaia should be fetched and built from the latest [released](https://github.com/cosmos/cosmos-sdk/releases) 21 | __v0.34.x__ version in the SDK repository. In addition, this repository should be 22 | considered unstable until the next major release of Gaia. Please bear with us 23 | while we continue the migration process and update documentation. 24 | 25 | ## Cosmos Hub Mainnet 26 | 27 | To run a full-node for the mainnet of the Cosmos Hub, first [install `gaia`](./docs/installation.md), then follow [the guide](./docs/join-mainnet.md). 28 | 29 | For status updates and genesis file, see the [launch repo](https://github.com/cosmos/launch). 30 | 31 | ## Quick Start 32 | 33 | ``` 34 | make install 35 | ``` 36 | 37 | ## Disambiguation 38 | 39 | This Cosmos-SDK project is not related to the [React-Cosmos](https://github.com/react-cosmos/react-cosmos) project (yet). Many thanks to Evan Coury and Ovidiu (@skidding) for this Github organization name. As per our agreement, this disambiguation notice will stay here. 40 | 41 | 42 | -------------------------------------------------------------------------------- /docs/translations/kr/validators/security.md: -------------------------------------------------------------------------------- 1 | ## 검증인 보안 2 | 3 | 검증인 세팅의 다양성이 네트워크 전체의 탄력성을 증가하기 때문에 각 검증인은 각자 독립적인 형태로 노드를 운영하는 것을 추천합니다. 메인넷을 대비하기 위해서 지금 부터 노드 운영을 시작하실 것을 추천합니다. 4 | 5 | ## 키 관리 - HSM 6 | 7 | 안전한 노드 운영의 기초는 공격자가 검증인의 프라이빗키를 탈취할 수 없게 하는 것입니다. 만약 이 것이 가능하다면, 키가 탈취된 모든 위임된 코인은 위험에 처해질 수 있습니다. 이런 리스크를 줄이기 위한 가장 좋은 방법은 하드웨어 보안 모듈(HSM, Hardware Security Module)을 이용하는 것입니다. 8 | 9 | 코스모스 허브에서 HSM을 사용하시는 경우, 해당 모듈은 `ed25519` 서명을 지원해야 합니다. YubiHSM2는 `ed25519`를 지원하며 이에 대한 어답터 라이브러리(adapter library)는 추후 지원할 계획입니다. YubiHSM은 프라이빗 키 탈취에 대한 보안을 지원하지만, 동일한 블록을 두번 서명하는 것에 대한 안전성은 제공하지 않는다는 것에 유의하시기 바랍니다. 10 | 11 | 이 외에도 텐더민트 팀은 현재 검증인 서명을 위한 Ledger Nano S 지원을 준비하고 있습니다. Ledger Nano S의 경우 최신 블록을 저장하기 떄문에 더블사인 공격을 막을 수 있을 것으로 보입니다. 12 | 13 | 추후 솔루션들이 준비되는대로 이 페이지는 업데이트 됩니다. 14 | 15 | ## 센트리노드 (DDOS 방어) 16 | 17 | 검증인은 코스모스 네트워크가 일정의 서비스 거부 공격(denial of service) 공격을 감내할 수 있도록 해야 합니다. 18 | 19 | 이런 공격을 방어할 방법 중 하나는 검증인이 본인의 네트워크를 '센트리노드 아키텍쳐' 형태로 구성하는 것입니다. 20 | 21 | 검증인은 신뢰할 수 있는 풀노드에만 연결해야 합니다. 이는 본인이 직접 운영하는 노드 또는 사회적으로(개인적으로) 아는 검증인들이 운영하는 풀노드 등이 포함될 수 있습니다. 대다수의 검증인 노드는 데이터센터에서 운영됩니다. 대다수의 데이터센터는 다른 주요 클라우드 서비스 제공자와 직접적인 링크를 제공합니다. 검증인들은 이런 링크를 통해서 클라우드 기반 센트리를 연결할 수 있습니다. 이런 형태의 아키텍쳐는 DDoS 공격의 부담을 검증 노드에서 센트리노드로 우회시키기 때문에 상황에 따라 추가적인 센트리노드를 운영해야될 수 있습니다. 22 | 23 | 센트리노드는 빠르게 추가될 수 있으며 상황에 따라 IP 주소를 변경할 수 있습니다. 센트리노드와 검증인 노드 간의 연결은 프라이빗 IP를 통해 이루어지기 때문에, 인터넷 기반 공격의 피해를 줄일 수 있습니다. 이런 형태의 디자인은 검증인의 블록 제안과 투표가 언제나 네트워크에 전달될 수 있게 합니다. 24 | 25 | 센트리노드 아키텍쳐를 세팅하시기 위해서는 다음 절차를 참고하십시오: 26 | 27 | 검증인 노드는 해당 노드의 `config.toml`을 수정해야 합니다: 28 | 29 | ```bash 30 | # Comma separated list of nodes to keep persistent connections to 31 | # Do not add private peers to this list if you don't want them advertised 32 | persistent_peers =[list of sentry nodes] 33 | 34 | # Set true to enable the peer-exchange reactor 35 | pex = false 36 | ``` 37 | 38 | 센트리노드 또한 해당 노드의 `config.toml` 파일을 수정해야 합니다: 39 | 40 | ```bash 41 | # Comma separated list of peer IDs to keep private (will not be gossiped to other peers) 42 | private_peer_ids = "ipaddress of validator nodes" 43 | ``` 44 | 45 | ## 환경 변수 46 | 47 | 기본적으로 다음 프리픽스(prefix)의 대문자 환경 변수(environment variables)는 소문자 커맨드라인 플래그를 대체하게 됩니다: 48 | 49 | - `GA` (for Gaia 플래그) 50 | - `TM` (for Tendermint 플래그) 51 | - `BC` (for democli 또는 basecli 플래그) 52 | 53 | 예를들어 `GA_CHAIN_ID` 환경 변수는 `--chain-id` 커맨드라인 플래그에 매핑됩니다. 명백한(explicit) 커맨드라인 플래그는 환경 변수 보다 상위에 속하며, 환경 변수는 모든 설정 파일 보다 상위에 속합니다. 중요한 파라미터는 CLI의 플래그로 정의되어야 하며 환경 변수의 수정 가능성을 줄이는 것이 중요합니다. 54 | 55 | -------------------------------------------------------------------------------- /networks/remote/ansible/roles/setup-validators/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Ensure keys folder exists locally 4 | file: path=keys state=directory 5 | connection: local 6 | run_once: true 7 | become: no 8 | 9 | - name: Create gaiad user 10 | user: name=gaiad home=/home/gaiad shell=/bin/bash 11 | 12 | - name: Copy binary 13 | copy: 14 | src: "{{BINARY}}" 15 | dest: /usr/bin 16 | mode: 0755 17 | 18 | - name: Copy service file 19 | copy: src=gaiad.service dest=/etc/systemd/system/gaiad.service mode=0755 20 | notify: reload systemd 21 | 22 | - name: Get node ID 23 | command: "cat /etc/nodeid" 24 | changed_when: false 25 | register: nodeid 26 | 27 | - name: Create initial transaction 28 | command: "/usr/bin/gaiad init gen-tx --name=node{{nodeid.stdout_lines[0]}} --ip={{inventory_hostname}}" 29 | register: gentxresult 30 | become: yes 31 | become_user: gaiad 32 | args: 33 | creates: /home/gaiad/.gaiad/config/gentx 34 | 35 | - name: Get wallet word seed from result of initial transaction locally 36 | when: gentxresult["changed"] 37 | shell: "echo '{{gentxresult.stdout}}' | python -c 'import json,sys ; print json.loads(\"\".join(sys.stdin.readlines()))[\"app_message\"][\"secret\"]'" 38 | changed_when: false 39 | register: walletkey 40 | connection: local 41 | 42 | - name: Write wallet word seed to local files 43 | when: gentxresult["changed"] 44 | copy: "content={{walletkey.stdout}} dest=keys/node{{nodeid.stdout_lines[0]}}" 45 | become: no 46 | connection: local 47 | 48 | - name: Find gentx file 49 | command: "ls /home/gaiad/.gaiad/config/gentx" 50 | changed_when: false 51 | register: gentxfile 52 | 53 | - name: Clear local gen-tx list 54 | file: path=files/ state=absent 55 | connection: local 56 | run_once: yes 57 | 58 | - name: Get gen-tx file 59 | fetch: 60 | dest: files/ 61 | src: "/home/gaiad/.gaiad/config/gentx/{{gentxfile.stdout_lines[0]}}" 62 | flat: yes 63 | 64 | - name: Compress gathered gen-tx files locally 65 | archive: path=files/ exclude_path=files/gen-tx.tgz dest=files/gen-tx.tgz 66 | run_once: yes 67 | connection: local 68 | 69 | - name: Unpack gen-tx archive 70 | unarchive: src=files/gen-tx.tgz dest=/home/gaiad/.gaiad/config/gentx owner=gaiad 71 | 72 | - name: Generate genesis.json 73 | command: "/usr/bin/gaiad init --with-txs --name=node{{nodeid.stdout_lines[0]}} --chain-id={{TESTNET_NAME}}" 74 | become: yes 75 | become_user: gaiad 76 | args: 77 | creates: /home/gaiad/.gaiad/config/genesis.json 78 | 79 | -------------------------------------------------------------------------------- /docs/join-testnet.md: -------------------------------------------------------------------------------- 1 | # Join the Public Testnet 2 | 3 | ::: tip Current Testnet 4 | See the [testnet repo](https://github.com/cosmos/testnets) for 5 | information on the latest testnet, including the correct version 6 | of Gaia to use and details about the genesis file. 7 | ::: 8 | 9 | ::: warning 10 | **You need to [install gaia](./installation.md) before you go further** 11 | ::: 12 | 13 | ## Starting a New Node 14 | 15 | > NOTE: If you ran a full node on a previous testnet, please skip to [Upgrading From Previous Testnet](#upgrading-from-previous-testnet). 16 | 17 | To start a new node, the mainnet instructions apply: 18 | 19 | - [Join the mainnet](./join-mainnet.md) 20 | - [Deploy a validator](./validators/validator-setup.md) 21 | 22 | The only difference is the SDK version and genesis file. See the [testnet repo](https://github.com/cosmos/testnets) for information on testnets, including the correct version of the Cosmos-SDK to use and details about the genesis file. 23 | 24 | ## Upgrading Your Node 25 | 26 | These instructions are for full nodes that have ran on previous versions of and would like to upgrade to the latest testnet. 27 | 28 | ### Reset Data 29 | 30 | First, remove the outdated files and reset the data. 31 | 32 | ```bash 33 | rm $HOME/.gaiad/config/addrbook.json $HOME/.gaiad/config/genesis.json 34 | gaiad unsafe-reset-all 35 | ``` 36 | 37 | Your node is now in a pristine state while keeping the original `priv_validator.json` and `config.toml`. If you had any sentry nodes or full nodes setup before, 38 | your node will still try to connect to them, but may fail if they haven't also 39 | been upgraded. 40 | 41 | ::: danger Warning 42 | Make sure that every node has a unique `priv_validator.json`. Do not copy the `priv_validator.json` from an old node to multiple new nodes. Running two nodes with the same `priv_validator.json` will cause you to double sign. 43 | ::: 44 | 45 | ### Software Upgrade 46 | 47 | Now it is time to upgrade the software: 48 | 49 | ```bash 50 | cd $GOPATH/src/github.com/cosmos/gaia 51 | git fetch --all && git checkout master 52 | make update_tools install 53 | ``` 54 | 55 | ::: tip 56 | *NOTE*: If you have issues at this step, please check that you have the latest stable version of GO installed. 57 | ::: 58 | 59 | Note we use `master` here since it contains the latest stable release. 60 | See the [testnet repo](https://github.com/cosmos/testnets) for details on which version is needed for which testnet, and the [Gaia release page](https://github.com/cosmos/gaia/releases) for details on each release. 61 | 62 | Your full node has been cleanly upgraded! 63 | -------------------------------------------------------------------------------- /docs/installation.md: -------------------------------------------------------------------------------- 1 | ## Install Gaia 2 | 3 | This guide will explain how to install the `gaiad` and `gaiacli` entrypoints onto your system. With these installed on a server, you can participate in the mainnet as either a [Full Node](./join-mainnet.md) or a [Validator](./validators/validator-setup.md). 4 | 5 | ### Install Go 6 | 7 | Install `go` by following the [official docs](https://golang.org/doc/install). Remember to set your `$GOPATH` and `$PATH` environment variables, for example: 8 | 9 | ```bash 10 | mkdir -p $HOME/go/bin 11 | echo "export GOPATH=$HOME/go" >> ~/.bash_profile 12 | echo "export PATH=\$PATH:\$GOPATH/bin" >> ~/.bash_profile 13 | source ~/.bash_profile 14 | ``` 15 | 16 | ::: tip 17 | **Go 1.12+** is required for the Cosmos SDK. 18 | ::: 19 | 20 | ### Install the binaries 21 | 22 | Next, let's install the latest version of Gaia. Make sure you `git checkout` the correct [released version](https://github.com/cosmos/gaia/releases). 23 | 24 | ```bash 25 | git clone -b https://github.com/cosmos/gaia 26 | cd gaia && make install 27 | ``` 28 | 29 | > _NOTE_: If you have issues at this step, please check that you have the latest stable version of GO installed. 30 | 31 | That will install the `gaiad` and `gaiacli` binaries. Verify that everything is OK: 32 | 33 | ```bash 34 | $ gaiad version --long 35 | $ gaiacli version --long 36 | ``` 37 | 38 | `gaiacli` for instance should output something similar to: 39 | 40 | ``` 41 | cosmos-sdk: 0.33.0 42 | git commit: 7b4104aced52aa5b59a96c28b5ebeea7877fc4f0 43 | build tags: netgo ledger 44 | go version go1.12 linux/amd64 45 | ``` 46 | 47 | ##### Build Tags 48 | 49 | Build tags indicate special features that have been enabled in the binary. 50 | 51 | | Build Tag | Description | 52 | | --------- | ----------------------------------------------- | 53 | | netgo | Name resolution will use pure Go code | 54 | | ledger | Ledger devices are supported (hardware wallets) | 55 | 56 | ### Install binary distribution via snap (Linux only) 57 | 58 | **Do not use snap at this time to install the binaries for production until we have a reproducible binary system.** 59 | 60 | ### Developer Workflow 61 | 62 | To test any changes made in the SDK or Tendermint, a `replace` clause needs to be added to `go.mod` providing the correct import path. 63 | 64 | - Make appropriate changes 65 | - Add `replace github.com/cosmos/cosmos-sdk => /path/to/clone/cosmos-sdk` to `go.mod` 66 | - Run `make clean install` or `make clean build` 67 | - Test changes 68 | 69 | ### Next 70 | 71 | Now you can [join the mainnet](./join-mainnet.md), [the public testnet](./join-testnet.md) or [create you own testnet](./deploy-testnet.md) 72 | -------------------------------------------------------------------------------- /networks/remote/terraform-app/infra/vpc.tf: -------------------------------------------------------------------------------- 1 | resource "aws_vpc" "vpc" { 2 | cidr_block = "10.0.0.0/16" 3 | 4 | tags { 5 | Name = "${var.name}" 6 | } 7 | 8 | } 9 | 10 | resource "aws_internet_gateway" "internet_gateway" { 11 | vpc_id = "${aws_vpc.vpc.id}" 12 | 13 | tags { 14 | Name = "${var.name}" 15 | } 16 | } 17 | 18 | resource "aws_route_table" "route_table" { 19 | vpc_id = "${aws_vpc.vpc.id}" 20 | 21 | route { 22 | cidr_block = "0.0.0.0/0" 23 | gateway_id = "${aws_internet_gateway.internet_gateway.id}" 24 | } 25 | 26 | tags { 27 | Name = "${var.name}" 28 | } 29 | } 30 | 31 | data "aws_availability_zones" "zones" { 32 | state = "available" 33 | } 34 | 35 | resource "aws_subnet" "subnet" { 36 | count = "${min(length(data.aws_availability_zones.zones.names),var.max_zones)}" 37 | vpc_id = "${aws_vpc.vpc.id}" 38 | availability_zone = "${element(data.aws_availability_zones.zones.names,count.index)}" 39 | cidr_block = "${cidrsubnet(aws_vpc.vpc.cidr_block, 8, count.index)}" 40 | map_public_ip_on_launch = "true" 41 | 42 | tags { 43 | Name = "${var.name}-${element(data.aws_availability_zones.zones.names,count.index)}" 44 | } 45 | } 46 | 47 | resource "aws_route_table_association" "route_table_association" { 48 | count = "${min(length(data.aws_availability_zones.zones.names),var.max_zones)}" 49 | subnet_id = "${element(aws_subnet.subnet.*.id,count.index)}" 50 | route_table_id = "${aws_route_table.route_table.id}" 51 | } 52 | 53 | resource "aws_security_group" "secgroup" { 54 | name = "${var.name}" 55 | vpc_id = "${aws_vpc.vpc.id}" 56 | description = "Automated security group for application instances" 57 | tags { 58 | Name = "${var.name}" 59 | } 60 | 61 | ingress { 62 | from_port = 22 63 | to_port = 22 64 | protocol = "tcp" 65 | cidr_blocks = ["0.0.0.0/0"] 66 | } 67 | 68 | ingress { 69 | from_port = 443 70 | to_port = 443 71 | protocol = "tcp" 72 | cidr_blocks = ["0.0.0.0/0"] 73 | } 74 | 75 | ingress { 76 | from_port = 1317 77 | to_port = 1317 78 | protocol = "tcp" 79 | cidr_blocks = ["0.0.0.0/0"] 80 | } 81 | 82 | ingress { 83 | from_port = 26656 84 | to_port = 26657 85 | protocol = "tcp" 86 | cidr_blocks = ["0.0.0.0/0"] 87 | } 88 | 89 | ingress { 90 | from_port = 26660 91 | to_port = 26660 92 | protocol = "tcp" 93 | cidr_blocks = ["0.0.0.0/0"] 94 | } 95 | 96 | egress { 97 | from_port = 0 98 | to_port = 0 99 | protocol = "-1" 100 | cidr_blocks = ["0.0.0.0/0"] 101 | 102 | } 103 | } 104 | 105 | -------------------------------------------------------------------------------- /networks/remote/terraform-aws/nodes/main.tf: -------------------------------------------------------------------------------- 1 | 2 | provider "aws" { 3 | region = "${var.region}" 4 | } 5 | 6 | resource "aws_key_pair" "testnets" { 7 | count = "${var.execute?1:0}" 8 | key_name = "testnets-${var.name}" 9 | public_key = "${file(var.ssh_public_file)}" 10 | } 11 | 12 | data "aws_ami" "linux" { 13 | most_recent = true 14 | filter { 15 | name = "name" 16 | values = ["${var.image_name}"] 17 | } 18 | } 19 | 20 | data "aws_availability_zones" "zones" { 21 | state = "available" 22 | } 23 | 24 | resource "aws_security_group" "secgroup" { 25 | count = "${var.execute?1:0}" 26 | name = "${var.name}" 27 | description = "Automated security group for performance testing testnets" 28 | tags { 29 | Name = "testnets-${var.name}" 30 | } 31 | 32 | ingress { 33 | from_port = 22 34 | to_port = 22 35 | protocol = "tcp" 36 | cidr_blocks = ["0.0.0.0/0"] 37 | } 38 | 39 | ingress { 40 | from_port = 26656 41 | to_port = 26657 42 | protocol = "tcp" 43 | cidr_blocks = ["0.0.0.0/0"] 44 | } 45 | 46 | ingress { 47 | from_port = 26660 48 | to_port = 26660 49 | protocol = "tcp" 50 | cidr_blocks = ["0.0.0.0/0"] 51 | } 52 | 53 | egress { 54 | from_port = 0 55 | to_port = 0 56 | protocol = "-1" 57 | cidr_blocks = ["0.0.0.0/0"] 58 | 59 | } 60 | } 61 | 62 | resource "aws_instance" "node" { 63 | count = "${var.execute?var.SERVERS*length(data.aws_availability_zones.zones.names):0}" 64 | ami = "${data.aws_ami.linux.image_id}" 65 | instance_type = "${var.instance_type}" 66 | key_name = "${aws_key_pair.testnets.key_name}" 67 | associate_public_ip_address = true 68 | security_groups = [ "${aws_security_group.secgroup.name}" ] 69 | availability_zone = "${element(data.aws_availability_zones.zones.names,count.index)}" 70 | 71 | tags { 72 | Environment = "${var.name}" 73 | Name = "${var.name}-${element(data.aws_availability_zones.zones.names,count.index)}" 74 | } 75 | 76 | volume_tags { 77 | Environment = "${var.name}" 78 | Name = "${var.name}-${element(data.aws_availability_zones.zones.names,count.index)}-VOLUME" 79 | } 80 | 81 | root_block_device { 82 | volume_size = 40 83 | } 84 | 85 | connection { 86 | user = "centos" 87 | private_key = "${file(var.ssh_private_file)}" 88 | timeout = "600s" 89 | } 90 | 91 | provisioner "file" { 92 | source = "files/terraform.sh" 93 | destination = "/tmp/terraform.sh" 94 | } 95 | 96 | provisioner "remote-exec" { 97 | inline = [ 98 | "chmod +x /tmp/terraform.sh", 99 | "sudo /tmp/terraform.sh ${var.name} ${var.multiplier} ${count.index}", 100 | ] 101 | } 102 | 103 | } 104 | 105 | -------------------------------------------------------------------------------- /docs/genesis-state.md: -------------------------------------------------------------------------------- 1 | # Gaia Genesis State 2 | 3 | Gaia genesis state, `GenesisState`, is composed of accounts, various module 4 | states and metadata such as genesis transactions. Each module may specify its 5 | own `GenesisState`. In addition, each module may specify its own genesis state 6 | validation, import and export functionality. 7 | 8 | The Gaia genesis state is defined as follows: 9 | 10 | ```go 11 | type GenesisState struct { 12 | Accounts []GenesisAccount `json:"accounts"` 13 | AuthData auth.GenesisState `json:"auth"` 14 | BankData bank.GenesisState `json:"bank"` 15 | StakingData staking.GenesisState `json:"staking"` 16 | MintData mint.GenesisState `json:"mint"` 17 | DistrData distr.GenesisState `json:"distribution"` 18 | GovData gov.GenesisState `json:"gov"` 19 | SlashingData slashing.GenesisState `json:"slashing"` 20 | GenTxs []json.RawMessage `json:"gentxs"` 21 | } 22 | ``` 23 | 24 | In the ABCI `initChainer` definition of Gaia the `initFromGenesisState` is called 25 | which internally calls each module's `InitGenesis` providing its own respective 26 | `GenesisState` as a parameter. 27 | 28 | ## Accounts 29 | 30 | Genesis accounts defined in the `GenesisState` are defined as follows: 31 | 32 | ```go 33 | type GenesisAccount struct { 34 | Address sdk.AccAddress `json:"address"` 35 | Coins sdk.Coins `json:"coins"` 36 | Sequence uint64 `json:"sequence_number"` 37 | AccountNumber uint64 `json:"account_number"` 38 | 39 | // vesting account fields 40 | OriginalVesting sdk.Coins `json:"original_vesting"` // total vesting coins upon initialization 41 | DelegatedFree sdk.Coins `json:"delegated_free"` // delegated vested coins at time of delegation 42 | DelegatedVesting sdk.Coins `json:"delegated_vesting"` // delegated vesting coins at time of delegation 43 | StartTime int64 `json:"start_time"` // vesting start time (UNIX Epoch time) 44 | EndTime int64 `json:"end_time"` // vesting end time (UNIX Epoch time) 45 | } 46 | ``` 47 | 48 | Each account must have a valid and unique account number in addition to a 49 | sequence number (nonce) and address. 50 | 51 | Accounts may also be vesting, in which case they must provide the necessary vesting 52 | information. Vesting accounts must provide at a minimum `OriginalVesting` and 53 | `EndTime`. If `StartTime` is also provided, the account will be treated as a 54 | "continuous" vesting account in which it vests coins at a predefined schedule. 55 | Providing a `StartTime` must be less than `EndTime` but may be in the future. 56 | In other words, it does not have to be equal to the genesis time. In a new chain 57 | starting from a fresh state (not exported), `OriginalVesting` must be less than 58 | or equal to `Coins.` 59 | 60 | 61 | -------------------------------------------------------------------------------- /docs/launch/blog-2-cn.md: -------------------------------------------------------------------------------- 1 | # **Cosmos主网上线三部曲** 2 | 3 | 4 | 5 | 6 | Cosmos主网启动将分成3个阶段分布完成,下面我们将具体介绍每一阶段的预期目标。 7 | 8 | 9 | 10 | ## **🚨第一阶段:网络逐步趋于稳定🚨** 11 | 12 | 13 | 14 | 在第一阶段,主网可能会不太稳定,也许会出现暂停或其他故障,可能需要Cosmos主网验证人和全节点运营者们一起来协助修复。在网络趋于稳定过程中,出现此类故障并不意外。 15 | 16 | 17 | **状态修改和主网启动:** 18 | 19 | 区块链的核心价值之一是其不可篡改性,也就是说我们不会通过回滚来修改过去的状态记录。最终,这种不可篡改的理念在软件共识协议层面得到了支持,并最终在社区参与者之间形成了社会契约。 20 | 21 | 22 | 23 | 也就是说,Cosmos Hub的底层技术开发是能够实现低难度的分叉和回滚的, 我们已经看到社区在测试网上做过多次相应的演练。这些技术也会在主网上应用,用以最终抵御卡特尔风险的发生。 24 | 25 | 26 | 27 | 回滚网络状态通常被认为是非常严重的问题,因为这将损害网络的经济最终性。因此,回滚网络状态只能在极端状态下使用,比如以太网的DAO硬分叉,也就是说,在Cosmos Hub主网启动初期,转账交易不会开启,因此回滚的危害性很小,因为状态转换远比“经济最终性”的影响低。 如果需要,比如发现漏洞,我们可以将过去某一个高度时的网络状态导出,然后重启网络,就如同我们在测试网上演练过的那样。 28 | 29 | 30 | 31 | 一旦链上治理决定开启交易功能,全网将会遵从经济最终性。 32 | 33 | 34 | 35 | 总而言之,如果在链上交易功能开启之前,Cosmos Hub发现任何错误或漏洞,那么用户可期望回滚至任意状态,甚至创世块。 36 | 37 | 38 | 39 | 一旦链上交易功能开始后,状态回滚方式将很难被采纳。 40 | 41 | 42 | 43 | **对开发人员的建议**:Cosmos主网启动是投资者参与主网的第一阶段。作为分布式应用的开发人员,您可能是Cosmos-SDK框架或Tendermint Core的用户。开发者基于[Cosmos-SDK](https://cosmos.network/docs/)或[Tendermint](https://tendermint.com/docs/)的应用开发进度现阶段应该不受Cosmos Hub的影响,但如果您的项目需要使用[IBC](https://blog.cosmos.network/developer-deep-dive-cosmos-ibc-5855aaf183fe)(链间通信协议),则必须要等到第三阶段或参与即将开始的IBC测试网络。 44 | 45 | 46 | 47 | **对于用户的建议**:在此阶段,我们强烈建议您不要交易Atoms(其实法律合同也限定不能交易),因为在这个阶段仍然存在状态回滚的风险。 48 | 49 | 50 | 51 | 但是,您可以通过下面链接的[CLI指南](https://github.com/cosmos/cosmos-sdk/blob/develop/docs/gaia/delegator-guide-cli.md)和视频教程的指导,在此阶段将Atoms通证委托给验证人。当然,如果发生状态修改,那么所有收益(包括手续费和通胀收益)都将丢失。Voyager是用于与Cosmos Hub交互的图形化客户端,目前处于alpha版,正在持续开发中。一旦Voager beta版上线,并可以安全使用,我们将另行公告。 52 | 53 | 54 | CLI指南和视频教程:https://v.qq.com/x/page/q08425izfhi.html 55 | 56 | 57 | 58 | ## 第二阶段:链上交易开启 59 | 60 | **摘要:** 61 | 62 | 一旦我们认为主网足够稳定,在链上抵押了Atom的通证持有者将会通过链上治理过程投票决定是否开启链上交易。 63 | 64 | 65 | 66 | 67 | Cosmos浏览器是查看治理提案状态的最佳途径,可以在我们的主网启动页面上找到多款[Cosmos浏览器](https://cosmos.network/launch)。 68 | 69 | 70 | 71 | 对用户来说:如果提案被社区接受,并且链上交易开启,您就可以在链上转移您的Atom了。 72 | 73 | 74 | 75 | ## 第三阶段:启用IBC协议 76 | 77 | 78 | 79 | 80 | 81 | **摘要:** 82 | 83 | 第三阶段我们将会发布[IBC协议](https://github.com/cosmos/cosmos-sdk/blob/develop/docs/spec/ibc/overview.md),并且对是否将其纳入Cosmos-SDK的核心模块库进行链上治理投票。 84 | 85 | 86 | 87 | **对开发人员的建议**:使用Cosmos-SDK或Tendermint BFT构建的应用专有链将能够连接到 Cosmos Hub,并与连接到Hubs上的其他任意区块链进行跨链交互。 88 | 89 | 90 | 91 | **对用户的建议**:您可以将各种通证和NFT直接从采用IBC协议连接的一个链转移到另一个通过IBC协议连接的链,而无需通过一个第三方中心化平台。 92 | 93 | 94 | 95 | ## 验证人提示: 提交您的主网gentx文件 96 | 97 | 1. 验证人应该已经生成并且安全的保存好用于主网验证的共识密钥。 98 | 99 | 2. 验证人根据自己获得ATOM通证的来源,比如募资参与者或权益争夺活动的获奖者,准备好在创世文件(Genesis)中需要签署的交易。 100 | 101 | 3. 一旦创世通证分配计划发布,我们将开始征集gentx文件。 102 | 103 | 104 | 105 | ## 总结 106 | 107 | Cosmos旨在建立所有区块链间的桥梁,最终建立一个区块链互联网。然而,路漫漫其修远兮,我们还有很长的路要走。主网上线之后,我们需要完成与整个通证经济世界的深度融合,很多的工作要做等着我们去完成。正如肯尼迪在逆境中曾经说过的那样: 108 | 109 | 110 | 111 | “我们选择去月球,不是因为很容易,而是因为很难......” 112 | 113 | 114 | 115 | 走更崎岖的路,才会看见更美的风景! 116 | **** 117 | -------------------------------------------------------------------------------- /docs/translations/cn/launch/blog-2-cn.md: -------------------------------------------------------------------------------- 1 | # **Cosmos主网上线三部曲** 2 | 3 | 4 | 5 | 6 | Cosmos主网启动将分成3个阶段分布完成,下面我们将具体介绍每一阶段的预期目标。 7 | 8 | 9 | 10 | ## **🚨第一阶段:网络逐步趋于稳定🚨** 11 | 12 | 13 | 14 | 在第一阶段,主网可能会不太稳定,也许会出现暂停或其他故障,可能需要Cosmos主网验证人和全节点运营者们一起来协助修复。在网络趋于稳定过程中,出现此类故障并不意外。 15 | 16 | 17 | **状态修改和主网启动:** 18 | 19 | 区块链的核心价值之一是其不可篡改性,也就是说我们不会通过回滚来修改过去的状态记录。最终,这种不可篡改的理念在软件共识协议层面得到了支持,并最终在社区参与者之间形成了社会契约。 20 | 21 | 22 | 23 | 也就是说,Cosmos Hub的底层技术开发是能够实现低难度的分叉和回滚的, 我们已经看到社区在测试网上做过多次相应的演练。这些技术也会在主网上应用,用以最终抵御卡特尔风险的发生。 24 | 25 | 26 | 27 | 回滚网络状态通常被认为是非常严重的问题,因为这将损害网络的经济最终性。因此,回滚网络状态只能在极端状态下使用,比如以太网的DAO硬分叉,也就是说,在Cosmos Hub主网启动初期,转账交易不会开启,因此回滚的危害性很小,因为状态转换远比“经济最终性”的影响低。 如果需要,比如发现漏洞,我们可以将过去某一个高度时的网络状态导出,然后重启网络,就如同我们在测试网上演练过的那样。 28 | 29 | 30 | 31 | 一旦链上治理决定开启交易功能,全网将会遵从经济最终性。 32 | 33 | 34 | 35 | 总而言之,如果在链上交易功能开启之前,Cosmos Hub发现任何错误或漏洞,那么用户可期望回滚至任意状态,甚至创世块。 36 | 37 | 38 | 39 | 一旦链上交易功能开始后,状态回滚方式将很难被采纳。 40 | 41 | 42 | 43 | **对开发人员的建议**:Cosmos主网启动是投资者参与主网的第一阶段。作为分布式应用的开发人员,您可能是Cosmos-SDK框架或Tendermint Core的用户。开发者基于[Cosmos-SDK](https://cosmos.network/docs/)或[Tendermint](https://tendermint.com/docs/)的应用开发进度现阶段应该不受Cosmos Hub的影响,但如果您的项目需要使用[IBC](https://blog.cosmos.network/developer-deep-dive-cosmos-ibc-5855aaf183fe)(链间通信协议),则必须要等到第三阶段或参与即将开始的IBC测试网络。 44 | 45 | 46 | 47 | **对于用户的建议**:在此阶段,我们强烈建议您不要交易Atoms(其实法律合同也限定不能交易),因为在这个阶段仍然存在状态回滚的风险。 48 | 49 | 50 | 51 | 但是,您可以通过下面链接的[CLI指南](https://github.com/cosmos/cosmos-sdk/blob/develop/docs/gaia/delegator-guide-cli.md)和视频教程的指导,在此阶段将Atoms通证委托给验证人。当然,如果发生状态修改,那么所有收益(包括手续费和通胀收益)都将丢失。Voyager是用于与Cosmos Hub交互的图形化客户端,目前处于alpha版,正在持续开发中。一旦Voager beta版上线,并可以安全使用,我们将另行公告。 52 | 53 | 54 | CLI指南和视频教程:https://v.qq.com/x/page/q08425izfhi.html 55 | 56 | 57 | 58 | ## 第二阶段:链上交易开启 59 | 60 | **摘要:** 61 | 62 | 一旦我们认为主网足够稳定,在链上抵押了Atom的通证持有者将会通过链上治理过程投票决定是否开启链上交易。 63 | 64 | 65 | 66 | 67 | Cosmos浏览器是查看治理提案状态的最佳途径,可以在我们的主网启动页面上找到多款[Cosmos浏览器](https://cosmos.network/launch)。 68 | 69 | 70 | 71 | 对用户来说:如果提案被社区接受,并且链上交易开启,您就可以在链上转移您的Atom了。 72 | 73 | 74 | 75 | ## 第三阶段:启用IBC协议 76 | 77 | 78 | 79 | 80 | 81 | **摘要:** 82 | 83 | 第三阶段我们将会发布[IBC协议](https://github.com/cosmos/cosmos-sdk/blob/develop/docs/spec/ibc/overview.md),并且对是否将其纳入Cosmos-SDK的核心模块库进行链上治理投票。 84 | 85 | 86 | 87 | **对开发人员的建议**:使用Cosmos-SDK或Tendermint BFT构建的应用专有链将能够连接到 Cosmos Hub,并与连接到Hubs上的其他任意区块链进行跨链交互。 88 | 89 | 90 | 91 | **对用户的建议**:您可以将各种通证和NFT直接从采用IBC协议连接的一个链转移到另一个通过IBC协议连接的链,而无需通过一个第三方中心化平台。 92 | 93 | 94 | 95 | ## 验证人提示: 提交您的主网gentx文件 96 | 97 | 1. 验证人应该已经生成并且安全的保存好用于主网验证的共识密钥。 98 | 99 | 2. 验证人根据自己获得ATOM通证的来源,比如募资参与者或权益争夺活动的获奖者,准备好在创世文件(Genesis)中需要签署的交易。 100 | 101 | 3. 一旦创世通证分配计划发布,我们将开始征集gentx文件。 102 | 103 | 104 | 105 | ## 总结 106 | 107 | Cosmos旨在建立所有区块链间的桥梁,最终建立一个区块链互联网。然而,路漫漫其修远兮,我们还有很长的路要走。主网上线之后,我们需要完成与整个通证经济世界的深度融合,很多的工作要做等着我们去完成。正如肯尼迪在逆境中曾经说过的那样: 108 | 109 | 110 | 111 | “我们选择去月球,不是因为很容易,而是因为很难......” 112 | 113 | 114 | 115 | 走更崎岖的路,才会看见更美的风景! 116 | **** 117 | -------------------------------------------------------------------------------- /docs/validators/overview.md: -------------------------------------------------------------------------------- 1 | # Validators Overview 2 | 3 | ## Introduction 4 | 5 | The [Cosmos Hub](../README.md) is based on [Tendermint](https://github.com/tendermint/tendermint/tree/master/docs/introduction), which relies on a set of validators that are responsible for committing new blocks in the blockchain. These validators participate in the consensus protocol by broadcasting votes which contain cryptographic signatures signed by each validator's private key. 6 | 7 | Validator candidates can bond their own Atoms and have Atoms ["delegated"](../delegator-guide-cli.md), or staked, to them by token holders. The Cosmos Hub will have 100 validators, but over time this will increase to 300 validators according to a predefined schedule. The validators are determined by who has the most stake delegated to them — the top 100 validator candidates with the most stake will become Cosmos validators. 8 | 9 | Validators and their delegators will earn Atoms as block provisions and tokens as transaction fees through execution of the Tendermint consensus protocol. Initially, transaction fees will be paid in Atoms but in the future, any token in the Cosmos ecosystem will be valid as fee tender if it is whitelisted by governance. Note that validators can set commission on the fees their delegators receive as additional incentive. 10 | 11 | If validators double sign, are frequently offline or do not participate in governance, their staked Atoms (including Atoms of users that delegated to them) can be slashed. The penalty depends on the severity of the violation. 12 | 13 | ## Hardware 14 | 15 | There currently exists no appropriate cloud solution for validator key management. This may change in 2018 when cloud SGX becomes more widely available. For this reason, validators must set up a physical operation secured with restricted access. A good starting place, for example, would be co-locating in secure data centers. 16 | 17 | Validators should expect to equip their datacenter location with redundant power, connectivity, and storage backups. Expect to have several redundant networking boxes for fiber, firewall and switching and then small servers with redundant hard drive and failover. Hardware can be on the low end of datacenter gear to start out with. 18 | 19 | We anticipate that network requirements will be low initially. The current testnet requires minimal resources. Then bandwidth, CPU and memory requirements will rise as the network grows. Large hard drives are recommended for storing years of blockchain history. 20 | 21 | ## Set Up a Website 22 | 23 | Set up a dedicated validator's website and signal your intention to become a validator on our [forum](https://forum.cosmos.network/t/validator-candidates-websites/127/3). This is important since delegators will want to have information about the entity they are delegating their Atoms to. 24 | 25 | ## Seek Legal Advice 26 | 27 | Seek legal advice if you intend to run a Validator. 28 | 29 | ## Community 30 | 31 | Discuss the finer details of being a validator on our community chat and forum: 32 | 33 | * [Validator Chat](https://riot.im/app/#/room/#cosmos_validators:matrix.org) 34 | * [Validator Forum](https://forum.cosmos.network/c/validating) 35 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at adrian@tendermint.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /cmd/gaiadebug/hack.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/base64" 5 | "encoding/hex" 6 | "fmt" 7 | "os" 8 | "path" 9 | 10 | "github.com/cosmos/cosmos-sdk/store" 11 | 12 | "github.com/cosmos/cosmos-sdk/baseapp" 13 | 14 | "github.com/spf13/cobra" 15 | "github.com/spf13/viper" 16 | abci "github.com/tendermint/tendermint/abci/types" 17 | "github.com/tendermint/tendermint/crypto/ed25519" 18 | 19 | "github.com/tendermint/tendermint/libs/log" 20 | 21 | sdk "github.com/cosmos/cosmos-sdk/types" 22 | 23 | gaia "github.com/cosmos/gaia/app" 24 | ) 25 | 26 | func runHackCmd(cmd *cobra.Command, args []string) error { 27 | 28 | if len(args) != 1 { 29 | return fmt.Errorf("Expected 1 arg") 30 | } 31 | 32 | // ".gaiad" 33 | dataDir := args[0] 34 | dataDir = path.Join(dataDir, "data") 35 | 36 | // load the app 37 | logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout)) 38 | db, err := sdk.NewLevelDB("gaia", dataDir) 39 | if err != nil { 40 | fmt.Println(err) 41 | os.Exit(1) 42 | } 43 | app, keyMain, keyStaking, stakingKeeper := gaia.NewGaiaAppUNSAFE( 44 | logger, db, nil, false, 0, baseapp.SetPruning(store.NewPruningOptionsFromString(viper.GetString("pruning")))) 45 | 46 | // print some info 47 | id := app.LastCommitID() 48 | lastBlockHeight := app.LastBlockHeight() 49 | fmt.Println("ID", id) 50 | fmt.Println("LastBlockHeight", lastBlockHeight) 51 | 52 | //---------------------------------------------------- 53 | // XXX: start hacking! 54 | //---------------------------------------------------- 55 | // eg. gaia-6001 testnet bug 56 | // We paniced when iterating through the "bypower" keys. 57 | // The following powerKey was there, but the corresponding "trouble" validator did not exist. 58 | // So here we do a binary search on the past states to find when the powerKey first showed up ... 59 | 60 | // operator of the validator the bonds, gets jailed, later unbonds, and then later is still found in the bypower store 61 | trouble := hexToBytes("D3DC0FF59F7C3B548B7AFA365561B87FD0208AF8") 62 | // this is his "bypower" key 63 | powerKey := hexToBytes("05303030303030303030303033FFFFFFFFFFFF4C0C0000FFFED3DC0FF59F7C3B548B7AFA365561B87FD0208AF8") 64 | 65 | topHeight := lastBlockHeight 66 | bottomHeight := int64(0) 67 | checkHeight := topHeight 68 | for { 69 | // load the given version of the state 70 | err = app.LoadVersion(checkHeight, keyMain) 71 | if err != nil { 72 | fmt.Println(err) 73 | os.Exit(1) 74 | } 75 | ctx := app.NewContext(true, abci.Header{}) 76 | 77 | // check for the powerkey and the validator from the store 78 | store := ctx.KVStore(keyStaking) 79 | res := store.Get(powerKey) 80 | val, _ := stakingKeeper.GetValidator(ctx, trouble) 81 | fmt.Println("checking height", checkHeight, res, val) 82 | if res == nil { 83 | bottomHeight = checkHeight 84 | } else { 85 | topHeight = checkHeight 86 | } 87 | checkHeight = (topHeight + bottomHeight) / 2 88 | } 89 | } 90 | 91 | func base64ToPub(b64 string) ed25519.PubKeyEd25519 { 92 | data, _ := base64.StdEncoding.DecodeString(b64) 93 | var pubKey ed25519.PubKeyEd25519 94 | copy(pubKey[:], data) 95 | return pubKey 96 | 97 | } 98 | 99 | func hexToBytes(h string) []byte { 100 | trouble, _ := hex.DecodeString(h) 101 | return trouble 102 | 103 | } 104 | -------------------------------------------------------------------------------- /sims.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | ######################################## 4 | ### Simulations 5 | 6 | SIMAPP = github.com/cosmos/gaia/app 7 | 8 | sim-gaia-nondeterminism: 9 | @echo "Running nondeterminism test..." 10 | @go test -mod=readonly $(SIMAPP) -run TestAppStateDeterminism -SimulationEnabled=true -v -timeout 10m 11 | 12 | sim-gaia-custom-genesis-fast: 13 | @echo "Running custom genesis simulation..." 14 | @echo "By default, ${HOME}/.gaiad/config/genesis.json will be used." 15 | @go test -mod=readonly github.com/cosmos/gaia/app -run TestFullGaiaSimulation -SimulationGenesis=${HOME}/.gaiad/config/genesis.json \ 16 | -SimulationEnabled=true -SimulationNumBlocks=100 -SimulationBlockSize=200 -SimulationCommit=true -SimulationSeed=99 -SimulationPeriod=5 -v -timeout 24h 17 | 18 | sim-gaia-fast: 19 | @echo "Running quick Gaia simulation. This may take several minutes..." 20 | @go test -mod=readonly github.com/cosmos/gaia/app -run TestFullGaiaSimulation -SimulationEnabled=true -SimulationNumBlocks=100 -SimulationBlockSize=200 -SimulationCommit=true -SimulationSeed=99 -SimulationPeriod=5 -v -timeout 24h 21 | 22 | sim-gaia-import-export: runsim 23 | @echo "Running Gaia import/export simulation. This may take several minutes..." 24 | $(GOPATH)/bin/runsim 25 5 TestGaiaImportExport 25 | 26 | sim-gaia-simulation-after-import: runsim 27 | @echo "Running Gaia simulation-after-import. This may take several minutes..." 28 | $(GOPATH)/bin/runsim 25 5 TestGaiaSimulationAfterImport 29 | 30 | sim-gaia-custom-genesis-multi-seed: runsim 31 | @echo "Running multi-seed custom genesis simulation..." 32 | @echo "By default, ${HOME}/.gaiad/config/genesis.json will be used." 33 | $(GOPATH)/bin/runsim -g ${HOME}/.gaiad/config/genesis.json 400 5 TestFullGaiaSimulation 34 | 35 | sim-gaia-multi-seed: runsim 36 | @echo "Running multi-seed Gaia simulation. This may take awhile!" 37 | $(GOPATH)/bin/runsim 400 5 TestFullGaiaSimulation 38 | 39 | sim-benchmark-invariants: 40 | @echo "Running simulation invariant benchmarks..." 41 | @go test -mod=readonly github.com/cosmos/gaia/app -benchmem -bench=BenchmarkInvariants -run=^$ \ 42 | -SimulationEnabled=true -SimulationNumBlocks=1000 -SimulationBlockSize=200 \ 43 | -SimulationCommit=true -SimulationSeed=57 -v -timeout 24h 44 | 45 | SIM_NUM_BLOCKS ?= 500 46 | SIM_BLOCK_SIZE ?= 200 47 | SIM_COMMIT ?= true 48 | sim-gaia-benchmark: 49 | @echo "Running Gaia benchmark for numBlocks=$(SIM_NUM_BLOCKS), blockSize=$(SIM_BLOCK_SIZE). This may take awhile!" 50 | @go test -mod=readonly -benchmem -run=^$$ github.com/cosmos/gaia/app -bench ^BenchmarkFullGaiaSimulation$$ \ 51 | -SimulationEnabled=true -SimulationNumBlocks=$(SIM_NUM_BLOCKS) -SimulationBlockSize=$(SIM_BLOCK_SIZE) -SimulationCommit=$(SIM_COMMIT) -timeout 24h 52 | 53 | sim-gaia-profile: 54 | @echo "Running Gaia benchmark for numBlocks=$(SIM_NUM_BLOCKS), blockSize=$(SIM_BLOCK_SIZE). This may take awhile!" 55 | @go test -mod=readonly -benchmem -run=^$$ github.com/cosmos/gaia/app -bench ^BenchmarkFullGaiaSimulation$$ \ 56 | -SimulationEnabled=true -SimulationNumBlocks=$(SIM_NUM_BLOCKS) -SimulationBlockSize=$(SIM_BLOCK_SIZE) -SimulationCommit=$(SIM_COMMIT) -timeout 24h -cpuprofile cpu.out -memprofile mem.out 57 | 58 | 59 | .PHONY: runsim sim-gaia-nondeterminism sim-gaia-custom-genesis-fast sim-gaia-fast sim-gaia-import-export \ 60 | sim-gaia-simulation-after-import sim-gaia-custom-genesis-multi-seed sim-gaia-multi-seed \ 61 | sim-benchmark-invariants sim-gaia-benchmark sim-gaia-profile 62 | -------------------------------------------------------------------------------- /docs/validators/security.md: -------------------------------------------------------------------------------- 1 | ## Validator Security 2 | 3 | Each validator candidate is encouraged to run its operations independently, as diverse setups increase the resilience of the network. Validator candidates should commence their setup phase now in order to be on time for launch. 4 | 5 | ## Key Management - HSM 6 | 7 | It is mission critical that an attacker cannot steal a validator's key. If this is possible, it puts the entire stake delegated to the compromised validator at risk. Hardware security modules are an important strategy for mitigating this risk. 8 | 9 | HSM modules must support `ed25519` signatures for the hub. The YubiHSM2 supports `ed25519` and we expect to have an adapter library available in December 2017. The YubiHSM can protect a private key but cannot ensure in a secure setting that it won't sign the same block twice. 10 | 11 | The Tendermint team is also working on extending our Ledger Nano S application to support validator signing. This app can store recent blocks and mitigate double signing attacks. 12 | 13 | We will update this page when more key storage solutions become available. 14 | 15 | ## Sentry Nodes (DDOS Protection) 16 | 17 | Validators are responsible for ensuring that the network can sustain denial of service attacks. 18 | 19 | One recommended way to mitigate these risks is for validators to carefully structure their network topology in a so-called sentry node architecture. 20 | 21 | Validator nodes should only connect to full-nodes they trust because they operate them themselves or are run by other validators they know socially. A validator node will typically run in a data center. Most data centers provide direct links the networks of major cloud providers. The validator can use those links to connect to sentry nodes in the cloud. This shifts the burden of denial-of-service from the validator's node directly to its sentry nodes, and may require new sentry nodes be spun up or activated to mitigate attacks on existing ones. 22 | 23 | Sentry nodes can be quickly spun up or change their IP addresses. Because the links to the sentry nodes are in private IP space, an internet based attacked cannot disturb them directly. This will ensure validator block proposals and votes always make it to the rest of the network. 24 | 25 | To setup your sentry node architecture you can follow the instructions below: 26 | 27 | Validators nodes should edit their config.toml: 28 | 29 | ```bash 30 | # Comma separated list of nodes to keep persistent connections to 31 | # Do not add private peers to this list if you don't want them advertised 32 | persistent_peers =[list of sentry nodes] 33 | 34 | # Set true to enable the peer-exchange reactor 35 | pex = false 36 | ``` 37 | 38 | Sentry Nodes should edit their config.toml: 39 | 40 | ```bash 41 | # Comma separated list of peer IDs to keep private (will not be gossiped to other peers) 42 | # Example ID: 3e16af0cead27979e1fc3dac57d03df3c7a77acc@3.87.179.235:26656 43 | 44 | private_peer_ids = "node_ids_of_private_peers" 45 | ``` 46 | 47 | ## Environment Variables 48 | 49 | By default, uppercase environment variables with the following prefixes will replace lowercase command-line flags: 50 | 51 | - `GA` (for Gaia flags) 52 | - `TM` (for Tendermint flags) 53 | - `BC` (for democli or basecli flags) 54 | 55 | For example, the environment variable `GA_CHAIN_ID` will map to the command line flag `--chain-id`. Note that while explicit command-line flags will take precedence over environment variables, environment variables will take precedence over any of your configuration files. For this reason, it's imperative that you lock down your environment such that any critical parameters are defined as flags on the CLI or prevent modification of any environment variables. 56 | -------------------------------------------------------------------------------- /docs/reproducible-builds.md: -------------------------------------------------------------------------------- 1 | ## Build Gaia Deterministically 2 | 3 | Gitian is the deterministic build process that is used to build the Gaia executables. It provides a way to be reasonably sure that the executables are really built from the git source. It also makes sure that the same, tested dependencies are used and statically built into the executable. 4 | 5 | Multiple developers build the source code by following a specific descriptor ("recipe"), cryptographically sign the result, and upload the resulting signature. These results are compared and only if they match, the build is accepted and provided for download. 6 | 7 | More independent Gitian builders are needed, which is why this guide exists. It is preferred you follow these steps yourself instead of using someone else's VM image to avoid 'contaminating' the build. 8 | 9 | This page contains all instructions required to build and sign reproducible Gaia binaries for Linux, Mac OS X, and Windows. 10 | 11 | ## Prerequisites 12 | 13 | Make sure your system satisfy minimum requisites as outlined in https://github.com/devrandom/gitian-builder#prerequisites. 14 | 15 | All the following instructions have been tested on *Ubuntu 18.04.2 LTS* with *docker 18.06.1-ce* and *docker 18.09.6-ce*. 16 | 17 | If you are on Mac OS X, make sure you have prepended your `PATH` environment variable with GNU coreutils's path before running the build script: 18 | 19 | ``` 20 | export PATH=/usr/local/opt/coreutils/libexec/gnubin/:$PATH 21 | ``` 22 | 23 | ## Build and sign 24 | 25 | Clone cosmos-sdk: 26 | 27 | ``` 28 | git clone git@github.com:cosmos/gaia 29 | ``` 30 | 31 | Checkout the commit, branch, or release tag you want to build: 32 | 33 | ``` 34 | cd gaia/ 35 | git checkout v0.35.0 36 | ``` 37 | 38 | Run the following command to launch a build for `linux` and sign the final build 39 | report (replace `user@example.com` with the GPG identity you want to sign the report with): 40 | 41 | ``` 42 | ./contrib/gitian-build.sh -s user@example.com linux 43 | ``` 44 | 45 | The above command generates two directories in the current working directory: 46 | * `gitian-build-linux` containing the `gitian-builder` clone used to drive the build process. 47 | * `gaia.sigs` containing the signed build report. 48 | 49 | Replace `linux` in the above command with `darwin` or `windows` to run builds for Mac OS X and Windows respectively. 50 | Run the following command to build binaries for all platforms (`darwin`, `linux`, and `windows`): 51 | 52 | ``` 53 | cd gaia/ && ./contrib/gitian-build.sh -s user@example.com all 54 | ``` 55 | 56 | If you want to generate unsigned builds, just remove the option `-s` from the command line: 57 | 58 | ``` 59 | ./contrib/gitian-build.sh linux 60 | ``` 61 | 62 | At the end of the procedure, build results can be found in the `./gaia.sigs` directory: 63 | 64 | Please refer to the `contrib/gitian-build.sh`'s help screen for further information on its usage. 65 | 66 | ## Signatures upload 67 | 68 | Once signatures are generated, they could be uploaded to gaia's dedicated repository: https://github.com/cosmos/gaia.sigs. 69 | The build script can take care of cloning the signatures repository and commit the signed result too: 70 | 71 | ``` 72 | ./contrib/gitian-build.sh -c -s user@example.com all 73 | ``` 74 | 75 | ## Troubleshooting 76 | 77 | ### Docker gitian-target container cannot be killed 78 | 79 | The issue is due to a relatively recent kernel apparmor change, [see here](https://github.com/moby/moby/issues/36809#issuecomment-379325713) for more information on a potential mitigation for the issue. 80 | 81 | On Ubuntu 18.04, when the container hangs and `docker` is unable to kill it you can try to use `pkill` to forcibly terminate `containerd-shim`: 82 | 83 | ``` 84 | sudo pkill containerd-shim 85 | docker system prune 86 | ``` 87 | -------------------------------------------------------------------------------- /contrib/gitian-descriptors/gitian-linux.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "gaia-linux" 3 | enable_cache: true 4 | distro: "ubuntu" 5 | suites: 6 | - "bionic" 7 | architectures: 8 | - "amd64" 9 | packages: 10 | - "bsdmainutils" 11 | - "build-essential" 12 | - "ca-certificates" 13 | - "curl" 14 | - "debhelper" 15 | - "dpkg-dev" 16 | - "devscripts" 17 | - "fakeroot" 18 | - "git" 19 | - "golang-any" 20 | - "xxd" 21 | - "quilt" 22 | remotes: 23 | - "url": "https://github.com/cosmos/gaia.git" 24 | "dir": "gaia" 25 | files: 26 | - "golang-debian-1.12.7-1.tar.gz" 27 | script: | 28 | set -e -o pipefail 29 | 30 | GO_SRC_RELEASE=golang-debian-1.12.7-1 31 | GO_SRC_TARBALL="${GO_SRC_RELEASE}.tar.gz" 32 | # Compile go and configure the environment 33 | export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" 34 | export BUILD_DIR=`pwd` 35 | tar xf "${GO_SRC_TARBALL}" 36 | rm -f "${GO_SRC_TARBALL}" 37 | [ -d "${GO_SRC_RELEASE}/" ] 38 | mv "${GO_SRC_RELEASE}/" go/ 39 | pushd go/ 40 | QUILT_PATCHES=debian/patches quilt push -a 41 | fakeroot debian/rules build RUN_TESTS=false GOCACHE=/tmp/go-cache 42 | popd 43 | 44 | export GOROOT=${BUILD_DIR}/go 45 | export GOPATH=${BUILD_DIR}/gopath 46 | mkdir -p ${GOPATH}/bin 47 | 48 | export PATH_orig=${PATH} 49 | export PATH=$GOPATH/bin:$GOROOT/bin:$PATH 50 | 51 | export ARCHS='386 amd64 arm arm64' 52 | export GO111MODULE=on 53 | 54 | # Make release tarball 55 | pushd gaia 56 | VERSION=$(git describe --tags | sed 's/^v//') 57 | COMMIT=$(git log -1 --format='%H') 58 | DISTNAME=gaia-${VERSION} 59 | git archive --format tar.gz --prefix ${DISTNAME}/ -o ${DISTNAME}.tar.gz HEAD 60 | SOURCEDIST=`pwd`/`echo gaia-*.tar.gz` 61 | popd 62 | 63 | # Correct tar file order 64 | mkdir -p temp 65 | pushd temp 66 | tar xf $SOURCEDIST 67 | rm $SOURCEDIST 68 | find gaia-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > $SOURCEDIST 69 | popd 70 | 71 | # Prepare GOPATH and install deps 72 | distsrc=${GOPATH}/src/github.com/cosmos/gaia 73 | mkdir -p ${distsrc} 74 | pushd ${distsrc} 75 | tar --strip-components=1 -xf $SOURCEDIST 76 | go mod download 77 | popd 78 | 79 | # Configure LDFLAGS for reproducible builds 80 | LDFLAGS="-extldflags=-static -buildid=${VERSION} -s -w \ 81 | -X github.com/cosmos/cosmos-sdk/version.Name=gaia \ 82 | -X github.com/cosmos/cosmos-sdk/version.ServerName=gaiad \ 83 | -X github.com/cosmos/cosmos-sdk/version.ClientName=gaiacli \ 84 | -X github.com/cosmos/cosmos-sdk/version.Version=${VERSION} \ 85 | -X github.com/cosmos/cosmos-sdk/version.Commit=${COMMIT} \ 86 | -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger" 87 | 88 | # Extract release tarball and build 89 | for arch in ${ARCHS}; do 90 | INSTALLPATH=`pwd`/installed/${DISTNAME}-${arch} 91 | mkdir -p ${INSTALLPATH} 92 | 93 | # Build gaia tool suite 94 | pushd ${distsrc} 95 | for prog in gaiacli gaiad; do 96 | GOARCH=${arch} GOROOT_FINAL=${GOROOT} go build -a \ 97 | -gcflags=all=-trimpath=${GOPATH} \ 98 | -asmflags=all=-trimpath=${GOPATH} \ 99 | -mod=readonly -tags "netgo ledger" \ 100 | -ldflags="${LDFLAGS}" \ 101 | -o ${INSTALLPATH}/${prog} ./cmd/${prog} 102 | 103 | done 104 | popd # ${distsrc} 105 | 106 | pushd ${INSTALLPATH} 107 | find -type f | sort | tar \ 108 | --no-recursion --mode='u+rw,go+r-w,a+X' \ 109 | --numeric-owner --sort=name \ 110 | --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-linux-${arch}.tar.gz 111 | popd # installed 112 | done 113 | 114 | rm -rf ${distsrc} 115 | 116 | mkdir -p $OUTDIR/src 117 | mv $SOURCEDIST $OUTDIR/src 118 | -------------------------------------------------------------------------------- /contrib/gitian-descriptors/gitian-darwin.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "gaia-darwin" 3 | enable_cache: true 4 | distro: "ubuntu" 5 | suites: 6 | - "bionic" 7 | architectures: 8 | - "amd64" 9 | packages: 10 | - "bsdmainutils" 11 | - "build-essential" 12 | - "ca-certificates" 13 | - "curl" 14 | - "debhelper" 15 | - "dpkg-dev" 16 | - "devscripts" 17 | - "fakeroot" 18 | - "git" 19 | - "golang-any" 20 | - "xxd" 21 | - "quilt" 22 | remotes: 23 | - "url": "https://github.com/cosmos/gaia.git" 24 | "dir": "gaia" 25 | files: 26 | - "golang-debian-1.12.7-1.tar.gz" 27 | script: | 28 | set -e -o pipefail 29 | 30 | GO_SRC_RELEASE=golang-debian-1.12.7-1 31 | GO_SRC_TARBALL="${GO_SRC_RELEASE}.tar.gz" 32 | # Compile go and configure the environment 33 | export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" 34 | export BUILD_DIR=`pwd` 35 | tar xf "${GO_SRC_TARBALL}" 36 | rm -f "${GO_SRC_TARBALL}" 37 | [ -d "${GO_SRC_RELEASE}/" ] 38 | mv "${GO_SRC_RELEASE}/" go/ 39 | pushd go/ 40 | QUILT_PATCHES=debian/patches quilt push -a 41 | fakeroot debian/rules build RUN_TESTS=false GOCACHE=/tmp/go-cache 42 | popd 43 | 44 | export GOOS=darwin 45 | export GOROOT=${BUILD_DIR}/go 46 | export GOPATH=${BUILD_DIR}/gopath 47 | mkdir -p ${GOPATH}/bin 48 | 49 | export PATH_orig=${PATH} 50 | export PATH=$GOPATH/bin:$GOROOT/bin:$PATH 51 | 52 | export ARCHS='386 amd64' 53 | export GO111MODULE=on 54 | 55 | # Make release tarball 56 | pushd gaia 57 | VERSION=$(git describe --tags | sed 's/^v//') 58 | COMMIT=$(git log -1 --format='%H') 59 | DISTNAME=gaia-${VERSION} 60 | git archive --format tar.gz --prefix ${DISTNAME}/ -o ${DISTNAME}.tar.gz HEAD 61 | SOURCEDIST=`pwd`/`echo gaia-*.tar.gz` 62 | popd 63 | 64 | # Correct tar file order 65 | mkdir -p temp 66 | pushd temp 67 | tar xf $SOURCEDIST 68 | rm $SOURCEDIST 69 | find gaia-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > $SOURCEDIST 70 | popd 71 | 72 | # Prepare GOPATH and install deps 73 | distsrc=${GOPATH}/src/github.com/cosmos/gaia 74 | mkdir -p ${distsrc} 75 | pushd ${distsrc} 76 | tar --strip-components=1 -xf $SOURCEDIST 77 | go mod download 78 | popd 79 | 80 | # Configure LDFLAGS for reproducible builds 81 | LDFLAGS="-extldflags=-static -buildid=${VERSION} -s -w \ 82 | -X github.com/cosmos/cosmos-sdk/version.Name=gaia \ 83 | -X github.com/cosmos/cosmos-sdk/version.ServerName=gaiad \ 84 | -X github.com/cosmos/cosmos-sdk/version.ClientName=gaiacli \ 85 | -X github.com/cosmos/cosmos-sdk/version.Version=${VERSION} \ 86 | -X github.com/cosmos/cosmos-sdk/version.Commit=${COMMIT} \ 87 | -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger" 88 | 89 | # Extract release tarball and build 90 | for arch in ${ARCHS}; do 91 | INSTALLPATH=`pwd`/installed/${DISTNAME}-${arch} 92 | mkdir -p ${INSTALLPATH} 93 | 94 | # Build gaia tool suite 95 | pushd ${distsrc} 96 | for prog in gaiacli gaiad; do 97 | GOARCH=${arch} GOROOT_FINAL=${GOROOT} go build -a \ 98 | -gcflags=all=-trimpath=${GOPATH} \ 99 | -asmflags=all=-trimpath=${GOPATH} \ 100 | -mod=readonly -tags "netgo ledger" \ 101 | -ldflags="${LDFLAGS}" \ 102 | -o ${INSTALLPATH}/${prog} ./cmd/${prog} 103 | 104 | done 105 | popd # ${distsrc} 106 | 107 | pushd ${INSTALLPATH} 108 | find -type f | sort | tar \ 109 | --no-recursion --mode='u+rw,go+r-w,a+X' \ 110 | --numeric-owner --sort=name \ 111 | --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-darwin-${arch}.tar.gz 112 | popd # installed 113 | done 114 | 115 | rm -rf ${distsrc} 116 | 117 | mkdir -p $OUTDIR/src 118 | mv $SOURCEDIST $OUTDIR/src 119 | -------------------------------------------------------------------------------- /contrib/gitian-descriptors/gitian-windows.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "gaia-windows" 3 | enable_cache: true 4 | distro: "ubuntu" 5 | suites: 6 | - "bionic" 7 | architectures: 8 | - "amd64" 9 | packages: 10 | - "bsdmainutils" 11 | - "build-essential" 12 | - "ca-certificates" 13 | - "curl" 14 | - "debhelper" 15 | - "dpkg-dev" 16 | - "devscripts" 17 | - "fakeroot" 18 | - "git" 19 | - "golang-any" 20 | - "xxd" 21 | - "quilt" 22 | remotes: 23 | - "url": "https://github.com/cosmos/gaia.git" 24 | "dir": "gaia" 25 | files: 26 | - "golang-debian-1.12.7-1.tar.gz" 27 | script: | 28 | set -e -o pipefail 29 | 30 | GO_SRC_RELEASE=golang-debian-1.12.7-1 31 | GO_SRC_TARBALL="${GO_SRC_RELEASE}.tar.gz" 32 | # Compile go and configure the environment 33 | export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" 34 | export BUILD_DIR=`pwd` 35 | tar xf "${GO_SRC_TARBALL}" 36 | rm -f "${GO_SRC_TARBALL}" 37 | [ -d "${GO_SRC_RELEASE}/" ] 38 | mv "${GO_SRC_RELEASE}/" go/ 39 | pushd go/ 40 | QUILT_PATCHES=debian/patches quilt push -a 41 | fakeroot debian/rules build RUN_TESTS=false GOCACHE=/tmp/go-cache 42 | popd 43 | 44 | export GOOS=windows 45 | export GOROOT=${BUILD_DIR}/go 46 | export GOPATH=${BUILD_DIR}/gopath 47 | mkdir -p ${GOPATH}/bin 48 | 49 | export PATH_orig=${PATH} 50 | export PATH=$GOPATH/bin:$GOROOT/bin:$PATH 51 | 52 | export ARCHS='386 amd64' 53 | export GO111MODULE=on 54 | 55 | # Make release tarball 56 | pushd gaia 57 | VERSION=$(git describe --tags | sed 's/^v//') 58 | COMMIT=$(git log -1 --format='%H') 59 | DISTNAME=gaia-${VERSION} 60 | git archive --format tar.gz --prefix ${DISTNAME}/ -o ${DISTNAME}.tar.gz HEAD 61 | SOURCEDIST=`pwd`/`echo gaia-*.tar.gz` 62 | popd 63 | 64 | # Correct tar file order 65 | mkdir -p temp 66 | pushd temp 67 | tar xf $SOURCEDIST 68 | rm $SOURCEDIST 69 | find gaia-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > $SOURCEDIST 70 | popd 71 | 72 | # Prepare GOPATH and install deps 73 | distsrc=${GOPATH}/src/github.com/cosmos/gaia 74 | mkdir -p ${distsrc} 75 | pushd ${distsrc} 76 | tar --strip-components=1 -xf $SOURCEDIST 77 | go mod download 78 | popd 79 | 80 | # Configure LDFLAGS for reproducible builds 81 | LDFLAGS="-extldflags=-static -buildid=${VERSION} -s -w \ 82 | -X github.com/cosmos/cosmos-sdk/version.Name=gaia \ 83 | -X github.com/cosmos/cosmos-sdk/version.ServerName=gaiad \ 84 | -X github.com/cosmos/cosmos-sdk/version.ClientName=gaiacli \ 85 | -X github.com/cosmos/cosmos-sdk/version.Version=${VERSION} \ 86 | -X github.com/cosmos/cosmos-sdk/version.Commit=${COMMIT} \ 87 | -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger" 88 | 89 | # Extract release tarball and build 90 | for arch in ${ARCHS}; do 91 | INSTALLPATH=`pwd`/installed/${DISTNAME}-${arch} 92 | mkdir -p ${INSTALLPATH} 93 | 94 | # Build gaia tool suite 95 | pushd ${distsrc} 96 | for prog in gaiacli gaiad; do 97 | exe=${prog}.exe 98 | GOARCH=${arch} GOROOT_FINAL=${GOROOT} go build -a \ 99 | -gcflags=all=-trimpath=${GOPATH} \ 100 | -asmflags=all=-trimpath=${GOPATH} \ 101 | -mod=readonly -tags "netgo ledger" \ 102 | -ldflags="${LDFLAGS}" \ 103 | -o ${INSTALLPATH}/${exe} ./cmd/${prog} 104 | 105 | done 106 | popd # ${distsrc} 107 | 108 | pushd ${INSTALLPATH} 109 | find -type f | sort | tar \ 110 | --no-recursion --mode='u+rw,go+r-w,a+X' \ 111 | --numeric-owner --sort=name \ 112 | --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-windows-${arch}.tar.gz 113 | popd # installed 114 | done 115 | 116 | rm -rf ${distsrc} 117 | 118 | mkdir -p $OUTDIR/src 119 | mv $SOURCEDIST $OUTDIR/src 120 | -------------------------------------------------------------------------------- /cli_test/README.md: -------------------------------------------------------------------------------- 1 | # Gaia CLI Integration tests 2 | 3 | The gaia cli integration tests live in this folder. You can run the full suite by running: 4 | 5 | ```bash 6 | go test -mod=readonly -p 4 `go list ./cli_test/...` -tags=cli_test 7 | ``` 8 | 9 | > NOTE: While the full suite runs in parallel, some of the tests can take up to a minute to complete 10 | 11 | ### Test Structure 12 | 13 | This integration suite [uses a thin wrapper](https://godoc.org/github.com/cosmos/cosmos-sdk/tests) over the [`os/exec`](https://golang.org/pkg/os/exec/) package. This allows the integration test to run against built binaries (both `gaiad` and `gaiacli` are used) while being written in golang. This allows tests to take advantage of the various golang code we have for operations like marshal/unmarshal, crypto, etc... 14 | 15 | > NOTE: The tests will use whatever `gaiad` or `gaiacli` binaries are available in your `$PATH`. You can check which binary will be run by the suite by running `which gaiad` or `which gaiacli`. If you have your `$GOPATH` properly setup they should be in `$GOPATH/bin/gaia*`. This will ensure that your test uses the latest binary you have built 16 | 17 | Tests generally follow this structure: 18 | 19 | ```go 20 | func TestMyNewCommand(t *testing.T) { 21 | t.Parallel() 22 | f := InitFixtures(t) 23 | 24 | // start gaiad server 25 | proc := f.GDStart() 26 | defer proc.Stop(false) 27 | 28 | // Your test code goes here... 29 | 30 | f.Cleanup() 31 | } 32 | ``` 33 | 34 | This boilerplate above: 35 | 36 | - Ensures the tests run in parallel. Because the tests are calling out to `os/exec` for many operations these tests can take a long time to run. 37 | - Creates `.gaiad` and `.gaiacli` folders in a new temp folder. 38 | - Uses `gaiacli` to create 2 accounts for use in testing: `foo` and `bar` 39 | - Creates a genesis file with coins (`1000footoken,1000feetoken,150stake`) controlled by the `foo` key 40 | - Generates an initial bonding transaction (`gentx`) to make the `foo` key a validator at genesis 41 | - Starts `gaiad` and stops it once the test exits 42 | - Cleans up test state on a successful run 43 | 44 | ### Notes when adding/running tests 45 | 46 | - Because the tests run against a built binary, you should make sure you build every time the code changes and you want to test again, otherwise you will be testing against an older version. If you are adding new tests this can easily lead to confusing test results. 47 | - The [`test_helpers.go`](./test_helpers.go) file is organized according to the format of `gaiacli` and `gaiad` commands. There are comments with section headers describing the different areas. Helper functions to call CLI functionality are generally named after the command (e.g. `gaiacli query staking validator` would be `QueryStakingValidator`). Try to keep functions grouped by their position in the command tree. 48 | - Test state that is needed by `tx` and `query` commands (`home`, `chain_id`, etc...) is stored on the `Fixtures` object. This makes constructing your new tests almost trivial. 49 | - Sometimes if you exit a test early there can be still running `gaiad` and `gaiacli` processes that will interrupt subsequent runs. Still running `gaiacli` processes will block access to the keybase while still running `gaiad` processes will block ports and prevent new tests from spinning up. You can ensure new tests spin up clean by running `pkill -9 gaiad && pkill -9 gaiacli` before each test run. 50 | - Most `query` and `tx` commands take a variadic `flags` argument. This pattern allows for the creation of a general function which is easily modified by adding flags. See the `TxSend` function and its use for a good example. 51 | - `Tx*` functions follow a general pattern and return `(success bool, stdout string, stderr string)`. This allows for easy testing of multiple different flag configurations. See `TestGaiaCLICreateValidator` or `TestGaiaCLISubmitProposal` for a good example of the pattern. 52 | -------------------------------------------------------------------------------- /docs/launch/blog-2-kr.md: -------------------------------------------------------------------------------- 1 | # 코스모스 허브 메인넷의 세 가지 단계 2 | ## 메인넷 후 개발 로드맵과 유저들을 위한 필수 정보 3 | 4 | 코스모스 허브의 런칭은 단계별로 나뉘어 진행될 계획입니다. 다음은 각 단계별로 어떤 사항들이 진행될지에 대한 요약입니다. 5 | 6 | # 🚨1단계: 네트워크 안정성 확보 🚨 7 | 8 | 메인넷의 최초 단계인 1단계에서 코스모스 네트워크는 다소 불안정할 수 있습니다. 메인넷 초기에는 네트워크 중단 같은 문제들이 발생할 확률이 존재합니다. 9 | 10 | 혹시라도 발생할 수 있는 문제들을 해결하기 위해서는 코스모스 허브 검증인 간, 풀노드 운영자 등 참여자들 간의 긴밀한 협업이 필요합니다. 11 | 12 | 유저는 충분한 네트워크 안정성이 확보될 때까지 문제들이 발생할 수 있다는 것을 인지해야 합니다. 13 | 14 | **블록체인 롤백과 메인넷 런칭** 15 | 16 | 블록체인 기술의 핵심 이념 중 하나는 불가역성(immutability)입니다. 17 | 18 | 불가역성이란 이미 진행된 블록체인의 기록을 되돌아가 바꾸지 않는다는 것입니다. 블록체인의 불가역성은 소프트웨어 계층에서 합의 프로토콜의 형태로 전개되지만, 궁극적으로 네트워크 참여자들의 사회적 계약(social contract) 형태로 유지됩니다. 19 | 20 | 여기서 참고할 것은 코스모스 허브는 의도적으로 포크와 롤백 절차를 간소화할 수 있도록 설계되었다는 것입니다. 코스모스 커뮤니티는 테스트넷 단계에서 이런 기능을 실제 사용했으며, 메인넷에서 또한 사용될 수 있습니다. 포크와 롤백 기능은 특정 카르텔 집단이 네트워크를 점령하는 것에 대한 대응 도구로 사용될 수 있습니다. 21 | 22 | 대다수의 블록체인 커뮤니티는 롤백을 부정적으로 인식하고 있으며 매우 신중하게 결정되어야 합니다. 블록체인의 상태를 되돌린다는 것은 블록체인 네트워크의 경제적 완결성(economic finality)을 깨트리는 행동입니다. 그렇기 때문에 블록체인 롤백은 이더리움의 The DAO 하드포크 같은 극한 상황 상황에서만 사용되어야 합니다. 23 | 24 | 단, 코스모스 허브 네트워크의 초기 단계에서는 토큰 전송 기능이 비활성화된 상태로 시작됩니다. 이런 특성은 블록체인 롤백의 중대성을 줄이게 되며 블록체인 상태의 변경의 ‘경제적 완결성’을 낮추게 됩니다. 버그 등 문제 발생으로 블록체인 롤백이 필요하다는 판단이 내려지는 경우, 테스트넷과 같이 블록체인 상태 롤백이 제네시스 블록까지도 진행될 수 있습니다. 25 | 26 | 거버넌스에 의하여 토큰 전송이 활성화되는 경우, 코스모스 네트워크는 경제적 완결성을 따르게 됩니다. 27 | 28 | 위 내용을 요약하자면, 토큰 전송이 활성화되기 전 코스모스 허브에 에러 또는 취약점이 발견되는 경우, 블록체인의 (제네시스 상태까지) 롤백이 진행될 수 있습니다. 29 | 30 | 하지만 토큰 전송이 활성화된 뒤라면 블록체인 롤백을 정당화하는 것은 상당히 어렵게 됩니다. 31 | 32 | **개발자 참고 사항**: 코스모스 메인넷 런칭은 펀드레이저 참가자들이 협동하여 코스모스 허브 소프트웨어를 운영하는 첫 단계입니다. 생태계 내 대다수의 탈중앙화 애플리케이션 개발자는 [코스모스 SDK](https://cosmos.network/docs/) 또는 [텐더민트 코어](https://tendermint.com/docs/)를 사용하고 있는 것으로 예상됩니다. 각 코스모스 SDK/텐더민트 기반 애플리케이션의 개발 진행은 코스모스 허브와 별도로 진행되어도 무관합니다. 다만, [IBC](https://blog.cosmos.network/developer-deep-dive-cosmos-ibc-5855aaf183fe)(Inter-Blockchain Communication)을 사용하기 위해서는 메인넷 3단계까지 기다리거나 IBC 테스트넷에서 시범운영을 하실 수 있습니다. 33 | 34 | **유저 참고 사항**: 메인넷 최초 단계에서는 코스모스 아톰을 거래하지 **않는** 것을 강력하게 권고합니다 (예, 법적 계약을 통한 거래). 1단계에서는 제네시스 블록까지 긴급 롤백이 진행될 수 있으므로 트랜잭션이 번복될 수 있는 위험이 존재합니다. 35 | 36 | 다만, 유저는 CLI 가이드 또는 하단의 영상 투토리얼을 참고하여 안전하게 아톰 위임을 진행하실 수는 있습니다. 다만 만약 블록체인 롤백이 진행되는 경우, 스테이킹으로 받은 리워드와 인플레이션 리워드의 손실이 있습니다. 37 | 38 | 첫 단계에서 오직 CLI를 사용해서 트랜잭션을 발생하는 것을 코스모스 허브와 소통할 때 사용될 보이저(Voyager) 지갑은 현재 알파 단계에 있기 때문에 안전하게 사용할 수 있는 프로그램은 CLI 뿐이라는 것을 강조합니다. 보이저 지갑이 안전하다는 판단이 내려지고 베타가 시작될때 별도의 공지가 있겠습니다. 39 | 40 | CLI 가이드 🔗: [https://github.com/cosmos/cosmos-sdk/blob/develop/docs/translations/kr/gaia/delegator-guide-cli.md](https://github.com/cosmos/cosmos-sdk/blob/develop/docs/translations/kr/gaia/delegator-guide-cli.md) 41 | 42 | CLI 위임 투토리얼 (영어): [https://www.youtube.com/watch?v=ydZw6o6Mzy0](https://www.youtube.com/watch?v=ydZw6o6Mzy0) 43 | 44 | # 2단계: 토큰 전송 활성화 45 | 46 | **요약**: 메인넷이 충분히 안정성을 확보했다는 판단이 내려진 후, 위임된 아톰을 보유한 홀더들은 아톰 토큰 전송 활성화에 대한 프로포절에 투표를 할 수 있습니다. 해당 절차는 블록체인 상의 거버넌스 절차를 통해 진행됩니다. 47 | 48 | 거버넌스 프로포절 현황에 대한 정보는 다양한 코스모스 익스플로러를 통해 확인하실 수 있습니다. 코스모스 익스플로러 목록은 [여기](https://cosmos.network/launch)를 참고하세요. 49 | 50 | **유저 참고 사항**: 토큰 전송 활성화 프로포절이 통과하고 전송이 활성화된 후 아톰 이동이 가능해집니다. 51 | 52 | # 3단계: IBC 활성화 53 | 54 | **요약**: 3단계에서는 IBC 프로토콜이 공개됩니다. 토큰 홀더는 IBC 기능을 코스모스 SDK의 코어 모듈 라이브러리로 활성화할지에 대한 거버넌스 투표를 하게됩니다. 55 | 56 | **개발자 참고 사항**: 이 단계에서 코스모스 SDK/텐더민트 BFT를 기반으로 만들어진 애플리케이션 특화 블록체인(application-specific blockchain)은 IBC를 통해 중앙화된 제삼자 없이 코스모스 허브와 소통할 수 있게 됩니다. IBC를 이용해 블록체인 간 다양한 토큰과 NFT(Non-fungible token)들의 이동이 가능해집니다. 57 | 58 | # 메인넷 검증인 준비 사항 59 | 60 | 1. 메인넷에서 사용할 검증인 컨센서스 키(validator consensus key)를 생성하고 안전한 형태로 보관하십시오. 61 | 2. 게임 오브 스테이크 상금 / 펀드레이저 계정에서 트랜잭션 생성 및 서명을 할 수 있도록 준비하십시오 62 | 3. ICF의 제네시스 토큰 분배 제안이 공개된 후 메인넷 Gentx 수집 작업을 시작합니다. 63 | 64 | # 글을 마무리 하며 65 | 66 | 코스모스의 목적은 모든 블록체인을 연결하여 ‘블록체인의 인터넷’을 만드는 것입니다. 67 | 68 | 앞으로 가야 할 길이 멀다는 것을 알고 있습니다. 69 | 70 | 메인넷이 런칭된 후, 토큰 이코노미 기반의 세상을 설계하는 본격적인 일이 본격적으로 시작돼야 할 것입니다. 71 | 72 | 하지만 미국 전 대통령 존 케네디의 말을 인용하자면, “우리는 달에 가기로 결정하였습니다. 그것이 쉽기 때문이 아니라 어렵기 때문에 이렇게 결정한 것입니다.” 73 | 74 | 달에 도착하는 그 날까지… 🚀 75 | -------------------------------------------------------------------------------- /docs/translations/cn/join-mainnet.md: -------------------------------------------------------------------------------- 1 | ## 加入主网 2 | 3 | ::: 提示 4 | 请查看[launch repo](https://github.com/cosmos/launch)获取主网信息,包含了所使用的Cosmos-SDK的正确版本和genesis文件。 5 | ::: 6 | 7 | ::: 警告 8 | **在更进一步之前你需要[安装gaia](./installation.md)** 9 | ::: 10 | 11 | ## 创建一个新节点 12 | 13 | 这些指令适用于从头开始设置一个全节点。 14 | 15 | 首先,初始化节点并创建必要的配置文件: 16 | 17 | ```bash 18 | gaiad init 19 | ``` 20 | 21 | ::: 注意 22 | moniker只能包含ASCII字符。使用Unicode字符会使得你的节点不可访问 23 | ::: 24 | 25 | 你可以稍后在`~/.gaiad/config/config.toml`文件中编辑`moniker`: 26 | 27 | ```toml 28 | # A custom human readable name for this node 29 | moniker = "" 30 | ``` 31 | 32 | 你可以编辑`~/.gaiad/config/config.toml`文件来开启垃圾交易过滤机制以拒绝收到的手续费过低的交易: 33 | 34 | ``` 35 | # This is a TOML config file. 36 | # For more information, see https://github.com/toml-lang/toml 37 | 38 | ##### main base config options ##### 39 | 40 | # The minimum gas prices a validator is willing to accept for processing a 41 | # transaction. A transaction's fees must meet the minimum of any denomination 42 | # specified in this config (e.g. 10uatom). 43 | 44 | minimum-gas-prices = "" 45 | ``` 46 | 47 | 你的全节点已经初始化成功! 48 | 49 | ## Genesis & Seeds 50 | 51 | ### 复制genesis文件 52 | 53 | 将主网的`genesis.json`文件放置在`gaiad`的配置文件夹中 54 | 55 | ```bash 56 | mkdir -p $HOME/.gaiad/config 57 | curl https://raw.githubusercontent.com/cosmos/launch/master/genesis.json > $HOME/.gaiad/config/genesis.json 58 | ``` 59 | 60 | 注意我们使用了[launch repo](https://github.com/cosmos/launch)中的`latest`文件夹,该文件夹包含了最新版本主网的详细信息。 61 | 62 | ::: 提示 63 | 如果你想加入的是公共测试网,点击[这里](./join-testnet.md) 64 | ::: 65 | 66 | 运行命令验证配置的正确性: 67 | 68 | ```bash 69 | gaiad start 70 | ``` 71 | 72 | ### 添加种子节点 73 | 74 | 你的节点需要知道如何寻找伙伴节点。你需要添加有用的种子节点到`$HOME/.gaiad/config/config.toml`文件中。[`launch`](https://github.com/cosmos/launch) repo包含了一些种子节点的链接。 75 | 76 | 如果这些种子节点不再运行,你可以在Cosmos Hub浏览器(可以在[launch page](https://cosmos.network/launch)中找到)发现种子节点和持久节点。 77 | 78 | 你还可以到[验证人Riot聊天室](https://riot.im/app/#/room/#cosmos-validators:matrix.org)里询问可用节点。 79 | 80 | 你可以阅读[这里](https://github.com/tendermint/tendermint/blob/develop/docs/tendermint-core/using-tendermint.md#peers)了解更多伙伴节点和种子节点的信息。 81 | 82 | ::: 警告 83 | 在Cosmos Hub主网中,可接受的币种是`uatom`,`1atom = 1.000.000uatom` 84 | ::: 85 | 86 | Cosmos Hub网络中的交易需要支付一笔交易手续费以得到处理。手续费支付执行交易所消耗的gas。计算公式如下: 87 | 88 | ``` 89 | fees = gas * gasPrices 90 | ``` 91 | 92 | `gas`由交易本身决定。不同的交易需要不同数量的`gas`。一笔交易的`gas`数量在它被执行时计算,但有一种方式可以提前估算,那就是把标识`gas` 93 | 的值设置为`auto`。当然,这只是给出一个预估值。如果你想要确保为交易提供足够的gas,你可以使用`--gas-adjustment`标识来调整预估值(默认是`1.0`)。 94 | 95 | `gasPrice`是每个单位`gas`的单价。每个验证人节点可以设置`min-gas-price`,只会把那些`gasPrice`高于自己设置的`min-gas-price`的交易打包。 96 | 97 | 交易的`fees`是`gas`与`gasPrice`的结果。作为一个用户,你必须输入三者中的两者。更高的`gasPrice`/`fees`,将提高你的交易被打包的机会。 98 | 99 | ::: 提示 100 | 主网中推荐的`gas-prices`是`0.025uatom` 101 | ::: 102 | 103 | ## 设置`minimum-gas-prices` 104 | 105 | 你的全节点可以在交易池中放入未确认的交易。为了保护其免受Spam攻击,最好设置一个`minimum-gas-prices`来过滤交易以决定是否要放入交易池。这个参数可以在`~/.gaiad/config/gaiad.toml`文件中配置。 106 | 107 | 推荐的初始`minimum-gas-prices`是`0.025uatom`,如果你愿意可以稍后再修改它。 108 | 109 | ## 运行一个全节点 110 | 111 | 通过这条命令开始运行全节点: 112 | 113 | ```bash 114 | gaiad start 115 | ``` 116 | 117 | 检查一切是否平稳运行中: 118 | 119 | ```bash 120 | gaiacli status 121 | ``` 122 | 123 | 使用[Cosmos Explorer](https://cosmos.network/launch)查看网络状态。 124 | 125 | ## 导出状态 126 | 127 | Gaia能够将整个应用程序的状态转存到一个JSON文件中,该文件可以用于分析还可以用作一个新网络的genesis文件。 128 | 129 | 导出状态: 130 | 131 | ```bash 132 | gaiad export > [filename].json 133 | ``` 134 | 135 | 你还可以导出指定高度的状态(处理完指定高度后的状态): 136 | 137 | ```bash 138 | gaiad export --height [height] > [filename].json 139 | ``` 140 | 141 | 如果你计划使用导出的状态文件启动一个新网络,导出时要加上`--for-zero-height`标识: 142 | 143 | ```bash 144 | gaiad export --height [height] --for-zero-height > [filename].json 145 | ``` 146 | 147 | ## 升级成为验证人节点 148 | 你现在有了一个运行状态的全节点。接下来,你可以升级你的全节点,成为一个Cosmos验证人。排名前100的验证人节点可以向Cosmos Hub提议新的区块。请查看[创建验证人节点](./validators/validator-setup.md)。 -------------------------------------------------------------------------------- /cmd/gaiad/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "io" 6 | 7 | "github.com/spf13/cobra" 8 | "github.com/spf13/viper" 9 | 10 | abci "github.com/tendermint/tendermint/abci/types" 11 | "github.com/tendermint/tendermint/libs/cli" 12 | dbm "github.com/tendermint/tendermint/libs/db" 13 | "github.com/tendermint/tendermint/libs/log" 14 | tmtypes "github.com/tendermint/tendermint/types" 15 | 16 | "github.com/cosmos/gaia/app" 17 | 18 | "github.com/cosmos/cosmos-sdk/baseapp" 19 | "github.com/cosmos/cosmos-sdk/client" 20 | "github.com/cosmos/cosmos-sdk/server" 21 | "github.com/cosmos/cosmos-sdk/store" 22 | sdk "github.com/cosmos/cosmos-sdk/types" 23 | "github.com/cosmos/cosmos-sdk/x/genaccounts" 24 | genaccscli "github.com/cosmos/cosmos-sdk/x/genaccounts/client/cli" 25 | genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" 26 | "github.com/cosmos/cosmos-sdk/x/staking" 27 | ) 28 | 29 | // gaiad custom flags 30 | const flagInvCheckPeriod = "inv-check-period" 31 | 32 | var invCheckPeriod uint 33 | 34 | func main() { 35 | cdc := app.MakeCodec() 36 | 37 | config := sdk.GetConfig() 38 | config.SetBech32PrefixForAccount(sdk.Bech32PrefixAccAddr, sdk.Bech32PrefixAccPub) 39 | config.SetBech32PrefixForValidator(sdk.Bech32PrefixValAddr, sdk.Bech32PrefixValPub) 40 | config.SetBech32PrefixForConsensusNode(sdk.Bech32PrefixConsAddr, sdk.Bech32PrefixConsPub) 41 | config.Seal() 42 | 43 | ctx := server.NewDefaultContext() 44 | cobra.EnableCommandSorting = false 45 | rootCmd := &cobra.Command{ 46 | Use: "gaiad", 47 | Short: "Gaia Daemon (server)", 48 | PersistentPreRunE: server.PersistentPreRunEFn(ctx), 49 | } 50 | 51 | rootCmd.AddCommand(genutilcli.InitCmd(ctx, cdc, app.ModuleBasics, app.DefaultNodeHome)) 52 | rootCmd.AddCommand(genutilcli.CollectGenTxsCmd(ctx, cdc, genaccounts.AppModuleBasic{}, app.DefaultNodeHome)) 53 | rootCmd.AddCommand(genutilcli.MigrateGenesisCmd(ctx, cdc)) 54 | rootCmd.AddCommand(genutilcli.GenTxCmd(ctx, cdc, app.ModuleBasics, staking.AppModuleBasic{}, 55 | genaccounts.AppModuleBasic{}, app.DefaultNodeHome, app.DefaultCLIHome)) 56 | rootCmd.AddCommand(genutilcli.ValidateGenesisCmd(ctx, cdc, app.ModuleBasics)) 57 | rootCmd.AddCommand(genaccscli.AddGenesisAccountCmd(ctx, cdc, app.DefaultNodeHome, app.DefaultCLIHome)) 58 | rootCmd.AddCommand(client.NewCompletionCmd(rootCmd, true)) 59 | rootCmd.AddCommand(testnetCmd(ctx, cdc, app.ModuleBasics, genaccounts.AppModuleBasic{})) 60 | rootCmd.AddCommand(replayCmd()) 61 | 62 | server.AddCommands(ctx, cdc, rootCmd, newApp, exportAppStateAndTMValidators) 63 | 64 | // prepare and add flags 65 | executor := cli.PrepareBaseCmd(rootCmd, "GA", app.DefaultNodeHome) 66 | rootCmd.PersistentFlags().UintVar(&invCheckPeriod, flagInvCheckPeriod, 67 | 0, "Assert registered invariants every N blocks") 68 | err := executor.Execute() 69 | if err != nil { 70 | panic(err) 71 | } 72 | } 73 | 74 | func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer) abci.Application { 75 | return app.NewGaiaApp( 76 | logger, db, traceStore, true, invCheckPeriod, 77 | baseapp.SetPruning(store.NewPruningOptionsFromString(viper.GetString("pruning"))), 78 | baseapp.SetMinGasPrices(viper.GetString(server.FlagMinGasPrices)), 79 | baseapp.SetHaltHeight(uint64(viper.GetInt(server.FlagHaltHeight))), 80 | ) 81 | } 82 | 83 | func exportAppStateAndTMValidators( 84 | logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailWhiteList []string, 85 | ) (json.RawMessage, []tmtypes.GenesisValidator, error) { 86 | 87 | if height != -1 { 88 | gApp := app.NewGaiaApp(logger, db, traceStore, false, uint(1)) 89 | err := gApp.LoadHeight(height) 90 | if err != nil { 91 | return nil, nil, err 92 | } 93 | return gApp.ExportAppStateAndValidators(forZeroHeight, jailWhiteList) 94 | } 95 | gApp := app.NewGaiaApp(logger, db, traceStore, true, uint(1)) 96 | return gApp.ExportAppStateAndValidators(forZeroHeight, jailWhiteList) 97 | } 98 | -------------------------------------------------------------------------------- /docs/upgrade-node.md: -------------------------------------------------------------------------------- 1 | # Upgrade Your Node 2 | 3 | This document describes the upgrade procedure of a `gaiad` full-node to a new version. 4 | 5 | ## Software Upgrade 6 | 7 | First, stop your instance of `gaiad`. Next, upgrade the software: 8 | 9 | ```bash 10 | cd $GOPATH/src/github.com/cosmos/gaia 11 | git fetch --all && git checkout 12 | make install 13 | ``` 14 | 15 | ::: tip 16 | *NOTE*: If you have issues at this step, please check that you have the latest stable version of GO installed. 17 | ::: 18 | 19 | See the [testnet repo](https://github.com/cosmos/testnets) for details on which version is needed for which public testnet, and the [Gaia release page](https://github.com/cosmos/Gaia/releases) for details on each release. 20 | 21 | Your full node has been cleanly upgraded! 22 | 23 | ## Upgrade Genesis File 24 | 25 | :::warning 26 | If the new version you are upgrading to has breaking changes, you will have to restart your chain. If it is not breaking, you can skip to [Restart](#restart) 27 | ::: 28 | 29 | To upgrade the genesis file, you can either fetch it from a trusted source or export it locally. 30 | 31 | ### Fetching from a Trusted Source 32 | 33 | If you are joining the mainnet, fetch the genesis from the [mainnet repo](https://github.com/cosmos/launch). If you are joining a public testnet, fetch the genesis from the appropriate testnet in the [testnet repo](https://github.com/cosmos/testnets). Otherwise, fetch it from your trusted source. 34 | 35 | Save the new genesis as `new_genesis.json`. Then replace the old `genesis.json` with `new_genesis.json` 36 | 37 | ```bash 38 | cd $HOME/.gaiad/config 39 | cp -f genesis.json new_genesis.json 40 | mv new_genesis.json genesis.json 41 | ``` 42 | 43 | Then, go to the [reset data](#reset-data) section. 44 | 45 | ### Exporting State to a New Genesis Locally 46 | 47 | If you were running a node in the previous version of the network and want to build your new genesis locally from a state of this previous network, use the following command: 48 | 49 | ```bash 50 | cd $HOME/.gaiad/config 51 | gaiad export --for-zero-height --height= > new_genesis.json 52 | ``` 53 | 54 | The command above take a state at a certain height `` and turns it into a new genesis file that can be used to start a new network. 55 | 56 | Then, replace the old `genesis.json` with `new_genesis.json`. 57 | 58 | ```bash 59 | cp -f genesis.json new_genesis.json 60 | mv new_genesis.json genesis.json 61 | ``` 62 | 63 | At this point, you might want to run a script to update the exported genesis into a genesis that is compatible with your new version. For example, the attributes of a the `Account` type changed, a script should query encoded account from the account store, unmarshall them, update their type, re-marshal and re-store them. You can find an example of such script [here](https://github.com/cosmos/cosmos-sdk/blob/master/contrib/export/v0.33.x-to-v0.34.0.py). 64 | 65 | ## Reset Data 66 | 67 | :::warning 68 | If the version you are upgrading to is not breaking from the previous one, you should not reset the data. If it is not breaking, you can skip to [Restart](#restart) 69 | ::: 70 | 71 | ::: warning 72 | If you are running a **validator node** on the mainnet, always be careful when doing `gaiad unsafe-reset-all`. You should never use this command if you are not switching `chain-id`. 73 | ::: 74 | 75 | ::: danger IMPORTANT 76 | Make sure that every node has a unique `priv_validator.json`. Do not copy the `priv_validator.json` from an old node to multiple new nodes. Running two nodes with the same `priv_validator.json` will cause you to get slashed due to double sign ! 77 | ::: 78 | 79 | First, remove the outdated files and reset the data. **If you are running a validator node, make sure you understand what you are doing before resetting**. 80 | 81 | ```bash 82 | gaiad unsafe-reset-all 83 | ``` 84 | 85 | Your node is now in a pristine state while keeping the original `priv_validator.json` and `config.toml`. If you had any sentry nodes or full nodes setup before, your node will still try to connect to them, but may fail if they haven't also been upgraded. 86 | 87 | ## Restart 88 | 89 | To restart your node, just type: 90 | 91 | ```bash 92 | gaiad start 93 | ``` 94 | -------------------------------------------------------------------------------- /docs/translations/cn/ledger.md: -------------------------------------------------------------------------------- 1 | # Ledger Nano支持 2 | 3 | ## 关于HD钱包 4 | 5 | HD钱包(分层确定性钱包), 最初是在比特币的[BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki)提案中提出, 6 | 是一种特殊的钱包类型,可以让用户从单个种子派生任意数量的账户。为了更好的理解, 让我们定义以下术语: 7 | 8 | - **钱包**: 从一个给定的seed中获得的一组账户。 9 | - **账户**: 一组公钥/私钥对。 10 | - **私钥**: 私钥是用于签署消息的私密信息。在区块链领域, 一个私钥就是一个账户的所有者。永远不要想他人透露用户的私钥。 11 | - **公钥**: 公钥是通过对私钥上使用不可逆的加密函数而获得的一条信息。从公钥中可以导出地址。但无法从公钥中逆向获得私钥。 12 | - **地址**: 地址是一个公开的用于标识账户的,带着可读前缀的字符串。通过对公钥使用加密函数获得。 13 | - **数字签名**: 数字签名是一段加密信息,证明了指定私钥的所有者在不泄露其私钥的情况下,批准了指定消息。 14 | - **种子**: 同助记词。 15 | - **助记词**: 助记符是一串单词,用作种子来派生私钥。助记符是每个钱包的核心。永远不要丢失你的助记词。把它写在一张纸上,然后把它存放在安全的地方。如果你失去了它,那就没有办法去重新获取它了。如果某人获得了助记词访问权限,他们将获得所有相关帐户的访问权限。 16 | 17 | HD钱包的核心是种子。用这个种子用户可以确定地生成子帐户。要从种子生成子帐户,使用了单向的数学转换。要决定生成哪个帐户,用户指定`path`,通常是`integer`(`0`,`1`,`2`,...)。 18 | 19 | 例如,通过将`path`指定为`0`,钱包将从种子生成`0号私钥`。然后,可以从`0号私钥`生成“`号公钥`。最后,可以从`0号公钥`生成`0号地址`。所有这些步骤都是单向的,这意味着`公钥`无法从`地址`中获得,`私钥`无法从`公钥`中获得,...... 20 | 21 | ``` 22 | Account 0 Account 1 Account 2 23 | 24 | +------------------+ +------------------+ +------------------+ 25 | | | | | | | 26 | | Address 0 | | Address 1 | | Address 2 | 27 | | ^ | | ^ | | ^ | 28 | | | | | | | | | | 29 | | | | | | | | | | 30 | | | | | | | | | | 31 | | + | | + | | + | 32 | | Public key 0 | | Public key 1 | | Public key 2 | 33 | | ^ | | ^ | | ^ | 34 | | | | | | | | | | 35 | | | | | | | | | | 36 | | | | | | | | | | 37 | | + | | + | | + | 38 | | Private key 0 | | Private key 1 | | Private key 2 | 39 | | ^ | | ^ | | ^ | 40 | +------------------+ +------------------+ +------------------+ 41 | | | | 42 | | | | 43 | | | | 44 | +--------------------------------------------------------------------+ 45 | | 46 | | 47 | +---------+---------+ 48 | | | 49 | | Mnemonic (Seed) | 50 | | | 51 | +-------------------+ 52 | ``` 53 | 54 | 从种子中推导出帐户的过程是确定性的。这意味着给定相同的路径,派生出私钥将始终相同。 55 | 56 | 存储在帐户中的资金由私钥控制。此私钥对助记词使用单向函数生成的。如果丢失了私钥,则可以使用助记词恢复它。但是,如果丢失了助记词,则将无法访问所有派生的私钥。同样,如果有人获得了你的助记词访问权限,他们就可以访问所有相关帐户。 57 | 58 | ## Ledger支持HD钱包 59 | 60 | 在Ledger钱包的内核,有一个用于生成私钥的助记词。初始化Ledger时,会生成助记词。 61 | 62 | ::: 危险 63 | **不要遗失或与任何人分享你的12/24个单词。为防止盗窃或资金损失,最好确保备份多个助记词拷贝,并将其存放在安全可靠的地方,并且只有你知道如何访问。如果有人能够访问你的助记词,他们将能够访问你的私钥并控制与其关联的帐户** 64 | ::: 65 | 66 | 助记词与Cosmos帐户体系兼容。用于在Cosmos Hub网络上生成地址和交易的工具称为`gaiacli`,它支持从Ledger种子派生帐户私钥。请注意,Ledger钱包充当种子和私钥的沙盒,并且对交易进行签名的过程完全在内部进行。没有任何私人信息会离开Ledger钱包。 67 | 68 | 要将`gaiacli`与Ledger钱包一起使用,你需要具备以下条件: 69 | 70 | - [在Ledger Nano中安装`COSMOS`应用并生成账户](./delegator-guide-cli.md#using-a-ledger-device) 71 | - [有一个你打算连接的可访问的并处于运行状态的`gaiad`实例](./delegator-guide-cli.md#accessing-the-cosmos-hub-network) 72 | - [一个同你所选的`gaiad`实例相连接的`gaiacli`实例](./delegator-guide-cli.md#setting-up-gaiacli) 73 | 74 | 现在,你都准备好去[发送交易到网络](./delegator-guide-cli.md#sending-transactions). 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /docs/validators/kms/kms_ledger.md: -------------------------------------------------------------------------------- 1 | # Setting up Tendermint KMS + Ledger 2 | 3 | ::: danger Warning 4 | The following instructions are a brief walkthrough and not a comprehensive guideline. You should consider and [research more about the security implications](./security.md) of activating an external KMS. 5 | ::: 6 | 7 | ::: danger Warning 8 | KMS and Ledger Tendermint app are currently work in progress. Details may vary. Use with care under your own risk. 9 | ::: 10 | 11 | ## Tendermint Validator app (for Ledger devices) 12 | 13 | You should be able to find the Tendermint app in Ledger Live. 14 | 15 | *Note: at the moment, you might need to enable `developer mode` in Ledger Live settings* 16 | 17 | ## KMS configuration 18 | 19 | In this section, we will configure a KMS to use a Ledger device running the Tendermint Validator App. 20 | 21 | ### Config file 22 | 23 | You can find other configuration examples [here](https://github.com/tendermint/kms/blob/master/tmkms.toml.example) 24 | 25 | - Create a `~/.tmkms/tmkms.toml` file with the following content (use an adequate `chain_id`) 26 | 27 | ```toml 28 | # Example KMS configuration file 29 | [[validator]] 30 | addr = "tcp://localhost:26658" # or "unix:///path/to/socket" 31 | chain_id = "gaia-11001" 32 | reconnect = true # true is the default 33 | secret_key = "~/.tmkms/secret_connection.key" 34 | 35 | [[providers.ledgertm]] 36 | chain_ids = ["gaia-11001"] 37 | ``` 38 | 39 | - Edit `addr` to point to your `gaiad` instance. 40 | - Adjust `chain-id` to match your `.gaiad/config/config.toml` settings. 41 | - `provider.ledgertm` has not additional parameters at the moment, however, it is important that you keep that header to enable the feature. 42 | 43 | *Plug your Ledger device and open the Tendermint validator app.* 44 | 45 | ### Generate secret key 46 | 47 | Now you need to generate secret_key: 48 | 49 | ```bash 50 | tmkms keygen ~/.tmkms/secret_connection.key 51 | ``` 52 | 53 | ### Retrieve validator key 54 | 55 | The last step is to retrieve the validator key that you will use in `gaiad`. 56 | 57 | Start the KMS: 58 | 59 | ```bash 60 | tmkms start -c ~/.tmkms/tmkms.toml 61 | ``` 62 | 63 | The output should look similar to: 64 | 65 | ```text 66 | 07:28:24 [INFO] tmkms 0.3.0 starting up... 67 | 07:28:24 [INFO] [keyring:ledgertm:ledgertm] added validator key cosmosvalconspub1zcjduepqy53m39prgp9dz3nz96kaav3el5e0th8ltwcf8cpavqdvpxgr5slsd6wz6f 68 | 07:28:24 [INFO] KMS node ID: 1BC12314E2E1C29015B66017A397F170C6ECDE4A 69 | ``` 70 | 71 | The KMS may complain that it cannot connect to gaiad. That is fine, we will fix it in the next section. 72 | 73 | This output indicates the validator key linked to this particular device is: `cosmosvalconspub1zcjduepqy53m39prgp9dz3nz96kaav3el5e0th8ltwcf8cpavqdvpxgr5slsd6wz6f` 74 | 75 | Take note of the validator pubkey that appears in your screen. *We will use it in the next section.* 76 | 77 | ## Gaia configuration 78 | 79 | You need to enable KMS access by editing `.gaiad/config/config.toml`. In this file, modify `priv_validator_laddr` to create a listening address/port or a unix socket in `gaiad`. 80 | 81 | For example: 82 | 83 | ```toml 84 | ... 85 | # TCP or UNIX socket address for Tendermint to listen on for 86 | # connections from an external PrivValidator process 87 | priv_validator_laddr = "tcp://127.0.0.1:26658" 88 | ... 89 | ``` 90 | 91 | Let's assume that you have set up your validator account and called it `kmsval`. You can tell gaiad the key that we've got in the previous section. 92 | 93 | ```bash 94 | gaiad gentx --name kmsval --pubkey {.ValidatorKey} 95 | ``` 96 | 97 | Now start `gaiad`. You should see that the KMS connects and receives a signature request. 98 | 99 | Once the ledger receives the first message, it will ask for confirmation that the values are adequate. 100 | 101 | ![](ledger_1.jpg) 102 | 103 | Click the right button, if the height and round are correct. 104 | 105 | After that, you will see that the KMS will start forwarding all signature requests to the ledger: 106 | 107 | ![](ledger_2.jpg) 108 | 109 | ::: danger Warning 110 | The word TEST in the second picture, second line appears because they were taken on a pre-release version. 111 | 112 | Once the app as been released in Ledger's app store, this word should NOT appear. 113 | ::: 114 | -------------------------------------------------------------------------------- /docs/launch/blog-1-cn.md: -------------------------------------------------------------------------------- 1 | # Cosmos Hub主网上线计划 2 | 3 | * 2016年夏天,Cosmos首次发表了项目白皮书。 4 | * 2017年春天,Cosmos完成了首次募资。 5 | * 2019年一月,Cosmos Hub软件完成功能开发。 6 | * 至此,Cosmos Hub主网即将启动。 7 | * 那么,Cosmos 主网上线将为Cosmos通证(Atom)的持有者带来什么呢? 8 | 9 | 如果你是一个Atom通证的持有者,你可以将通证委托给主网的验证人并参加对链上治理提案的投票。 实际上,通证持有者的委托和参与治理对于未来网络的成功具有决定性的意义。 然而,通证持有者暂时还不能在网络上实现交易。 在下一个允许交易的硬分叉启动之前,交易协议是关闭的。 10 | 11 | **Atom通证持有人务必仔细阅读以下内容,以保障您的通证能够安全委托给验证人。在您开始实际操作前,请先仔细阅读整个CLI指南并熟悉所有命令** 12 | 13 | * [CLI指南](https://github.com/cosmos/cosmos-sdk/blob/develop/docs/gaia/delegator-guide-cli.md) 14 | 15 | CLI指南中所介绍的流程是至今为止唯一经过验证的在主网实现通证委托的安全途径。这是因为指南中用到的gaiacli工具是唯一正在进行第三方安全审计的数字钱包软件,目前尚没有其他数字钱包供应商通过类似的安全审计。 16 | 17 | 请记住,通证委托有一定风险。 一旦您将通证委托给了一个验证人,通证将在委托期内锁定,无法回收。 如果在这段时间内,被委托的验证人有任何违规行为,您的部分或者全部通证将被罚没焚毁。因此,在委托前,您有责任对验证人进行尽职调查。 18 | 19 | **Cosmos Hub主网仍然是个实验型的网络。在主网的早期,估计仍会出现一些问题,比如软件升级,或发现新的漏洞。现有的工具要求使用者具有很高的专业技术能力,并且可能还会存在我们跨链基金会或者Tendermint团队无法控制的风险(请见跨链 Cosmos 贡献条款中的风险部分条款)。使用Cosmos Hub开源软件需要遵守Apache 2.0授权协议,使用者需要自己承担所有风险,而且软件将依照“现状”提供,不提供任何形式的保证或条件,并且跨链基金会和/或Tendermint团队不对因软件引起的损失承担任何责任。所以,务必请谨慎行事!** 20 | 21 | * [跨链 Cosmos 贡献条款](https://github.com/cosmos/cosmos/blob/master/fundraiser/Interchain%20Cosmos%20Contribution%20Terms%20-%20FINAL.pdf) 22 | * [Apache 2.0授权协议](https://www.apache.org/licenses/LICENSE-2.0) 23 | 24 | 如果您希望获得更多关于通证委托的介绍并且愿意和Cosmos的开发者做直接的交流,您可以参加我们2月14日的线上直播,在直播中我们将介绍主网启动后通证委托的整个流程。 25 | 26 | 注册链接:[gotowebinar.com/register/](https://register.gotowebinar.com/register/5028753165739687691) 27 | 28 | ## 主网启动的里程碑 29 | 30 | 欢迎收藏[cosmos.network/launch](https://cosmos.network/launch),跟踪主网启动全过程。 31 | 32 | * Cosmos-SDK 安全审计✔: 在1月初,Cosmos-SDK启动了2019年一季度计划进行的一系列第三方安全评估的第一个评估项目。此次安全评估审计持续2周半的时间,2个不同的安全审计公司对Cosmos-SDK各部分做了安全评估,而第三家安全审计公司的评估工作也正在进行中。 33 | * Cosmos-SDK正式发布版本: RC版本一旦完成,Cosmos-SDK的功能在主网上线前将不再变更,此后Cosmos-SDK团队将开始一轮内部漏洞检测,以便进一步确保在发布前完成最终的安全性检查。Cosmos-SDK v0.31.0 一发布,我们将启动一个新的Gaia测试网,以便在实际运行环境中找到那些在测试中难以被发现的漏洞。 34 | * 权益争夺赛结束: 2018年12月启动的权益争夺赛(GoS)是同类区块链网络的第一个对抗性的测试网络。GoS旨在对纯PoS网络中的经济激励和社区协作进行压力测试。到目前为止,GoS区块链网络已经完成了3次硬分叉。GoS任务结束后,我们将通过记分准则来判断获胜者,并且在整个活动结束时宣布对获胜者的奖励。[GoS记分准则](https://github.com/cosmos/game-of-stakes/blob/master/README.md#scoring) 35 | * 创世交易的收集: 跨链基金会将对创世时Atom通证的分配情况发布一个议案,提出了对Cosmos投资者,参与者,早期贡献者和权益争夺赛的获胜者的通证分配方案。任何被推荐获得通证分配的个人(或机构)都可以提交一个gentx文件,只有提交了该文件才有可能在主网启动创世时成为Cosmos验证人。推荐分配数量和gentx收集的最终结果将保存在创世genesis文件中 36 | * Cosmos Hub 主网启动🔥 🚀 🌔🔥: 一旦社区接受了genesis文件, 并且占有2/3以上投票权的验证人们上线,Cosmos主网就可以启动了。 37 | 38 | ## Cosmos官方交流渠道 39 | 40 | **以下是Cosmos有关主网启动的官方渠道** 41 | * Cosmos Network (twitter.com/cosmos) 42 | * Cosmos GitHub (github.com/cosmos) 43 | * Cosmos Blog (blog.cosmos.network) 44 | **请注意Cosmos forum,Riot群,和Telegram群将不被视为官方信息发布渠道。** 45 | * [Cosmos forum](https://forum.cosmos.network) 46 | * [Riot群](https://riot.im/app/#/group/+cosmos:matrix.org) 47 | * [Telegram群](http://t.me/cosmosproject) 48 | 49 | 如果你对下一步应该做什么或者消息来源的可信度还有什么疑虑,那么在启动时请先不要有任何行动,您可以关注以上三个Cosmos官方渠道发布的最新情况,另外不要向任何管理员、网站或者非官方软件提供您的助记词。 50 | 51 | 切记,我们绝不会要求您提供您的私钥或者助记词。 52 | 53 | ## 在主网启动期间确保资产安全可靠 54 | 55 | 任何公链启动都会令人十分激动,但同时也会有一些唯利是图的人趁机作恶。自人类起源,社会工程学就已经存在了,在当今技术时代,网络钓鱼和鱼叉式网钓是利用社会工程学原理实行欺诈的主要形式。这两种攻击方式都非常有效,95%以上的账户安全漏洞都是由这两种攻击造成的,而且现在也不仅是通过电子邮件来发动攻击这么简单了。今天,网络钓鱼可能会随机或有针对性地发生在您所有的信息接收渠道,无论您是使用Signal,Telegram,SMS,Twitter或只是在论坛、社交媒体上接收信息,都有可能受到网络攻击,盗取您的重要信息和资产。 56 | 57 | 虽然作恶者的攻击听起来很可怕,但我们仍可以做很多事情来保护自己免受各种攻击。在准备主网启动期间,我们有必要为您提供一些培训来提高您发现和规避安全风险的能力,提供验证信息的可靠渠道,并通过一些技术手段来减少或避免关键风险和证件被窃风险。 58 | 59 | ## 安全规则 60 | 61 | #### 参与Cosmos主网启动,您需要熟记以下规则: 62 | 63 | * 直接从官方来源下载软件,并确保在您进行助记词相关的任何操作时始终使用最新、最安全的gaiacli版本。最新版的Tendermint,Cosmos-SDK和gaiacli只能从我们官方GitHub仓库中获取,从这些渠道下载可避免上当受骗,避免使用恶意修改的软件版本。 64 | * 不要将助记词告诉给任何人,你是助记词的唯一保管人。如果有人试图为您的Atom提供托管服务,那么就要警惕了:为了避免对通证失去控制,您应该将其离线存储,最大限度降低被盗风险,并制定安全的备份策略,永远不要与任何人分享。 65 | * 对于在区块链或加密货币环境中要求您访问来自可疑或不熟悉网站的附件或电子邮件要保持警惕。攻击者可能会试图引诱您访问虚假网站,以从您的计算机窃取敏感信息。如果您是Gmail用户,[请在此处对钓鱼邮件进行测试](https://phishingquiz.withgoogle.com)。 66 | * 在购买Atoms之前,请做好充分的信息调研。通证在主网启动时是不允许交易的,所以它们不能进行买卖。只有到实现交易功能的硬叉发布后才能实现通证的在线交易。通证的在线交易功能实现后,请首先对卖方和交易所进行全面调研,确保Atom通证的来源可信。 67 | * Tendermint团队和跨链基金会都不会出售Atom通证,所以,如果您在社交媒体或者电子邮件中看到我们发出的通证销售广告,请不要相信,一定是假的。 68 | * 对于来自论坛或者技术交流群中的陌生人提供的技术建议必须保持警惕!您需要熟悉所有重要的指令,特别是那些可能存在高风险的操作指令。您可以查阅我们的官方文档,以避免上当受骗,损害自身及他人的利益。请牢记:Cosmos论坛,Riot群,和Telegram群都不是Cosmos官方信息或者新闻的发布渠道。 69 | * 在发送交易前再次确认交易。链上地址的确很长,但请仔细检查,确保交易发送到正确的地址,防止错误发送。 70 | 71 | 如果突然出现的交易极具诱惑,或显示的消息要求您提供永远不应该与其他人分享的信息,您就应该立刻通过Cosmos网站或者其他官方渠道来验证这些信息。请再次牢记,来自Cosmos,Tendermint团队或跨链基金会的任何人都不会发送电子邮件要求您提供任何类型的帐户凭据或您的助记词,我们仅会通过我们的官方博客,Twitter和GitHub帐户与Cosmos社区沟通重要新闻和进展。 72 | -------------------------------------------------------------------------------- /docs/translations/cn/launch/blog-1-cn.md: -------------------------------------------------------------------------------- 1 | # Cosmos Hub主网上线计划 2 | 3 | * 2016年夏天,Cosmos首次发表了项目白皮书。 4 | * 2017年春天,Cosmos完成了首次募资。 5 | * 2019年一月,Cosmos Hub软件完成功能开发。 6 | * 至此,Cosmos Hub主网即将启动。 7 | * 那么,Cosmos 主网上线将为Cosmos通证(Atom)的持有者带来什么呢? 8 | 9 | 如果你是一个Atom通证的持有者,你可以将通证委托给主网的验证人并参加对链上治理提案的投票。 实际上,通证持有者的委托和参与治理对于未来网络的成功具有决定性的意义。 然而,通证持有者暂时还不能在网络上实现交易。 在下一个允许交易的硬分叉启动之前,交易协议是关闭的。 10 | 11 | **Atom通证持有人务必仔细阅读以下内容,以保障您的通证能够安全委托给验证人。在您开始实际操作前,请先仔细阅读整个CLI指南并熟悉所有命令** 12 | 13 | * [CLI指南](https://github.com/cosmos/cosmos-sdk/blob/develop/docs/gaia/delegator-guide-cli.md) 14 | 15 | CLI指南中所介绍的流程是至今为止唯一经过验证的在主网实现通证委托的安全途径。这是因为指南中用到的gaiacli工具是唯一正在进行第三方安全审计的数字钱包软件,目前尚没有其他数字钱包供应商通过类似的安全审计。 16 | 17 | 请记住,通证委托有一定风险。 一旦您将通证委托给了一个验证人,通证将在委托期内锁定,无法回收。 如果在这段时间内,被委托的验证人有任何违规行为,您的部分或者全部通证将被罚没焚毁。因此,在委托前,您有责任对验证人进行尽职调查。 18 | 19 | **Cosmos Hub主网仍然是个实验型的网络。在主网的早期,估计仍会出现一些问题,比如软件升级,或发现新的漏洞。现有的工具要求使用者具有很高的专业技术能力,并且可能还会存在我们跨链基金会或者Tendermint团队无法控制的风险(请见跨链 Cosmos 贡献条款中的风险部分条款)。使用Cosmos Hub开源软件需要遵守Apache 2.0授权协议,使用者需要自己承担所有风险,而且软件将依照“现状”提供,不提供任何形式的保证或条件,并且跨链基金会和/或Tendermint团队不对因软件引起的损失承担任何责任。所以,务必请谨慎行事!** 20 | 21 | * [跨链 Cosmos 贡献条款](https://github.com/cosmos/cosmos/blob/master/fundraiser/Interchain%20Cosmos%20Contribution%20Terms%20-%20FINAL.pdf) 22 | * [Apache 2.0授权协议](https://www.apache.org/licenses/LICENSE-2.0) 23 | 24 | 如果您希望获得更多关于通证委托的介绍并且愿意和Cosmos的开发者做直接的交流,您可以参加我们2月14日的线上直播,在直播中我们将介绍主网启动后通证委托的整个流程。 25 | 26 | 注册链接:[gotowebinar.com/register/](https://register.gotowebinar.com/register/5028753165739687691) 27 | 28 | ## 主网启动的里程碑 29 | 30 | 欢迎收藏[cosmos.network/launch](https://cosmos.network/launch),跟踪主网启动全过程。 31 | 32 | * Cosmos-SDK 安全审计✔: 在1月初,Cosmos-SDK启动了2019年一季度计划进行的一系列第三方安全评估的第一个评估项目。此次安全评估审计持续2周半的时间,2个不同的安全审计公司对Cosmos-SDK各部分做了安全评估,而第三家安全审计公司的评估工作也正在进行中。 33 | * Cosmos-SDK正式发布版本: RC版本一旦完成,Cosmos-SDK的功能在主网上线前将不再变更,此后Cosmos-SDK团队将开始一轮内部漏洞检测,以便进一步确保在发布前完成最终的安全性检查。Cosmos-SDK v0.31.0 一发布,我们将启动一个新的Gaia测试网,以便在实际运行环境中找到那些在测试中难以被发现的漏洞。 34 | * 权益争夺赛结束: 2018年12月启动的权益争夺赛(GoS)是同类区块链网络的第一个对抗性的测试网络。GoS旨在对纯PoS网络中的经济激励和社区协作进行压力测试。到目前为止,GoS区块链网络已经完成了3次硬分叉。GoS任务结束后,我们将通过记分准则来判断获胜者,并且在整个活动结束时宣布对获胜者的奖励。[GoS记分准则](https://github.com/cosmos/game-of-stakes/blob/master/README.md#scoring) 35 | * 创世交易的收集: 跨链基金会将对创世时Atom通证的分配情况发布一个议案,提出了对Cosmos投资者,参与者,早期贡献者和权益争夺赛的获胜者的通证分配方案。任何被推荐获得通证分配的个人(或机构)都可以提交一个gentx文件,只有提交了该文件才有可能在主网启动创世时成为Cosmos验证人。推荐分配数量和gentx收集的最终结果将保存在创世genesis文件中 36 | * Cosmos Hub 主网启动🔥 🚀 🌔🔥: 一旦社区接受了genesis文件, 并且占有2/3以上投票权的验证人们上线,Cosmos主网就可以启动了。 37 | 38 | ## Cosmos官方交流渠道 39 | 40 | **以下是Cosmos有关主网启动的官方渠道** 41 | * Cosmos Network (twitter.com/cosmos) 42 | * Cosmos GitHub (github.com/cosmos) 43 | * Cosmos Blog (blog.cosmos.network) 44 | **请注意Cosmos forum,Riot群,和Telegram群将不被视为官方信息发布渠道。** 45 | * [Cosmos forum](https://forum.cosmos.network) 46 | * [Riot群](https://riot.im/app/#/group/+cosmos:matrix.org) 47 | * [Telegram群](http://t.me/cosmosproject) 48 | 49 | 如果你对下一步应该做什么或者消息来源的可信度还有什么疑虑,那么在启动时请先不要有任何行动,您可以关注以上三个Cosmos官方渠道发布的最新情况,另外不要向任何管理员、网站或者非官方软件提供您的助记词。 50 | 51 | 切记,我们绝不会要求您提供您的私钥或者助记词。 52 | 53 | ## 在主网启动期间确保资产安全可靠 54 | 55 | 任何公链启动都会令人十分激动,但同时也会有一些唯利是图的人趁机作恶。自人类起源,社会工程学就已经存在了,在当今技术时代,网络钓鱼和鱼叉式网钓是利用社会工程学原理实行欺诈的主要形式。这两种攻击方式都非常有效,95%以上的账户安全漏洞都是由这两种攻击造成的,而且现在也不仅是通过电子邮件来发动攻击这么简单了。今天,网络钓鱼可能会随机或有针对性地发生在您所有的信息接收渠道,无论您是使用Signal,Telegram,SMS,Twitter或只是在论坛、社交媒体上接收信息,都有可能受到网络攻击,盗取您的重要信息和资产。 56 | 57 | 虽然作恶者的攻击听起来很可怕,但我们仍可以做很多事情来保护自己免受各种攻击。在准备主网启动期间,我们有必要为您提供一些培训来提高您发现和规避安全风险的能力,提供验证信息的可靠渠道,并通过一些技术手段来减少或避免关键风险和证件被窃风险。 58 | 59 | ## 安全规则 60 | 61 | #### 参与Cosmos主网启动,您需要熟记以下规则: 62 | 63 | * 直接从官方来源下载软件,并确保在您进行助记词相关的任何操作时始终使用最新、最安全的gaiacli版本。最新版的Tendermint,Cosmos-SDK和gaiacli只能从我们官方GitHub仓库中获取,从这些渠道下载可避免上当受骗,避免使用恶意修改的软件版本。 64 | * 不要将助记词告诉给任何人,你是助记词的唯一保管人。如果有人试图为您的Atom提供托管服务,那么就要警惕了:为了避免对通证失去控制,您应该将其离线存储,最大限度降低被盗风险,并制定安全的备份策略,永远不要与任何人分享。 65 | * 对于在区块链或加密货币环境中要求您访问来自可疑或不熟悉网站的附件或电子邮件要保持警惕。攻击者可能会试图引诱您访问虚假网站,以从您的计算机窃取敏感信息。如果您是Gmail用户,[请在此处对钓鱼邮件进行测试](https://phishingquiz.withgoogle.com)。 66 | * 在购买Atoms之前,请做好充分的信息调研。通证在主网启动时是不允许交易的,所以它们不能进行买卖。只有到实现交易功能的硬叉发布后才能实现通证的在线交易。通证的在线交易功能实现后,请首先对卖方和交易所进行全面调研,确保Atom通证的来源可信。 67 | * Tendermint团队和跨链基金会都不会出售Atom通证,所以,如果您在社交媒体或者电子邮件中看到我们发出的通证销售广告,请不要相信,一定是假的。 68 | * 对于来自论坛或者技术交流群中的陌生人提供的技术建议必须保持警惕!您需要熟悉所有重要的指令,特别是那些可能存在高风险的操作指令。您可以查阅我们的官方文档,以避免上当受骗,损害自身及他人的利益。请牢记:Cosmos论坛,Riot群,和Telegram群都不是Cosmos官方信息或者新闻的发布渠道。 69 | * 在发送交易前再次确认交易。链上地址的确很长,但请仔细检查,确保交易发送到正确的地址,防止错误发送。 70 | 71 | 如果突然出现的交易极具诱惑,或显示的消息要求您提供永远不应该与其他人分享的信息,您就应该立刻通过Cosmos网站或者其他官方渠道来验证这些信息。请再次牢记,来自Cosmos,Tendermint团队或跨链基金会的任何人都不会发送电子邮件要求您提供任何类型的帐户凭据或您的助记词,我们仅会通过我们的官方博客,Twitter和GitHub帐户与Cosmos社区沟通重要新闻和进展。 72 | -------------------------------------------------------------------------------- /docs/DOCS_README.md: -------------------------------------------------------------------------------- 1 | # Updating the docs 2 | 3 | If you want to open a PR on Gaia to update the documentation, please follow the guidelines in the [`CONTRIBUTING.md`](https://github.com/cosmos/gaia/tree/master/CONTRIBUTING.md) 4 | 5 | ## Docs Build Workflow 6 | 7 | The documentation for Gaia is hosted at: 8 | 9 | - https://hub.cosmos.network/docs/ 10 | 11 | built from the files in this (`/docs`) directory for [master](https://github.com/cosmos/gaia/tree/master/docs) 12 | 13 | 14 | ### How It Works 15 | 16 | There is a CircleCI job listening for changes in the `/docs` directory, on both 17 | the `master` and `develop` branches. Any updates to files in this directory 18 | on those branches will automatically trigger a website deployment. Under the hood, 19 | the private website repository has a `make build-docs` target consumed by a CircleCI job in that repo. 20 | 21 | ## README 22 | 23 | The [README.md](./README.md) is also the landing page for the documentation 24 | on the website. During the Jenkins build, the current commit is added to the bottom 25 | of the README. 26 | 27 | ## Config.js 28 | 29 | The [config.js](./.vuepress/config.js) generates the sidebar and Table of Contents 30 | on the website docs. Note the use of relative links and the omission of 31 | file extensions. Additional features are available to improve the look 32 | of the sidebar. 33 | 34 | ## Links 35 | 36 | **NOTE:** Strongly consider the existing links - both within this directory 37 | and to the website docs - when moving or deleting files. 38 | 39 | Relative links should be used nearly everywhere, having discovered and weighed the following: 40 | 41 | ### Relative 42 | 43 | Where is the other file, relative to the current one? 44 | 45 | - works both on GitHub and for the VuePress build 46 | - confusing / annoying to have things like: `../../../../myfile.md` 47 | - requires more updates when files are re-shuffled 48 | 49 | ### Absolute 50 | 51 | Where is the other file, given the root of the repo? 52 | 53 | - works on GitHub, doesn't work for the VuePress build 54 | - this is much nicer: `/docs/hereitis/myfile.md` 55 | - if you move that file around, the links inside it are preserved (but not to it, of course) 56 | 57 | ### Full 58 | 59 | The full GitHub URL to a file or directory. Used occasionally when it makes sense 60 | to send users to the GitHub. 61 | 62 | ## Building Locally 63 | 64 | To build and serve the documentation locally, run: 65 | 66 | ```bash 67 | npm install -g vuepress 68 | ``` 69 | 70 | then change the following line in the `config.js`: 71 | 72 | ```js 73 | base: "/docs/", 74 | ``` 75 | 76 | to: 77 | 78 | ```js 79 | base: "/", 80 | ``` 81 | 82 | Finally, go up one directory to the root of the repo and run: 83 | 84 | ```bash 85 | # from root of repo 86 | vuepress build docs 87 | cd dist/docs 88 | python -m SimpleHTTPServer 8080 89 | ``` 90 | 91 | then navigate to localhost:8080 in your browser. 92 | 93 | ## Build RPC Docs 94 | 95 | First, run `make tools` from the root of repo, to install the swagger-ui tool. 96 | 97 | Then, edit the `swagger.yaml` manually; it is found [here](https://github.com/cosmos/gaia/blob/master/cmd/gaiacli/swagger-ui/swagger.yaml) 98 | 99 | Finally, run `make update-gaia-lite-docs` from the root of the repo. 100 | 101 | ## Search 102 | 103 | We are using [Algolia](https://www.algolia.com) to power full-text search. This uses a public API search-only key in the `config.js` as well as a [cosmos_network.json](https://github.com/algolia/docsearch-configs/blob/master/configs/cosmos_network.json) configuration file that we can update with PRs. 104 | 105 | ## Consistency 106 | 107 | Because the build processes are identical (as is the information contained herein), this file should be kept in sync as 108 | much as possible with its [counterpart in the Tendermint Core repo](https://github.com/tendermint/tendermint/blob/develop/docs/DOCS_README.md). 109 | 110 | ### Update and Build the RPC docs 111 | 112 | 1. Execute the following command at the root directory to install the swagger-ui generate tool. 113 | ```bash 114 | make tools 115 | ``` 116 | 2. Edit API docs 117 | 1. Directly Edit API docs manually: `cmd/gaiacli/swagger-ui/swagger.yaml`. 118 | 2. Edit API docs within the [Swagger Editor](https://editor.swagger.io/). Please refer to this [document](https://swagger.io/docs/specification/2-0/basic-structure/) for the correct structure in `.yaml`. 119 | 3. Download `swagger.yaml` and replace the old `swagger.yaml` under fold `cmd/gaiacli/swagger-ui`. 120 | 4. Compile gaiacli 121 | ```bash 122 | make install 123 | ``` 124 | -------------------------------------------------------------------------------- /docs/translations/kr/join-testnet.md: -------------------------------------------------------------------------------- 1 | # 최신 퍼블릭 테스트넷에 참가하기 2 | 3 | ::: tip 최신 테스트넷 4 | 최신 테스트넷에 대한 정보는 다음의 [테스트넷 리포](https://github.com/cosmos/testnets)를 참고하세요. 어떤 코스모스 SDK 버전과 제네시스 파일에 대한 정보가 포합되어있습니다. 5 | ::: 6 | 7 | ::: warning 8 | **여기에서 더 진행하시기 전에 [gaia](./installation.md)가 꼭 설치되어있어야 합니다.** 9 | ::: 10 | 11 | ## 새로운 노드 세팅하기 12 | 13 | > 참고: 과거 테스트넷에서 풀 노드를 운영하셨다면 이 항목은 건너뛰시고 [과거 테스트넷에서 업그레이드 하기](#upgrading-from-previous-testnet)를 참고하세요. 14 | 15 | 다음 절차는 새로운 풀노드를 처음부터 세팅하는 절차입니다. 16 | 17 | 우선 노드를 실행하고 필요한 config 파일을 생성합니다: 18 | 19 | ```bash 20 | gaiad init --moniker 21 | ``` 22 | 23 | ::: warning 참고 24 | `--moniker`는 ASCII 캐릭터만을 지원합니다. Unicode 캐릭터를 이용하는 경우 노드 접근이 불가능할 수 있으니 참고하세요. 25 | ::: 26 | 27 | `moniker`는 `~/.gaiad/config/config.toml` 파일을 통해 추후에 변경이 가능합니다: 28 | 29 | ```toml 30 | # A custom human readable name for this node 31 | moniker = "" 32 | ``` 33 | 34 | 최소 수수료보다 낮은 트랜잭션을 거절하는 스팸 방지 메커니즘을 활성화 하시려면 `~/.gaiad/config/gaiad.toml` 파일을 변경하시면 됩니다: 35 | 36 | ``` 37 | # This is a TOML config file. 38 | # For more information, see https://github.com/toml-lang/toml 39 | 40 | ##### main base config options ##### 41 | 42 | # Validators reject any tx from the mempool with less than the minimum fee per gas. 43 | minimum_fees = "" 44 | ``` 45 | 46 | 47 | 당신의 풀노드가 활성화 되었습니다! [제네시스와 시드](#genesis-seeds)로 넘어가주세요. 48 | 49 | ## 과거 테스트넷에서 업그레이드 하기 50 | 51 | 다음은 과거 테스트넷에서 운영을 했었던 풀노드가 최신 테스트넷으로 업그레이드를 하기 위한 절차입니다. 52 | 53 | ### 데이터 리셋 54 | 55 | 우선, 과거 파일을 삭제하고 데이터를 리셋합니다. 56 | 57 | ```bash 58 | rm $HOME/.gaiad/config/addrbook.json $HOME/.gaiad/config/genesis.json 59 | gaiad unsafe-reset-all 60 | ``` 61 | 62 | 이제 `priv_validator.json`과 `config.toml`을 제외하고 노드가 초기화 되었습니다. 만약 해당 노드에 연결된적이 있는 센트리노드나 풀노드가 같이 업그레이드 되지 않았다면 연결이 실패할 수 있습니다. 63 | 64 | ::: danger 경고 65 | 각 노드가 **고유한** `priv_validator.json`을 보유하고 있는 것을 확인하세요. 오래된 노드의 `priv_validator.json`을 다수의 새로운 노드로 복사하지 마세요. 동일한 `priv_validator.json`을 보유한 두개 이상의 노드가 동시에 운영될 경우, **더블 사이닝**이 일어날 수 있습니다. 66 | ::: 67 | 68 | ### 소프트웨어 업그레이드 69 | 70 | 이제 소프트웨어를 업그레이드할 시간입니다: 71 | 72 | ```bash 73 | cd $GOPATH/src/github.com/cosmos/cosmos-sdk 74 | git fetch --all && git checkout master 75 | make update_tools install 76 | ``` 77 | 78 | ::: tip 79 | *참고*: 이 단계에서 문제가 있으시다면 최신 스테이블 GO 버전이 설치되어있는지 확인해주세요. 80 | ::: 81 | 82 | 위 예시에서는 가장 최신 스테이블 릴리즈가 있는 `master`를 사용합니다. 테스트넷마다 운용하는 릴리즈가 다를 경우가 있으니 [testnet repo](https://github.com/cosmos/testnets)를 확인하셔서 어떤 버전이 필요한지 확인하시고, [SDK 릴리즈 페이지](https://github.com/cosmos/cosmos-sdk/releases)에서 각 릴리즈에 대한 정보를 확인하세요. 83 | 84 | 이제 풀 노드가 깔끔하게 업그레이드 되었습니다! 85 | 86 | ## 제네시스와 시드 87 | 88 | ### 제네시스 파일 복사하기 89 | 90 | 테스트넷의 `genesis.json`파일을 `gaiad`의 config 디렉토리로 가져옵니다. 91 | 92 | ```bash 93 | mkdir -p $HOME/.gaiad/config 94 | curl https://raw.githubusercontent.com/cosmos/testnets/master/latest/genesis.json > $HOME/.gaiad/config/genesis.json 95 | ``` 96 | 97 | 위 예시에서는 최신 테스트넷에 대한 정보가 포함되어있는 [테스트넷 repo]의 `latest`를 이용하는 것을 참고하세요. 만약 다른 테스트넷에 연결하신다면 해당 테스트넷의 파일을 가져오는 것인지 확인하세요. 98 | 99 | 설정이 올바르게 작동하는지 확인하기 위해서는 다음을 실행하세요: 100 | 101 | ```bash 102 | gaiad start 103 | ``` 104 | 105 | ### 시드 노드 추가하기 106 | 107 | 이제 노드가 다른 피어들을 찾는 방법을 알아야합니다. `$HOME/.gaiad/config/config.toml`에 안정적인 시드 노드들을 추가할 차례입니다. `testnets` repo에 각 테스트넷에 대한 시드 노드 링크가 포함되어있습니다. 만약 현재 운영되고 있는 테스트넷을 참가하고 싶으시다면 [여기](https://github.com/cosmos/testnets)에서 어떤 노드를 이용할지 확인하세요. 108 | 109 | 만약 해당 시드가 작동하지 않는다면, 추가적인 시드와 피어들을 [코스모스 익스플로러](https://explorer.cosmos.network/nodes)를 통해 확인하실 수 있습니다. `Full Nodes` 탭을 들어가셔서 프라이빗(`10.x.x.x`) 또는 로컬 IP 주소(https://en.wikipedia.org/wiki/Private_network)가 *아닌* 노드를 열어보세요. `Persistent Peer` 값에 연결 스트링(connection string)이 표기되어 있습니다. 가장 최적화된 결과를 위해서는 4-6을 이용하세요. 110 | 111 | 이 외에도 [밸리데이터 라이엇 채팅방](https://riot.im/app/#/room/#cosmos-validators:matrix.org)을 통해서 피어 요청을 할 수 있습니다. 112 | 113 | 시드와 피어에 대한 더 많은 정보를 원하시면 [여기](https://github.com/tendermint/tendermint/blob/develop/docs/tendermint-core/using-tendermint.md#peers)를 확인하세요. 114 | 115 | ## 풀노드 운영하기 116 | 117 | 다음 커맨드로 풀노드를 시작하세요: 118 | 119 | ```bash 120 | gaiad start 121 | ``` 122 | 123 | 모든 것이 잘 작동하고 있는지 확인하기 위해서는: 124 | 125 | ```bash 126 | gaiacli status 127 | ``` 128 | 129 | 네트워크 상태를 [코스모스 익스플로러](https://explorecosmos.network)를 통해 확인하세요. 현재 풀 노드가 현재 블록높이로 싱크되었을 경우, 익스플로러의 [풀 노드 리스트](https://explorecosmos.network/validators)에 표시가 될 것입니다. 익스플로러가 모든 노드에 연결하지는 않아 표시가 되지 않을 수 있다는 점 참고해주십시오. 130 | 131 | ## 상태 내보내기(Export State) 132 | 133 | Gaia는 현재 애플리케이션의 상태를 JSON파일 형태로 내보낼 수 있습니다. 이런 데이터는 수동 분석과 새로운 네트워크의 제네시스 파일로 이용될 때 유용할 수 있습니다. 134 | 135 | 현재 상태를 내보내기 위해서는: 136 | 137 | ```bash 138 | gaiad export > [filename].json 139 | ``` 140 | 141 | 특정 블록 높이의 상태를 내보낼 수 있습니다(해당 블록 처리 후 상태): 142 | 143 | ```bash 144 | gaiad export --height [height] > [filename].json 145 | ``` 146 | 147 | 만약 해당 상태를 기반으로 새로운 네트워크를 시작하시려 한다면, `--for-zero-height` 플래그를 이용하셔서 내보내기를 실행해주세요: 148 | 149 | ```bash 150 | gaiad export --height [height] --for-zero-height > [filename].json 151 | ``` 152 | 153 | ## 밸리데이터 노드로 업그레이드 하기 154 | 155 | 이제 풀노드가 활성화 되었습니다! 다음은 무엇일까요? 156 | 157 | 이제는 해당 풀노드를 업그레이드 하여 코스모스 밸리데이터가 될 수 있습니다. 상위 100개 밸리데이터는 코스모스 허브의 블록 생성과 제안을 할 수 있습니다. 밸리데이터 노드로 업그레이드 하시기 위해서는 [밸리데이터 설정하기](./validators/validator-setup.md) 항목으로 넘어가주세요. 158 | --------------------------------------------------------------------------------