From c96dcf647383bc4adf82ed24684bfe49777c456d Mon Sep 17 00:00:00 2001 From: kidinamoto01 Date: Wed, 15 Aug 2018 15:41:09 +0800 Subject: [PATCH 01/24] add docs --- docs/get-started/full-node.md | 79 +++++++++++++++++++ docs/get-started/install-iris.md | 117 +++++++++++++++++++++++++++++ docs/get-started/validator-node.md | 54 +++++++++++++ 3 files changed, 250 insertions(+) create mode 100644 docs/get-started/full-node.md create mode 100644 docs/get-started/install-iris.md create mode 100644 docs/get-started/validator-node.md diff --git a/docs/get-started/full-node.md b/docs/get-started/full-node.md new file mode 100644 index 000000000..a2bb0dab5 --- /dev/null +++ b/docs/get-started/full-node.md @@ -0,0 +1,79 @@ +# Setup A Full-node + +Before setting up your validator node, make sure you've already installed **Iris** by this [guide](https://github.com/irisnet/testnets/blob/master/testnets/docs/install%20iris.md) + +### Step 2: Setting Up Your Node + +These instructions are for setting up a brand new full node from scratch. + +First, initialize the node and create the necessary config files: + +``` +iris init --name --home= +``` + +> Note: Only ASCII characters are supported for the `--name`. Using Unicode characters will render your node unreachable. + +The default \$IRISHOME is `~/.iris` , You can edit this `name` later, in the `~/.iris/config/config.toml` file: + +``` +# A custom human readable name for this node +moniker = "" +external_address = "" +``` + + +Optional: +Set `addr_book_strict` to `false` to make peering more easily. + +``` +addr_book_strict = false +``` +Your full node has been initialized! + +### Get Configuration Files + +If you want to be part of the genesis file geneartion process, please follow this [guide](https://github.com/kidinamoto01/testnets-1/blob/master/testnets/docs/Genesis%20Generation%20Process.md) to sumbmit a json file. Otherwise, you could always send related transaction to become a validator later. + +After the genesis file generation process is finished, please download the genesis and the default config file. + +``` +cd $IRISHOME/config/ +rm genesis.json +rm config.toml +wget https://raw.githubusercontent.com/irisnet/testnets/master/testnets/fuxi-2000/config/config.toml +wget https://raw.githubusercontent.com/irisnet/testnets/master/testnets/fuxi-2000/config/genesis.json +``` + +### Add Seed Nodes + +Your node needs to know how to find peers. You'll need to add healthy seed nodes to `$IRISHOME/config/config.toml`. Here are some seed nodes you can use: + +``` +c16700520a810b270206d59f0f02ea9abd85a4fe@35.165.232.141:26656 +``` + +Meanwhile, you could add some known full node as `Persistent Peer`. Your node could connect to `sentry node` as `persistent peers`. + + +Chang the `external_address` to your `public IP:26656`. + + +### Run a Full Node + +Start the full node with this command: + +``` +iris start --home=$IRISHOME > iris.log +``` + +Check that everything is running smoothly: + +``` +iriscli status +``` +You could see the following +``` +{"node_info":{"id":"71b188e9fdefd939453b3cd10c0eae45a8d02a2b","listen_addr":"172.31.0.190:26656","network":"fuxi-2000","version":"0.22.6","channels":"4020212223303800","moniker":"name","other":["amino_version=0.10.1","p2p_version=0.5.0","consensus_version=v1/0.2.2","rpc_version=0.7.0/3","tx_index=on","rpc_addr=tcp://0.0.0.0:26657"]},"sync_info":{"latest_block_hash":"CC9BBE0B38643DAF3D9B78D928E2ACA654E5A39C","latest_app_hash":"56B9228A97D5B85BFDBEE020E597D45D427ABC43","latest_block_height":"30048","latest_block_time":"2018-08-02T08:23:44.566550056Z","catching_up":false},"validator_info":{"address":"F638F7EA8A8E4DA559A346E1C404F83941749713","pub_key":{"type":"tendermint/PubKeyEd25519","value":"oI16LfBmnP8CefSGwIjAIO3QZ05xwB1+s4oPIQ3Yaag="},"voting_power":"10"}} +``` +When you see `catching_up` is `false`, it means the node is synced with the rest of testnet, otherwise it means it's still syncing. \ No newline at end of file diff --git a/docs/get-started/install-iris.md b/docs/get-started/install-iris.md new file mode 100644 index 000000000..4549f8f09 --- /dev/null +++ b/docs/get-started/install-iris.md @@ -0,0 +1,117 @@ +# Install Iris + +### Step 1: Configure Your Server + +All the blockchains in IRISnet is based on Cosmos-SDK, which is a framework for building blockchain applications in Golang. It is being used to build [Cosmos Hub](https://cosmos.network/). It's recommended to run a validator node on Linux server. + +**Recommanded Configurations:** + +1. 2 CPU +2. Memory: 4GB +3. Disk: 60GB SSD +4. OS: Ubuntu 16.04 LTS +5. Allow all incoming connections from TCP port 26656 and 26657 + +### Step 2: Install Iris + +There are two ways to get Iris running on your server. First, you could download the binary files from our release pages. You could also download the source code and compile it locally. + +#### Download Binary Directly + +Go to the download page: https://github.com/irisnet/irishub/releases/ then get the release v0.3.4 on your computer. +`unzip -C /usr/local/bin iris$VERSION.$OS-$ARCH.zip` to `/usr/local/bin/ ` You could verify you have the right version installed by running the following commands: + +``` +$ iris version +v0.3.4 + +$ iriscli version +v0.3.4 +``` + +#### Compile Source Code + +- Install Go 1.10+ + +``` +$ sudo add-apt-repository ppa:gophers/archive +$ sudo apt-get update +$ sudo apt-get install golang-1.10-go +``` + +> Note that golang-1.10-go puts binaries in /usr/lib/go-1.10/bin. If you want them on your PATH, you need to make that change yourself. + +Using snaps also works quite well: + +``` +This will give you the latest version of go +$ sudo snap install --classic go +``` + +> A restart is required for the command to be recognized. + +Then you need to verify the versions of Go: + +``` +$ go version +go version go1.10.3 darwin/amd64 +``` + +Then, you need to add `GOPATH` to system `PATH` , then your system could correctly compile the code. + +Open your `.profile` in your home directory. Add the following lines at the end of file: + +``` +GOPATH=$HOME/go +PATH=$GOPATH/bin:$PATH +``` + +Save the file and exit the editor. Then run the following to make your bash reload your profile configurations. + +``` +$ source $HOME/.profile +``` + +Now you should see something like this if you echo your\$GOPATH and \$PATH variables + +``` +$ echo $GOPATH +/home/iris/go +$ echo $PATH +/home/isir/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +``` + +- Get the code and compile Iris + +After setup Go correctly, you should be able to compile and run **Iris**. + +``` +mkdir -p $GOPATH/src/github.com/irisnet +cd $GOPATH/src/github.com/irisnet +git clone https://github.com/irisnet/irishub +cd irishub && git checkout v0.3.4 +curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh +make get_vendor_deps && make install +``` + +If your environment variables have set up correctly, you should not get any errors by running the above commands. +Now check your **Iris** version. + +``` +$ iris version +v0.3.4 +$ iriscli version +v0.3.4 +``` + +### How to Update + +Get latest code (you can also `git fetch` only the version desired), ensure the dependencies are up to date, then recompile. + +``` +cd $GOPATH/src/github.com/irisnet/irishub +git fetch -a origin +git checkout VERSION +make get_vendor_deps +make install +``` \ No newline at end of file diff --git a/docs/get-started/validator-node.md b/docs/get-started/validator-node.md new file mode 100644 index 000000000..8558acf48 --- /dev/null +++ b/docs/get-started/validator-node.md @@ -0,0 +1,54 @@ +#Running a Validator Node + +Validators are responsible for committing new blocks to the blockchain through voting. A validator's stake is slashed if they become unavailable, double sign a transaction, or don't cast their votes. Please read about [Sentry Node Architecture](https://github.com/kidinamoto01/testnets-1/blob/master/testnets/docs/Setup%20A%20Sentry%20Node.md) to protect your node from DDOS attacks and to ensure high-availability. + +### Create A Validator + +Your `fvp` can be used to create a new validator by staking tokens. You can find your validator pubkey by running: + +``` +iris tendermint show_validator --home= +``` + +Next, craft your `iriscli stake create-validator` command: + +You can always get some `IRIS` by using the [Faucet](https://testnet.irisplorer.io/#/faucet). Please don't abuse it. + +``` +iriscli stake create-validator --amount=100iris --pubkey= --address-validator= --moniker= --chain-id=fuxi-2000 --name= +``` + +### Edit Validator Description + +You can edit your validator's public description. This info is to identify your validator, and will be relied on by delegators to decide which validators to stake to. Make sure to provide input for every flag below, otherwise the field will default to empty (`--moniker`defaults to the machine name). + +``` +iriscli stake edit-validator + --address-validator= + --moniker="choose a moniker" \ + --website="https://cosmos.network" \ + --details="" + --chain-id=fuxi-2000 \ + --name= +``` + +### View Validator Description + +View the validator's information with this command: + +``` +iriscli stake validator \ + --address-validator= \ + --chain-id=fuxi-2000 +``` + +### Confirm Your Validator is Running + +Your validator is active if the following command returns anything: + +``` +iriscli advanced tendermint validator-set | grep "$( tendermint show_validator)" +``` + +You should also be able to see your validator on the [Explorer](https://testnet.irisplorer.io). You are looking for the `bech32` encoded `address` in the `~/.iris/config/priv_validator.json` file. + From 8a546ca59ebab4cb481ac8bfc70a5bc27f456e15 Mon Sep 17 00:00:00 2001 From: kidinamoto01 Date: Wed, 15 Aug 2018 15:50:59 +0800 Subject: [PATCH 02/24] add docs --- docs/get-started/validator-node.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/validator-node.md b/docs/get-started/validator-node.md index 8558acf48..bfdbd0e19 100644 --- a/docs/get-started/validator-node.md +++ b/docs/get-started/validator-node.md @@ -15,7 +15,7 @@ Next, craft your `iriscli stake create-validator` command: You can always get some `IRIS` by using the [Faucet](https://testnet.irisplorer.io/#/faucet). Please don't abuse it. ``` -iriscli stake create-validator --amount=100iris --pubkey= --address-validator= --moniker= --chain-id=fuxi-2000 --name= +iriscli stake create-validator --amount=10iris --pubkey= --address-validator= --moniker= --chain-id=fuxi-2000 --name= ``` ### Edit Validator Description From b83047c3a057e59a037d48e1348029596f8ca7e2 Mon Sep 17 00:00:00 2001 From: kidinamoto01 Date: Wed, 15 Aug 2018 16:13:44 +0800 Subject: [PATCH 03/24] add docs --- docs/get-started/full-node.md | 5 ++--- docs/get-started/validator-node.md | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/get-started/full-node.md b/docs/get-started/full-node.md index a2bb0dab5..e5eee708f 100644 --- a/docs/get-started/full-node.md +++ b/docs/get-started/full-node.md @@ -1,6 +1,6 @@ # Setup A Full-node -Before setting up your validator node, make sure you've already installed **Iris** by this [guide](https://github.com/irisnet/testnets/blob/master/testnets/docs/install%20iris.md) +Before setting up your validator node, make sure you've already installed **Iris** by this [guide](install-iris.md) ### Step 2: Setting Up Your Node @@ -33,9 +33,8 @@ Your full node has been initialized! ### Get Configuration Files -If you want to be part of the genesis file geneartion process, please follow this [guide](https://github.com/kidinamoto01/testnets-1/blob/master/testnets/docs/Genesis%20Generation%20Process.md) to sumbmit a json file. Otherwise, you could always send related transaction to become a validator later. -After the genesis file generation process is finished, please download the genesis and the default config file. +After the genesis file is ready, please download the genesis and the default config file. ``` cd $IRISHOME/config/ diff --git a/docs/get-started/validator-node.md b/docs/get-started/validator-node.md index bfdbd0e19..f1ce54d85 100644 --- a/docs/get-started/validator-node.md +++ b/docs/get-started/validator-node.md @@ -1,6 +1,6 @@ #Running a Validator Node -Validators are responsible for committing new blocks to the blockchain through voting. A validator's stake is slashed if they become unavailable, double sign a transaction, or don't cast their votes. Please read about [Sentry Node Architecture](https://github.com/kidinamoto01/testnets-1/blob/master/testnets/docs/Setup%20A%20Sentry%20Node.md) to protect your node from DDOS attacks and to ensure high-availability. +Validators are responsible for committing new blocks to the blockchain through voting. A validator's stake is slashed if they become unavailable, double sign a transaction, or don't cast their votes. Please read about Sentry Node Architecture to protect your node from DDOS attacks and to ensure high-availability. ### Create A Validator From d13606663fa3485cb48ec553a4cff27d035133ad Mon Sep 17 00:00:00 2001 From: kidinamoto01 Date: Fri, 17 Aug 2018 15:51:35 +0800 Subject: [PATCH 04/24] add whitepaper --- docs/introduction/Whitepaper.md | 1032 ++++++++++++++++++++++++++++ docs/introduction/Whitepaper_CN.md | 616 +++++++++++++++++ 2 files changed, 1648 insertions(+) create mode 100644 docs/introduction/Whitepaper.md create mode 100644 docs/introduction/Whitepaper_CN.md diff --git a/docs/introduction/Whitepaper.md b/docs/introduction/Whitepaper.md new file mode 100644 index 000000000..a1916bd21 --- /dev/null +++ b/docs/introduction/Whitepaper.md @@ -0,0 +1,1032 @@ +# The IRIS Network +**Inter-chain service infrastructure and protocol for building trustworthy and distributed business applications** + +Harriet Cao harriet@bianjie.ai
+Haifeng Xi haifeng@bianjie.ai + +_NOTE: If you can read this on GitHub, then we're still actively developing this +document. Please check regularly for updates!_ +
+ +## Table of Contents ########################################################### + +* [Disclaimer](#disclaimer) +* [IRIS Overview](#iris-overview) + * [Cosmos and Tendermint](#cosmos-and-tendermint) + * [IRIS Innovations](#iris-innovations) +* [IRIS Network Design](#iris-network-design) + * [Network Actors](#network-actors) + * [IRIS Services](#iris-services) + * [IBC Enhancement](#ibc-enhancement) +* [Use Cases](#use-cases) +* [Token Economics](#token-economics) +* [Initial Token Distribution](#initial-token-distribution) +* [Roadmap](#roadmap) +* [The Team](#the-team) + * [Core Members](#core-members) + * [Advisors](#advisors) +* [References](#references) + +
+ +## Disclaimer + +This whitepaper and any other documents published in association with this whitepaper relate to the intended development and use of the IRIS network. They are information purposes only and may be subject to change. + +### This whitepaper describes a developing project + +This whitepaper contains forward-looking statements that are based on the beliefs of IRIS Foundation Limited, as well as certain assumptions made by and information available to IRIS Foundation Limited. + +The IRIS network as envisaged in this whitepaper is under development and is being constantly updated, including but not limited to key governance and technical features. The IRIS token involves and relates to the development and use of experimental platforms (software) and technologies that may not come to fruition or achieve the objectives specified in this whitepaper. + +If and when the IRIS network is completed, it may differ significantly from the network set out in this whitepaper. No representation or warranty is given as to the achievement or reasonableness of any plans, future projections or prospects and nothing in this document is or should be relied upon as a promise or representation as to the future. + +### No offer of regulated products + +The IRIS tokens are not intended to represent a security or any other regulated product in any jurisdiction. + +This document does not constitute an offer or solicitation of securities or any other regulated product, nor a promotion, invitation or solicitation for investment purposes. The terms of the purchase are not intended to be a financial service offering document or a prospectus of any sort. + +The IRIS tokens do not represent equity, shares, units, royalties or rights to capital, profit, returns or income in the platform or software or in IRIS Foundation Limited or any other company or intellectual property associated with the platform or any other public or private enterprise, corporation, foundation or other entity in any jurisdiction. + +### This whitepaper is not advice + +This whitepaper does not constitute advice to purchase any IRIS tokens. It must not be relied upon in connection with any contract or purchasing decision. + +### Risk warning + +The purchase of IRIS tokens and participation in the IRIS network carries with it significant risks. + +Prior to purchasing IRIS tokens, you should carefully assess and take into account the risks, including those listed on and in any other documentation. + +### Views of IRIS Foundation Limited only + +The views and opinions expressed in this whitepaper are those of IRIS Foundation Limited and do not necessarily reflect the official policy or position of any government, quasi-government, authority or public body (including but not limited to any regulatory body of any jurisdiction) in any jurisdiction. + +Information contained in this whitepaper is based on sources considered reliable by IRIS Foundation Limited but there is no assurance as to their accuracy or completeness. + +### English is the authorised language of this whitepaper + +This whitepaper and related materials are issued in English only. Any translation is for reference purposes only and is not certified by IRIS Foundation Limited or any other person. No assurance can be made as to the accuracy and completeness of any translations. If there is any inconsistency between a translation and the English version of this whitepaper, the English version prevails. + +### No third party affiliation or endorsements + +References in this whitepaper to specific companies and platforms are for illustrative purposes only. The use of any company and/or platform names and trademarks does not imply any affiliation with, or endorsement by, any of those parties. + +### You must obtain all necessary professional advice + +You must consult a lawyer, accountant and/or tax professional, as well as any other professional advisors, as necessary prior to determining whether to purchase IRIS tokens or otherwise participate in the IRIS network. + +
+ +## IRIS OVERVIEW ################################################################ + +> The IRIS network is named after the Greek goddess Iris, said to be the personification of the rainbow and the faithful messenger between heaven and humanity. + +Contractual relationships are a fundamental building block of human society and the +importance of blockchain technology lies in providing a very efficient +and cost effective way of realizing reliable contractual +relationships: for the first time, trust (which is also very +costly to establish) is not needed when multiple parties participate in sophisticated +business interactions. It has been said that blockchain technology provides +the most important elements for distributed business to take place: lifting network effect +and very low transaction cost. More and more people see the potential of +blockchains as the new internet of value and will gradually transform the +current business models into more efficient distributed ones. Especially +the token mechanism embedded in most modern blockchain emphasizes each network +participant's right and will disrupt business in its current form [\[1\]][1]. + +However, blockchain technology is still in its early stages. As with any new technology, there are drawbacks. These include limited performance and undeveloped governance mechanisms. Presently, these drawbacks make it difficult for blockchains to support real-world distributed business collaboration. Consortium chains, such as Hyperledger Fabric and R3 Corda, and organisations such as the Ethereum Enterprise Alliance, have tried to address those performance and governance issues to make blockchain technology more suitable for enterprises. However, today consortium chains are dominated by huge +enterprise companies. Furthermore their close-form off on-chain governance model +is very inefficient. Without a token economics model and the +openness and the excitement in public chains, consortium chains may be viewed as lacking vitality. + +We would like to enhance the current blockchain technology and +make it possible to enable thousands and millions of Small Medium Businesses ("SMBs") and even individual freelance business service providers to provide their services and enjoy the rewards in an open network. To achieve this, we have identified the following challenges and consequent opportunities for technology innovations: + +**Not all computation could or should be implemented as on-chain computations such as smart contracts** + +The [Turing-complete](https://en.wikipedia.org/wiki/Turing_completeness) virtual +machine provided by Ethereum [\[2\]][2] runs Smart Contracts gives people a lot of hope of developing +decentralized applications. However Smart contracts can only handle deterministic logic (so +every node can reach an identical state after processing every +transaction and block) while huge amount of existing business logic that +is not deterministic and might vary at different time and under +different environmental parameters. Especially these days, business systems have placed an increasing amount of reliance on computer algorithms, including Natural Language Processing ("NLP"), machine learning, and operation research algorithms, for decision optimization. In those +algorithms, very often we purposely add some randomness to make the +decision not to get stuck at local optimal states while trying to find a +better sub-optimal result. + +On the other hand, some of the real world business logics are meant to +be run once off-chain and shouldn't be implemented as smart contracts +this type of replicated computing. Integration and collaboration of off-chain services and resources with +a distributed ledger is key to further advance the adoption of +blockchain technology for more real-world use scenarios. + +**How to reuse the existing blockchain resources, including both public chains and consortium chains** + +It is infeasible to use one public chain to address all use cases. +Every day there are different chains going live which focus on one aspect +of problem solving such as distributed storage, asset ownership or predict market etc. +According to the coinmarketcap.com, there are more than 1000 +cryptocurrencies currently active on various exchanges. + +While building business applications involve handling storage and also +different source of data feeds. Another motivation of our work involves +how to support building distributed business applications by reusing +some of the existing work like storage (IPFS, SIA, Storj.io etc.), data feed +(Augur, Gnosis, Oraclize etc.) and IoT (IOTA etc.) provided by those +dedicated blockchains and not reinventing the wheel. + +Besides, there are many (near) real-time business transactions do need +more close form consortium/permission/private chains to address +performance, security and business governance requirements. Our vision of distributed business infrastructure needs to have the Interoperability of many heterogeneous chains including public/consortium/permission/private chains. + +Inter-chain technology is a very nature answer to the requirement. +However, till today, the existing Inter-chain technologies are mainly +designed to provide interoperability among existing blockchains and +focus on token value transfer. The question of how to consume the +resource provided in different chains still remains unanswered. + +Comparing the proposed inter-chain technologies like Cosmos [\[3\]][3] and +Polkadot [\[4\]][4], we find out that Cosmos provides more mature base for +interoperability and scalability. Especially, we found the design of +"`many hubs and many zones`" and "`each zones are independent blockchains +having independent governance models`" from Cosmos provides a very +suitable architecture for modeling the real world complexity in a SOC +way. To best reuse the existing framework, we present the IRIS Network, a +decentralized inter-chain network composing hub and zones with +implementing a layer of service infrastructure based on +Cosmos/Tendermint [\[5\]][5], with enhanced usage of token . + +Since the IRIS network is designed on top of Cosmos/Tendermint, we will first discuss Cosmos/Tendermint, summarize the features we inherit from Cosmos/Tendermint and summarize the innovations we have created. + +### Cosmos and Tendermint ################################################################ + +Cosmos [\[3\]][3] intends to build the 'internet of blockchains'. It is a network of many independent blockchains, called "zones". Each zone is powered by classical Byzantine fault-tolerant ("BFT") +consensus protocols like [Tendermint](https://tendermint.com/). + +Tendermint provides a high-performance, consistent, secure BFT consensus +engine, where strict fork-accountability guarantees hold over the +behavior of malicious actors. Tendermint is well suited for scaling +heterogeneous blockchains including public blockchains such as Ethermint +[\[6\]][6], which is a blazing fast Proof-of-Stake implementation of +Ethereum, as well as performance critical permission/consortium chains. +The successful stories on using Tendermint in the permission/consortium +chain domain including Oracle [\[7\]][7], CITA [\[8\]][8] and +Hyperledger Burrow [\[9\]][9]. + +Tendermint is used as the consensus protocol for building the first zone +on the Cosmos Hub. Hub can connect to many different +kinds of zones, and the communication is achieved via an +inter-blockchain communication ("IBC") protocol, a kind of virtual UDP or +TCP for blockchains. Tokens can be transferred from one zone to another +securely through the Cosmos Hub, without the need for an exchange +or a trusted third party between zones. + +To develop robust interoperable blockchains and blockchain applications +with Cosmos Hub, Cosmos SDK provides blockchain development +\'starter-kit\' of common blockchain modules while not enforcing +user stories thus giving maximum flexibility for application customization. + +### IRIS Innovations ################################################################ + +IRIS network aims to build technology foundation which facilitate +construction of distributed business applications. It goes beyond today's +blockchain systems which are mainly for digitalized assets. + +The key challenges that we aim to address via the IRIS network are two-fold: +* Integration and collaboration of off-chain computing and resources on + a distributed ledger; +* interoperability of the services across + heterogeneous chains. + +We address those challenges through incorporation +of a service oriented infrastructure into Cosmos/Tendermint. + +Our design inherits the thinking pattern from +many years of service-oriented architecture ("SOA") practices. SOA is an architectural approach to create +systems built from autonomous services which have explicit boundaries, +share schemas and contracts [\[13\]][13]. Earlier practice of SOA focused +on the implementation of Enterprise Service Bus ("ESB") which enables +communication among services via a common communication bus which +consists of a variety of point-to-point connections between providers +and consumers. However, centralized management of services through ESB could +trigger a single point of failure, also adds dependency of service +deployment. The recent surge of micro-services architectural style can be +seen as a development of SOA without focusing on the ESB rather using +light message queues for inter service communication. In IRIS network, +the inter service communication is intended to be implemented over blockchain to +leverage blockchain as a trusted machine for mediating business +collaborations. It runs without prerequisite of existing trust among service +provider and service consumer which is very hard to establish. + +The IRIS network uses Tendermint protocol as a high-performance consensus +engine. Leveraging the flexibility provided by tendermint's Application +BlockChain Interface ("ABCI"), we define a set of service infrastructure +transaction types including service provisioning, service consumption +and service governance. As explained earlier, most business logic is not +suitable for implementation as deterministic smart contracts on +blockchain, we are using this service layer to move the business +application specific logics and transaction processing off the +blockchain itself and use the blockchain only to get consensus on the +results generated through those services. This idea is also inspired by +existing work from blockchain community when address performance issues +of moving some complicated computation off the main chain, such as Lightning +Network's off-chain state channels [\[10\]][10] as well as Plasma's fraud +proof side chains [\[11\]][11]. Although we are not implementing side chains, +we rip traditional business logic computation off the blockchain + and use it as a trustworthy mediation bus for +complicated business collaboration. + +For interchain communication, Cosmos IBC [\[12\]][12] defines a protocol for +transferring values from an account on one chain to an account on another +chain. The IRIS network designs new semantics to allow cross-chain computation to be invoked by leveraging IBC. We believe this capability is very important when building scalable business applications. Further details of potential use cases are set out below. + +The IRIS network is intended to provide the service infrastructure for handing and coordinating on-chain transaction processing with off-chain data processing and business logic execution. Enhanced IBC capability +allows those off-chain processing to be invoked cross chain, if required. The IRIS network, as presently envisaged, will also include client-side tools, including a smart wallet enabling cross-chain multi-asset storage, as well as consume and provide iServices. We plan to provide SDKs for easy construction of iServices. For example, for a specific service definition, the Client SDK would generate the provider side skeleton as well as consumer side stub for major programming languages. + +
+ +## IRIS Network Design ################################################################ + +![Figure of IRIS Network](https://github.com/irisnet/irisnet/blob/master/images/chap2-1.png?raw=true) + +As illustrated in the figure above, the IRIS network is intended to have the +same topology as the Cosmos network. We plan to connect the IRIS Hub to +the Cosmos Hub as one of its zones and regional hubs. IRIS full nodes, +developed with the IRIS SDK (which is itself a planned extension of the +Cosmos SDK), are proposed to provide a service infrastructure as well as +offer integration with an embedded InterPlanetary File System ("IPFS") node. + +IRIS Services (a.k.a. "iServices") intend to bridge the gap between the blockchain +world and the conventional business application world, by mediating a +complete lifecycle of off-chain services -- from their definition, +binding (provider registration), invocation, to their governance +(profiling and dispute resolution). By enhancing the IBC processing +logic to support service semantics, the IRIS SDK is intended to allow +distributed business services to be available across the internet of blockchains. + +While the IRIS network focuses on providing an innovative solution +for distributed business applications, it is still part of +the broader Cosmos network. All zones connected to our proposed IRIS hub would be able to interact with any other zone in the Cosmos network over +the standard IBC protocol. Furthermore, by introducing a layer of service +semantics, which we believe could enable a whole new set of business scenarios, +the planned IRIS network would represent an increase in scale and diversity +of the Cosmos network. + +### Network Actors + +1. **Consumers** are those users who may consume off-chain services by sending + requests to the network and receiving responses from the network. + +2. **Providers** are those users who may offer the implementation of one or more +iService definitions and often act as *adaptors* of off-chain services and resources located + in other public and consortium chains, as well as in enterprise legacy + systems. Providers monitor and process incoming requests and send responses + back to the network. A provider could at the same time act as a consumer + by sending requests to other providers. As planned, providers would be required to + charge a fee for any services they might offer, and the service fee, by default, would be + priced in the IRIS network's native fee token known as "IRIS"; providers + could also price their services in other whitelisted Cosmos fee tokens, to be + considered in due course. + +3. **Profiler** is the special user who works on behalf of the IRIS Foundation +Limited ("Foundation"), a Hong Kong incorporated company limited by guarantee. +The Foundation will take the lead in building the IRIS network. The profiler +is the sole user authorized to invoke iServices in the profiling mode, which +is intended to help create and maintain objective *provider profiles* that +consumers use to select suitable providers. + +### IRIS Services + +In this section, we set out the intended technical parameters for deploying iServices on the IRIS network. + +**Service Definition** + +A `Method` is composed of: + +* `ID (int)`: The unique ID of this method in the encompassing iService + +* `Name (string)`: The unique name of this method in the iService + +* `Description (string)`: A description of this method + +* `Input (string)`: A structured definition of the input parameters + +* `Output (string)`: A structured definition of the output result + +* `Error (string)`: A structured definition of all possible error conditions + +* `OutputPrivacy (enum)`: Can be one of `NoPrivacy` or `PubKeyEncryption` + +A `ServiceDefinition` is composed of: + +* `Name (string)`: The name of this iService + +* `Description (string)`: A description of this iService + +* `Tags (string)`: Comma separated keywords about this iService + +* `Creator (string)`: A self-description of the iService creator. *Optional* + +* `ChainID (string)`: The ID of the blockchain where this iService was + originally defined + +* `Messaging (enum)`: Can be one of `Unicast` or `Multicast` + +* `Methods ([]Method)`: The definition of methods available in this iService + +A `CreateServiceDefinitionTx` transaction is composed of: + +* `Definition (ServiceDefinition)`: The service definition to be created + +**Service Binding**: + +A `CreateServiceBindingTx` transaction is composed of: + +* `DefinitionHash ([]byte)`: The hash of the service definition that the provider is binding to + +* `ChainID (string)`: The ID of the blockchain where the provider is connected + +* `ProviderAddress ([]byte)`: The provider's blockchain address + +* `BindingType (enum)`: Can be one of `Local` or `Global`; choose `Global` if a + provider wants the binding to be exposed to the rest of the world; + otherwise, use `Local` + +* `ProviderDeposit (int64)`: To create an effective binding, the provider + must put down a deposit (in terms of IRIS token amount) that is greater than + the value of the system parameter `MinProviderDeposit`; a larger deposit + may imply more trustworthiness of the provider + +* `ServicePricing (string)`: A structured definition of the service pricing + model on a per method basis, including cost per call, volume discount, + promotional terms etc.; service fee is by default listed in IRIS token but + could also be quoted in other whitelisted fee tokens. + +* `ServiceLevel (string)`: A structured definition of service level the + provider agrees to bind himself to, in terms of response time, + availability etc. + +* `BindingExpiration (int64)`: The blockchain height where this binding + expires; a negative number means "never expire" + +An `UpdateServiceBindingTx` transaction is composed of: + +* `DefinitionHash ([]byte)`: The hash of the service definition the + provider has bound to + +* `ChainID (string)`: The ID of the blockchain where the provider is + connected + +* `ProviderAddress ([]byte)`: The provider's blockchain address + +* `ChangeSet (string)`: A structured definition of desired changes to an + existing binding identified by the preceding three fields + +![Figure of iService Definition and Bindings](https://github.com/irisnet/irisnet/blob/master/images/chap2-2.png?raw=true) + +A provider can update `ServicePricing`, `ServiceLevel` and `BindingExpiration` +at any time, but a small amount of their deposit will be slashed for +changing the latter two (specified by `ServiceLevelUpdateSlash` and +`BindingExpirationUpdateSlash` respectively). Setting `BindingExpiration` to +a height that is lower than the current height will be interpreted as +invalidating the binding immediately. + +Updates to `ProviderDeposit` will always be treated as *adding to* the +current deposit balance. Whenever the balance drops below +`MinProviderDeposit`, the binding will be disabled until the provider +increases the balance above the threshold. Upon expiration or +invalidation of a binding, the provider will automatically get back the +remaining balance of its deposit. + +`BindingType` can be changed from `Local` to `Global`, but not the other way +around. To downgrade a binding from `Global` to `Local`, a provider must +first invalidate the binding in question and then create a new `Local` +binding. + +If a provider somehow needs to move the binding to a new address, it is +not allowed to update `ProviderAddress` directly; instead, the provider +should invalidate the current binding and create another one with the +desired new `ProviderAddress`. + +Upon successful execution of these two transactions by the application +(i.e., iService business logic in the IRIS SDK), a `ServiceBinding` object +will be created or updated accordingly. + +A `ServiceBinding` is composed of: + +* `DefinitionHash ([]byte)` + +* `ChainID (string)` + +* `ProviderAddress ([]byte)` + +* `ServiceLevel (string)` + +* `ServicePricing (string)` + +* `BindingExpiration (int64)` + +* `IsValid (enum)`: Can be one of `True` or `False` + +**Service Invocation** + +![Figure of Service Invocation](https://github.com/irisnet/irisnet/blob/master/images/chap2-3.png?raw=true) + +Consumers and providers are proposed to interact with each other through *endpoints*. +There are two kinds of endpoints -- *request table* and *response table* +(see Figure above). Service requests are posted to request tables monitored +by interested provider(s) which pick up and process requests addressed +to them; service results (or errors) are posted back to response tables +monitored in turn by matched consumers. + +For a `Multicast` service, all of its bindings share one request table; +for a `Unicast` service, however, a separate request table is created and +maintained for each of its bindings. As for the other direction, a dedicated response table would be created and managed for each consumer. + +A `ServiceRequest` is composed of: + +* `ChainID (string)`: The ID of the blockchain where the consumer is + connected + +* `ConsumerAddress ([]byte)`: The blockchain address of the consumer + +* `DefinitionHash ([]byte)`: The hash of the service definition + +* `MethodID (int)`: The ID of the method to be invoked + +* `InputValue (string)`: A structured representation of input values + +* `BindingHash ([]byte)`: The hash of the target binding, in case of a + `Unicast` service. *Optional* + +* `MaxServiceFee (int64)`: The max amount of service fee the consumer is + willing to pay for a `Multicast` request. *Optional* + +* `Timeout (int)`: The max number of blocks the consumer is willing to wait + for response(s) to come back + +A `PostServiceRequestTx` transaction is composed of: + +* `Requests ([]ServiceRequest)`: The service requests to be posted + +* `RequestDeposits ([]int64)`: The consumer must put down for each request + a deposit (in terms of IRIS amount) that is greater than the value of + `MinRequestDeposit`; this deposit is meant to incentivize the consumer to acknowledge receipt of service responses in a timely manner (see `ConfirmServiceResponseTx`). + +The application will verify that each request is coming from a consumer +with matching `ChainID` and `ConsumerAddress`, the targeted binding is +valid, the request deposit is sufficient, the consumer's account balance is +enough to cover the request deposits and service fees, and that the total +number of requests in the transaction is less than `MaxRequestPostBatch`. + +When a verified request is appended to the request table, the related +service fee (`MaxServiceFee` in case of a `Multicast` request) will be +deducted from the consumer's account and locked up in escrow. + +A `GetServiceRequest` query is composed of: + +* `DefinitionHash ([]byte)`: The hash of the service definition + +* `BindingHash ([]byte)`: The hash of this provider's binding to the + service in question; the application will verify that the binding is + valid and the caller matches the binding's `ChainID` and `ProviderAddress` + +* `BeginHeight (uint64)`: The blockchain height from where the application + should start to retrieve requests for the provider, up to a total number + that is the lesser of `BatchSize` and `MaxRequestGetBatch` + +* `BatchSize (int)`: The max number of requests to be returned + +A `ServiceResponse` is composed of: + +* `RequestHash ([]byte)`: The hash of the matched request + +* `BindingHash ([]byte)`: The hash of this provider's service binding + +* `OutputValue ([]byte)`: A structured (potentially encrypted) + representation of output result. *Optional* + +* `ErrorMsg (string)`: A structured representation of error messages. + *Optional* + +A `PostServiceResponseTx` transaction is composed of: + +* `Responses ([]ServiceResponse)`: The service responses to be posted + +The application will verify that each response is coming from a +provider with matching `ChainID` and `ProviderAddress`, and that the number +of responses in the transaction is less than `MaxResponsePostBatch`. A +verified request will be appended to the response table for the intended +consumer. + +A `GetServiceResponse` query is composed of: + +* `RequestHash ([]byte)`: The hash of the original request; the + application will verify that the caller matches the request's `ChainID` + and `ConsumerAddress` + +* `BeginHeight (uint64)`: The blockchain height from where the application + should start to retrieve responses for the consumer, up to a total + number that is the lesser of `BatchSize` and `MaxResponseGetBatch` + +* `BatchSize (int)`: The max number of responses to be returned + +A `ConfirmServiceResponseTx` transaction is composed of: + +* `ResponseHash ([][]byte)`: The hash of responses to be confirmed + +The application will verify that the each response to be confirmed is +indeed for a request originated by the caller, and that the number of +responses in the transaction is less than `MaxResponseConfirmBatch`. + +Responses that fall out of the `Timeout` window (and, in case of `Multicast` +responses, when `MaxServiceFee` runs out as more responses come back) will +not be accepted by the application. A consumer starts processing a +`Unicast` response immediately upon receiving it. However, for `Multicast` +responses, a consumer will need to wait until the `Timeout` window elapses before +starting to process all responses received, if any. + +When a `Unicast` response is confirmed by the consumer, the associated +service fee will be released from escrow to the matched provider account +-- after a small tax (defined by `ServiceFeeTaxRate`) is deducted and +added to the *system reserve*; and the associated request deposit will +be returned to the consumer as well. + +In the case of a `Multicast` request, the situation is a bit more complex: +when a response is confirmed, only part of the request deposit is +returned to the consumer, in proportion to the response related service +fee vs `MaxServiceFee`; and after all responses are confirmed, the +remaining escrow balance for the request will be returned to the +consumer. + +If a request timeouts without seeing any response come back, the +application will refund the associated balance held in escrow plus the request +deposit, in full, back to the consumer. However, if the consumer does +not confirm a response in time (before `ResponseConfirmTimeout` + +blockchain height of the response), a small penalty (defined by +`ResponseConfirmDelayPenaltyRate`) will be applied before the request +deposit is refunded to the consumer, while the associated service fee +will be released to the provider as usual. + +**Dispute Resolution** + +In any case where a consumer is unsatisfied with a service response, a mechanism should exist allowing the consumer to issue a complaint and consequently, to receive an acceptable solution to that complaint, without having to resort to a centralized authority such as the legal system. Also, this mechanism should avoid +introducing subjective evaluation, which could be abused by either side. + +The process to resolve a dispute that arises on the IRIS network resembles that of service invocation, except that a consumer sends a `Complaint` to the provider, and the provider responds with a `Resolution`. These interactions are intended to happen through a pair of global endpoints known as *complaint table* and *resolution table*. + +Under the present design for the IRIS network, a consumer deposit is required for filing a complaint. Where a consumer does not confirm a resolution in a timely manner, a penalty will be deducted from this deposit. Similarly, a provider's deposit will be partially slashed if he fails to respond to a complaint in a timely manner. + +A `Complaint` is composed of: + +* `ResponseHash ([]byte)`: The hash of the response in dispute + +* `Problem (string)`: A description of the problem with the service response + +* `PreferredDisposal (enum)`: Can be one of `Refund` or `Redo` + +A Resolution is composed of: + +* `ComplaintHash ([]byte)`: The hash of the matched complaint + +* `Disposal (enum)`: Can be one of `Refund` or `Redo` + +* `Refund (uint64)`: Service fee refund. *Optional* + +* `OutputValue ([]byte)`: A structured (potentially encrypted) + representation of output result. *Optional* + +Our intended dispute resolution process, as outlined above, may not be legally binding. Nonetheless, we believe that it will provide an efficient means of resolving common disputes on the IRIS network. + +**Service Profiling** + +Bootstrapping the iService ecosystem presents a few challenges. A major challenge is finding a way to make it easy for consumers to discover suitable providers - consumers need performance metrics to evaluate and select a provider, yet without consumer usage no performance metrics will be available. + +With the intention to solve this circular issue, we plan to introduce a profiling mechanism where a privileged system user, the profiler, invokes all the active services on a regular schedule. This would leave objective performance data in the network (such as response time, availability, complaint handling etc.) that are useful for real consumers. + +Service profiling calls would be exempt from service fees and consumer +deposits, but they would incur network transaction fees. These calls +would originate from a few reserved addresses that are intended to be recognized and honored by the application. + +Profiling activities would stay at a relatively stable level for new services +and gradually decline for individual services as they start to +attract real consumer calls, which is expected to generate more performance data on their own. + +Transaction fees incurred during profiling would be paid out from the system reserve by default, and the Foundation reserve would step in if necessary. + +**Query** + +All the service related lifecycle objects described above can be queried +using the ABCI Query interface [\[3\]][3]. These queries would be executed over +the Query connection and do not participate in the consensus process. We +have already seen how `GetServiceRequest` and `GetServiceResponse` queries +work as part of the service invocation process. + +Below is a non-exhaustive summary of our currently planned queries: + +**Service Objects** + +| Object | Commonly Used Filters | Authorization | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| Service Definition | Name, keywords, source (chain ID), messaging type, with active bindings... | Anyone can query | +| Service Binding (for a given definition) | Location (local or remote), pricing, service level, expiration... | Anyone can query | +| Service Request | Service definition and binding, blockchain height, batch size | Only matched provider(s) | +| Service Response | Service request, blockchain height, batch size | Only matched consumer | + + +**Performance Metrics** + +| Area | Metrics | Authorization | +| --------------------------- | ---------------------------------------- | ----------------- | +| Provider (address) | Number of services provided (ever and active), response time (min, max and average), requests served (local and remote), requests missed, complaints received, complaints ignored, ... | Anyone can query | +| Provider (binding) | Active time, response time (min, max and average), requests served (local and remote), requests missed, complaints received, complaints ignored, ... | Anyone can query | +| Consumer | Number of services ever used, requests made, requests confirmed (in time and missed), complaints made, resolutions confirmed, ... | Anyone can query | +| Consumer (service, binding) | Requests made, requests confirmed (in time and missed), complaints made, resolutions confirmed, ... | Anyone can query | + + +### IBC Enhancement + +One unique advantage of establishing our service infrastructure on top of Cosmos is the potential for services to be *deployed once and invoked +everywhere*, over an internet of blockchains. Specifically, our plan is to +accomplish the following: + +1. Service definitions are broadcast to every zone in the IRIS network; + +2. Global service bindings are broadcast to every zone in the IRIS network; + +3. Service requests or complaints targeting a remote provider are routed to + the blockchain to which the provider is connected; + +4. Service responses or resolution meant for a remote consumer are routed + back to the blockchain to which the consumer is connected. + +When processing a `CreateServiceDefinitionTx` transaction, the application +is designed to first validate and store the `ServiceDefinition` object locally, before creating an `IBCPacket` containing the definition for each neighboring chain. + +Each neighbor eventually receives -- from the corresponding relay process -- +an `IBCPacketTx` containing the packet; if the definition does not already +exist in the receiving chain, the latter will pass on the definition by +creating an `IBCPacket` for each of *its* neighbors -- except the source +chain from which it received the packet in the first place; if the +definition already exists, the receiving chain stops passing on the +definition. + +Similarly, when a `ServiceBinding` is created or updated with its +`BindingType` set or updated to `Global`, an `IBCPacket` containing the +binding is created for each neighboring chain, and gets propagated across +the entire IRIS network. + +An `IBCPacket` described above is composed of: + +* `Header (IBCPacketHeader)`: The packet header + +* `Payload (ServiceDefinition or ServiceBinding)`: The bytes of the service + definition or binding + +The `IBCPacketHeader` above is composed of: + +* `SrcChainID (string)`: The ID of the blockchain creating this packet + +* `DstChainID (string)`: The ID of the neighboring blockchain this packet is + destined for + +* `Number (int)`: A unique number for all packets + +* `Status (enum)`: `NoAck` + +* `Type (string)`: "iris-service-definition" or "iris-service-binding" + +Now let's take a look at how interchain service invocation happens through IBC. +When a request is made for a `Unicast` service, the application checks if +the target binding is `Local`; where this is true, the `ServiceRequest` is appended to the corresponding request table as explained in 2.2; otherwise, an +`IBCPacket` containing the `ServiceRequest` will be created instead. + +An `IBCPacket` containing a `ServiceRequest` is composed of: + +* `Header (IBCPacketHeader)`: The packet header + +* `Payload (ServiceRequest)`: The bytes of the service request + +The `IBCPacketHeader` above is composed of: + +* `SrcChainID (string)`: The ID of the blockchain creating this packet + +* `DstChainID (string)`: The ID of the blockchain where the remote provider + is located, i.e., `ServiceRequest.ServiceBinding.ChainID` + +* `Number (int)`: A unique number for all packets + +* `Status (enum)`: `AckPending` + +* `Type (string)`: "iris-service-request" + +* `MaxHeight (int)`: Current height + `ServiceRequest.Timeout` + +As a remote request finally arrives at the destination chain, the +application would append it to the corresponding endpoint (the request table) +for the targeted binding. A response to this remote request would be +wrapped in a receipt `IBCPacket` that is routed all the way back to the +source chain and appended to the remote endpoint (the response table) for +the originating consumer. + +Request for a remote `Multicast` service is treated in the same way except +that more than one `IBCPacket` could be generated in the source chain. + +Remote complaints and resolutions are expected to work in the same manner as requests and responses, and therefore will not be elaborated here. + +Below is a complete list of application-dependent `IBCPacket` types: + +| **Type** | **iService Object** | +| ------------------------- | ------------------- | +| "iris-service-definition" | ServiceDefinition | +| "iris-service-binding" | ServiceBinding | +| "iris-service-request" | ServiceRequest | +| "iris-service-response" | ServiceResponse | +| "iris-complaint" | Complaint | +| "iris-resolution" | Resolution | + +
+ +## Use Cases ################################################################ + +In this section, we have set out some potential use cases for the IRIS network. + +### Distributed AI for privacy preserving data analysis + +The proposed service infrastructure has been prototyped by Bianjie AI, a +Shanghai based startup, into its permission product `BEAN (Blockchain +Edge Analytics Network)` to solve the longstanding challenge of getting +data for running analytics models. Although homomorphic encryption is +one of the key methods allowing computing to be achieved over encrypted data, it is said to be unable to practically solve real world machine learning problems due to its slow performance. As a result, BEAN was created to take a different approach. This approach uses the idea of model parallelism taken from the traditional distributed AI study [\[14\]][14] and +utilizing SOA design patterns to develop distributed analytics services as an additional layer to the blockchain. + +To protect data access, the (partial) model that runs on the data side needs to be open sourced to the client and specified in the service definition. Since only the partial model is released to the client, the model developers do not have to worry about someone stealing their idea; equally, the data owners never need to worry about losing control of data usage as their data will not be leaving its origin. + +Other potential benefits could include the following: +1. Only a small amount of parametric data being exchanged on-chain, which can help enhance performance. + + . A more practical way for data usage auditing, which is often needed in the healthcare domain. + +Healthcare data is highly private, involving numerous security requirements. This puts forward the challenge for healthcare data to be used for the purposes of cross-organization collaboration (such as a cross-hospital clinic records search for diagnosis assistance, new drug clinic test patient identification, health insurance automatic claim processing etc.). This minimum viable product ("MVP") service layer implementation is built on top of `Ethermint` in attempt to connect hospitals, insurance companies and analytics service providers to provide privacy preserving healthcare data analytics capability. + +Smart contracts have been implemented to support on-chain service registration and invocation. One example of the off-chain data processing could be to support a Diagnosis Related Group ("DRG") grouping analytics service. More specifically, when a hospital user invokes the DRG service, the raw medical record is processed off-chain using service provider provided client side NLP (implemented as SQL and Python) code stub to exact structured data inputs for receiving DRGs service over blockchain without passing the highly confidential raw medical records. + +The `BEAN` +scenario demonstrates a more complicated service use case including +implementing distributed analytics, and connecting service providers as +well as service consumers, utilizing blockchain to provide audible +transaction ledge as well as trustworthy distributed computing +foundation. + +### Data and analytics e-marketplace + +From studying several proposed AI+Blockchain projects, it seems that most of the projects aim to provide data exchange markets and analytics API markets. With proposed `IRIS` infrastructure, those +networks could potentially be built with ease through publishing data as data services and wrapping analytics API as analytics services utilizing the `IRIS` service provider SDK. + +### Distributed e-commerce + +With the proposed `IRIS` infrastructure, integration with traditional systems +like `ERP` to obtain inventory information, or inter-chain query on trusted data sources to obtain information such as transportation and weather data, will be quite similar to the approach with which many enterprise application developers are already familiar. With those services integrated to support +distributed e-commerce applications, it could be possible for distributed e-commerce applications to provide a similar user experience as centralized systems, such as Amazon or Alibaba. + +### Combining public chains & consortium chains + +For many business scenarios, taking a hybrid architecture of combining the good features of a public chain and a consortium chain can provide beneficial results, particularly with regards to performance, security and economic incentives. + +For example, hospitals and insurance companies could form a consortium blockchain to support high performance medical insurance transactions, whilst identifying other information such as statistics regarding certain diseases as a global service, which can be invoked from other public chains. The tokens received from public chains can be awarded back to +those information providers in the consortium chain, which motivate the +system participants to improve and promote services. With this infrastructure provided by `IRIS`, large-scale spontaneous collaboration could be made possible while still supporting stringent performance and security requirements. + +There are many use cases that could be supported by the `IRIS` service +infrastructure, such as more efficient asset based security systems, +distributed regulation technology such as due diligence, mutual aid +marketplace etc. One of `IRIS` project plans is also working closely with +such application project teams to support and enable them with needed +blockchain infrastructure and allow them to focus on delivering the +envisioned business value more efficiently. + +
+ +## Token Economics ################################################################ + +Similar to the Cosmos Network, the IRIS network, as presently designed, is intended to support a multi-token model. The tokens will be held on the various zones, and can be moved from one zone to another via the IRIS Hub. There are two types of tokens that are expected to support IRIS network's operation: + +* staking token +* fee token + +### Staking token + +Adopting the same staking mechanism design used in the Cosmos network [\[15\]][15], the IRIS Hub will have its own special native token for staking. This token will be called "IRIS". We have a number of ideas in mind regarding the specific functionality of the IRIS token, including: + +* integration of the IRIS token in the IRIS network's consensus engine validators, through a system of validators and delegators; + +* voting power to participate in the IRIS network's governance + + +### Fee token + +There are two types of fee tokens in IRIS network: +* **Network fee** token is for spam-prevention and payment to validators in maintaining the + ledger; +* **Service fee** token is used for payment to service providers + who deploy iServices and the default payment service token is IRIS token. + +The IRIS network is intended to support all whitelisted fee tokens from the Cosmos network, e.g [Photon](https://blog.cosmos.network/cosmos-fee-token-introducing-the-photon-8a62b2f51aa), plus the IRIS token. + +Supporting a variety of whitelisted fee tokens is a feature that we plan to adopt from Cosmos. It can provide an enhanced experience for network participants. In Cosmos, for `network fee token`, each validator has a config +file defines his personal weighting of how much they value each fee +token. Validator can run a separate cron job to update the config file +based on validator preferred live market data or maybe just use a +default config value. + +For the `service fee token` design, similarly a multi-token model is planned to be supported. A service provider on the IRIS network should therefore have the freedom to charge for their services in their preferred tokens, provided that it appears on the whitelist. + +To help IRIS network participants mitigate cryptocurrency price volatility, the Foundation intends to facilitate the deployment of global iServices for retrieving market data from different exchanges, or through the potential introduction of oracles. + +Both staking and fee tokens are subject to further refinement to ensure compliance with legal and regulatory obligations. + +
+ +## Initial Token Distribution ################################################################ + +On Genesis, the initial token supply will be 2,000,000,000 IRIS tokens. The distribution of IRIS tokens is planned to be as follows: + +* **Private Sale**: 20% + +* **Core Developer Team**: 20% (4-year vesting period starting from IRIS Hub launch, during which the team will vest 1/48th of its IRIS tokens each month) + +* **IRIS Foundation**: 15% (reserved to support the operations of the Foundation) + +* **Ecosystem Development**: 45% (swap with zones connecting to IRIS Hub; grant to potential users; awards to outstanding partners; potential public sale) + +If and when the IRIS network is fully deployed, the annual inflation rate of IRIS tokens will be adjusted to account for the fact that a substantial portion of IRIS tokens in circulation may be voluntarily staked by participants to participate in the consensus engine. + +Proceeds from the private sale of IRIS tokens will be used, first and foremost, for the development of the IRIS network. The planned usage distribution is as follows: + +* **Foundation Operations**: 10% (including service providers and contractors fees, for example, auditing, consulting, legal and other third party fees, and other overheads) + +* **Software Development**: 50% (including costs, fees and expenses directly attributable to the development of launch) + +* **Developer Enablement**: 10% (including funding hackathons, awards to volunteers and training programs) + +* **Research and Development Sponsorships**: 10% (including conference, research programs and university outreach) + +* **Marketing and Promotion**: 20% (including business development, community programs and outreach, together with related travel, communication, publication, distribution and other expenses) + + +
+ +## Roadmap ################################################################ + +The expected IRIS project is set out below. We reiterate that the roadmap is indicative only, and subject to change. + +* **PANGU** (January 2018 \~ July 2018) The first stage of the IRIS project will focus on having the IRIS Hub up and running and connected to the Cosmos Hub. We also intend to release an initial version of the mobile client for the IRIS network. + + +* **NUWA** (July 2018 \~ November 2018) +The second stage will focus on building the fundamental IRIS Service Layer. This will involve enabling service definition, binding, invocation and query. +In this stage we are also aiming to have a beta version of the IRIS SDK ready for developers. + +* **KUAFU** (December 2018 \~ May 2019) The third stage will focus on incremental upgrades to the IRIS network in order to support our planned advanced IRIS Service governance features. + + +* **HOUYI** (Beyond June 2019) +The fourth stage will focus on further technology innovations to the IRIS network, IRIS SDK and mobile client, as well as developer engagement. + +
+ +## The Team ################################################################ + +**Tendermint** (the team that developed the [Tendermint](https://www.tendermint.com) consensus engine and is currently building Cosmos), **Wancloud** (a subsidiary of [Wanxiang +Blockchain](http://www.wxblockchain.com) and **Bianjie AI** will work together to build the IRIS network's infrastructure. + +Tendermint's intended role to give technical advice and development support to the IRIS project team in extending the Tendermint ABCI and the Cosmos IBC technologies. +[Wancloud](https://www.wancloud.io) is envisaged as the key strategy partner to both the Cosmos and IRIS ecosystems, and we understand that it intends to participate in Cosmos and IRIS development across Asia. + +**Bianjie AI** +will be the core development team for the IRIS network, leveraging the team's experience established from building distributed AI analytics services for healthcare data analysis and exchange. [Bianjie AI](https://www.bianjie.ai) is a Shanghai-based start-up established in 2016. It focuses on developing innovative products and solutions for healthcare and financial industries, using advanced Blockchain and AI technologies. One of Bianjie's core products, `BEAN (Blockchain Edge Analytics Network)` BEAN (Blockchain Edge Analytics Network), is a permission chain which delivers distributed data analytics services for privacy preserving healthcare data analysis and exchange using NLP and machine learning technologies. Bianjie AI is +currently extending `BEAN` capabilities to build the IRIS network. +**Bianjie AI** +is also the operation and service partner of Cosmos Network in China. + + +### Core Members + +**Harriet Cao** + +[Harriet](https://www.linkedin.com/in/harrietcao/) is the founder of Bianjie AI, which a Shanghai-based start-up focusing on building smart services for blockchain that enable trustworthy and efficient business collaborations using distributed AI technology. Harriet is an award-winning practitioner of data analytics and artificial intelligence technologies, and was the recipient of 2010 INFORMS Daniel H. Wagner Prize. Prior to establishing Bianjie AI, Harriet worked for IBM Research for more than 16 years in various capacities including Director of IBM Research Shanghai Lab and Big Data Analytics Leader for IBM Global Labs. +Harriet has an M.S degree in Robotics from Carnegie Mellon University and an M.S. degree in Automation Control from Tsinghua University. + + +**Haifeng Xi** + +[Haifeng](https://www.linkedin.com/in/haifengxi/) is a senior technologist and entrepreneur. Since returning to China from the United States in 2009, he had worked in the capacity of Chief Technology Officer for three companies, one of which is NASDAQ listed. He also co-founded two start-ups in Shanghai, where he plays an active role of technical leader and engineering champion. +Haifeng has a Master's degree in Electrical and Computer Engineering from the University of Maryland, and a Master's and Bachelor's degree in Automatic Control from Tsinghua University. + + +**Jae Kwon** + +After graduating from Cornell in 2005 with an undergraduate degree in computer science, [Jae](https://www.linkedin.com/in/yjkwon/) worked as a software developer in Silicon Valley, first at Amazon (where he worked on the Alexa digital assistant), then later at Yelp, where he led their mobile app development team. +After getting the blockchain bug, Jae created the Tendermint BFT consensus algorithm and the Tendermint Core blockchain engine, with the intent of creating a provably secure proof-of-stake algorithm. +In addition to Tendermint, Jae is also the creator of Cosmos. + + +**Tom Tao** + +Since joining Wanxiang in August 2016, [Tom](https://www.linkedin.com/in/tom-tao-14763a45/) is responsible for Wanxiang Blockhain Group's consulting service, Wancloud BaaS Platform as well as the ChainBase accelerator and incubator service. Before Wanxiang, Tom worked in service management and business management for over 18 years in a number of global leading companies. +Tom has spearheaded the introduction of cloud services, IoT data service platforms, and creative accelerator technologies into the Chinese market. +Tom has been tracking trends in the blockchain, cloud computing, IoT and smart manufacturing industries since 2013. Tom has a Master's degree in Physics from Fudan University and a Bachelor's degree in Electrical Engineering from Nankai University. + + +### Advisors + +**Jim Yang** + +[Jim Yang](https://www.linkedin.com/in/jimyang/) runs Strategy for Tendermint. He was the founder and CEO at ChatX, mobile messaging studio. ChatX developed various mobile messaging/social apps. He also co-founded Identyx, where he served as CEO until its acquisition by Red Hat. Identyx developed an open source enterprise identity management software. + +**Zaki Manian** + +[Zaki Manian](https://zaki.manian.org), Executive Director of Trusted IoT Alliance, is a prolific contributor to the development of blockchain and cryptocurrency technology. Zaki has deep expertise in cryptography and distributed consensus system. He is also an advisor to the Cosmos project, and several other investment funds and startup in the space. + +**Adrian Brink** + +[Adrian Brink](https://adrianbrink.com), Core Developer & Head of Community of Tendermint / Cosmos Network. + +**Michael Yuan** + +[Dr. Michael Yuan](http://www.michaelyuan.com) is the Director of the [CyberMiles Foundation](https://cm.5miles.com). Michael received a PhD in Astrophysics from University of Texas at Austin. He is the author of 5 books on software development, published by Prentice Hall, Addison-Wesley, and O'Reilly. Michael was an active code committer in large Open Source projects such as Firefox, Fedora, JBoss, and others. He is an expert on enterprise and mobile software, and was a Principle Investigator on multiple research projects funded by the US government. + +
+ +## References ################################################################ + +[1]: https://drive.google.com/file/d/1bI7JIOe-CfJ5fPHKxYlFub2Kg-KCGU6r/view?usp=sharing +[2]: http://ethdocs.org/en/latest/ +[3]: https://cosmos.network/whitepaper +[4]: https://polkadot.io/ +[5]: https://tendermint.readthedocs.io/en/master/ +[6]: https://ethermint.zone/ +[7]: http://www.freepatentsonline.com/y2017/0236120.html +[8]: https://github.com/cryptape/cita-whitepaper/blob/master/en/technical-whitepaper.md +[9]: https://github.com/hyperledger/burrow +[10]: https://lightning.network/lightning-network-paper.pdf +[11]: https://www.plasma.io/plasma.pdf +[12]: https://github.com/cosmos/ibc/blob/master/README.md +[13]: https://www.amazon.com/SOA-Principles-Service-Thomas-Erl/dp/0132344823 +[14]: http://www.cs.toronto.edu/~ranzato/publications/DistBeliefNIPS2012_withAppendix.pdf +[15]: https://medium.com/@tendermint/b5b2c682a292 +[16]: https://drive.google.com/file/d/1jtyYtx7t1xy9gxEi2T5lXFNd8xUY7bhJ/view + + +* [1] Wanxiang Blochchain Inc., Distributed Business Value Research Institute, + "Blockchain and Distributed Business Whitepaper", September 2017. + +* [2] Ethereum Foundation, "Ethereum Homestead Documentation", + http://ethdocs.org/en/latest/ + +* [3] Jae Kwon, Ethan Buchman,"Cosmos, A Network of Distributed + Ledgers", https://cosmos.network/whitepaper + +* [4] Gavin Wood, "Polkadot: Vision For a Heterogeneous Muilti-chain + Framework", https://polkadot.io/ + +* [5] Tendermint, https://tendermint.readthedocs.io/en/master/ + +* [6] Ethermint, https://ethermint.zone/ + +* [7] Oracle International Corporation, "Accountability and Trust in + Distributed Ledger Systems", USA Patent Application 20170236120, August + 17, 2017, http://www.freepatentsonline.com/y2017/0236120.html + +* [8] Jan Xie, "CITA Technical Whitepaper", + https://github.com/cryptape/cita-whitepaper/blob/master/en/technical-whitepaper.md + +* [9] Hyperledger Burrow, https://github.com/hyperledger/burrow + +* [10] Joseph Poon, Thaddeus Dryja, "The Bitcoin Lightning Network: + Scalable Off-Chain Instant Payments", January 14, 2016, + https://lightning.network/lightning-network-paper.pdf + +* [11] Joseph Poon, Vitalik Buterin, "Plasma: Scalable Autonomous Smart + Contracts", August 11, 2017, https://www.plasma.io/plasma.pdf + +* [12] Ethan Frey, "Cosmos IBC Specification", Sep. 29, 2017, + https://github.com/cosmos/ibc/blob/master/README.md + +* [13] Thomas Erl,  "SOA: Principles of Service Design", Prentice Hall; + 1st edition (July 28, 2007) + +* [14] Dean, J., Corrado, G.S., Monga, R., et al, Ng, A. Y. "Large Scale + Distributed Deep Networks". In Proceedings of the Neural Information + Processing Systems (NIPS'12) (Lake Tahoe, Nevada, United States, + December 3--6, 2012). Curran Associates, Inc, 57 Morehouse Lane, Red + Hook, NY, 2013, 1223-1232. + +* [15] Tendermint Blog, "Cosmos Validator Economics -- Revenue Streams", + January 2018, https://medium.com/@tendermint/b5b2c682a292 + +* [16] Sunny Aggarwal, "Cosmos Token Model", December 2017, + https://drive.google.com/file/d/1jtyYtx7t1xy9gxEi2T5lXFNd8xUY7bhJ/view diff --git a/docs/introduction/Whitepaper_CN.md b/docs/introduction/Whitepaper_CN.md new file mode 100644 index 000000000..cfb8d494d --- /dev/null +++ b/docs/introduction/Whitepaper_CN.md @@ -0,0 +1,616 @@ +# IRIS 网络白皮书 + +**用于构建可信分布式商业应用的跨链服务基础设施及协议** + +Harriet Cao harriet@bianjie.ai
Haifeng Xi haifeng@bianjie.ai + +_NOTE:如果你可以在GitHub上阅读,那么我们仍然在积极完善这个文档。 请定期检查更新!_
+ +## 目录 + +- [免责声明](#disclaimer) +- [IRIS 概览](#iris-概览) + - [Cosmos 和 Tendermint](#cosmos-和-tendermint) + - [IRIS 技术创新](#iris-技术创新) +- [IRIS网络设计](#iris-网络设计) + - [网络参与者](#网络参与者) + - [IRIS服务](#iris-服务) + - [IBC 改进](#ibc-改进) +- [用例](#用例) +- [通证经济](#通证经济) +- [初始通证分配](#初始通证分配) +- [路线图](#路线图) +- [团队](#团队) + - [核心成员](#核心成员) + - [顾问](#顾问) +- [参考文献](#参考文献) + +
+ +## 免责声明 + +本白皮书及其相关文档用于接下来对IRIS网络的开发和应用。仅做信息传播之用并可能更改。 + +### 本文介绍了一个开发中的项目 + +本文基于IRIS 基金会有限公司(IRIS Foundation Limited)提供的已知信息及假设,包含了符合该基金会理念的前瞻性声明。 + +本文所设想的IRIS网络尚在开发中,并将不断更新,这些更新包括但不限于关键治理和关键技术。 开发使用IRIS通证或与之相关的测试平台(软件)以及技术,可能无法实现或无法完全实现本白皮书所述的目标。 + +如果IRIS网络得以完成,可能与本文所述有所不同。本文不对未来的任何计划、预测或前景的成功性或者合理性做出陈述或保证,本文的任何内容都不应被视为对未来的承诺或陈述。 + +### 并非监管类产品的要约 + +IRIS通证不代表任何一种有价证券或者任何其它司法监管下的产品。 + +本文不构成对任何有价证券或其他受监管产品的出价要约或询价邀请,也不构成以投资为目的的促销、邀请或询价。其购买条款并非提供金融服务的文件或任何类型的招股说明书。 + +IRIS通证不代表任何平台或软件系统、或IRIS 基金会有限公司以及其他任何公司的股权、股份、单位、资本权益或版权使用费、利润、回报或收入,不代表任何与平台有关的公有或私有企业、公司、基金会以及其他受监管实体的知识产权。 + +### 并非建议 + +本白皮书不构成任何对IRIS通证的购买建议。请不要依赖本白皮书去达成任何合同或购买的决策。 + +### 风险警告 + +购买IRIS通证并参与IRIS网络伴随着极大的风险。 + +在购买IRIS通证之前,您应该仔细评估并考虑风险,包括在上和其他任何文档中列出的风险。 + +### 仅代表IRIS基金会有限公司的意见 + +本白皮书所表达的观点为IRIS 基金会有限公司的观点,并不一定反映任何政府、准政府、当局或公共机构(包括但不限于任何管辖范围内的任何管辖机构)的官方政策或立场。 + +本白皮书中的信息基于IRIS 基金会认为可靠的来源,但并不能保证其准确性或完整性。 + +### 英文是本白皮书的授权语言 + +本白皮书和相关材料仅以英文发行。任何翻译并未经IRIS 基金会有限公司或其他人员认证,其准确性和完整性无法保证,仅供参考。如果翻译与本白皮书的英文版本之间有任何不一致之处,则以英文版本为准。 + +### 非第三方从属关联或背书 + +本白皮书中提及的特定公司和平台仅供参考。使用任何公司和/或平台名称和商标并不意味着与其有任何的从属关联或背书。 + +### 您必须获得所有必要的专业建议 + +您有必要在决定是否购买IRIS通证或参与IRIS网络项目之前,必须咨询律师、会计师和/或税务专业人员,以及其他专业顾问。 + +
+ +## IRIS 概览 + +> IRIS网络是以希腊女神Iris的名字命名的,她是彩虹的化身,是在天堂和人类之间忠诚传递消息的信使。 + +契约关系是人类社会的基本组成部分,区块链技术的重要性在于提供一种非常有效和低成本的方式来实现可靠的契约关系:第一次出现了多方参与复杂的业务交互时不再需要(本来非常昂贵的)信任。 也就是说区块链技术为分布式商业提供了最重要的元素:以极低的交易成本提升网络效益。越来越多的人认识到区块链作为新的价值互联网的影响力,并将逐步把当前的商业模式转变为更高效的分布式网络。 特别是内置于大多数现代区块链中的通证机制,强调每个网络参与者的权利,并将革新商业的现有模式[[1]]。 + +不过,区块链技术仍处于早期阶段。与其它新技术一样也存在缺点,包括有限的性能和还没有发展起来的治理机制。目前,这些缺点使区块链难以支持真实的分布式商业协作。 诸如Hyperledger Fabric和R3 Corda,以及以太坊企业联盟(Ethereum Enterprise Alliance)等组织都在试图通过联盟链(consortium chains)解决这些性能和治理的问题,使区块链技术更适用于企业。然而,如今的联盟链由大型企业公司主导的,他们封闭式的链上链下治理模式非常低效。联盟链可能因为缺乏公有链的通证经济模型及其开放性和激励性而缺乏活力。 + +我们希望发展当前的区块链技术,让成千上万的中小企业(Small Medium Businesses,SMBs),甚至是个体自由职业者,可以在一个开放的网络中提供他们的服务并享受回报。为了实现这一目标,我们确定了以下挑战以及随之而来的技术创新机会: + +**并非所有的运算都可以或应该以诸如智能合约这样的形式在区块链上实现** + +以太坊提供了[图灵完备](https://en.wikipedia.org/wiki/Turing_completeness)的虚拟机 [[2]]运行智能合约,带给人们开发分布式应用的诸多希望。 然而,智能合约只能处理确定性逻辑(因此每个节点在处理完同一交易和块后都能达到相同的状态),而大量现存的业务逻辑是不确定的,在不同时间和不同环境参数下可能会发生变化。 特别是现在,业务系统越来越依赖于计算机的算法进行决策优化,包括自然语言处理(Natural Language Processing,NLP),机器学习和操作研究算法。我们经常会故意在这些算法中添加一些随机性,以使决策不仅仅是局部最优状态,同时试图找到一个更好的次优结果。 + +另一方面,一些真实世界的业务逻辑应该在链下运行,不应该作为诸如可重复运算的智能合约这种类型来执行。 利用分布式账本集成和协同链下的服务和资源,是进一步推动区块链技术在更多真实场景中应用的关键。 + +**如何利用现有的区块链资源,包括公有链和联盟链** + +使用一个公有链来处理所有用例是不可行的。每天都有不同的区块链上线,各自专注于解决问题的一个方面,比如分布式存储、资产所有权或市场预测等。据coinmarketcap.com显示,目前有超过1000种加密货币在不同的交易平台上活跃。 + +构建业务应用程序时涉及处理存储以及不同数据源的来源,我们的另一个工作动机是如何通过重用一些现有的工作,比如存储(IPFS, SIA, Storj.io等等)、数据发送(Augur,Gnosis,Oraclize等)和物联网(IOTA等)提供的这些专用的区块链,而不是“重新发明轮子”。 + +此外,有很多(近)实时业务交易确实需要更密切的联盟链/许可链/私有链来处理性能问题、安全问题和业务治理要求。因此,我们对分布式商业基础设施的愿景是要具备在多种异构链,包括公共链/联盟链/许可链/私有链之间具备互操作的能力。 + +跨链技术是满足这一需求非常自然的解决方案。 然而目前为止,现有的跨链技术主要是为了在已有区块链中提供互操作性,并专注于通证的价值转移。 如何使用不同区块链提供的资源,这一问题仍然没有答案。 + +比较现有的跨链技术如Cosmos [[3]] 和 Polkadot[[4]],提出的跨链技术,我们发现Cosmos为互操作性和可扩展性提供了更成熟的基础。 尤其我们发现Cosmos的多枢纽多分区( "many hubs and many zones" )和每个分区都是独立的区块链,拥有独立的治理模型( "each zones are independent blockchains having independent governance models" 的设计,提供了一种非常合适的体系架构,可以用SOC(Seperation of Concern,SOC)的方式对现实世界的复杂性进行建模。 为了最好地重用现有框架,我们提出了IRIS网络(IRIS Network),它是由一个枢纽和众多分区构成的去中心化的跨链网络,基于Cosmos/Tendermint [[5]]实现,具有更为完善的通证使用。 + +鉴于IRIS网络是基于Cosmos/Tendermint设计的,我们将首先讨论Cosmos/Tendermint,总结我们从Cosmos/Tendermint继承的特性和独特的创新。 + +### Cosmos 和 Tendermint + +Cosmos[[3]]想要建立“区块链的互联网”。 这是由许多被称为分区“Zone”的独立区块链构成的互联网络,每个分区都由经典的拜占庭容错(Byzantine fault-tolerant,BFT)共识协议(如Tendermint)提供支持。 + +Tendermint提供了一个高性能、一致的、安全的BFT共识引擎,严格的分叉问责保证能够控制作恶者的行为。Tendermint非常适合用于扩展异构区块链,包括公有链以及注重的性能的许可链/联盟链,像Ethermint [[6]]就是一次对Ethereum以太坊POS机制的快速实现。 使用Tendermint在许可/联盟链域中的成功案例包括Oracle [[7]],CITA [[8]] 和Hyperledger Burrow [[9]]。 + +Tendermint作为共识协议用于在Cosmos Hub上构建第一个分区。Cosmos Hub可以连接到许多不同类型的分区,并且通过一种相当于区块链之间的虚拟UDP或TCP的IBC协议( Inter-blockchain Communication,IBC)实现跨链通信。 通证可以安全地通过Cosmos Hub从一个分区转移到另一个分区,而不需要在分区之间的交易所或受信任的第三方。 + +为了使用Cosmos Hub开发强大的可互操作区块链和区块链应用,Cosmos SDK提供了区块链常用模块的开发“入门套件”,而不是限制可实现的用户故事,从而为应用定制提供了最大的灵活性。 + +### IRIS 技术创新 + +IRIS网络的目标是为构建分布式商业应用提供技术基础设施,它超越了主要用于数字资产的现有区块链系统。 + +我们打算通过IRIS网络解决的关键挑战在于两个方面: +- 利用分布式账本支持链下运算资源的集成和协同 +- 服务跨异构区块链的互操作性 + +我们通过将面向服务的基础架构融入Cosmos / Tendermint来应对这些挑战。 + +我们的设计继承了多年来面向服务架构(Service-oriented Architecture,SOA)实践的思维模式。 SOA是一种架构方法,用于创建由自治服务构建的系统,这些系统具有明确的边界、共享模式和契约[[13]]。早期的SOA实践侧重于实施企业服务总线(Enterprise Service Bus,ESB),通过服务提供者和服务消费者之间的各种点对点连接组成公用总线,实现服务间的通信。但是,通过ESB集中管理服务可能会触发单点故障,也会增加服务部署的依赖性。最近大量的微服务架构可以看作是SOA的发展,不再关注ESB而是使用轻量级的消息队列进行服务间通信。在IRIS网络中,服务之间的通信旨在通过实施区块链作为信任机器来协同实现商业协作,使它在服务提供者和服务消费者之间很难建立信任的前提下也能运行。 + +IRIS网络使用Tendermint协议作为高性能的共识引擎。利用Tendermint的区块链应用接口(Application BlockChain Interface,ABCI)提供的灵活性,我们定义了一组服务的基础交易类型,包括:服务提供,服务消费和服务治理。如前所述,大多数业务逻辑不适合作为区块链上确定的智能合约来实施,我们正在使用这个服务层将业务应用的特定逻辑和事务处理移出区块链,仅使用区块链对这些服务产生的结果达成共识。这一想法也受到区块链社区已有成果的启发,将一些复杂计算从主链上移除以解决性能问题,例如Lightning Network的离线状态通道[[10]]以及Plasma的防欺诈侧链[[11]]。尽管我们没有实施侧链,但是我们将传统业务逻辑计算从区块链中剥离出来,并将其用作复杂业务协作的可信中介总线。 + +对于跨链通信,Cosmos IBC [[12]]定义了一个协议用于将价值从一条链上的某个帐户转移到另一条链上的某个帐户的协议。而IRIS网络设计了新的语义,以允许利用IBC调用跨链计算资源。我们认为这种能力在构建可扩展的业务应用程序时非常重要。更详细的潜在用例将会在后面描述。 + +IRIS网络旨在提供服务基础设施,以处理和协同链上的交易处理与链下的数据处理和业务逻辑执行。必要时,扩展的IBC功能允许那些链下的处理被跨链调用。 按目前的设想,IRIS网络还将包含客户端工具,一个支持跨链多资产存储的智能钱包以及服务消费方和提供方使用的iServices。 我们计划提供SDK以轻松构建iServices。 例如,对于特定的服务定义,客户端Client SDK将生成服务提供方的框架以及服务消费方的模块。 + +
+ +## IRIS 网络设计 + +![img](https://github.com/irisnet/irisnet/blob/master/images/chap2-1.png?raw=true) + +如上图所示,IRIS网络在设计上与Cosmos网络具有相同的拓扑结构。 我们计划将IRIS Hub作为Cosmos众多分区和区域型Hub之一与Cosmos Hub连接起来。IRIS SDK本身就是计划对Cosmos SDK的扩展,由IRIS SDK开发的IRIS全节点旨在提供一个服务的基础设施,并在内部集成了分布式文件系统IPFS(InterPlanetary File System,IPFS)。 + +IRIS Services(又名“iServices”)旨在对链下服务从定义、绑定(服务提供方注册)、调用到治理(分析和争端解决)的全生命周期传递,来跨越区块链世界和传统业务应用世界之间的鸿沟。 IRIS SDK通过增强的IBC处理逻辑来支持服务语义,以允许分布式商业服务在区块链互联网上可用。 + +尽管IRIS网络专注于为分布式业务应用提供创新解决方案,但它仍是Cosmos网络的一部分。 连接到IRIS Hub的所有分区都可以通过标准IBC协议与Cosmos网络中的任何其他分区进行交互。此外,我们相信通过引入服务语义层可以实现全新的业务场景,创新的IRIS网络将增加Cosmos网络的规模和多样性。 + +### 网络参与者 + +1. **服务消费者** 服务消费者是通过向网络发送请求并接收响应来使用链下服务的用户。 + +2. **服务提供者** 服务提供者是那些可能提供一个或多个iService定义的用户,并且通常是其它公有链和联盟链甚至传统企业应用系统中链下服务和资源之间的适配器。服务提供者监听和处理传入的请求,并将结果发送回网络。一个服务提供者可以向其它服务提供者发送请求而同时成为服务消费者。服务提提供者可以按计划为他们提供的任何服务收取费用,默认情况下服务费使用IRIS网络的原生费用通证“IRIS”定价;也可以在适当的时候考虑使用Cosmos白名单中的其他费用通证对服务定价。 + +3. **分析员** 分析员是一种特殊用户,代表了发起建立IRIS网络的IRIS基金会有限公司(IRIS Foundation Limited),这是一家注册在香港的股份有限公司。分析员是在分析模式中调用iServices的唯一授权用户,旨在帮助创建和维护服务提供者的概要文件,通过这些客观的概要文件服务消费者可以选择合适的服务提供者。 + +### IRIS 服务 + +在本节中,我们列出了在IRS网络上部署iService时预计使用的技术参数。 + +**服务定义** + +`Method`包括 : + +* `ID (int)`: iService中该方法的唯一标识 +* `Name (string)`: iService中该方法的唯一名称 +* `Description (string)`: 对该方法的描述 +* `Input (string)`: 对输入参数的结构化定义 +* `Output (string)`: 对输出结果的机构化定义 +* `Error (string)`: 对可能出现的错误条件的结构化定义 +* `OutputPrivacy (enum)`: 设置此方法是非隐私的还是公钥加密的,可选值`NoPrivacy`/`PubKeyEncryption` + +`ServiceDefinition`包括: + +* `Name (string)`: 该iService服务的名称 +* `Description (string)`: 对此iService服务的描述 +* `Tags (string)`: 此iService服务以逗号分隔的关键字 +* `Creator (string)`: 对此iService服务创建者的描述. *可选* +* `ChainID (string)`: 最初定义此iService服务的区块链标识 +* `Messaging (enum)`: 设置此服务消息是单播还是多播,可选值`Unicast`/`Multicast` +* `Methods ([]Method)`: 定义此iService服务中可用的方法 + +`CreateServiceDefinitionTx` 交易包括: + +* `Definition (ServiceDefinition)`: 创建的服务定义 + +**服务绑定**: + +`CreateServiceBindingTx` 交易包括: + +* `DefinitionHash ([]byte)`: 服务定义的哈希值,由服务提供者绑定 +* `ChainID (string)`: 服务提供者所接入的区块链标识 +* `ProviderAddress ([]byte)`: 服务提供者的区块链地址 +* `BindingType (enum)`: 对服务是本地还是全局的设置,可选值`Local`/`Global`;其中`Global`选项将绑定暴露到全局,反之则使用`Local` +* `ProviderDeposit (int64)`: 服务提供者的保证金。服务提供者必须提供大于系统参数`MinProviderDeposit`所设(以IRIS通证计数)的保证金,才能创建有效的绑定,押金越高意味着更值得信任 +* `ServicePricing (string)`: 服务定价。基于每个方法对服务价格模型的结构化定义,包括每次的调用成本、批量折扣、促销条款等;服务费默认使用IRIS通证也可以是白名单列出的其它费用通证 +* `ServiceLevel (string)`: 服务水平。对服务提供者自己认可所绑定服务水平的结构化定义,包括响应时间、可用性等。 +* `BindingExpiration (int64)`: 此绑定过期的区块高度,采用负数即表示“永不过期” + +`UpdateServiceBindingTx` 交易包括: + +* `DefinitionHash ([]byte)`: 服务定义的哈希值,由服务提供者绑定 +* `ChainID (string)`: 服务提供者接入区块链标识 +* `ProviderAddress ([]byte)`: 服务提供者的区块链地址 +* `ChangeSet (string)`: 更改集,由前面三个字段确定的现有绑定所需更改内容的结构化定义 + +![img](https://github.com/irisnet/irisnet/blob/master/images/chap2-2.png?raw=true) + + +服务提供者可以在任何时间更新`ServicePricing`,`ServiceLevel`和`BindingExpiration`,但他们的少量保证金将随后续(分别由`ServiceLevelUpdateSlash`和 `BindingExpirationUpdateSlash`规定的)两种情况减少。当`BindingExpiration`设置的高度低于当前区块高度,将立即被解释为无效的绑定。 + +更新 `ProviderDeposit`将始终被视为*adding to*,即增加当前保证金余额。当保证金低于`MinProviderDeposit`时,绑定将失效,直到服务提供者增加余额高于阈值方可恢复。绑定过期或者失效的时候,保证金余额将自动返还给服务提供者。 + +`BindingType`可用从`Local`更改为`Global`,但反之不行。要把一个绑定从`Global` 降到 `Local`,服务提供者只能先使绑定的问题失效,然后重新创建一个 `Local`型的绑定。 + +如果服务提供者出于某种原因需要将绑定移到一个新地址,是不允许直接更新`ProviderAddress`的;必须先使当前绑定失效,再使用所需的 `ProviderAddress`创建另一个绑定. + +一个 `ServiceBinding` 的对象将在应用程序成功的执行这两个交易时(例如,在IRIS SDK种的iService业务逻辑)被创建或更新. + +`ServiceBinding`包括: + +* `DefinitionHash ([]byte)` +* `ChainID (string)` +* `ProviderAddress ([]byte)` +* `ServiceLevel (string)` +* `ServicePricing (string)` +* `BindingExpiration (int64)` +* `IsValid (enum)`: 可选项`True`/`False` + +**服务调用** + +![img](https://github.com/irisnet/irisnet/blob/master/images/chap2-3.png?raw=true) + +服务消费者和服务提供者被建议通过 *端点(endpoints)* 交互。有两种服务端点 —— *请求表(request table)* 和 *响应表(response table)* (见上图)。服务请求被添加到请求表,感兴趣的服务提供者监控这些请求表并接收和处理发送给他们的请求; 服务结果(或错误)被返回由相应的服务消费者反过来监控的响应表中。 + +`Multicast`多播服务的所有绑定共享一个请求表;而`Unicast`单播服务为每个绑定创建和维护单独的请求表。 至于另一个方向(的服务)将为每个服务消费者创建和管理专用的响应表。 + +`ServiceRequest`交易包括: + +- `ChainID (string)`: 服务消费者所接入的区块链标识ID +- `ConsumerAddress ([]byte)`: 服务消费者所的区块链地址 +- `DefinitionHash ([]byte)`: 服务定义的哈希值 +- `MethodID (int)`: 被调用的方法ID +- `InputValue (string)`: 输入值的结构化表示 +- `BindingHash ([]byte)`:在'Unicast'单播服务情况下目标绑定的哈希值。 *可选* +- `MaxServiceFee (int64)`: 服务消费者愿意为一个'Multicast'多播请求支付的最大服务费金额 。*可选* +- `Timeout (int)`: 服务消费者愿意等待响应返回的最大区块数 + +`PostServiceRequestTx` 交易包括: + +- `Requests ([]ServiceRequest)`: 被发送的服务请求 +- `RequestDeposits ([]int64)`: 服务消费者必须为每个请求者(使用IRIS计数)支付大于`MinRequestDeposit`的押金。此押金目的是为了激励消费者及时确认收到的服务响应(参考 `ConfirmServiceResponseTx`). + +应用程序将验证用户与'ChainID'和'ConsumerAddress'一致的每一个请求、目标绑定的有效性、请求押金充足,服务消费者帐户余额足够支付请求押金和服务费用,并且请求的总数小于`MaxRequestPostBatch`。 + +当一个已验证请求被追加到请求表中时,相关服务费用(对'Multicast'多播方式是'MaxServiceFee')将从服务消费者的账户中扣除并锁定到第三方托管。 + + `GetServiceRequest` 查询包括: + +- `DefinitionHash ([]byte)`: 服务定义的哈希值 +- `BindingHash ([]byte)`: 服务提供者对此问题绑定服务的哈希值; 应用程序将验证绑定有效,并且调用者具有匹配绑定的区块链标识`ChainID`和服务提供者地址`ProviderAddress` +- `BeginHeight (uint64)`: 应用程序应当从此区块高度开始检索对服务提供者的请求,一般是最大请求数'BatchSize'和'MaxRequestGetBatch'中较小的一个 +- `BatchSize (int)`: 返回的最大请求数 + + `ServiceResponse` 查询包括: + +- `RequestHash ([]byte)`: 所匹配请求的哈希值 +- `BindingHash ([]byte)`: 服务提供者绑定服务的哈希值 +- `OutputValue ([]byte)`: 输出结果的结构化(可能加密)表示。*可选* +- `ErrorMsg (string)`: 错误信息的结构化表示。*可选* + + `PostServiceResponseTx` 交易包含: + +- `Responses ([]ServiceResponse)`: 服务回复内容 + +应用程序将验证服务提供者的每个响应是否带有匹配的区块链标识`ChainID`和地址`ProviderAddress`,并且该交易中的响应数少于`MaxResponsePostBatch`。经过验证的请求将附加到目标消费者的响应表中。 + +`GetServiceResponse` 查询包括: + +- `RequestHash ([]byte)`: 原始请求的哈希值,应用程序将校验调用者是否有匹配的区块链标识'ChainID'和服务消费者地址'ConsumerAddress' +- `BeginHeight (uint64)`: 应用程序应当从此区块高度开始检索服务提供者的响应,一般是最大响应数`BatchSize`和`MaxResponseGetBatch`中的较小的一个 +- `BatchSize (int)`: 返回的最大响应数 + +`ConfirmServiceResponseTx` 交易包含: + +- `ResponseHash ([][]byte)`: 待确认响应的哈希值 + +应用程序将验证每个待确认响应是否确实是由调用者发起的请求,并且此交易中的响应数量小于`MaxResponseConfirmBatch`。 + +从`Timeout`超时窗口中退出的响应(对于'Multicast'多播服务,当`MaxServiceFee`随响应返回增加而消耗光时)将不会被应用程序接受。服务消费者一收到'Unicast'单播响应就立即开始处理。然而,对于`Multicast`多播响应,必须等待`Timeout`超时窗口结束,然后才开始处理可能收到的全部响应。 + +当一个`Unicast`单播响应被用户确认,相关服务费用将从托管账户中释放到匹配的服务提供者账户 ——其中扣除少量(由'ServiceFeeTaxRate'定义的)税金并添加到*系统准备金(system reserve)* 中; 同时,相关请求的押金也将退还给服务消费者。 + +在`Multicast`多播请求的情况有点复杂:每个响应确认时,只有部分请求押金被退还给服务消费者,即此响应相关服务费用占`MaxServiceFee`的比例; 在所有的响应被确认之后,此请求剩余的托管余额将会退还给服务消费者。 + +如果请求超时而没有看到任何响应,则应用程序将托管中的相关余额以及请求押金全额退还给用户。但是,如果用户没有(在`ResponseConfirmTimeout`+响应区块数的高度之前)及时确认回复,请求押金将被执行一个(由`ResponseConfirmDelayPenaltyRate`定义的)小惩罚再退还给消费者,与此同时,相关服务费将照常释放给服务提供者。 + +**争议解决** + +在任何情况下如果服务消费者对服务响应不满意,就应该存在一种机制允许服务消费者发出投诉,从而获得可接受的解决方案,而不必求助于诸如法律系统等集中的权威。同时,这种机制应避免引入可能会被任一方滥用的主观评价。 + +解决出现在IRIS网络上的争议,其过程类似于服务调用,不仅服务消费者向服务提供者发送`Complaint`(服务),而且服务提供者以一个`Resolution`(服务)进行响应。这些交互是通过一对称为 *投诉表(complaint table)* 和 *解决方案表(resolution table)* 的全局端点来实现的。 + +在IRIS网络目前的设计中,提交投诉时需要一份消费押金。如果服务消费者不及时确认某个解决方案,将从该押金中扣除罚款。同样地,如果服务提供者不及时响应投诉,他的保证金将被部分削减。 + +`Complaint` 包含: + +- `ResponseHash ([]byte)`: 对争议响应的哈希 +- `Problem (string)`: 对服务响应的问题描述 +- `PreferredDisposal (enum)`: 可以是`Refund`或`Redo`选项 + +`Resolution`包括: + +- `ComplaintHash ([]byte)`: 对所匹配投诉的哈希 +- `Disposal (enum)`: 可以是`Refund`或`Redo`选项 +- `Refund (uint64)`: 服务费退款. *可选* +- `OutputValue ([]byte)`:输出结果的结构化(可能加密)表示。 *可选* + +如上所述,我们预期的争议解决流程可能不具有法律约束力。尽管如此,我们认为这将为解决IRIS网络上的常见争议提供有效手段。 + +**服务分析** + +引入iService生态系统带来一些挑战。一个主要的挑战是找到一种方法,让服务消费者更容易发现合适的服务提供者——服务消费者需要性能指标来评估和选择服务提供商,但如果没有服务消费者的使用,性能指标也就不可用。 + +为了试图解决这个循环问题,我们计划引入一种分析机制,在这个机制中,一个享有特权的系统用户即分析员,在常规的调度下调用所有活动的服务。这将使网络中的客观性能数据(例如响应时间、可用性、投诉处理等)对实际消费者有用。 + +服务分析调用将免除服务费用和消费押金,但会产生网络交易费用。这些调用来自那些被应用程序识别和认可的保留地址。 + +对于新服务,分析活动将保持相对稳定的水平,随着它们开始吸引真正的服务消费者调用并预计生成更多的性能数据,分析活动将逐渐减少单个服务的使用。 + +分析过程中发生的交易费用默认情况下从系统准备金(system reserve)中支付,必要时基金会准备金(Foundation reserve)将会介入。 + +**查询** + +上述所有与服务生命周期相关的对象都可以使用ABCI 'Query'接口[\[3\]]查询到。这些查询将通过'Query'连接执行,并不参与共识过程。我们已经看到了如何得到的`GetServiceRequest`和得到`GetServiceResponse`查询作为服务调用过程的一部分。 +上面描述的所有与服务相关的生命周期对象都可以使用ABCI查询接口3来查询。 + +以下是我们目前计划的查询的一个非详尽的摘要: + +**服务对象** + +| Object | Commonly Used Filters | Authorization | +| ---------------------------------------- | ------------------------------------------------------------ | ------------------------ | +| Service Definition | Name, keywords, source (chain ID), messaging type, with active bindings... | Anyone can query | +| Service Binding (for a given definition) | Location (local or remote), pricing, service level, expiration... | Anyone can query | +| Service Request | Service definition and binding, blockchain height, batch size | Only matched provider(s) | +| Service Response | Service request, blockchain height, batch size | Only matched consumer | + + +**性能指标** + + +| Area | Metrics | Authorization | +| --------------------------- | ------------------------------------------------------------ | ---------------- | +| Provider (address) | Number of services provided (ever and active), response time (min, max and average), requests served (local and remote), requests missed, complaints received, complaints ignored, ... | Anyone can query | +| Provider (binding) | Active time, response time (min, max and average), requests served (local and remote), requests missed, complaints received, complaints ignored, ... | Anyone can query | +| Consumer | Number of services ever used, requests made, requests confirmed (in time and missed), complaints made, resolutions confirmed, ... | Anyone can query | +| Consumer (service, binding) | Requests made, requests confirmed (in time and missed), complaints made, resolutions confirmed, ... | Anyone can query | + +### IBC 改进 + +在Cosmos上建立自己的服务基础架构有一个独特优势:*服务可以部署一次,并通过区块链互联网随时随地进行调用*。具体来说,我们的计划是完成以下内容: +1. 服务定义广播到IRIS网络中的每个分区; +2. 全局服务绑定广播到IRIS网络中的每个分区; +3. 针对远程提供者的服务请求或投诉被路由到提供者所连接的区块链; +4. 针对远程消费者的服务响应或决议被路由回消费者所连接的区块链。 + +在处理一个`CreateServiceDefinitionTx`交易时,应用程序被设计为首先在本地验证和存储`ServiceDefinition`对象,然后创建一个包含了对每个相邻链定义的`IBCPacket`。 + +每个相邻链最终从相应的中继过程中接收包含该数据包的`IBCPacketTx`;如果此定义在接收链中尚不存在,则后者将通过为他的每个相邻链(除了最初接收数据包的源链之外)创建一个`IBCPacket`来传递此定义;如果该定义已经存在,接收链将停止传递此定义。 + +同样,当`ServiceBinding`创建或更新它的`BindingType`集合或更新为`Global`时,将为每个相邻链创建一个包含绑定的`IBCPacket`数据包,并在整个IRIS网络中进行广播。 + +上述`IBCPacket`由以下部分组成: + + +- `Header (IBCPacketHeader)` :数据包的头部 + + +- `Payload(ServiceDefinition或ServiceBinding)`:服务定义或绑定的字节数 + +前面提到的`IBCPacketHeader`由以下部分组成: + +- `SrcChainID(string)`:创建此数据包的区块链标识ID +- `DstChainID(string)`:此数据包将派往的相邻区块链标识ID +- `Number(int)`:数据包对应的唯一编号 +- `Status(enum)`:'NoAck' +- `Type (string)`:“iris-service-definition”或者是“iris-service-binding” + +现在让我们来看看如何通过IBC发生跨链服务调用。当请求一个`Unicast`单播服务时,应用程序检查目标绑定是否是`Local`本地的,如果是`Local`则将`ServiceRequest`追加到相应的请求表中,如2.2所述;否则,将会创建一个包含`ServiceRequest`的`IBCPacket`。 + + +包含一个'ServiceRequest'的`IBCPacket`由以下部分组成: + +- `Header(IBCPacketHeader)`:数据包的头部 +- `Payload(ServiceRequest)`:服务请求的字节数 + +前面提到的`IBCPacketHeader`由以下部分组成: + +- `SrcChainID(string)`:创建此数据包的区块链标识ID +- `DstChainID(string)`:远程服务提供者所在的区块链标识ID,例如'ServiceRequest'、'ServiceBinding'、'ChainID' +- `Number(int)`:数据包对应的唯一编号 +- `Status(enum)`:'AckPending' +- `Type(string)`:“iris-service-request” +- `MaxHeight(int)`:当前高度加上'ServiceRequest.Timeout' + +当远程请求最终到达目标链时,应用程序将其追加到相应的端点(请求表)中,以便进行目标绑定。对此远程请求的响应将被包装在一个收据IBCPacket中,该收据被一直路由回到源链,并将其追加到原始消费者的远程端点(响应表)中。 + +对远程的`Multicast`多播服务的请求以相同的方式处理,只不过可以在源链中生成多个`IBCPacket`。 + +远程投诉和解决的工作方式与请求和响应的方式相同,因此在此不做详细阐述。 + +下面是应用程序依赖`IBCPacket`类型的完整列表: + +| **类型** | **iService 对象** | +| ------------------------- | ------------------- | +| "iris-service-definition" | ServiceDefinition | +| "iris-service-binding" | ServiceBinding | +| "iris-service-request" | ServiceRequest | +| "iris-service-response" | ServiceResponse | +| "iris-complaint" | Complaint | +| "iris-resolution" | Resolution | + +
+ +## 用例 + +在本节中,我们为IRIS网络列出了一些可能的用例。 + +### 分布式人工智能用于隐私保护下的数据分析 + +这个用例的服务基础架构已由位于上海的初创公司`边界智能`进行了原型设计,并将其应用到联盟链产品`BEAN (BlockchainEdge Analytics Network)`中,用于解决长期已来为运行分析模型获取数据的挑战。尽管同态加密是允许通过加密数据实现计算的关键方法之一,但由于性能低下,实际上无法解决现实世界的机器学习问题。因此,BEAN的创建提供了另一种解决方案--利用传统的分布式人工智能研究[[14]]中的模型并行性和SOA设计模式,作为区块链的附加层开发分布式分析服务。 + +为了保护数据存取,运行在数据端的(部分)模型需要开放给客户端,并在服务定义中说明。由于只有部分模型开放给客户端,模型开发人员不必担心有人窃取他们的想法;同样,数据拥有者永远不需要担心失去对其数据使用的控制,因为数据不会离开他们的数据源。 + +其他潜在的好处可能包括以下几点: + +1. 仅在链上交换少量参数数据,这可以帮助提高性能。 + +2. 一种更实用的数据使用审计方法,这在医疗保健领域经常被用到。 + +医疗健康数据隐私度高,涉及众多安全需求。这就为医疗健康数据用于跨组织协作的目的提出了挑战(例如用于辅助诊断的跨医院会诊记录搜索,新药临床试验的患者身份,健康保险自动理赔等)。最小化可行产品(Minimum Viable Product,MVP)服务层的实现是建立在`Ethermint`的基础之上,试图连接众多医院、保险公司和分析服务提供者,以提供具有隐私保护的医疗健康数据分析能力。 + +支持链上服务注册和调用的智能合约已经实现。链下数据处理的一个例子是支持相关诊断组(Diagnosis Related Group,DRG)的分组分析服务。更具体地说,当一个医院用户调用DRG服务时,原始医疗记录将在链下进行处理,使用服务提供者提供的客户端NLP(由SQL和Python实现)代码存根来提取通过区块链接收DRGS服务传来的结构化数据,而不传递高度机密的原始医疗记录。 + +`BEAN`场景阐述了一个更复杂的服务使用案例,包括实现分布式分析、连接服务提供者和服务消费者、利用区块链提供可审计交易平台以及可信任的分布式计算基础。 + +### 数据和分析电子市场 + +通过对几个AI+区块链项目的研究,发现似乎大部分项目都旨在提供数据交换市场和分析API市场。在建议的`IRIS`基础架构中,通过使用`IRIS`服务提供者SDK来发布数据作为数据服务和包装分析API作为分析服务,从而轻松地构建这些网络。 + +### 分布式电子商务 + +将建议的`IRIS`基础架构与传统系统(例如`ERP`)集成以获取库存信息,或对可信数据源进行链间查询以获取交通和天气数据等信息,此方法与许多企业应用程序开发人员已经熟悉的方法非常相似。通过集成这些服务来支持分布式电子商务应用程序,就有可能提供与中心化系统(例如Amazon亚马逊或Alibaba阿里巴巴)相近的用户体验。 + +### 公有链和联盟链的结合 + +对于许多业务场景而言,采用混合了公有链和联盟链优良特性的混合架构,从而可以提供有益的结果,特别是在性能、安全性和经济激励方面。 + +例如,医院和保险公司可以组成联盟链以支持高性能的医疗保险交易,同时识别其他信息,例如关于某些疾病的全球服务的统计数据,这些信息可以从其他公有链中调用。从公有链接收到的通证可以返回给联盟链中的信息提供者,从而激励系统参与者改善和提高服务质量。利用`IRIS`提供的这种基础架构,可以在满足严格的性能和安全要求的前提下实现大规模的自发协作。 + +`IRIS`服务基础架构可以支持许多用例,例如更高效的基于资产的安全系统、分布式监管技术(如严格评估,互助市场等)。IRIS项目计划之一还包括与此类应用程序项目团队展开密切合作,以支持并使他们能够拥有所需的区块链基础架构,让他们专注于更高效地交付预期的业务价值。 + +
+ +## 通证经济 + +与Cosmos网络相似,IRIS网络也被设计为支持多通证模型。这些通证被不同的分区所拥有,同时可以通过IRIS枢纽从一个分区转移到另一个分区。我们构建了两种通证类型来支持IRIS网络上的操作: + +- 权益通证 +- 费用通证 + +### 权益通证 + +与Cosmos网络 [[15]][15]采用同样的权益机制设计,IRIS枢纽也拥有自己特殊的原生通证来表示权益。通证命名为`IRIS`。关于IRIS通证,我们设计了一些具体功能,其包括: + +- 通过验证人和代理人系统,将IRIS通证整合到IRIS网络的共识引擎验证人中; +- 代表投票权,参与IRIS网络的治理 + +### 费用通证 + +在IRIS网络中有两种费用通证: + +- **网络费用** 用来进行垃圾请求防范和支付验证人进行账本维护的报酬; +- **服务费用** 用来支付部署iServices的服务提供者的报酬。默认支付服务的通证为IRIS通证 + +IRIS网络旨在支持所有来自Cosmos网络白名单中的费用通证,例如 [Photon光子](https://blog.cosmos.network/cosmos-fee-token-introducing-the-photon-8a62b2f51aa), 以及IRIS通证。 + +支持各种白名单的中的费用通证是我们计划从Cosmos中采用的一个特性。它可以为网络的参与者提供增强的体验。在Cosmos中,对于网络费用通证`network fee token`,每一个验证人都拥有配置文件来定义他自己对每一个费用通证的价值评估。验证人可以运行一个独立的定时器,根据实时市场数据更新配置信息,或者使用默认的配置数据。 + +对于服务费用通证`service fee token`的设计,同样支持多通证模型。因此,在IRIS网络上的服务提供者,可以自由选择白名单中出现的通证为其服务收费。 + +为了帮助IRIS网络的参与者降低通证价格的波动性,基金会希望发展全球性的iService以从不同的交易所、或者从oracle预言机的潜在信息中获取市场价格数据。 + +权益通证和费用通证都会进一步细化以确保符合法律和监管规定的义务。 + +
+ +## 初始通证分配 + +最开始,系统预计发放2000000000个IRIS通证。IRIS通证的分布计划如下: + +- **私募**: 20% +- **核心开发团队**: 20% (自IRIS Hub主网上线起的4年成熟期,每月释放1/48。) +- **IRIS 基金会**: 15% (保留用作基金会的日常建设和运营) +- **生态建设**: 45% (在链接到IRIS Hub的分区中进行通证交换;激励潜在用户;奖励的合作伙伴) + +如果IRIS网络完全开发完毕,IRIS通证每年的通胀速率会根据账户进行调整,因为事实上,很大一部分流通中的IRIS通证都将被参与者作为权益证明主动投入到共识引擎中。 + +首要说明的是,私募的IRIS通证将用于开发IRIS网络。这部分通证的使用计划如下: + +- **运营**: 10% (包括服务提供者和承建商的费用,例如,审计、顾问、法律和其他第三方费用,以及其它管理费)) +- **软件开发**: 50% (包括直接用于开发上线所需的成本、费用和开支) +- **开发者支持**: 10% (包括黑客马拉松、志愿者奖励和培训项目) +- **研发赞助**: 10% (包括会议、研究项目和大学合作) +- **市场拓展**: 20% (包括业务发展,社区发展和推广,以及出差、交流、出版、发行和其他费用等) + +
+ +## 路线图 + +预期的IRIS项目路线图如下。这里我们重申一下,路线图只是一个大概方向,将来根据项目实施会有变化。 + +- **盘古**(2018年1月~2018年7月):IRIS项目的第一阶段,将集中在构建和运行IRIS Hub以及与Cosmos Hub的交互。同时,我们将发布一个初始版本的IRIS网络移动客户端。 + +- **女娲**   (2018年7月~2018年11月):第二阶段主要集中在构建IRIS Service Layer。这将涉及启用服务定义、绑定、调用和查询。在这个阶段,我们也打算为开发者准备一个beta版的IRIS SDK。 + +- **夸父** (2018年12月~2019年5月):第三阶段主要专注于IRIS网络的增量升级,以支持我们计划中先进的IRIS Service治理特性。 + +- **后裔** (2019年6月之后):第四阶段专注在IRIS网络、IRIS SDK和移动客户端的技术创新,以及开发者的参与。 + +
+ +## 团队 + +**Tendermint** (该团队开发了 [Tendermint](https://www.tendermint.com)共识引擎,当前正在开发Cosmos), **Wancloud万云** ( [万向区块链](http://www.wxblockchain.com) 子公司)和 **边界智能** 将共同构建IRIS网络的基础设施。 + +Tendermint将在扩展Tendermint ABCI和Cosmos IBC技术方面,为IRIS项目团队提供技术咨询和开发支持。[Wancloud万云](https://www.wancloud.io) 将是Cosmos和IRIS生态系统的关键战略合作伙伴,它将积极参与Cosmos和IRIS在亚太地区的开发和发展。 + +边界智能将是IRIS网络的核心开发团队,IRIS充分借助团队创建分布式智能分析服务的经验,实现医疗数据分析与交换。边界智能是一家于2016年在上海成立的初创公司,专注于利用先进的区块链技术和人工智能技术为医疗和金融行业开发创新产品和提供解决方案。边界智能中的一个核心产品`BEAN`(区块链智能信息边缘分析网络Blockchain Edge Analytics Network)是一条许可链,它利用自然语言分析及机器学习技术为隐私保护、医疗健康数据的分析和交换提供分布式智能分析服务。边界智能正不断扩展`BEAN`功能来构建IRIS网络,同时,**边界智能**也是Cosmos网络在中国的运营和服务合作伙伴。 + +### 核心成员 + +**曹恒** + +[曹恒](https://www.linkedin.com/in/harrietcao/) 是边界智能的创始人,该公司是一家成立于上海的初创公司。边界智能专注于利用分布式AI技术为区块链提供智能化服务,支持可信高效的行业协作。曹恒是曾获得过2010年美国运筹学和管理学研究协会(INFORMS)颁发的数据分析和人工智能技术领域的“Daniel H. Wagner”大奖。在创立边界智能之前,曹恒在IBM 研究院工作16年,曾担任IBM研究院上海研究院院长,是前IBM全球研究院大数据分析技术带头人。曹恒拥有卡耐基梅隆大学机器人硕士学位和清华大学自动化控制学士学位。 + +**奚海峰** + +[奚海峰](https://www.linkedin.com/in/haifengxi/) 是高级技术专家和企业家。自2009年从美国归国以来,他曾在三家公司担任首席技术官,其中一家是纳斯达克上市公司。他还在上海联合创立过两家初创公司,并在那里担当技术和工程学的领导角色。奚海峰拥有马里兰大学电子与计算机工程硕士学位,以及清华大学自动化控制硕士和学士学位。 + +**Jae Kwon** + +2005年,[Jae](https://www.linkedin.com/in/yjkwon/)毕业于康奈尔大学计算机科学学士学位后,曾在硅谷担任软件开发工程师,起先在亚马逊从事Alexa开发工作,后来在Yelp带领移动应用开发团队。Jae在认识到区块链问题后,开发了Tendermint BFT共识算法和Tendermint Core共识引擎。Tendermint是第一个可信的PoS算法。 除了开发Tendermint之外,Jae还是Cosmos的创始人之一。 + +**陶曲明** + +[陶曲明](https://www.linkedin.com/in/tom-tao-14763a45/)自2016年8月加入万向以来,便负责万向区块链集团的咨询服务,万云BaaS平台,以及ChainBase加速器和孵化器服务。在加入万向前,他曾在多家全球领先企业里积累了超过18年的丰富服务管理和业务管理的实践经验。Tom率先将云服务,物联网数据服务平台和加速器技术引入中国市场。自2013年起,Tom一直在跟踪区块链,云计算,物联网和智能制造行业的发展趋势。Tom拥有复旦大学物理学硕士学位和南开大学电气工程学士学位。 + + +### 顾问 + +**Jim Yang** + +[Jim Yang](https://www.linkedin.com/in/jimyang/) 是Tendermint首席运营官。 他是ChatX移动信息工作室的创始人兼首席执行官。 ChatX开发了各种移动消息/社交应用程序。 他还共同创立了Identyx并一直担任CEO至被Red Hat收购。 Identyx开发一个开源企业身份管理软件。 + +**Zaki Manian** + +[Zaki Manian](https://zaki.manian.org)是可信物联网联盟执行董事,也是区块链和加密货币技术发展的丰富贡献者。 Zaki在密码学和分布式共识系统方面拥有深厚的专业积累。 他还是Cosmos项目以及其创业项目的顾问。 + +**Adrian Brink** + +[Adrian Brink](https://adrianbrink.com), 是Tendermint / Cosmos 网络的核心开发者和社区负责人。 + +**Michael Yuan** + +[Dr. Michael Yuan](http://www.michaelyuan.com) 博士是 [CyberMiles Foundation](https://cm.5miles.com)基金会的负责人。Michael在德克萨斯大学奥斯汀分校获得了天体物理学博士学位。 他编写的5本关于软件开发的书已由Prentice Hall,Addison-Wesley和O'Reilly出版。 Michael是Firefox,Fedora,JBoss等大型开源项目中的活跃代码提交者。 他是企业应用软件和移动软件方面的专家,也是参与了多个由美国政府资助的研究项目。 + +
+ +## 参考文献################################################################### + +[1]: https://drive.google.com/file/d/1bI7JIOe-CfJ5fPHKxYlFub2Kg-KCGU6r/view?usp=sharing +[2]: http://ethdocs.org/en/latest/ +[3]: https://cosmos.network/whitepaper +[4]: https://polkadot.io/ +[5]: https://tendermint.readthedocs.io/en/master/ +[6]: https://ethermint.zone/ +[7]: http://www.freepatentsonline.com/y2017/0236120.html +[8]: https://github.com/cryptape/cita-whitepaper/blob/master/en/technical-whitepaper.md +[9]: https://github.com/hyperledger/burrow +[10]: https://lightning.network/lightning-network-paper.pdf +[11]: https://www.plasma.io/plasma.pdf +[12]: https://github.com/cosmos/ibc/blob/master/README.md +[13]: https://www.amazon.com/SOA-Principles-Service-Thomas-Erl/dp/0132344823 +[14]: http://www.cs.toronto.edu/~ranzato/publications/DistBeliefNIPS2012_withAppendix.pdf +[15]: https://medium.com/@tendermint/b5b2c682a292 +[16]: https://drive.google.com/file/d/1jtyYtx7t1xy9gxEi2T5lXFNd8xUY7bhJ/view + +* [1] Wanxiang Blochchain Inc., Distributed Business Value Research Institute,"Blockchain and Distributed Business Whitepaper", September 2017. +* [2] Ethereum Foundation, "Ethereum Homestead Documentation", +* [3] Jae Kwon, Ethan Buchman,"Cosmos, A Network of DistributedLedgers", +* [4] Gavin Wood, "Polkadot: Vision For a Heterogeneous Muilti-chainFramework", +* [5] Tendermint, +* [6] Ethermint, +* [7] Oracle International Corporation, "Accountability and Trust inDistributed Ledger Systems", USA Patent Application 20170236120, August17, 2017, +* [8] Jan Xie, "CITA Technical Whitepaper", +* [9] Hyperledger Burrow, +* [10] Joseph Poon, Thaddeus Dryja, "The Bitcoin Lightning Network:Scalable Off-Chain Instant Payments", January 14, 2016, +* [11] Joseph Poon, Vitalik Buterin, "Plasma: Scalable Autonomous SmartContracts", August 11, 2017, +* [12] Ethan Frey, "Cosmos IBC Specification", Sep. 29, 2017, +* [13] Thomas Erl, "SOA: Principles of Service Design", Prentice Hall;1st edition (July 28, 2007) +* [14] Dean, J., Corrado, G.S., Monga, R., et al, Ng, A. Y. "Large ScaleDistributed Deep Networks". In Proceedings of the Neural InformationProcessing Systems (NIPS'12) (Lake Tahoe, Nevada, United States,December 3--6, 2012). Curran Associates, Inc, 57 Morehouse Lane, RedHook, NY, 2013, 1223-1232. +* [15] Tendermint Blog, "Cosmos Validator Economics -- Revenue Streams",January 2018, @tendermint/b5b2c682a292 +* [16] Sunny Aggarwal, "Cosmos Token Model", December 2017, From 6904770817ce2f2a7a15a504e69b500aaa66da83 Mon Sep 17 00:00:00 2001 From: kidinamoto01 Date: Fri, 17 Aug 2018 16:07:21 +0800 Subject: [PATCH 05/24] add validators --- docs/validators/Setup A Sentry Node.md | 59 ++++++++++++++++++++++++++ docs/validators/overview.md | 15 +++++++ 2 files changed, 74 insertions(+) create mode 100644 docs/validators/Setup A Sentry Node.md create mode 100644 docs/validators/overview.md diff --git a/docs/validators/Setup A Sentry Node.md b/docs/validators/Setup A Sentry Node.md new file mode 100644 index 000000000..184150087 --- /dev/null +++ b/docs/validators/Setup A Sentry Node.md @@ -0,0 +1,59 @@ +# Setup A Sentry Node + +## Why do we need a sentry node? + +A validator node is under the risk of distributed denial-of-service (DDoS)attack. It occures when an attacker tries to disrupt normal traffic of a node. In this way, this node will be isolated from other nodes in the network. One way to mitigate this risk is for validators to carefully structure their network topology in a so-called sentry node architecture. + +## What is a sentry node? + +In IRISnet, a sentry node is just a normal full node. The validator node will only connect to its sentry node. In this way, the sentry nodes will be protect the validator node from DDoS attack. + +## How to setup a sentry node? + + +### Sentry Node + +On the sentry node's side, you need to get fully initialized first. + +Then, you should edit its `config.tmol` file, and change `private_peers_id` field: + +``` +private_peers_id="" +``` + +`validator node id` is the `node-id` of validator node. + +Then you could start your sentry node, + +``` +iris start --home= +``` + +If you have multiple sentry node, you could make them as `persistent-peers` to each other. + +### Validator Node + +On the validator node's side, you also need to get fully initialized first, and make sure you have the `priv_validator.json` file backuped. + +Then, you should edit its `config.tmol` file, + +``` +persistent_peers="@" +``` + +If you want to put multiple sentry info, you need to separate the information with `,` + +Set +``` +pex=false +``` +In this way, the validator node will diable its peer reactor, so it will not respond to any peer exchange request other than its sentry nodes. + +Then you could start your validator node, + +``` +iris start --home= +``` + +It's also recommanded to enable the firewall of validator node. + diff --git a/docs/validators/overview.md b/docs/validators/overview.md new file mode 100644 index 000000000..7a563530d --- /dev/null +++ b/docs/validators/overview.md @@ -0,0 +1,15 @@ +## Tendermint & Cosmos-SDK + +Tendermint is software for securely and consistently replicating an application on many machines. Tendermint is designed to be easy-to-use, simple-to-understand, highly performant, and useful for a wide variety of distributed applications. + + + +## What is a validator + +The IRIS network will keep generating value when its validators could keep the whole network secure. +Validator candidates can bond their own IRIS to become a validator. + + +## What is a delegator + +People that cannot, or do not want to run validator operations, can still participate in the staking process as delegators. Indeed, validators are not chosen based on their own stake but based on their total stake, which is the sum of their own stake and of the stake that is delegated to them. This is an important property, as it makes delegators a safeguard against validators that exhibit bad behavior. If a validator misbehaves, its delegators will move their Atoms away from it, thereby reducing its stake. Eventually, if a validator's stake falls under the top 100 addresses with highest stake, it will exit the validator set. \ No newline at end of file From bd3f7fcc589ea584fe2e095616466f5814a26b07 Mon Sep 17 00:00:00 2001 From: zhangyelong Date: Fri, 24 Aug 2018 10:13:39 +0800 Subject: [PATCH 06/24] #DEVOPS-119 Add vuepress config for Docs --- .gitignore | 6 +++++- docs/.vuepress/config.js | 44 ++++++++++++++++++++++++++++++++++++++++ docs/README.md | 1 + 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 docs/.vuepress/config.js create mode 100644 docs/README.md diff --git a/.gitignore b/.gitignore index 71c34377c..1a4ce0000 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,8 @@ vendor .DS_Store .idea build/ -*.out +.out +docs/.vuepress/dist/ +node_modules/ +package.json +yarn.lock diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js new file mode 100644 index 000000000..30b3442a3 --- /dev/null +++ b/docs/.vuepress/config.js @@ -0,0 +1,44 @@ +module.exports = { + title: 'IRIShub Document', + description: '', + base: "/", + themeConfig: { + displayAllHeaders: false, + nav: [ + { text: 'Back to IRISnet', link: 'https://www.irisnet.org' } + ], + sidebar: [ + { + title: 'Introduction', + collapsable: false, + children: [ + ['/introduction/Whitepaper.md', 'Whitepaper - English'], + ['/introduction/Whitepaper_CN.md', 'Whitepaper - 中文'] + ] + },{ + title: 'Getting Started', + collapsable: false, + children: [ + ['/get-started/install-iris.md', 'Install'], + ['/get-started/full-node.md', 'Run a Full Node'], + ['/get-started/validator-node.md', 'Run a Validator Node'] + ] + },{ + title: 'Modules', + collapsable: false, + children: [ + ['/modules/fee-token/feeToken.md', 'Fee Token'], + ['/modules/gov/gov_spec.md', 'Governance'], + ['/modules/software-upgrade/software-upgrade.md', 'Software Upgrade'] + ] + },{ + title: 'Validators', + collapsable: false, + children: [ + ['/validators/overview.md', 'Overview'], + ['/validators/Setup A Sentry Node.md', 'Setup a Sentry Node'] + ] + } + ] + } +} diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 000000000..5c20510e4 --- /dev/null +++ b/docs/README.md @@ -0,0 +1 @@ +# Welcome to the IRISnet Docs! From 0dd6bda41d28422dc103a4c3f4de8586d88a3ed8 Mon Sep 17 00:00:00 2001 From: zhangyelong Date: Fri, 24 Aug 2018 14:28:17 +0800 Subject: [PATCH 07/24] Update docs base path --- docs/.vuepress/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 30b3442a3..445cb4aa4 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,7 +1,7 @@ module.exports = { title: 'IRIShub Document', description: '', - base: "/", + base: "/docs", themeConfig: { displayAllHeaders: false, nav: [ From 0b08ab13afce4b104f10ed913b8527ee102263df Mon Sep 17 00:00:00 2001 From: zhangyelong Date: Fri, 24 Aug 2018 15:30:35 +0800 Subject: [PATCH 08/24] Update vuepress config --- docs/.vuepress/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 445cb4aa4..6aa9bb7cd 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,7 +1,7 @@ module.exports = { title: 'IRIShub Document', description: '', - base: "/docs", + base: "/docs/", themeConfig: { displayAllHeaders: false, nav: [ From fae415dc8438bbf00ee41bc90ba46f2a90e356fb Mon Sep 17 00:00:00 2001 From: zhangyelong Date: Mon, 27 Aug 2018 10:10:17 +0800 Subject: [PATCH 09/24] Update vuepress config --- docs/.vuepress/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 6aa9bb7cd..a328c37a1 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,5 +1,5 @@ module.exports = { - title: 'IRIShub Document', + title: 'IRISnet Document', description: '', base: "/docs/", themeConfig: { From d476a2438bf5db73a8107aa0dfa85dc691c1201e Mon Sep 17 00:00:00 2001 From: Yelong Zhang Date: Wed, 5 Sep 2018 10:38:59 +0800 Subject: [PATCH 10/24] Update README.md From 6c2aa96977bcb958b5b408bee4108d70cd6efccc Mon Sep 17 00:00:00 2001 From: Yelong Zhang Date: Wed, 5 Sep 2018 10:39:24 +0800 Subject: [PATCH 11/24] Update README.md --- docs/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/README.md b/docs/README.md index 5c20510e4..1f4302d94 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1 +1,2 @@ # Welcome to the IRISnet Docs! + From 46b3a1cc27e8eaf87e4b86dcea65c895d30bd3fd Mon Sep 17 00:00:00 2001 From: Yelong Zhang Date: Wed, 5 Sep 2018 11:23:05 +0800 Subject: [PATCH 12/24] Update README.md --- docs/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 1f4302d94..5c20510e4 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,2 +1 @@ # Welcome to the IRISnet Docs! - From 8eab94a1b3904cced504d50b8c48ad437854e767 Mon Sep 17 00:00:00 2001 From: zhangyelong Date: Wed, 5 Sep 2018 14:26:51 +0800 Subject: [PATCH 13/24] update vuepress config --- docs/.vuepress/config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index a328c37a1..12006c22b 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -27,16 +27,16 @@ module.exports = { title: 'Modules', collapsable: false, children: [ + ['/modules/coin/coin_type.md', 'Coin Type'], ['/modules/fee-token/feeToken.md', 'Fee Token'], - ['/modules/gov/gov_spec.md', 'Governance'], - ['/modules/software-upgrade/software-upgrade.md', 'Software Upgrade'] + ['/modules/gov/gov_spec.md', 'Governance'] ] },{ title: 'Validators', collapsable: false, children: [ ['/validators/overview.md', 'Overview'], - ['/validators/Setup A Sentry Node.md', 'Setup a Sentry Node'] + ['/validators/Setup A Sentry Node.md', 'Setup a Sentry Node'] ] } ] From 75c131be74323023b0010609371bd0c587fc1d16 Mon Sep 17 00:00:00 2001 From: kidinamoto01 Date: Fri, 7 Sep 2018 14:25:01 +0800 Subject: [PATCH 14/24] modify docs --- docs/get-started/full-node.md | 45 +++++++----- docs/get-started/install-iris.md | 16 +++-- docs/get-started/validator-node.md | 107 +++++++++++++++++++++++++---- 3 files changed, 128 insertions(+), 40 deletions(-) diff --git a/docs/get-started/full-node.md b/docs/get-started/full-node.md index e5eee708f..c7810cf31 100644 --- a/docs/get-started/full-node.md +++ b/docs/get-started/full-node.md @@ -2,7 +2,7 @@ Before setting up your validator node, make sure you've already installed **Iris** by this [guide](install-iris.md) -### Step 2: Setting Up Your Node +### Step 1: Init Your Node These instructions are for setting up a brand new full node from scratch. @@ -16,10 +16,28 @@ iris init --name --home= The default \$IRISHOME is `~/.iris` , You can edit this `name` later, in the `~/.iris/config/config.toml` file: +Your full node has been initialized! + +### Get Configuration Files + + +After the genesis file is ready, please download the genesis and the default config file. + +``` +cd $IRISHOME/config/ +rm genesis.json +rm config.toml +wget https://raw.githubusercontent.com/irisnet/testnets/master/testnets/fuxi-3000/config/config.toml +wget https://raw.githubusercontent.com/irisnet/testnets/master/testnets/fuxi-3000/config/genesis.json +``` +## Edit your Config File + +You could customized the `moniker` and `external_address` fields. + ``` # A custom human readable name for this node moniker = "" -external_address = "" +external_address = ":26656" ``` @@ -29,20 +47,7 @@ Set `addr_book_strict` to `false` to make peering more easily. ``` addr_book_strict = false ``` -Your full node has been initialized! - -### Get Configuration Files - - -After the genesis file is ready, please download the genesis and the default config file. -``` -cd $IRISHOME/config/ -rm genesis.json -rm config.toml -wget https://raw.githubusercontent.com/irisnet/testnets/master/testnets/fuxi-2000/config/config.toml -wget https://raw.githubusercontent.com/irisnet/testnets/master/testnets/fuxi-2000/config/genesis.json -``` ### Add Seed Nodes @@ -50,15 +55,17 @@ Your node needs to know how to find peers. You'll need to add healthy seed nodes ``` c16700520a810b270206d59f0f02ea9abd85a4fe@35.165.232.141:26656 +a12cfb2f535210ea12731f94a76b691832056156@120.79.226.163:26656 ``` Meanwhile, you could add some known full node as `Persistent Peer`. Your node could connect to `sentry node` as `persistent peers`. -Chang the `external_address` to your `public IP:26656`. +### Enable Port +You will need to set `26656` port to get connected with other peers and `26657` to query information of Tendermint. -### Run a Full Node +## Run a Full Node Start the full node with this command: @@ -73,6 +80,6 @@ iriscli status ``` You could see the following ``` -{"node_info":{"id":"71b188e9fdefd939453b3cd10c0eae45a8d02a2b","listen_addr":"172.31.0.190:26656","network":"fuxi-2000","version":"0.22.6","channels":"4020212223303800","moniker":"name","other":["amino_version=0.10.1","p2p_version=0.5.0","consensus_version=v1/0.2.2","rpc_version=0.7.0/3","tx_index=on","rpc_addr=tcp://0.0.0.0:26657"]},"sync_info":{"latest_block_hash":"CC9BBE0B38643DAF3D9B78D928E2ACA654E5A39C","latest_app_hash":"56B9228A97D5B85BFDBEE020E597D45D427ABC43","latest_block_height":"30048","latest_block_time":"2018-08-02T08:23:44.566550056Z","catching_up":false},"validator_info":{"address":"F638F7EA8A8E4DA559A346E1C404F83941749713","pub_key":{"type":"tendermint/PubKeyEd25519","value":"oI16LfBmnP8CefSGwIjAIO3QZ05xwB1+s4oPIQ3Yaag="},"voting_power":"10"}} +{"node_info":{"id":"1c40d19d695721fc3e3ce44cbc3f446f038b36e4","listen_addr":"172.31.0.190:46656","network":"iris-stage-4","version":"0.22.6","channels":"4020212223303800","moniker":"name","other":["amino_version=0.10.1","p2p_version=0.5.0","consensus_version=v1/0.2.2","rpc_version=0.7.0/3","tx_index=on","rpc_addr=tcp://0.0.0.0:46657"]},"sync_info":{"latest_block_hash":"41117D8CB54FA54EFD8DEAD81D6D83BDCE0E63AC","latest_app_hash":"95D82B8AC8B64C4CD6F85C1D91F999C2D1DA4F0A","latest_block_height":"1517","latest_block_time":"2018-09-07T05:44:27.810641328Z","catching_up":false},"validator_info":{"address":"3FCCECF1A27A9CEBD394F3A0C5253ADAA8392EB7","pub_key":{"type":"tendermint/PubKeyEd25519","value":"wZp1blOEwJu4UuqbEmivzjUMO1UwUK4C0jRH96HhV90="},"voting_power":"100"}} ``` -When you see `catching_up` is `false`, it means the node is synced with the rest of testnet, otherwise it means it's still syncing. \ No newline at end of file +If you see the `catching_up` is `false`, it means your node is fully synced with the network, otherwise your node is still downloading blocks. Once fully synced, you could upgrade your node to a validator node. The instructions is [here](validator-node.md). \ No newline at end of file diff --git a/docs/get-started/install-iris.md b/docs/get-started/install-iris.md index 4549f8f09..de0f05f13 100644 --- a/docs/get-started/install-iris.md +++ b/docs/get-started/install-iris.md @@ -18,15 +18,17 @@ There are two ways to get Iris running on your server. First, you could download #### Download Binary Directly -Go to the download page: https://github.com/irisnet/irishub/releases/ then get the release v0.3.4 on your computer. -`unzip -C /usr/local/bin iris$VERSION.$OS-$ARCH.zip` to `/usr/local/bin/ ` You could verify you have the right version installed by running the following commands: +Go to the download page: https://github.com/irisnet/irishub/releases/ then get the release v0.4.0 on your computer. +`unzip -C /usr/local/bin iris$VERSION.$OS-$ARCH.zip` to `/usr/local/bin/ ` + +You could verify you have the right version installed by running the following commands: ``` $ iris version -v0.3.4 +v0.4.0 $ iriscli version -v0.3.4 +v0.4.0 ``` #### Compile Source Code @@ -89,7 +91,7 @@ After setup Go correctly, you should be able to compile and run **Iris**. mkdir -p $GOPATH/src/github.com/irisnet cd $GOPATH/src/github.com/irisnet git clone https://github.com/irisnet/irishub -cd irishub && git checkout v0.3.4 +cd irishub && git checkout v0.4.0 curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh make get_vendor_deps && make install ``` @@ -99,9 +101,9 @@ Now check your **Iris** version. ``` $ iris version -v0.3.4 +v0.4.0 $ iriscli version -v0.3.4 +v0.4.0 ``` ### How to Update diff --git a/docs/get-started/validator-node.md b/docs/get-started/validator-node.md index f1ce54d85..5c6a92d55 100644 --- a/docs/get-started/validator-node.md +++ b/docs/get-started/validator-node.md @@ -1,37 +1,114 @@ #Running a Validator Node +Before setting up your validator node, make sure you've already installed **Iris** by this [guide](full-node.md) + Validators are responsible for committing new blocks to the blockchain through voting. A validator's stake is slashed if they become unavailable, double sign a transaction, or don't cast their votes. Please read about Sentry Node Architecture to protect your node from DDOS attacks and to ensure high-availability. -### Create A Validator +## Create A Validator + +### Get IRIS Token + +#### Create Account + +You need to get `iris` and `iriscli` installed first. Then, follow the instructions below to create a new account: + +``` +iriscli keys add +``` + +Then, you should print a password of at least 8 characters. + +The output will look like the following: +``` +NAME: TYPE: ADDRESS: PUBKEY: +tom local faa1arlugktm7p64uylcmh6w0g5m09ptvklxm5k69x fap1addwnpepqvlmtpv7tke2k93vlyfpy2sxup93jfulll6r3jty695dkh09tekrzagazek +**Important** write this seed phrase in a safe place. +It is the only way to recover your account if you ever forget your password. + +blast change tumble toddler rival ordinary chicken dirt physical club few language noise oak moment consider enemy claim elephant cruel people adult peanut garden +``` + +You could see the address and public key of this account. Please node that account address in IRISnet will start with `faa` and public key of account will start with `fap`. -Your `fvp` can be used to create a new validator by staking tokens. You can find your validator pubkey by running: +The seed phrase of this account will also be displayed. You could use these 24-character phrase to recover this account in another server. The recover command is: +``` +iriscli keys add --recover +``` +Once you have created your own address, please comment this issue with your address and you could receive 1,000iris soon. Each team will receivce once, then you could use these tokens to stake as a validator. The following command is used to check the balance of your account: ``` -iris tendermint show_validator --home= +iriscli account --node=http://localhost:26657 ``` +### Claim tokens -Next, craft your `iriscli stake create-validator` command: + +Please reply this [issue](https://github.com/irisnet/testnets/issues/69) with the generated address. The team will send you 10000IRIS after verfication. You can always get some `IRIS` by using the [Faucet](https://testnet.irisplorer.io/#/faucet). Please don't abuse it. + +## Create A Validator + + +You need to get the public key of your node before upgrade your node to a validator node. The public key of will start `fvp`, it can be used to create a new validator by staking tokens. + +You can find your validator pubkey by running: + +``` +iris tendermint show_validator --home= +``` +Example output: ``` -iriscli stake create-validator --amount=10iris --pubkey= --address-validator= --moniker= --chain-id=fuxi-2000 --name= +fvp1zcjduepqv7z2kgussh7ufe8e0prupwcm7l9jcn2fp90yeupaszmqjk73rjxq8yzw85 ``` +Next, use the output as `` field for `iriscli stake create-validator` command: + + +``` +iriscli stake create-validator --amount=iris --pubkey= --address-validator= --moniker= --chain-id=game-of-genesis --name= --node=http://localhost:36657 +``` +Please note the **amount** needs to be the **minimium unit** of IRIS. + +1 IRIS=10^18iris + +In this way, to stake 1IRIS, you need to do: + +``` +iriscli stake create-validator --pubkey= --address-validator= --fee=40000000000000000iris --gas=2000000 --from= --chain-id=game-of-genesis --node=tcp://localhost:36657 --amount=1000000000000000000iris +``` +Don't forget the `fee` and `gas` field. To read more about fees in IRISHub, you should read [this](/modules/fee-token/feeToken.md) + +### View Validator Info + +View the validator's information with this command: + +``` +iriscli stake validator --address-validator= --chain-id=game-of-genesis --node=tcp://localhost:36657 +``` + +The `` is start with config.toml + +### Confirm Your Validator is Running + +Your validator is active if the following command returns anything: + +``` +iriscli status --node=tcp://localhost:36657 +``` + +You should also be able to see your power is above 0. Also, you should see validator on the [Explorer](https://testnet.irisplorer.io). + ### Edit Validator Description You can edit your validator's public description. This info is to identify your validator, and will be relied on by delegators to decide which validators to stake to. Make sure to provide input for every flag below, otherwise the field will default to empty (`--moniker`defaults to the machine name). +You should put your name of your team in `details`. + ``` -iriscli stake edit-validator - --address-validator= - --moniker="choose a moniker" \ - --website="https://cosmos.network" \ - --details="" - --chain-id=fuxi-2000 \ - --name= +iriscli stake edit-validator --address-validator= --moniker="choose a moniker" --website="https://irisnet.org" --details="team" --chain-id=game-of-genesis + --name= --node=tcp://localhost:36657 --fee=40000000000000000iris --gas=2000000 ``` - ### View Validator Description View the validator's information with this command: @@ -47,8 +124,10 @@ iriscli stake validator \ Your validator is active if the following command returns anything: ``` -iriscli advanced tendermint validator-set | grep "$( tendermint show_validator)" +iriscli status ``` +You should see the voting power of your validator node is above zero. + You should also be able to see your validator on the [Explorer](https://testnet.irisplorer.io). You are looking for the `bech32` encoded `address` in the `~/.iris/config/priv_validator.json` file. From 57a5f65186bc43018daf3b7bcff0833337bd8d32 Mon Sep 17 00:00:00 2001 From: kidinamoto01 Date: Fri, 7 Sep 2018 14:28:25 +0800 Subject: [PATCH 15/24] modify docs --- docs/get-started/validator-node.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/get-started/validator-node.md b/docs/get-started/validator-node.md index 5c6a92d55..33b624dcb 100644 --- a/docs/get-started/validator-node.md +++ b/docs/get-started/validator-node.md @@ -65,7 +65,7 @@ Next, use the output as `` field for `iriscli stake create-validator` c ``` -iriscli stake create-validator --amount=iris --pubkey= --address-validator= --moniker= --chain-id=game-of-genesis --name= --node=http://localhost:36657 +iriscli stake create-validator --amount=iris --pubkey= --address-validator= --moniker= --chain-id=game-of-genesis --name= --node=http://localhost:26657 ``` Please note the **amount** needs to be the **minimium unit** of IRIS. @@ -74,7 +74,7 @@ Please note the **amount** needs to be the **minimium unit** of IRIS. In this way, to stake 1IRIS, you need to do: ``` -iriscli stake create-validator --pubkey= --address-validator= --fee=40000000000000000iris --gas=2000000 --from= --chain-id=game-of-genesis --node=tcp://localhost:36657 --amount=1000000000000000000iris +iriscli stake create-validator --pubkey= --address-validator= --fee=40000000000000000iris --gas=2000000 --from= --chain-id=game-of-genesis --node=tcp://localhost:26657 --amount=1000000000000000000iris ``` Don't forget the `fee` and `gas` field. To read more about fees in IRISHub, you should read [this](/modules/fee-token/feeToken.md) @@ -83,7 +83,7 @@ Don't forget the `fee` and `gas` field. To read more about fees in IRISHub, you View the validator's information with this command: ``` -iriscli stake validator --address-validator= --chain-id=game-of-genesis --node=tcp://localhost:36657 +iriscli stake validator --address-validator= --chain-id=game-of-genesis --node=tcp://localhost:26657 ``` The `` is start with config.toml @@ -93,7 +93,7 @@ The `` is start with config.toml Your validator is active if the following command returns anything: ``` -iriscli status --node=tcp://localhost:36657 +iriscli status --node=tcp://localhost:26657 ``` You should also be able to see your power is above 0. Also, you should see validator on the [Explorer](https://testnet.irisplorer.io). @@ -107,7 +107,7 @@ You should put your name of your team in `details`. ``` iriscli stake edit-validator --address-validator= --moniker="choose a moniker" --website="https://irisnet.org" --details="team" --chain-id=game-of-genesis - --name= --node=tcp://localhost:36657 --fee=40000000000000000iris --gas=2000000 + --name= --node=tcp://localhost:26657 --fee=40000000000000000iris --gas=2000000 ``` ### View Validator Description From 71618b6f8cbc96faf2c6475341c960bb3c44c1f1 Mon Sep 17 00:00:00 2001 From: kidinamoto01 Date: Fri, 7 Sep 2018 14:48:49 +0800 Subject: [PATCH 16/24] add tool docs --- docs/get-started/README.md | 41 +++++++++++++ docs/get-started/tools/Deploy-IRIS-Monitor.md | 48 +++++++++++++++ docs/get-started/tools/Setup_Sentrynode.md | 59 +++++++++++++++++++ 3 files changed, 148 insertions(+) create mode 100644 docs/get-started/README.md create mode 100644 docs/get-started/tools/Deploy-IRIS-Monitor.md create mode 100644 docs/get-started/tools/Setup_Sentrynode.md diff --git a/docs/get-started/README.md b/docs/get-started/README.md new file mode 100644 index 000000000..e63ecb3ac --- /dev/null +++ b/docs/get-started/README.md @@ -0,0 +1,41 @@ +# IRISnet Testnet + +## What is IRISnet + +IRIS network (a.k.a. IRISnet) is named after Greek goddess **Iris**, said to be the personification of the rainbow and the faithful messenger between heaven and humanity. IRIS network aims to build the foundation which facilitates construction of distributed business applications. IRIS hub will provide iServices, which allow resources such as data service and computing services being invoked across blockchains. To know more about IRISnet, please read this blog. + +## How to Join Fuxi Testnet + +### Step 1: Install Iris on Your Server + +Please follow this [instruction](install-iris.md) to get **Iris** installed locally. + +### Step 2: Run a Full Node + +Please follow this [instruction](full-node.md) to get your full node running. + + +### Step 3: Upgrade to Validator Node + +Please follow this [instruction](validator-node.md) to upgrade your full node to validator node. + +### Deploy IRISHub Monitor + +Please follow this [guide](tools/Deploy-IRIS-Monitor.md) to get IRIHub monitor running on your side. + + +### Upgrade to Validator Node + +You now have an active full node. What's the next step? + +If you have participated in the genesis file generation process, you should be a validator once you are fully synced. + +If you miss the genesis file generation process, you can still upgrade your full node to become a IRISnet Validator. The top 100 validators have the ability to propose new blocks to the IRIS Hub. Continue onto [the Validator Setup](). + +### Setup a sentry node + +A validator is under the risk of being attacked. You could follow this [guide](tools/Setup_Sentrynode.md) to setup a sentry node to protect yourself. + +## Useful Links + +* Riot chat: #irisvalidators:matrix.org diff --git a/docs/get-started/tools/Deploy-IRIS-Monitor.md b/docs/get-started/tools/Deploy-IRIS-Monitor.md new file mode 100644 index 000000000..3a5d2d567 --- /dev/null +++ b/docs/get-started/tools/Deploy-IRIS-Monitor.md @@ -0,0 +1,48 @@ +# How to deploy IRISHUB monitor + +Please make sure that iris is installed in your computer and added to $PATH.You can see this page for insturcion https://github.com/irisnet/irishub. You also need /bin/bash, wc, ps to ensure the monitor work properly. + +1. Download the monitoring tools +``` +wget https://raw.githubusercontent.com/programokey/monitor/master/monitor.tar.gz +``` + +2. Uncompress the monitoring tools: +``` +tar -xzvf monitor.tar.gz +``` + +3. Edit the running parameters + +``` +cd monitor +vim start.sh +``` + +4. Edit the third command in `start.sh` + +modify +-a=378E63271D5BE927443E17CBAAFE68DEFF383DA7 +to +-a= +modify +--chain-id=fuxi-test +to +--chain-id= +modify +--node="tcp://localhost:26657" +to +--node= + +5. start the monitoring tools +``` +./start.sh +``` + +then, you can visit http://localhost:3000/ to see the grafana monitoring page. The default username and password are both admin. We strongly recommend immediately changing your username & password after login. +Click the Home button, and open the IRIS HUB. Then you can see all the monitoring parameters. + +6. stop the monitor +``` +./stop.sh +``` \ No newline at end of file diff --git a/docs/get-started/tools/Setup_Sentrynode.md b/docs/get-started/tools/Setup_Sentrynode.md new file mode 100644 index 000000000..8d1da7ffa --- /dev/null +++ b/docs/get-started/tools/Setup_Sentrynode.md @@ -0,0 +1,59 @@ +# Setup A Sentry Node + +## Why do we need a sentry node? + +A validator node is under the risk of distributed denial-of-service (DDoS)attack. It occures when an attacker tries to disrupt normal traffic of a node. In this way, this node will be isolated from other nodes in the network. One way to mitigate this risk is for validators to carefully structure their network topology in a so-called sentry node architecture. + +## What is a sentry node? + +In IRISnet, a sentry node is just a normal full node. The validator node will only connect to its sentry node. In this way, the sentry nodes will be protect the validator node from DDoS attack. + +## How to setup a sentry node? + + +### Sentry Node + +On the sentry node's side, you need to get fully initialized first. + +Then, you should edit its `config.tmol` file, and change `private_peers_id` field: + +``` +private_peers_ids="" +``` + +`validator node id` is the `node-id` of validator node. + +Then you could start your sentry node, + +``` +iris start --home= +``` + +If you have multiple sentry node, you could make them as `persistent-peers` to each other. + +### Validator Node + +On the validator node's side, you also need to get fully initialized first, and make sure you have the `priv_validator.json` file backuped. + +Then, you should edit its `config.tmol` file, + +``` +persistent_peers="@" +``` + +If you want to put multiple sentry info, you need to separate the information with `,` + +Set +``` +pex=false +``` +In this way, the validator node will diable its peer reactor, so it will not respond to any peer exchange request other than its sentry nodes. + +Then you could start your validator node, + +``` +iris start --home= +``` + +It's also recommanded to enable the firewall of validator node. + From 8ff10110c7d9e19ac691f30f39fd1dda53339b41 Mon Sep 17 00:00:00 2001 From: kidinamoto01 Date: Fri, 7 Sep 2018 15:02:12 +0800 Subject: [PATCH 17/24] add gentx --- .../get-started/Genesis Generation Process.md | 75 ++++++ docs/get-started/docs_CN/README.md | 225 ++++++++++++++++++ docs/get-started/tools/Bech32 on IRISnet.md | 36 +++ 3 files changed, 336 insertions(+) create mode 100644 docs/get-started/Genesis Generation Process.md create mode 100644 docs/get-started/docs_CN/README.md create mode 100644 docs/get-started/tools/Bech32 on IRISnet.md diff --git a/docs/get-started/Genesis Generation Process.md b/docs/get-started/Genesis Generation Process.md new file mode 100644 index 000000000..6f079cb6e --- /dev/null +++ b/docs/get-started/Genesis Generation Process.md @@ -0,0 +1,75 @@ +# How To Participate in Genesis Process + +## Requirement + +You must have follow this [guide](install-iris.md) to install the correct version of **Iris**. + +## Step 1: + +Please run the `gen-tx` command to generate files. + + +``` +iris init gen-tx --name= --home= --ip= +``` + +You could see the following output: + +``` +{ + "app_message": { + "secret": "artist green between expand license credit dinner link confirm web tell trip north web crouch february item level crop bullet fancy mixed behind anxiety" + }, + "gen_tx_file": { + "node_id": "b272ea8a29f5b21dfb4587968f22a5612c6b120a", + "ip": "192.168.1.7", + "validator": { + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "0CtwpyEviDneH7uQUL5a+e+cTqJC0sciZSJk21moH8Y=" + }, + "power": "100", + "name": "" + }, + "app_gen_tx": { + "name": "name", + "address": "faa1nnlmkvfmdvn7efwqz7eyur9rszdw723adx2mcx", + "pub_key": "fap1zcjduepq6q4hpfep97yrnhslhwg9p0j6l8hecn4zgtfvwgn9yfjdkkdgrlrqftg82c" + } + } +} +``` + +The `app_message` contains the seed phrase to recover the account of `address` field you just created. +There will be a gentx-node-ID.json a file. + +The content of the file will be: + +``` +{ + "node_id": "b272ea8a29f5b21dfb4587968f22a5612c6b120a", + "ip": "192.168.1.7", + "validator": { + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "0CtwpyEviDneH7uQUL5a+e+cTqJC0sciZSJk21moH8Y=" + }, + "power": "100", + "name": "" + }, + "app_gen_tx": { + "name": "name", + "address": "faa1nnlmkvfmdvn7efwqz7eyur9rszdw723adx2mcx", + "pub_key": "fap1zcjduepq6q4hpfep97yrnhslhwg9p0j6l8hecn4zgtfvwgn9yfjdkkdgrlrqftg82c" + } +``` +validator is generated by \$IRISHOME/config/priv_validator.json + +## Step 2: + +Submit your gentx-node-ID.json to `https://github.com/irisnet/testnets/tree/master/testnets/fuxi-3000/config/gentx` by createing a pull request. + +After the team has collected all the gen-tx transactions, we will publish the genesis file. + +You could then download the final genesis file and start a node. + diff --git a/docs/get-started/docs_CN/README.md b/docs/get-started/docs_CN/README.md new file mode 100644 index 000000000..389daafc9 --- /dev/null +++ b/docs/get-started/docs_CN/README.md @@ -0,0 +1,225 @@ +# IRISnet测试网 + + + * [IRIShub 简介](#IRIShub-简介) + * [如何加入fuxi-2000测试网](#如何加入fuxi-1002测试网) + * [安装IRIShub](#安装IRIShub) + * [部署一个全节点](#部署一个全节点) + * [测试IRISHub相关功能](#测试IRISHub相关功能) + +## IRIShub 简介 + +IRIS Hub是在Cosmos生态中的区域性枢纽,提供iService服务 + +## 如何加入fuxi-2000测试网 + +### 安装IRIShub + +#### 服务器配置要求 + + +首先,你需要配置一台服务器。你的验证人节点应该能够一直运行,使用你可能需要在一台数据中心的服务器。任何像AWS、GCP、DigitalOcean中的云服务器都是适合的。 + +IRIS Hub是用Go语言编写的。它可以在任何能够编译并运行Go语言程序的平台上工作。然而,我强烈建议在Linux服务器上运行验证人节点。我曾经尝试在Windows上运行验证人节点。我能够顺利的编译但是在运行的时候会有一些问题。接下来的说明和指导都是基于Linux服务器的。 +这是我们的服务器的配置: + +* CPU核数:2 +* 内存容量:2GB +* 磁盘空间:40GB +* 操作系统:Ubuntu 18.04 LTS/16.04 LTS +* 允许的入方向的链接:TCP端口 26656 和 26657 + + +#### 方法1:下载发行版安装 + +进入下载页: https://github.com/irisnet/irishub/releases/ +下载对应版本的可执行文件 +解压缩tar -C /usr/local/bin -xzf iris$VERSION.$OS-$ARCH.zip +拷贝到/usr/local/bin/目录下 +执行以下命令,若出现对应的版本号则说明安装成功。 +``` +$ iris version +v0.3.4 + +$ iriscli version +v0.3.4 +``` +#### 方法2:源码编译安装 + +#### 安装Go版本 1.10+ + + +系统要求: + +Ubuntu LTS 16.04 + + +安装IRISHub需要保证Go的版本在1.10以上, + +通过执行以下命令安装1.10版本的Go。 + +``` + $ sudo add-apt-repository ppa:gophers/archive + $ sudo apt-get update + $ sudo apt-get install golang-1.10-go +``` + +以上命令将安装 golang-1.10-go在 /usr/lib/go-1.10/bin. 需要将它加入到PATH中 + +``` + echo "export PATH=$PATH:/usr/lib/go-1.10/bin" >> ~/.bash_profile + source ~/.bash_profile +``` + +同时,你需要指定相关的 $GOPATH, $GOBIN, 和 $PATH 变量, 例如: + +``` + mkdir -p $HOME/go/bin + echo "export GOPATH=$HOME/go" >> ~/.bash_profile + source ~/.bash_profile + echo "export GOBIN=$GOPATH/bin" >> ~/.bash_profile + source ~/.bash_profile + echo "export PATH=$PATH:$GOBIN" >> ~/.bash_profile + source ~/.bash_profile +``` + +参考链接: + +1. https://golang.org/doc/install +2. https://github.com/golang/go/wiki/Ubuntu + + + +#### 下载源码并安装 + + +在完成Go的安装后,通过以下命令下载并安装IRIS hub相关程序. + +``` +mkdir -p $GOPATH/src/github.com/irisnet +cd $GOPATH/src/github.com/irisnet +git clone https://github.com/irisnet/irishub +cd irishub && git checkout v0.4.0 + +curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + +make get_vendor_deps && make install +``` + +以上命令将完成 iris 和 iriscli的安装. 若出现对应的版本号则说明安装成功。 + +``` + $ iris version + v0.4.0 + + $ iriscli version + v0.4.0 +``` + +### 部署一个全节点 + +* **配置软件运行的目录** + +iris在运行过程中所依赖的配置文件和数据会存放在\$IRISHOME下,所以在运行iris前,需要指定一个目录作为$IRISHOME。若不配置目录,则\$IRISHOME默认为:/\$HOME/.iris。 + +* **初始化** + 执行以下操作, + ``` + iris init --home= + ``` + +会在$IRISHOME下创建两个文件夹:/config 和 /data。/config终会包含两个重要文件:genesis.json 和config.toml。genesis文件中定义了区块链网络的初始状态,而config.toml指定了iris软件模块的重要组成部分。 + +* **下载配置文件文件** + +如果你想参加到genesis文件的生成流程中,请根据以下[文档](https://github.com/irisnet/testnets/blob/master/fuxi/docs_CN/Genesis-generation.md)提交相关文件。 + +下载配置文件,并替换原有的/$IRISHOME/config目录下的文件: + + cd $IRISHOME/config/ + rm genesis.json + rm config.toml + wget https://raw.githubusercontent.com/irisnet/testnets/master/fuxi/fuxi-3000/config/config.toml + wget https://raw.githubusercontent.com/irisnet/testnets/master/fuxi/fuxi-3000/config/genesis.json + +* **修改配置文件** + +在config.tmol文件中可以配置以下信息: + +1. 将moniker字段配置称为自定义的名称,这样便于区分不同的节点 +2. seed字段用语设置种子节点,在fuxi-2000中的官方种子节点为: + +c16700520a810b270206d59f0f02ea9abd85a4fe@35.165.232.141:26656 + +3. 将`external_address` 改为`本地IP:26656` + +* **启动一个全节点** + +通过以下命令启动全节点,并将日志输出到文件中: + + iris start --home $IRISHOME > log & + +通过执行以下操作确认节点的运行状态: + + iriscli status + +示例输出: + + {"node_info":{"id":"3fb472c641078eaaee4a4acbe32841f18967672c","listen_addr":"172.31.0.190:26656","network":"fuxi-2000","version":"0.22.6","channels":"4020212223303800","moniker":"name","other":["amino_version=0.10.1","p2p_version=0.5.0","consensus_version=v1/0.2.2","rpc_version=0.7.0/3","tx_index=on","rpc_addr=tcp://0.0.0.0:26657"]},"sync_info":{"latest_block_hash":"7B1168B2055B19F811773EEE56BB3C9ECB6F3B37","latest_app_hash":"B8F7F8BF18E3F1829CCDE26897DB905A51AF4372","latest_block_height":12567,"latest_block_time":"2018-08-25T11:33:13.164432273Z","catching_up":false},"validator_info":{"address":"CAF80DAEC0F4A7036DD2116B56F89B07F43A133E","pub_key":{"type":"AC26791624DE60","value":"Cl6Yq+gqZZY14QxrguOaZqAswPhluv7bDfcyQx2uSRc="},"voting_power":0}} + +通过以上命令可以查看状态: + +* `"catching_up":false`: 表示节点与网络保持同步 + +* `"catching_up":true`: 表示节点正在同步区块 + +* `"latest_block_height"`: 表示最新的区块高度 + + ​ + +* **重置一个全节点** + +若需要将一个节点重启,则可以通过以下命令让节点再次通过与网络保持同步。 + +重置IRIShub节点流程如下: + +1. 关闭iris进程 + + kill -9 + +若Genesis文件有变动,则需要下载新的文件到$IRISHOME/config目录下。 + +2. 重置iris + +iris unsafe_reset_all --home=$IRIShome + +3. 重新启动 + +通过以下命令启动全节点,并将日志输出到文件中: + + iris start --home > log文件地址 & + +通过执行以下操作确认节点的运行状态: + + iriscli status + +示例输出: + +```json +{"node_info":{"id":"3fb472c641078eaaee4a4acbe32841f18967672c","listen_addr":"172.31.0.190:26656","network":"fuxi-2000","version":"0.22.6","channels":"4020212223303800","moniker":"name","other":["amino_version=0.10.1","p2p_version=0.5.0","consensus_version=v1/0.2.2","rpc_version=0.7.0/3","tx_index=on","rpc_addr=tcp://0.0.0.0:26657"]},"sync_info":{"latest_block_hash":"7B1168B2055B19F811773EEE56BB3C9ECB6F3B37","latest_app_hash":"B8F7F8BF18E3F1829CCDE26897DB905A51AF4372","latest_block_height":12567,"latest_block_time":"2018-08-25T11:33:13.164432273Z","catching_up":false},"validator_info":{"address":"CAF80DAEC0F4A7036DD2116B56F89B07F43A133E","pub_key":{"type":"AC26791624DE60","value":"Cl6Yq+gqZZY14QxrguOaZqAswPhluv7bDfcyQx2uSRc="},"voting_power":0}} +``` + +通过以上命令可以查看状态: + +* `"catching_up":false`: 表示节点与网络保持同步 + +* `"latest_block_height"`: 表示最新的区块高度 + + +### 测试IRISHub相关功能 + +在接下来你可以执行以下操作测试IRISHub的功能: + +* 通证交易:[Link](https://github.com/irisnet/testnets/blob/master/fuxi/docs_CN/转账交易.md) +* 对于权益通证进行绑定和委托的操作: [Link](https://github.com/irisnet/testnets/blob/master/fuxi/docs_CN/Basic-Bond:Delegate-Operation.md) +* 部署IRISHub Monitor [Link](https://github.com/irisnet/testnets/blob/master/fuxi/docs_CN/如何部署monitor.md) diff --git a/docs/get-started/tools/Bech32 on IRISnet.md b/docs/get-started/tools/Bech32 on IRISnet.md new file mode 100644 index 000000000..a62927bb4 --- /dev/null +++ b/docs/get-started/tools/Bech32 on IRISnet.md @@ -0,0 +1,36 @@ +# Bech32 on IRISnet + +Bech32 is a new Bitcoin address format proposed by Pieter Wuille and Greg Maxwell. Besides Bitcoin addresses, Bech32 can encode any short binary data. In the IRIS network, keys and addresses may refer to a number of different roles in the network like accounts, validators etc. The IRIS network is designed to use the Bech32 address format to provide robust integrity checks on data. The human readable part(HRP) makes it more efficient to read and the users could see error messages. + + +## Human Readable Part Table + + +| HRP | Definition | +| ------------- |:-------------:| +|faa |IRISnet Account Address| +|fap| IRISnet Account Public Key| +|fva |IRISnet Consensus Address| +|fvp| IRISnet Consensus Public Key| + +## Separator + +Why include a separator in addresses? That way the human-readable part is unambiguously separated from the data part, avoiding potential collisions with other human-readable parts that share a prefix. It also allows us to avoid having character-set restrictions on the human-readable part. The separator is 1 because using a non-alphanumeric character would complicate copy-pasting of addresses (with no double-click selection in several applications). Therefore an alphanumeric character outside the normal character set was chosen. + +## Encoding + +Not all interfaces to users IRISnet should be exposed as bech32 interfaces. Many address are still in hex or base64 encoded form. + +To covert between other binary reprsentation of addresses and keys, it is important to first apply the Amino enocoding process before bech32 encoding. + + +## Example + +Once you create a new address, you should see the following: + +` +NAME: TYPE: ADDRESS: PUBKEY: +test1 local faa18ekc4dswwrh2a6lfyev4tr25h5y76jkpqsz7kl fap1addwnpepqgxa40ww28uy9q46gg48g6ulqdzwupyjcwfumgfjpvz7krmg5mrnw6zv8uv +` + +This means you have created a new address `faa18ekc4dswwrh2a6lfyev4tr25h5y76jkpqsz7kl`, its hrp is `faa`. And its public key could be encoded into `fap1addwnpepqgxa40ww28uy9q46gg48g6ulqdzwupyjcwfumgfjpvz7krmg5mrnw6zv8uv`, its hrp is `fap`. \ No newline at end of file From 9f792d1bf5dace8635c09b9716368b98ab411f5d Mon Sep 17 00:00:00 2001 From: programonkey <872127164@qq.com> Date: Fri, 7 Sep 2018 15:12:58 +0800 Subject: [PATCH 18/24] Update full-node.md --- docs/get-started/full-node.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/get-started/full-node.md b/docs/get-started/full-node.md index c7810cf31..6d094d5bf 100644 --- a/docs/get-started/full-node.md +++ b/docs/get-started/full-node.md @@ -1,6 +1,6 @@ # Setup A Full-node -Before setting up your validator node, make sure you've already installed **Iris** by this [guide](install-iris.md) +Before setting up your validator node, make sure you already had **Iris** installed by following this [guide](install-iris.md) ### Step 1: Init Your Node @@ -21,7 +21,7 @@ Your full node has been initialized! ### Get Configuration Files -After the genesis file is ready, please download the genesis and the default config file. +After intializing your node, please download the genesis file and the config file to join in the testnet. ``` cd $IRISHOME/config/ @@ -51,7 +51,7 @@ addr_book_strict = false ### Add Seed Nodes -Your node needs to know how to find peers. You'll need to add healthy seed nodes to `$IRISHOME/config/config.toml`. Here are some seed nodes you can use: +Your node needs to know how to find more peers. You'll need to add healthy seed nodes to `$IRISHOME/config/config.toml`. Here are some seed nodes you can use: ``` c16700520a810b270206d59f0f02ea9abd85a4fe@35.165.232.141:26656 @@ -82,4 +82,4 @@ You could see the following ``` {"node_info":{"id":"1c40d19d695721fc3e3ce44cbc3f446f038b36e4","listen_addr":"172.31.0.190:46656","network":"iris-stage-4","version":"0.22.6","channels":"4020212223303800","moniker":"name","other":["amino_version=0.10.1","p2p_version=0.5.0","consensus_version=v1/0.2.2","rpc_version=0.7.0/3","tx_index=on","rpc_addr=tcp://0.0.0.0:46657"]},"sync_info":{"latest_block_hash":"41117D8CB54FA54EFD8DEAD81D6D83BDCE0E63AC","latest_app_hash":"95D82B8AC8B64C4CD6F85C1D91F999C2D1DA4F0A","latest_block_height":"1517","latest_block_time":"2018-09-07T05:44:27.810641328Z","catching_up":false},"validator_info":{"address":"3FCCECF1A27A9CEBD394F3A0C5253ADAA8392EB7","pub_key":{"type":"tendermint/PubKeyEd25519","value":"wZp1blOEwJu4UuqbEmivzjUMO1UwUK4C0jRH96HhV90="},"voting_power":"100"}} ``` -If you see the `catching_up` is `false`, it means your node is fully synced with the network, otherwise your node is still downloading blocks. Once fully synced, you could upgrade your node to a validator node. The instructions is [here](validator-node.md). \ No newline at end of file +If you see the `catching_up` is `false`, it means your node is fully synced with the network, otherwise your node is still downloading blocks. Once fully synced, you could upgrade your node to a validator node. The instructions is in [here](validator-node.md). From fa69b576c16f0d7feef5a68114241ac0a0c53d84 Mon Sep 17 00:00:00 2001 From: programonkey <872127164@qq.com> Date: Fri, 7 Sep 2018 15:22:46 +0800 Subject: [PATCH 19/24] Update install-iris.md --- docs/get-started/install-iris.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/get-started/install-iris.md b/docs/get-started/install-iris.md index de0f05f13..528c8092c 100644 --- a/docs/get-started/install-iris.md +++ b/docs/get-started/install-iris.md @@ -10,18 +10,18 @@ All the blockchains in IRISnet is based on Cosmos-SDK, which is a framework for 2. Memory: 4GB 3. Disk: 60GB SSD 4. OS: Ubuntu 16.04 LTS -5. Allow all incoming connections from TCP port 26656 and 26657 +5. Allow all incoming connections on TCP port 26656 and 26657 ### Step 2: Install Iris -There are two ways to get Iris running on your server. First, you could download the binary files from our release pages. You could also download the source code and compile it locally. +There are two ways to get Iris running on your server. You can download the binary files from our release pages, or you can download the source code and compile it locally. #### Download Binary Directly Go to the download page: https://github.com/irisnet/irishub/releases/ then get the release v0.4.0 on your computer. `unzip -C /usr/local/bin iris$VERSION.$OS-$ARCH.zip` to `/usr/local/bin/ ` -You could verify you have the right version installed by running the following commands: +You can verify you have the right version installed by running the following commands: ``` $ iris version @@ -86,7 +86,7 @@ $ echo $PATH - Get the code and compile Iris After setup Go correctly, you should be able to compile and run **Iris**. - +Make sure that you can access to google.com for that our project used some libraries provided by google. ``` mkdir -p $GOPATH/src/github.com/irisnet cd $GOPATH/src/github.com/irisnet @@ -116,4 +116,4 @@ git fetch -a origin git checkout VERSION make get_vendor_deps make install -``` \ No newline at end of file +``` From e5e0a3ff928a2ff0a6c3ff87ea65cb9b4cdd5120 Mon Sep 17 00:00:00 2001 From: kidinamoto01 Date: Fri, 7 Sep 2018 15:29:30 +0800 Subject: [PATCH 20/24] add docs Chinese --- .../get-started/docs_CN/Genesis-generation.md | 77 ++++++++++++ docs/get-started/docs_CN/README.md | 30 ++--- ...12\345\205\266\346\220\255\345\273\272.md" | 54 ++++++++ ...275\225\351\203\250\347\275\262monitor.md" | 46 +++++++ .../\345\256\211\350\243\205IRISHub.md" | 118 ++++++++++++++++++ ...52\345\205\250\350\212\202\347\202\271.md" | 89 +++++++++++++ ...01\344\272\272\350\212\202\347\202\271.md" | 38 ++++++ docs/get-started/install-iris.md | 3 +- 8 files changed, 436 insertions(+), 19 deletions(-) create mode 100644 docs/get-started/docs_CN/Genesis-generation.md create mode 100644 "docs/get-started/docs_CN/tools/\345\223\250\345\205\265\350\212\202\347\202\271\345\217\212\345\205\266\346\220\255\345\273\272.md" create mode 100644 "docs/get-started/docs_CN/tools/\345\246\202\344\275\225\351\203\250\347\275\262monitor.md" create mode 100644 "docs/get-started/docs_CN/\345\256\211\350\243\205IRISHub.md" create mode 100644 "docs/get-started/docs_CN/\350\277\220\350\241\214\344\270\200\344\270\252\345\205\250\350\212\202\347\202\271.md" create mode 100644 "docs/get-started/docs_CN/\350\277\220\350\241\214\344\270\200\344\270\252\351\252\214\350\257\201\344\272\272\350\212\202\347\202\271.md" diff --git a/docs/get-started/docs_CN/Genesis-generation.md b/docs/get-started/docs_CN/Genesis-generation.md new file mode 100644 index 000000000..a64d29449 --- /dev/null +++ b/docs/get-started/docs_CN/Genesis-generation.md @@ -0,0 +1,77 @@ +# Genesis文件生成流程 + + +1. 每个希望成为验证人的参与者确保安装了对应版本的软件:iris v0.4.0 + +2. 执行gentx命令,获得一个node-id.json的文件。这个操作将默认生成一个余额为200IRIS的账户,该账户默认绑定100IRIS成为一个验证人候选人。 + +``` + iris init gen-tx --name= --home= --ip= +``` + 代码示例: + ``` + iris init gen-tx --name=alice + ``` + + ``` + { + "app_message": { + "secret": "similar spread grace kite security age pig easy always prize salon clip exhibit electric art abandon" + }, + "gen_tx_file": { + "node_id": "3385a8e3895b169eab3024079d987602b4d2b383", + "ip": "192.168.1.7", + "validator": { + "pub_key": { + "type": "AC26791624DE60", + "value": "RDxXckkpTc35q9xlLNXjzUAov6xMkGJlwtWg2IqAkD8=" + }, + "power": 100, + "name": "" + }, + "app_gen_tx": { + "name": "alice", + "address": "8D3B5761BC2B9048E2A7745B14E62D51C82E0B7C", + "pub_key": { + "type": "AC26791624DE60", + "value": "RDxXckkpTc35q9xlLNXjzUAov6xMkGJlwtWg2IqAkD8=" + } + } + } + } + ``` +然后你可以发现在$IRISHOME/config目录下生成了一个gentx文件夹。里面存在一个gentx-node-ID.json文件。这个文件包含了如下信息: + + ``` + { + "node_id": "3385a8e3895b169eab3024079d987602b4d2b383", + "ip": "192.168.1.7", + "validator": { + "pub_key": { + "type": "AC26791624DE60", + "value": "RDxXckkpTc35q9xlLNXjzUAov6xMkGJlwtWg2IqAkD8=" + }, + "power": 100, + "name": "" + }, + "app_gen_tx": { + "name": "alice", + "address": "8D3B5761BC2B9048E2A7745B14E62D51C82E0B7C", + "pub_key": { + "type": "AC26791624DE60", + "value": "RDxXckkpTc35q9xlLNXjzUAov6xMkGJlwtWg2IqAkD8=" + } + } + } + ``` + validator字段对应了home/config下的节点信息 + + `app_gen_tx`中说明了拥有这个节点的账户信息。这个账户的助记词就是刚刚的secret + +3. 将上述提到的json文件以提交Pull Request的形式上传到`https://github.com/irisnet/testnets/tree/master/testnets/fuxi-3000/config/gentx`目录下: + + 注意⚠️:json文中的IP改成公网IP + + + + diff --git a/docs/get-started/docs_CN/README.md b/docs/get-started/docs_CN/README.md index 389daafc9..e23698ba5 100644 --- a/docs/get-started/docs_CN/README.md +++ b/docs/get-started/docs_CN/README.md @@ -124,16 +124,14 @@ iris在运行过程中所依赖的配置文件和数据会存放在\$IRISHOME下 * **初始化** 执行以下操作, - ``` + ``` iris init --home= - ``` + ``` 会在$IRISHOME下创建两个文件夹:/config 和 /data。/config终会包含两个重要文件:genesis.json 和config.toml。genesis文件中定义了区块链网络的初始状态,而config.toml指定了iris软件模块的重要组成部分。 * **下载配置文件文件** -如果你想参加到genesis文件的生成流程中,请根据以下[文档](https://github.com/irisnet/testnets/blob/master/fuxi/docs_CN/Genesis-generation.md)提交相关文件。 - 下载配置文件,并替换原有的/$IRISHOME/config目录下的文件: cd $IRISHOME/config/ @@ -148,8 +146,9 @@ iris在运行过程中所依赖的配置文件和数据会存放在\$IRISHOME下 1. 将moniker字段配置称为自定义的名称,这样便于区分不同的节点 2. seed字段用语设置种子节点,在fuxi-2000中的官方种子节点为: - +``` c16700520a810b270206d59f0f02ea9abd85a4fe@35.165.232.141:26656 +``` 3. 将`external_address` 改为`本地IP:26656` @@ -165,8 +164,9 @@ c16700520a810b270206d59f0f02ea9abd85a4fe@35.165.232.141:26656 示例输出: - {"node_info":{"id":"3fb472c641078eaaee4a4acbe32841f18967672c","listen_addr":"172.31.0.190:26656","network":"fuxi-2000","version":"0.22.6","channels":"4020212223303800","moniker":"name","other":["amino_version=0.10.1","p2p_version=0.5.0","consensus_version=v1/0.2.2","rpc_version=0.7.0/3","tx_index=on","rpc_addr=tcp://0.0.0.0:26657"]},"sync_info":{"latest_block_hash":"7B1168B2055B19F811773EEE56BB3C9ECB6F3B37","latest_app_hash":"B8F7F8BF18E3F1829CCDE26897DB905A51AF4372","latest_block_height":12567,"latest_block_time":"2018-08-25T11:33:13.164432273Z","catching_up":false},"validator_info":{"address":"CAF80DAEC0F4A7036DD2116B56F89B07F43A133E","pub_key":{"type":"AC26791624DE60","value":"Cl6Yq+gqZZY14QxrguOaZqAswPhluv7bDfcyQx2uSRc="},"voting_power":0}} - +```json +{"node_info":{"id":"1c40d19d695721fc3e3ce44cbc3f446f038b36e4","listen_addr":"172.31.0.190:46656","network":"iris-stage-4","version":"0.22.6","channels":"4020212223303800","moniker":"name","other":["amino_version=0.10.1","p2p_version=0.5.0","consensus_version=v1/0.2.2","rpc_version=0.7.0/3","tx_index=on","rpc_addr=tcp://0.0.0.0:46657"]},"sync_info":{"latest_block_hash":"41117D8CB54FA54EFD8DEAD81D6D83BDCE0E63AC","latest_app_hash":"95D82B8AC8B64C4CD6F85C1D91F999C2D1DA4F0A","latest_block_height":"1517","latest_block_time":"2018-09-07T05:44:27.810641328Z","catching_up":false},"validator_info":{"address":"3FCCECF1A27A9CEBD394F3A0C5253ADAA8392EB7","pub_key":{"type":"tendermint/PubKeyEd25519","value":"wZp1blOEwJu4UuqbEmivzjUMO1UwUK4C0jRH96HhV90="},"voting_power":"100"}} +``` 通过以上命令可以查看状态: * `"catching_up":false`: 表示节点与网络保持同步 @@ -184,8 +184,10 @@ c16700520a810b270206d59f0f02ea9abd85a4fe@35.165.232.141:26656 重置IRIShub节点流程如下: 1. 关闭iris进程 - - kill -9 +``` +kill -9 PID +``` + 若Genesis文件有变动,则需要下载新的文件到$IRISHOME/config目录下。 @@ -206,7 +208,7 @@ iris unsafe_reset_all --home=$IRIShome 示例输出: ```json -{"node_info":{"id":"3fb472c641078eaaee4a4acbe32841f18967672c","listen_addr":"172.31.0.190:26656","network":"fuxi-2000","version":"0.22.6","channels":"4020212223303800","moniker":"name","other":["amino_version=0.10.1","p2p_version=0.5.0","consensus_version=v1/0.2.2","rpc_version=0.7.0/3","tx_index=on","rpc_addr=tcp://0.0.0.0:26657"]},"sync_info":{"latest_block_hash":"7B1168B2055B19F811773EEE56BB3C9ECB6F3B37","latest_app_hash":"B8F7F8BF18E3F1829CCDE26897DB905A51AF4372","latest_block_height":12567,"latest_block_time":"2018-08-25T11:33:13.164432273Z","catching_up":false},"validator_info":{"address":"CAF80DAEC0F4A7036DD2116B56F89B07F43A133E","pub_key":{"type":"AC26791624DE60","value":"Cl6Yq+gqZZY14QxrguOaZqAswPhluv7bDfcyQx2uSRc="},"voting_power":0}} +{"node_info":{"id":"1c40d19d695721fc3e3ce44cbc3f446f038b36e4","listen_addr":"172.31.0.190:46656","network":"iris-stage-4","version":"0.22.6","channels":"4020212223303800","moniker":"name","other":["amino_version=0.10.1","p2p_version=0.5.0","consensus_version=v1/0.2.2","rpc_version=0.7.0/3","tx_index=on","rpc_addr=tcp://0.0.0.0:46657"]},"sync_info":{"latest_block_hash":"41117D8CB54FA54EFD8DEAD81D6D83BDCE0E63AC","latest_app_hash":"95D82B8AC8B64C4CD6F85C1D91F999C2D1DA4F0A","latest_block_height":"1517","latest_block_time":"2018-09-07T05:44:27.810641328Z","catching_up":false},"validator_info":{"address":"3FCCECF1A27A9CEBD394F3A0C5253ADAA8392EB7","pub_key":{"type":"tendermint/PubKeyEd25519","value":"wZp1blOEwJu4UuqbEmivzjUMO1UwUK4C0jRH96HhV90="},"voting_power":"100"}} ``` 通过以上命令可以查看状态: @@ -215,11 +217,3 @@ iris unsafe_reset_all --home=$IRIShome * `"latest_block_height"`: 表示最新的区块高度 - -### 测试IRISHub相关功能 - -在接下来你可以执行以下操作测试IRISHub的功能: - -* 通证交易:[Link](https://github.com/irisnet/testnets/blob/master/fuxi/docs_CN/转账交易.md) -* 对于权益通证进行绑定和委托的操作: [Link](https://github.com/irisnet/testnets/blob/master/fuxi/docs_CN/Basic-Bond:Delegate-Operation.md) -* 部署IRISHub Monitor [Link](https://github.com/irisnet/testnets/blob/master/fuxi/docs_CN/如何部署monitor.md) diff --git "a/docs/get-started/docs_CN/tools/\345\223\250\345\205\265\350\212\202\347\202\271\345\217\212\345\205\266\346\220\255\345\273\272.md" "b/docs/get-started/docs_CN/tools/\345\223\250\345\205\265\350\212\202\347\202\271\345\217\212\345\205\266\346\220\255\345\273\272.md" new file mode 100644 index 000000000..7913b2694 --- /dev/null +++ "b/docs/get-started/docs_CN/tools/\345\223\250\345\205\265\350\212\202\347\202\271\345\217\212\345\205\266\346\220\255\345\273\272.md" @@ -0,0 +1,54 @@ +# 哨兵节点及其搭建 + +为了保证验证人节点的安全性和可用性,我们建议为验证人节点配置2个以上的哨兵节点。使用哨兵节点的好处在于可以有效地防止DoS攻击等其他针对验证人节点的攻击。 + +## 初始化一个全节点 + +为了搭建哨兵节点,首先我们需要初始化一些全节点。执行以下命令创建一个全节点(建议在多台不同的服务器上创建多个哨兵节点以提高可用性和安全性) +``` +iris init --name= --home= +``` +< sentry home>是你指定的哨兵节点的地址。示例: +``` +iris init --name="sentry" --home=sentry --home-client=sentry +{ + "chain_id": "test-chain-hfuDmL", + "node_id": "937efdf8526e3d9e8b5e887fa953ff1645cc096d", + "app_message": { + "secret": "issue envelope dose rail busy glass treat crop royal resemble city deer hungry govern cable angle cousin during mountain december spare stick unveil great" + } +} +``` + + +## 修改哨兵节点的配置 + +然后将验证人节点中的genesis.json文件复制到 < sentry home>/config/目录下。接下来对< sentry home>/config/目录下的config.tmol进行编辑。需要进行如下修改: +``` +private_peers_ids="" +``` + +这里的< validator node id>可以在验证人节点上使用iriscli status命令获得。经过这样设置之后然后使用 + +``` +iris init --home= +``` + +启动哨兵节点。对每个哨兵节点都需要进行这些操作。 + +## 修改验证人节点的配置 + +接下来需要对验证人节点的< validator home>/config/目录下的config.tmol进行修改: + +``` +persistent_peers="@" +``` + +这里只写sentry节点的node id和地址,多个哨兵节点的信息使用逗号分开。 + +设置`pex=false` 不与其他节点进行peers交换,这样验证人节点就不会连接除persistent_peers之外的节点。 +这里的< sentry node id>可以在哨兵节点上使用iriscli status命令获得。修改完成后需要重启验证人节点使修改生效。 + +``` +iris init --home= +``` diff --git "a/docs/get-started/docs_CN/tools/\345\246\202\344\275\225\351\203\250\347\275\262monitor.md" "b/docs/get-started/docs_CN/tools/\345\246\202\344\275\225\351\203\250\347\275\262monitor.md" new file mode 100644 index 000000000..19918cb12 --- /dev/null +++ "b/docs/get-started/docs_CN/tools/\345\246\202\344\275\225\351\203\250\347\275\262monitor.md" @@ -0,0 +1,46 @@ +# 如何部署monitor + +确保已经安装了iris等工具,系统中需要有/bin/bash、wc、ps等命令。 你可以参考这个页面来安装iris工具:https://github.com/irisnet/irishub + +1. 下载打包好的监控工具。 +``` +wget https://raw.githubusercontent.com/programokey/monitor/master/monitor.tar.gz +``` + +2. 解压监控工具包 + +``` +tar -xzvf monitor.tar.gz +``` + +3. 修改运行参数 + +``` +cd monitor +vim start.sh +``` + +将第三条命令中的 + +-a=378E63271D5BE927443E17CBAAFE68DEFF383DA7 +修改为 +-a=<你的验证人地址的hex编码> +--chain-id=fuxi-test +修改为 +--chain-id=<你要监控的网络的ID> +--node="tcp://localhost:26657" +修改为 +--node=<你要监控的节点监听的rpc端口(默认为26657)> + + +4. 启动监控工具 +``` +./start.sh +``` +接下来就可以访问localhost:3000来查看grafana监控。打开网页后使用默认用户名admin,默认密码admin登录。建议登录之后立即修改密码。 +点击Home按钮,然后在general栏中打开IRIS HUB即可看到监控项。 + +5. 关闭监控 +``` +./stop.sh +``` diff --git "a/docs/get-started/docs_CN/\345\256\211\350\243\205IRISHub.md" "b/docs/get-started/docs_CN/\345\256\211\350\243\205IRISHub.md" new file mode 100644 index 000000000..0fd8f95ce --- /dev/null +++ "b/docs/get-started/docs_CN/\345\256\211\350\243\205IRISHub.md" @@ -0,0 +1,118 @@ +### 安装IRIShub + +#### 服务器配置要求 + + +首先,你需要配置一台服务器。你的验证人节点应该能够一直运行,使用你可能需要在一台数据中心的服务器。任何像AWS、GCP、DigitalOcean中的云服务器都是适合的。 + +IRIS Hub是用Go语言编写的。它可以在任何能够编译并运行Go语言程序的平台上工作。然而,我强烈建议在Linux服务器上运行验证人节点。我曾经尝试在Windows上运行验证人节点。我能够顺利的编译但是在运行的时候会有一些问题。接下来的说明和指导都是基于Linux服务器的。 +这是我们推荐的服务器的配置: + +* CPU核数:2 +* 内存容量:2GB +* 磁盘空间:40GB +* 操作系统:Ubuntu 18.04 LTS/16.04 LTS +* 允许的入方向的链接:TCP端口 26656 和 26657 + + +#### 方法1:下载发行版安装 + +进入下载页: https://github.com/irisnet/irishub/releases/ +下载对应版本的可执行文件 +解压缩 +``` +tar -C /usr/local/bin -xzf iris$VERSION.$OS-$ARCH.zip +``` +拷贝到/usr/local/bin/目录下 +执行以下命令,若出现对应的版本号则说明安装成功。 + +``` +$ iris version +v0.4.0 + +$ iriscli version +v0.4.0 +``` +#### 方法2:源码编译安装 + +#### 安装Go版本 1.10+ + + +系统要求: + +Ubuntu LTS 16.04 + + +安装IRISHub需要保证Go的版本在1.10以上, + +通过执行以下命令安装1.10版本的Go。 + +``` + $ sudo add-apt-repository ppa:gophers/archive + $ sudo apt-get update + $ sudo apt-get install golang-1.10-go +``` + +以上命令将安装 golang-1.10-go在 /usr/lib/go-1.10/bin. 需要将它加入到PATH中 + +``` + echo "export PATH=$PATH:/usr/lib/go-1.10/bin" >> ~/.bash_profile + source ~/.bash_profile +``` + +同时,你需要指定相关的 $GOPATH, $GOBIN, 和 $PATH 变量, 例如: + +``` + mkdir -p $HOME/go/bin + echo "export GOPATH=$HOME/go" >> ~/.bash_profile + source ~/.bash_profile + echo "export GOBIN=$GOPATH/bin" >> ~/.bash_profile + source ~/.bash_profile + echo "export PATH=$PATH:$GOBIN" >> ~/.bash_profile + source ~/.bash_profile +``` + +参考链接: + +1. https://golang.org/doc/install +2. https://github.com/golang/go/wiki/Ubuntu + + + +#### 下载源码并安装 + + +在完成Go的安装后,通过以下命令下载并安装IRIS hub相关程序. + +``` +mkdir -p $GOPATH/src/github.com/irisnet +cd $GOPATH/src/github.com/irisnet +git clone https://github.com/irisnet/irishub +cd irishub && git checkout v0.4.0 + +curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + +make get_vendor_deps && make install +``` + +以上命令将完成 iris 和 iriscli的安装. 若出现对应的版本号则说明安装成功。 + +``` + $ iris version + v0.4.0 + + $ iriscli version + v0.4.0 +``` +### 如何升级IRISHub + +通过执行一下命令可以完成IRISHub从v0.3.4到v0.4.0的升级 + +``` +cd $GOPATH/src/github.com/irisnet/irishub +git fetch -a origin +rm Gopkg.lock +git checkout v0.4.0 +make get_vendor_deps +make install +``` \ No newline at end of file diff --git "a/docs/get-started/docs_CN/\350\277\220\350\241\214\344\270\200\344\270\252\345\205\250\350\212\202\347\202\271.md" "b/docs/get-started/docs_CN/\350\277\220\350\241\214\344\270\200\344\270\252\345\205\250\350\212\202\347\202\271.md" new file mode 100644 index 000000000..ca7eecb42 --- /dev/null +++ "b/docs/get-started/docs_CN/\350\277\220\350\241\214\344\270\200\344\270\252\345\205\250\350\212\202\347\202\271.md" @@ -0,0 +1,89 @@ +# 如何运行一个全节点 + +## 配置 + +### 设置软件运行的目录 + +iris在运行过程中所依赖的配置文件和数据会存放在\$IRISHOME下,所以在运行iris前,需要指定一个目录作为\$IRISHOME。\$IRISHOME默认为:/Users/$user/.iris。 + +在\$IRISHOME需要设置两个文件夹:/config 和 /data + +### 下载配置文件文件 +iris运行中需要用到两个重要的文件:genesis.json 和config.toml + +genesis文件中定义了区块链网络的初始状态,而config.toml指定了iris软件模块的重要组成部分。 + +下载这两个文件到/$IRISHOME/config目录下: + +``` +cd $IRISHOME/config/ +wget https://raw.githubusercontent.com/irisnet/testnets/master/testnets/fuxi-2000/config/config.toml +wget https://raw.githubusercontent.com/irisnet/testnets/master/testnets/fuxi-2000/config/genesis.json +``` +### 修改配置文件 +在config.tmol文件中可以配置以下信息: +* 将`moniker`字段配置称为自定义的名称,这样便于区分不同的节点 +* `seed`字段用语设置种子节点,在fuxi-2000中的官方中字节点为:3fb472c641078eaaee4a4acbe32841f18967672c@35.165.232.141:26657 + +## 启动一个全节点 + +通过以下命令启动全节点,并将日志输出到文件中: +``` +iris start --home {path_to_your_home} > log文件地址 & +``` +通过执行以下操作确认节点的运行状态: +``` +iriscli status +``` +示例输出: +```json +{"node_info":{"id":"3fb472c641078eaaee4a4acbe32841f18967672c","listen_addr":"172.31.0.190:26656","network":"fuxi-2000","version":"0.22.6","channels":"4020212223303800","moniker":"name","other":["amino_version=0.10.1","p2p_version=0.5.0","consensus_version=v1/0.2.2","rpc_version=0.7.0/3","tx_index=on","rpc_addr=tcp://0.0.0.0:26657"]},"sync_info":{"latest_block_hash":"7B1168B2055B19F811773EEE56BB3C9ECB6F3B37","latest_app_hash":"B8F7F8BF18E3F1829CCDE26897DB905A51AF4372","latest_block_height":12567,"latest_block_time":"2018-08-25T11:33:13.164432273Z","catching_up":false},"validator_info":{"address":"CAF80DAEC0F4A7036DD2116B56F89B07F43A133E","pub_key":{"type":"AC26791624DE60","value":"Cl6Yq+gqZZY14QxrguOaZqAswPhluv7bDfcyQx2uSRc="},"voting_power":0}} +``` +通过以上命令可以查看状态: + +* `"catching_up":false`: 表示节点与网络保持同步 + +* `"catching_up":true`: 表示节点正在同步区块 + +* `"latest_block_height"`: 表示最新的区块高度 + + +之后你就应该可以在浏览器中看到 + +## 重置一个全节点 + +若需要将一个节点重启,则可以通过以下命令让节点再次通过与网络保持同步。 + +### 重置IRIShub节点流程如下: + +1. 关闭iris进程 +``` +kill -9 +``` + +若Genesis文件有变动,则需要下载新的文件到$IRISHOME/config目录下。 + +2. 重置iris +``` +iris unsafe_reset_all --home= +``` + +3. 重新启动 + +通过以下命令启动全节点,并将日志输出到文件中: +``` +iris start --home > log文件地址 & +``` +通过执行以下操作确认节点的运行状态: +``` +iriscli status +``` +示例输出: +```json +{"node_info":{"id":"3fb472c641078eaaee4a4acbe32841f18967672c","listen_addr":"172.31.0.190:26656","network":"fuxi-2000","version":"0.22.6","channels":"4020212223303800","moniker":"name","other":["amino_version=0.10.1","p2p_version=0.5.0","consensus_version=v1/0.2.2","rpc_version=0.7.0/3","tx_index=on","rpc_addr=tcp://0.0.0.0:26657"]},"sync_info":{"latest_block_hash":"7B1168B2055B19F811773EEE56BB3C9ECB6F3B37","latest_app_hash":"B8F7F8BF18E3F1829CCDE26897DB905A51AF4372","latest_block_height":12567,"latest_block_time":"2018-08-25T11:33:13.164432273Z","catching_up":false},"validator_info":{"address":"CAF80DAEC0F4A7036DD2116B56F89B07F43A133E","pub_key":{"type":"AC26791624DE60","value":"Cl6Yq+gqZZY14QxrguOaZqAswPhluv7bDfcyQx2uSRc="},"voting_power":100}} +``` +通过以上命令可以查看状态: + +* `"catching_up":false`: 表示节点与网络保持同步 + +* `"latest_block_height"`: 表示最新的区块高度 \ No newline at end of file diff --git "a/docs/get-started/docs_CN/\350\277\220\350\241\214\344\270\200\344\270\252\351\252\214\350\257\201\344\272\272\350\212\202\347\202\271.md" "b/docs/get-started/docs_CN/\350\277\220\350\241\214\344\270\200\344\270\252\351\252\214\350\257\201\344\272\272\350\212\202\347\202\271.md" new file mode 100644 index 000000000..786850751 --- /dev/null +++ "b/docs/get-started/docs_CN/\350\277\220\350\241\214\344\270\200\344\270\252\351\252\214\350\257\201\344\272\272\350\212\202\347\202\271.md" @@ -0,0 +1,38 @@ +# 运行一个验证人节点 + +## 验证人是什么 + +在IRISHub枢纽中,验证人负责将交易打包并提交区块。成为一个验证人需要满足很多条件,不仅仅是技术和硬件上的投资。同时,因为只有在有限验证人的条件下,Tendermint才能发挥最大的作用。目前,我们将IRISHub枢纽的验证人上限定为100。也就是说只有前100个验证人能够获得奖励,而大部分IRIS持有者不会成为验证人而是通过委托的方式决定谁会成为验证人。 + +## 委托人是什么 + + + +## 如何成为一个验证人? + +### 方法1:参与到genesis.json文件的产生过程中,成为Genesis Validator + +参与到genesis.json文件生成的步骤: + +* 执行gentx命令,获得一个node-id.json的文件 +* 将上述提到的json文件以提交Pull Request的形式上传到`https://github.com/irisnet/testnets/tree/master/testnets//gentx`目录下 +* 在完成提交后,irisnet测试网的负责人将统一发布genesis.json和config.toml文件到本地 +* 修改config.toml中的默认参数:`moniker` =\;`timeout_commit=5000` + +### 方法2:在网络启动后,先运行一个全节点,再绑定成为一个Validator + +若你错过了提交gentx的机会,你仍然可以成为一个测试网中的验证人。 + +步骤如下: + +* 运行一个全节点,具体方法在这里: +* 生成一个账户,从水龙头上领取10iris到这个账户中 +* 在确保了节点与网络保持同步后,通过执行以下命令将该节点绑定成为一个验证人节点 +``` +iriscli stake create-validator --amount=100iris --pubkey= --address-validator= --moniker= --chain-id= --from= +``` +* 检查节点状态: +``` +iriscli status +``` +若观察到`voting_power`的权重不为0,则说明绑定成功。 diff --git a/docs/get-started/install-iris.md b/docs/get-started/install-iris.md index de0f05f13..672c59efe 100644 --- a/docs/get-started/install-iris.md +++ b/docs/get-started/install-iris.md @@ -113,7 +113,8 @@ Get latest code (you can also `git fetch` only the version desired), ensure the ``` cd $GOPATH/src/github.com/irisnet/irishub git fetch -a origin -git checkout VERSION +rm Gopkg.lock +git checkout v0.4.0 make get_vendor_deps make install ``` \ No newline at end of file From 1be873629d9fb196ac9aa7cc854033620296a77e Mon Sep 17 00:00:00 2001 From: kidinamoto01 Date: Fri, 7 Sep 2018 15:32:10 +0800 Subject: [PATCH 21/24] add docs Chinese --- docs/get-started/docs_CN/README.md | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/docs/get-started/docs_CN/README.md b/docs/get-started/docs_CN/README.md index e23698ba5..e99b46e8b 100644 --- a/docs/get-started/docs_CN/README.md +++ b/docs/get-started/docs_CN/README.md @@ -1,17 +1,11 @@ # IRISnet测试网 - * [IRIShub 简介](#IRIShub-简介) - * [如何加入fuxi-2000测试网](#如何加入fuxi-1002测试网) - * [安装IRIShub](#安装IRIShub) - * [部署一个全节点](#部署一个全节点) - * [测试IRISHub相关功能](#测试IRISHub相关功能) - ## IRIShub 简介 IRIS Hub是在Cosmos生态中的区域性枢纽,提供iService服务 -## 如何加入fuxi-2000测试网 +## 如何加入fuxi-3000测试网 ### 安装IRIShub @@ -39,10 +33,10 @@ IRIS Hub是用Go语言编写的。它可以在任何能够编译并运行Go语 执行以下命令,若出现对应的版本号则说明安装成功。 ``` $ iris version -v0.3.4 +v0.4.0 $ iriscli version -v0.3.4 +v0.4.0 ``` #### 方法2:源码编译安装 @@ -109,11 +103,11 @@ make get_vendor_deps && make install 以上命令将完成 iris 和 iriscli的安装. 若出现对应的版本号则说明安装成功。 ``` - $ iris version - v0.4.0 +$ iris version +v0.4.0 - $ iriscli version - v0.4.0 +$ iriscli version +v0.4.0 ``` ### 部署一个全节点 From f690f53fdc4d15849c9a4d56c211315e9ff6140a Mon Sep 17 00:00:00 2001 From: programonkey <872127164@qq.com> Date: Fri, 7 Sep 2018 15:32:44 +0800 Subject: [PATCH 22/24] Update validator-node.md --- docs/get-started/validator-node.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/get-started/validator-node.md b/docs/get-started/validator-node.md index 33b624dcb..38d85826c 100644 --- a/docs/get-started/validator-node.md +++ b/docs/get-started/validator-node.md @@ -1,8 +1,8 @@ -#Running a Validator Node +# Running a Validator Node Before setting up your validator node, make sure you've already installed **Iris** by this [guide](full-node.md) -Validators are responsible for committing new blocks to the blockchain through voting. A validator's stake is slashed if they become unavailable, double sign a transaction, or don't cast their votes. Please read about Sentry Node Architecture to protect your node from DDOS attacks and to ensure high-availability. +Validators are responsible for committing new blocks to the blockchain through consensus. A validator's stake will be slashed if they become unavailable, double sign a transaction, or don't cast their votes. Please read about Sentry Node Architecture to protect your node from DDOS attacks and to ensure high-availability. ## Create A Validator @@ -16,7 +16,7 @@ You need to get `iris` and `iriscli` installed first. Then, follow the instructi iriscli keys add ``` -Then, you should print a password of at least 8 characters. +Then, you should set a password of at least 8 characters. The output will look like the following: ``` @@ -30,7 +30,7 @@ blast change tumble toddler rival ordinary chicken dirt physical club few langua You could see the address and public key of this account. Please node that account address in IRISnet will start with `faa` and public key of account will start with `fap`. -The seed phrase of this account will also be displayed. You could use these 24-character phrase to recover this account in another server. The recover command is: +The seed phrase of this account will also be displayed. You could use these 24 phrases to recover this account in another server. The recover command is: ``` iriscli keys add --recover ``` @@ -50,9 +50,9 @@ You can always get some `IRIS` by using the [Faucet](https://testnet.irisplorer ## Create A Validator -You need to get the public key of your node before upgrade your node to a validator node. The public key of will start `fvp`, it can be used to create a new validator by staking tokens. +You need to get the public key of your node before upgrade your node to a validator node. The public key of your node starts with `fvp`, it can be used to create a new validator by staking tokens. -You can find your validator pubkey by running: +You can find your validator's pubkey by running: ``` iris tendermint show_validator --home= @@ -86,7 +86,7 @@ View the validator's information with this command: iriscli stake validator --address-validator= --chain-id=game-of-genesis --node=tcp://localhost:26657 ``` -The `` is start with config.toml +The `` is your account address that starts with 'faa' ### Confirm Your Validator is Running From b51b8eda9538444203b986bfacad386237e167ed Mon Sep 17 00:00:00 2001 From: HaoyangLiu Date: Fri, 7 Sep 2018 16:07:04 +0800 Subject: [PATCH 23/24] IRISHUB-364: fix bug in genesis initialize --- Gopkg.lock | 239 ++++++++++++++++++++++++++++++++++++++++++++----- Gopkg.toml | 2 +- app/genesis.go | 4 +- 3 files changed, 218 insertions(+), 27 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index c4705c68d..29c97f705 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,47 +2,62 @@ [[projects]] + digest = "1:e92f5581902c345eb4ceffdcd4a854fb8f73cf436d47d837d1ec98ef1fe0a214" name = "github.com/StackExchange/wmi" packages = ["."] + pruneopts = "UT" revision = "5d049714c4a64225c3c79a7cf7d02f7fb5b96338" version = "1.0.0" [[projects]] + digest = "1:09a7f74eb6bb3c0f14d8926610c87f569c5cff68e978d30e9a3540aeb626fdf0" name = "github.com/bartekn/go-bip39" packages = ["."] + pruneopts = "UT" revision = "a05967ea095d81c8fe4833776774cfaff8e5036c" [[projects]] branch = "master" + digest = "1:d6afaeed1502aa28e80a4ed0981d570ad91b2579193404256ce672ed0a609e0d" name = "github.com/beorn7/perks" packages = ["quantile"] + pruneopts = "UT" revision = "3a771d992973f24aa725d07868b467d1ddfceafb" [[projects]] + digest = "1:1343a2963481a305ca4d051e84bc2abd16b601ee22ed324f8d605de1adb291b0" name = "github.com/bgentry/speakeasy" packages = ["."] + pruneopts = "UT" revision = "4aabc24848ce5fd31929f7d1e4ea74d3709c14cd" version = "v0.1.0" [[projects]] branch = "master" + digest = "1:70f6b224a59b2fa453debffa85c77f71063d8754b90c8c4fbad5794e2c382b0f" name = "github.com/brejski/hid" packages = ["."] + pruneopts = "UT" revision = "06112dcfcc50a7e0e4fd06e17f9791e788fdaafc" [[projects]] branch = "master" + digest = "1:2c00f064ba355903866cbfbf3f7f4c0fe64af6638cc7d1b8bdcf3181bc67f1d8" name = "github.com/btcsuite/btcd" packages = ["btcec"] + pruneopts = "UT" revision = "79e00513b1011888b1e675157ab89f527f901cae" [[projects]] + digest = "1:386de157f7d19259a7f9c81f26ce011223ce0f090353c1152ffdf730d7d10ac2" name = "github.com/btcsuite/btcutil" packages = ["bech32"] + pruneopts = "UT" revision = "d4cc87b860166d00d6b5b9e0d3b3d71d6088d4d4" [[projects]] - branch = "irisnet/refactor" + branch = "irisnet/develop" + digest = "1:30a362be7be5b3b0fe27e206577a77cff95f8cd11a12d1179f93934cccbe5663" name = "github.com/cosmos/cosmos-sdk" packages = [ "baseapp", @@ -89,29 +104,37 @@ "x/stake/client/rest", "x/stake/keeper", "x/stake/tags", - "x/stake/types" + "x/stake/types", ] - revision = "8a8f85781fe8296fb8ee40ed8e5dbb2581c82b60" + pruneopts = "UT" + revision = "1d5c081067680987f342d99c1c4087c477ea9b4a" source = "https://github.com/irisnet/cosmos-sdk.git" [[projects]] + digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec" name = "github.com/davecgh/go-spew" packages = ["spew"] + pruneopts = "UT" revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73" version = "v1.1.1" [[projects]] + digest = "1:c7644c73a3d23741fdba8a99b1464e021a224b7e205be497271a8003a15ca41b" name = "github.com/ebuchman/fail-test" packages = ["."] + pruneopts = "UT" revision = "95f809107225be108efcf10a3509e4ea6ceef3c4" [[projects]] + digest = "1:abeb38ade3f32a92943e5be54f55ed6d6e3b6602761d74b4aab4c9dd45c18abd" name = "github.com/fsnotify/fsnotify" packages = ["."] + pruneopts = "UT" revision = "c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9" version = "v1.4.7" [[projects]] + digest = "1:fdf5169073fb0ad6dc12a70c249145e30f4058647bea25f0abd48b6d9f228a11" name = "github.com/go-kit/kit" packages = [ "log", @@ -120,33 +143,41 @@ "metrics", "metrics/discard", "metrics/internal/lv", - "metrics/prometheus" + "metrics/prometheus", ] + pruneopts = "UT" revision = "4dc7be5d2d12881735283bcab7352178e190fc71" version = "v0.6.0" [[projects]] + digest = "1:31a18dae27a29aa074515e43a443abfd2ba6deb6d69309d8d7ce789c45f34659" name = "github.com/go-logfmt/logfmt" packages = ["."] + pruneopts = "UT" revision = "390ab7935ee28ec6b286364bba9b4dd6410cb3d5" version = "v0.3.0" [[projects]] + digest = "1:64a5a67c69b70c2420e607a8545d674a23778ed9c3e80607bfd17b77c6c87f6a" name = "github.com/go-ole/go-ole" packages = [ ".", - "oleutil" + "oleutil", ] + pruneopts = "UT" revision = "a41e3c4b706f6ae8dfbff342b06e40fa4d2d0506" version = "v1.2.1" [[projects]] + digest = "1:586ea76dbd0374d6fb649a91d70d652b7fe0ccffb8910a77468e7702e7901f3d" name = "github.com/go-stack/stack" packages = ["."] + pruneopts = "UT" revision = "2fee6af1a9795aafbe0253a0cfbdf668e1fb8a9a" version = "v1.8.0" [[projects]] + digest = "1:35621fe20f140f05a0c4ef662c26c0ab4ee50bca78aa30fe87d33120bd28165e" name = "github.com/gogo/protobuf" packages = [ "gogoproto", @@ -154,165 +185,208 @@ "proto", "protoc-gen-gogo/descriptor", "sortkeys", - "types" + "types", ] + pruneopts = "UT" revision = "636bf0302bc95575d69441b25a2603156ffdddf1" version = "v1.1.1" [[projects]] + digest = "1:17fe264ee908afc795734e8c4e63db2accabaf57326dbf21763a7d6b86096260" name = "github.com/golang/protobuf" packages = [ "proto", "ptypes", "ptypes/any", "ptypes/duration", - "ptypes/timestamp" + "ptypes/timestamp", ] + pruneopts = "UT" revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265" version = "v1.1.0" [[projects]] branch = "master" + digest = "1:4a0c6bb4805508a6287675fac876be2ac1182539ca8a32468d8128882e9d5009" name = "github.com/golang/snappy" packages = ["."] + pruneopts = "UT" revision = "2e65f85255dbc3072edf28d6b5b8efc472979f5a" [[projects]] + digest = "1:c79fb010be38a59d657c48c6ba1d003a8aa651fa56b579d959d74573b7dff8e1" name = "github.com/gorilla/context" packages = ["."] + pruneopts = "UT" revision = "08b5f424b9271eedf6f9f0ce86cb9396ed337a42" version = "v1.1.1" [[projects]] + digest = "1:e73f5b0152105f18bc131fba127d9949305c8693f8a762588a82a48f61756f5f" name = "github.com/gorilla/mux" packages = ["."] + pruneopts = "UT" revision = "e3702bed27f0d39777b0b37b664b6280e8ef8fbf" version = "v1.6.2" [[projects]] + digest = "1:43dd08a10854b2056e615d1b1d22ac94559d822e1f8b6fcc92c1a1057e85188e" name = "github.com/gorilla/websocket" packages = ["."] + pruneopts = "UT" revision = "ea4d1f681babbce9545c9c5f3d5194a789c89f5b" version = "v1.2.0" [[projects]] + digest = "1:ea40c24cdbacd054a6ae9de03e62c5f252479b96c716375aace5c120d68647c8" name = "github.com/hashicorp/hcl" packages = [ ".", "hcl/ast", "hcl/parser", - "hcl/printer", "hcl/scanner", "hcl/strconv", "hcl/token", "json/parser", "json/scanner", - "json/token" + "json/token", ] + pruneopts = "UT" revision = "8cb6e5b959231cc1119e43259c4a608f9c51a241" version = "v1.0.0" [[projects]] + digest = "1:870d441fe217b8e689d7949fef6e43efbc787e50f200cb1e70dbca9204a1d6be" name = "github.com/inconshreveable/mousetrap" packages = ["."] + pruneopts = "UT" revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" version = "v1.0" [[projects]] branch = "master" + digest = "1:39b27d1381a30421f9813967a5866fba35dc1d4df43a6eefe3b7a5444cb07214" name = "github.com/jmhodges/levigo" packages = ["."] + pruneopts = "UT" revision = "c42d9e0ca023e2198120196f842701bb4c55d7b9" [[projects]] branch = "master" + digest = "1:a64e323dc06b73892e5bb5d040ced475c4645d456038333883f58934abbf6f72" name = "github.com/kr/logfmt" packages = ["."] + pruneopts = "UT" revision = "b84e30acd515aadc4b783ad4ff83aff3299bdfe0" [[projects]] + digest = "1:c568d7727aa262c32bdf8a3f7db83614f7af0ed661474b24588de635c20024c7" name = "github.com/magiconair/properties" packages = ["."] + pruneopts = "UT" revision = "c2353362d570a7bfa228149c62842019201cfb71" version = "v1.8.0" [[projects]] + digest = "1:d4d17353dbd05cb52a2a52b7fe1771883b682806f68db442b436294926bbfafb" name = "github.com/mattn/go-isatty" packages = ["."] + pruneopts = "UT" revision = "0360b2af4f38e8d38c7fce2a9f4e702702d73a39" version = "v0.0.3" [[projects]] + digest = "1:ff5ebae34cfbf047d505ee150de27e60570e8c394b3b8fdbb720ff6ac71985fc" name = "github.com/matttproud/golang_protobuf_extensions" packages = ["pbutil"] + pruneopts = "UT" revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c" version = "v1.0.1" [[projects]] + digest = "1:645110e089152bd0f4a011a2648fbb0e4df5977be73ca605781157ac297f50c4" name = "github.com/mitchellh/mapstructure" packages = ["."] + pruneopts = "UT" revision = "fa473d140ef3c6adf42d6b391fe76707f1f243c8" version = "v1.0.0" [[projects]] + digest = "1:95741de3af260a92cc5c7f3f3061e85273f5a81b5db20d4bd68da74bd521675e" name = "github.com/pelletier/go-toml" packages = ["."] + pruneopts = "UT" revision = "c01d1270ff3e442a8a57cddc1c92dc1138598194" version = "v1.2.0" [[projects]] + digest = "1:40e195917a951a8bf867cd05de2a46aaf1806c50cf92eebf4c16f78cd196f747" name = "github.com/pkg/errors" packages = ["."] + pruneopts = "UT" revision = "645ef00459ed84a119197bfb8d8205042c6df63d" version = "v0.8.0" [[projects]] + digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe" name = "github.com/pmezard/go-difflib" packages = ["difflib"] + pruneopts = "UT" revision = "792786c7400a136282c1664665ae0a8db921c6c2" version = "v1.0.0" [[projects]] + digest = "1:c1a04665f9613e082e1209cf288bf64f4068dcd6c87a64bf1c4ff006ad422ba0" name = "github.com/prometheus/client_golang" packages = [ "prometheus", - "prometheus/promhttp" + "prometheus/promhttp", ] + pruneopts = "UT" revision = "ae27198cdd90bf12cd134ad79d1366a6cf49f632" [[projects]] branch = "master" + digest = "1:2d5cd61daa5565187e1d96bae64dbbc6080dacf741448e9629c64fd93203b0d4" name = "github.com/prometheus/client_model" packages = ["go"] + pruneopts = "UT" revision = "5c3871d89910bfb32f5fcab2aa4b9ec68e65a99f" [[projects]] branch = "master" + digest = "1:63b68062b8968092eb86bedc4e68894bd096ea6b24920faca8b9dcf451f54bb5" name = "github.com/prometheus/common" packages = [ "expfmt", "internal/bitbucket.org/ww/goautoneg", - "model" + "model", ] + pruneopts = "UT" revision = "c7de2306084e37d54b8be01f3541a8464345e9a5" [[projects]] branch = "master" + digest = "1:8c49953a1414305f2ff5465147ee576dd705487c35b15918fcd4efdc0cb7a290" name = "github.com/prometheus/procfs" packages = [ ".", "internal/util", "nfs", - "xfs" + "xfs", ] + pruneopts = "UT" revision = "05ee40e3a273f7245e8777337fc7b46e533a9a92" [[projects]] + digest = "1:c4556a44e350b50a490544d9b06e9fba9c286c21d6c0e47f54f3a9214597298c" name = "github.com/rcrowley/go-metrics" packages = ["."] + pruneopts = "UT" revision = "e2704e165165ec55d062f5919b4b29494e9fa790" [[projects]] + digest = "1:22e4289b3741da96aceecc4d1dcbf682ae167c759d010fd88c63c65c9a2e8c72" name = "github.com/shirou/gopsutil" packages = [ "cpu", @@ -321,67 +395,85 @@ "internal/common", "mem", "net", - "process" + "process", ] + pruneopts = "UT" revision = "8048a2e9c5773235122027dd585cf821b2af1249" version = "v2.18.07" [[projects]] branch = "master" + digest = "1:99c6a6dab47067c9b898e8c8b13d130c6ab4ffbcc4b7cc6236c2cd0b1e344f5b" name = "github.com/shirou/w32" packages = ["."] + pruneopts = "UT" revision = "bb4de0191aa41b5507caa14b0650cdbddcd9280b" [[projects]] + digest = "1:bd1ae00087d17c5a748660b8e89e1043e1e5479d0fea743352cda2f8dd8c4f84" name = "github.com/spf13/afero" packages = [ ".", - "mem" + "mem", ] + pruneopts = "UT" revision = "787d034dfe70e44075ccc060d346146ef53270ad" version = "v1.1.1" [[projects]] + digest = "1:516e71bed754268937f57d4ecb190e01958452336fa73dbac880894164e91c1f" name = "github.com/spf13/cast" packages = ["."] + pruneopts = "UT" revision = "8965335b8c7107321228e3e3702cab9832751bac" version = "v1.2.0" [[projects]] + digest = "1:7ffc0983035bc7e297da3688d9fe19d60a420e9c38bef23f845c53788ed6a05e" name = "github.com/spf13/cobra" packages = ["."] + pruneopts = "UT" revision = "7b2c5ac9fc04fc5efafb60700713d4fa609b777b" version = "v0.0.1" [[projects]] branch = "master" + digest = "1:8a020f916b23ff574845789daee6818daf8d25a4852419aae3f0b12378ba432a" name = "github.com/spf13/jwalterweatherman" packages = ["."] + pruneopts = "UT" revision = "14d3d4c518341bea657dd8a226f5121c0ff8c9f2" [[projects]] + digest = "1:dab83a1bbc7ad3d7a6ba1a1cc1760f25ac38cdf7d96a5cdd55cd915a4f5ceaf9" name = "github.com/spf13/pflag" packages = ["."] + pruneopts = "UT" revision = "9a97c102cda95a86cec2345a6f09f55a939babf5" version = "v1.0.2" [[projects]] + digest = "1:f8e1a678a2571e265f4bf91a3e5e32aa6b1474a55cb0ea849750cc177b664d96" name = "github.com/spf13/viper" packages = ["."] + pruneopts = "UT" revision = "25b30aa063fc18e48662b86996252eabdcf2f0c7" version = "v1.0.0" [[projects]] + digest = "1:7e8d267900c7fa7f35129a2a37596e38ed0f11ca746d6d9ba727980ee138f9f6" name = "github.com/stretchr/testify" packages = [ "assert", - "require" + "require", ] + pruneopts = "UT" revision = "12b6f73e6084dad08a7c6e575284b177ecafbc71" version = "v1.2.1" [[projects]] branch = "master" + digest = "1:f2ffd421680b0a3f7887501b3c6974bcf19217ecd301d0e2c9b681940ec363d5" name = "github.com/syndtr/goleveldb" packages = [ "leveldb", @@ -395,35 +487,43 @@ "leveldb/opt", "leveldb/storage", "leveldb/table", - "leveldb/util" + "leveldb/util", ] + pruneopts = "UT" revision = "ae2bd5eed72d46b28834ec3f60db3a3ebedd8dbd" [[projects]] branch = "master" + digest = "1:087aaa7920e5d0bf79586feb57ce01c35c830396ab4392798112e8aae8c47722" name = "github.com/tendermint/ed25519" packages = [ ".", "edwards25519", - "extra25519" + "extra25519", ] + pruneopts = "UT" revision = "d8387025d2b9d158cf4efb07e7ebf814bcce2057" [[projects]] + digest = "1:e0a2a4be1e20c305badc2b0a7a9ab7fef6da500763bec23ab81df3b5f9eec9ee" name = "github.com/tendermint/go-amino" packages = ["."] + pruneopts = "UT" revision = "a8328986c1608950fa5d3d1c0472cccc4f8fc02c" version = "v0.12.0-rc0" [[projects]] branch = "irisnet/feature_upgrade" + digest = "1:54f4d8af39f33769cd0d9de09141a676283d2948a349c9ae72dc39dfd6a6aae8" name = "github.com/tendermint/iavl" packages = ["."] + pruneopts = "UT" revision = "849c21e8f93ce782cb9f9f64fabcccb5580b4f90" source = "https://github.com/irisnet/iavl.git" [[projects]] branch = "irisnet/develop" + digest = "1:3b9a2a8316e40b16dcd3f5f42e467b049b5d68465a5d8360014d0b3acebd570e" name = "github.com/tendermint/tendermint" packages = [ "abci/client", @@ -483,18 +583,22 @@ "state/txindex/kv", "state/txindex/null", "types", - "version" + "version", ] + pruneopts = "UT" revision = "c7737b350a9453bab6571d8d5f489a590609d6f2" source = "https://github.com/irisnet/tendermint.git" [[projects]] + digest = "1:4dcb0dd65feecb068ce23a234d1a07c7868a1e39f52a6defcae0bb371d03abf6" name = "github.com/zondax/ledger-goclient" packages = ["."] + pruneopts = "UT" revision = "4296ee5701e945f9b3a7dbe51f402e0b9be57259" [[projects]] branch = "master" + digest = "1:27507554c6d4f060d8d700c31c624a43d3a92baa634e178ddc044bdf7d13b44a" name = "golang.org/x/crypto" packages = [ "blowfish", @@ -510,11 +614,13 @@ "pbkdf2", "poly1305", "ripemd160", - "salsa20/salsa" + "salsa20/salsa", ] + pruneopts = "UT" revision = "614d502a4dac94afa3a6ce146bd1736da82514c6" [[projects]] + digest = "1:d36f55a999540d29b6ea3c2ea29d71c76b1d9853fdcd3e5c5cb4836f2ba118f1" name = "golang.org/x/net" packages = [ "context", @@ -524,21 +630,25 @@ "idna", "internal/timeseries", "netutil", - "trace" + "trace", ] + pruneopts = "UT" revision = "292b43bbf7cb8d35ddf40f8d5100ef3837cced3f" [[projects]] branch = "master" + digest = "1:4127b29f1944eff530af85b792ea671e77efbeceffc0a9394f55c8da9798caf0" name = "golang.org/x/sys" packages = [ "cpu", "unix", - "windows" + "windows", ] + pruneopts = "UT" revision = "4910a1d54f876d7b22162a85f4d066d3ee649450" [[projects]] + digest = "1:a2ab62866c75542dd18d2b069fec854577a20211d7c0ea6ae746072a1dccdd18" name = "golang.org/x/text" packages = [ "collate", @@ -554,18 +664,22 @@ "unicode/bidi", "unicode/cldr", "unicode/norm", - "unicode/rangetable" + "unicode/rangetable", ] + pruneopts = "UT" revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" version = "v0.3.0" [[projects]] branch = "master" + digest = "1:077c1c599507b3b3e9156d17d36e1e61928ee9b53a5b420f10f28ebd4a0b275c" name = "google.golang.org/genproto" packages = ["googleapis/rpc/status"] + pruneopts = "UT" revision = "c66870c02cf823ceb633bcd05be3c7cda29976f4" [[projects]] + digest = "1:2dab32a43451e320e49608ff4542fdfc653c95dcc35d0065ec9c6c3dd540ed74" name = "google.golang.org/grpc" packages = [ ".", @@ -592,20 +706,97 @@ "stats", "status", "tap", - "transport" + "transport", ] + pruneopts = "UT" revision = "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" version = "v1.13.0" [[projects]] + digest = "1:342378ac4dcb378a5448dd723f0784ae519383532f5e70ade24132c4c8693202" name = "gopkg.in/yaml.v2" packages = ["."] + pruneopts = "UT" revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" version = "v2.2.1" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "7a5d70db7b6b5b7ea2ba66d9363a28af74f9d7877531c4d898c0f32beabd03bf" + input-imports = [ + "github.com/cosmos/cosmos-sdk/baseapp", + "github.com/cosmos/cosmos-sdk/client", + "github.com/cosmos/cosmos-sdk/client/context", + "github.com/cosmos/cosmos-sdk/client/keys", + "github.com/cosmos/cosmos-sdk/client/rpc", + "github.com/cosmos/cosmos-sdk/client/tx", + "github.com/cosmos/cosmos-sdk/client/utils", + "github.com/cosmos/cosmos-sdk/crypto/keys", + "github.com/cosmos/cosmos-sdk/server", + "github.com/cosmos/cosmos-sdk/server/config", + "github.com/cosmos/cosmos-sdk/store", + "github.com/cosmos/cosmos-sdk/types", + "github.com/cosmos/cosmos-sdk/version", + "github.com/cosmos/cosmos-sdk/wire", + "github.com/cosmos/cosmos-sdk/x/auth", + "github.com/cosmos/cosmos-sdk/x/auth/client/cli", + "github.com/cosmos/cosmos-sdk/x/auth/client/context", + "github.com/cosmos/cosmos-sdk/x/auth/client/rest", + "github.com/cosmos/cosmos-sdk/x/bank", + "github.com/cosmos/cosmos-sdk/x/bank/client", + "github.com/cosmos/cosmos-sdk/x/bank/client/cli", + "github.com/cosmos/cosmos-sdk/x/bank/client/rest", + "github.com/cosmos/cosmos-sdk/x/gov", + "github.com/cosmos/cosmos-sdk/x/gov/client/cli", + "github.com/cosmos/cosmos-sdk/x/gov/client/rest", + "github.com/cosmos/cosmos-sdk/x/gov/tags", + "github.com/cosmos/cosmos-sdk/x/ibc", + "github.com/cosmos/cosmos-sdk/x/ibc/client/cli", + "github.com/cosmos/cosmos-sdk/x/ibc/client/rest", + "github.com/cosmos/cosmos-sdk/x/mock", + "github.com/cosmos/cosmos-sdk/x/mock/simulation", + "github.com/cosmos/cosmos-sdk/x/params", + "github.com/cosmos/cosmos-sdk/x/slashing", + "github.com/cosmos/cosmos-sdk/x/slashing/client/cli", + "github.com/cosmos/cosmos-sdk/x/slashing/client/rest", + "github.com/cosmos/cosmos-sdk/x/stake", + "github.com/cosmos/cosmos-sdk/x/stake/client/cli", + "github.com/cosmos/cosmos-sdk/x/stake/client/rest", + "github.com/cosmos/cosmos-sdk/x/stake/types", + "github.com/go-kit/kit/metrics", + "github.com/go-kit/kit/metrics/prometheus", + "github.com/gorilla/mux", + "github.com/pelletier/go-toml", + "github.com/pkg/errors", + "github.com/prometheus/client_golang/prometheus", + "github.com/prometheus/client_golang/prometheus/promhttp", + "github.com/shirou/gopsutil/cpu", + "github.com/shirou/gopsutil/disk", + "github.com/shirou/gopsutil/mem", + "github.com/shirou/gopsutil/process", + "github.com/spf13/cobra", + "github.com/spf13/pflag", + "github.com/spf13/viper", + "github.com/stretchr/testify/assert", + "github.com/stretchr/testify/require", + "github.com/tendermint/tendermint/abci/server", + "github.com/tendermint/tendermint/abci/types", + "github.com/tendermint/tendermint/blockchain", + "github.com/tendermint/tendermint/consensus", + "github.com/tendermint/tendermint/crypto", + "github.com/tendermint/tendermint/crypto/ed25519", + "github.com/tendermint/tendermint/crypto/tmhash", + "github.com/tendermint/tendermint/libs/cli", + "github.com/tendermint/tendermint/libs/common", + "github.com/tendermint/tendermint/libs/db", + "github.com/tendermint/tendermint/libs/log", + "github.com/tendermint/tendermint/mempool", + "github.com/tendermint/tendermint/node", + "github.com/tendermint/tendermint/rpc/client", + "github.com/tendermint/tendermint/rpc/core/types", + "github.com/tendermint/tendermint/rpc/lib/server", + "github.com/tendermint/tendermint/state", + "github.com/tendermint/tendermint/types", + ] solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 2be8a1832..12be6a81e 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -29,7 +29,7 @@ [[constraint]] name = "github.com/cosmos/cosmos-sdk" source = "https://github.com/irisnet/cosmos-sdk.git" - branch = "irisnet/refactor" + branch = "irisnet/develop" [[override]] name = "github.com/golang/protobuf" diff --git a/app/genesis.go b/app/genesis.go index 30a7a2b52..0bb7b88b1 100644 --- a/app/genesis.go +++ b/app/genesis.go @@ -57,7 +57,7 @@ var ( flagName = "name" flagClientHome = "home-client" flagOWK = "owk" - denom = "iris" + denom = "iris-atto" feeAmt = int64(100) IrisCt = types.NewDefaultCoinType(denom) freeFermionVal ,_ = IrisCt.ConvertToMinCoin(fmt.Sprintf("%d%s",feeAmt,denom)) @@ -176,7 +176,7 @@ func IrisAppGenState(cdc *wire.Codec, appGenTxs []json.RawMessage) (genesisState // add some new shares to the validator var issuedDelShares sdk.Rat - validator, stakeData.Pool, issuedDelShares = validator.AddTokensFromDel(stakeData.Pool, feeAmt) + validator, stakeData.Pool, issuedDelShares = validator.AddTokensFromDel(stakeData.Pool, freeFermionVal.Amount) //validator.TokenPrecision = stakeData.Params.DenomPrecision stakeData.Validators = append(stakeData.Validators, validator) From b961670d6edb1531bfd3888ba6ba8768d6002c12 Mon Sep 17 00:00:00 2001 From: kidinamoto01 Date: Fri, 7 Sep 2018 17:24:00 +0800 Subject: [PATCH 24/24] IRISTNET-121 Modify commands --- docs/get-started/Genesis Generation Process.md | 2 +- docs/get-started/docs_CN/Genesis-generation.md | 8 ++++---- docs/get-started/docs_CN/README.md | 4 ++-- ...71\345\217\212\345\205\266\346\220\255\345\273\272.md" | 8 ++++---- ...14\350\257\201\344\272\272\350\212\202\347\202\271.md" | 2 +- docs/get-started/full-node.md | 4 ++-- docs/get-started/tools/Setup_Sentrynode.md | 8 ++++---- docs/get-started/validator-node.md | 8 ++++---- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/get-started/Genesis Generation Process.md b/docs/get-started/Genesis Generation Process.md index 6f079cb6e..715f775bc 100644 --- a/docs/get-started/Genesis Generation Process.md +++ b/docs/get-started/Genesis Generation Process.md @@ -10,7 +10,7 @@ Please run the `gen-tx` command to generate files. ``` -iris init gen-tx --name= --home= --ip= +iris init gen-tx --name=your_name --home=path_to_home --ip=Your_public_IP ``` You could see the following output: diff --git a/docs/get-started/docs_CN/Genesis-generation.md b/docs/get-started/docs_CN/Genesis-generation.md index a64d29449..e43254019 100644 --- a/docs/get-started/docs_CN/Genesis-generation.md +++ b/docs/get-started/docs_CN/Genesis-generation.md @@ -6,14 +6,14 @@ 2. 执行gentx命令,获得一个node-id.json的文件。这个操作将默认生成一个余额为200IRIS的账户,该账户默认绑定100IRIS成为一个验证人候选人。 ``` - iris init gen-tx --name= --home= --ip= + iris init gen-tx --name=your_name --home=path_to_home --ip=Your_public_IP ``` 代码示例: - ``` +``` iris init gen-tx --name=alice - ``` +``` - ``` +``` { "app_message": { "secret": "similar spread grace kite security age pig easy always prize salon clip exhibit electric art abandon" diff --git a/docs/get-started/docs_CN/README.md b/docs/get-started/docs_CN/README.md index e99b46e8b..10bdd015e 100644 --- a/docs/get-started/docs_CN/README.md +++ b/docs/get-started/docs_CN/README.md @@ -119,7 +119,7 @@ iris在运行过程中所依赖的配置文件和数据会存放在\$IRISHOME下 * **初始化** 执行以下操作, ``` - iris init --home= + iris init --home=iris-home ``` 会在$IRISHOME下创建两个文件夹:/config 和 /data。/config终会包含两个重要文件:genesis.json 和config.toml。genesis文件中定义了区块链网络的初始状态,而config.toml指定了iris软件模块的重要组成部分。 @@ -193,7 +193,7 @@ iris unsafe_reset_all --home=$IRIShome 通过以下命令启动全节点,并将日志输出到文件中: - iris start --home > log文件地址 & + iris start --home path_to_your_home > log文件地址 & 通过执行以下操作确认节点的运行状态: diff --git "a/docs/get-started/docs_CN/tools/\345\223\250\345\205\265\350\212\202\347\202\271\345\217\212\345\205\266\346\220\255\345\273\272.md" "b/docs/get-started/docs_CN/tools/\345\223\250\345\205\265\350\212\202\347\202\271\345\217\212\345\205\266\346\220\255\345\273\272.md" index 7913b2694..52495dc2f 100644 --- "a/docs/get-started/docs_CN/tools/\345\223\250\345\205\265\350\212\202\347\202\271\345\217\212\345\205\266\346\220\255\345\273\272.md" +++ "b/docs/get-started/docs_CN/tools/\345\223\250\345\205\265\350\212\202\347\202\271\345\217\212\345\205\266\346\220\255\345\273\272.md" @@ -25,13 +25,13 @@ iris init --name="sentry" --home=sentry --home-client=sentry 然后将验证人节点中的genesis.json文件复制到 < sentry home>/config/目录下。接下来对< sentry home>/config/目录下的config.tmol进行编辑。需要进行如下修改: ``` -private_peers_ids="" +private_peers_ids="validator_node_id" ``` 这里的< validator node id>可以在验证人节点上使用iriscli status命令获得。经过这样设置之后然后使用 ``` -iris init --home= +iris init --home=sentry_home ``` 启动哨兵节点。对每个哨兵节点都需要进行这些操作。 @@ -41,7 +41,7 @@ iris init --home= 接下来需要对验证人节点的< validator home>/config/目录下的config.tmol进行修改: ``` -persistent_peers="@" +persistent_peers="sentry node id@sentry listen address" ``` 这里只写sentry节点的node id和地址,多个哨兵节点的信息使用逗号分开。 @@ -50,5 +50,5 @@ persistent_peers="@" 这里的< sentry node id>可以在哨兵节点上使用iriscli status命令获得。修改完成后需要重启验证人节点使修改生效。 ``` -iris init --home= +iris init --home=validator node home ``` diff --git "a/docs/get-started/docs_CN/\350\277\220\350\241\214\344\270\200\344\270\252\351\252\214\350\257\201\344\272\272\350\212\202\347\202\271.md" "b/docs/get-started/docs_CN/\350\277\220\350\241\214\344\270\200\344\270\252\351\252\214\350\257\201\344\272\272\350\212\202\347\202\271.md" index 786850751..0afe1e9fc 100644 --- "a/docs/get-started/docs_CN/\350\277\220\350\241\214\344\270\200\344\270\252\351\252\214\350\257\201\344\272\272\350\212\202\347\202\271.md" +++ "b/docs/get-started/docs_CN/\350\277\220\350\241\214\344\270\200\344\270\252\351\252\214\350\257\201\344\272\272\350\212\202\347\202\271.md" @@ -29,7 +29,7 @@ * 生成一个账户,从水龙头上领取10iris到这个账户中 * 在确保了节点与网络保持同步后,通过执行以下命令将该节点绑定成为一个验证人节点 ``` -iriscli stake create-validator --amount=100iris --pubkey= --address-validator= --moniker= --chain-id= --from= +iriscli stake create-validator --amount=100iris --pubkey=pubkey --address-validator= --moniker= --chain-id= --from= ``` * 检查节点状态: ``` diff --git a/docs/get-started/full-node.md b/docs/get-started/full-node.md index c7810cf31..1bf3136b6 100644 --- a/docs/get-started/full-node.md +++ b/docs/get-started/full-node.md @@ -9,7 +9,7 @@ These instructions are for setting up a brand new full node from scratch. First, initialize the node and create the necessary config files: ``` -iris init --name --home= +iris init --name your_custom_name --home=IRISHOME ``` > Note: Only ASCII characters are supported for the `--name`. Using Unicode characters will render your node unreachable. @@ -37,7 +37,7 @@ You could customized the `moniker` and `external_address` fields. ``` # A custom human readable name for this node moniker = "" -external_address = ":26656" +external_address = "your-public-IP:26656" ``` diff --git a/docs/get-started/tools/Setup_Sentrynode.md b/docs/get-started/tools/Setup_Sentrynode.md index 8d1da7ffa..328867153 100644 --- a/docs/get-started/tools/Setup_Sentrynode.md +++ b/docs/get-started/tools/Setup_Sentrynode.md @@ -18,7 +18,7 @@ On the sentry node's side, you need to get fully initialized first. Then, you should edit its `config.tmol` file, and change `private_peers_id` field: ``` -private_peers_ids="" +private_peers_ids="validator_node_id" ``` `validator node id` is the `node-id` of validator node. @@ -26,7 +26,7 @@ private_peers_ids="" Then you could start your sentry node, ``` -iris start --home= +iris start --home=sentry_home ``` If you have multiple sentry node, you could make them as `persistent-peers` to each other. @@ -38,7 +38,7 @@ On the validator node's side, you also need to get fully initialized first, and Then, you should edit its `config.tmol` file, ``` -persistent_peers="@" +persistent_peers="sentry_node_id@sentry_listen_address" ``` If you want to put multiple sentry info, you need to separate the information with `,` @@ -52,7 +52,7 @@ In this way, the validator node will diable its peer reactor, so it will not res Then you could start your validator node, ``` -iris start --home= +iris start --home=sentry_home ``` It's also recommanded to enable the firewall of validator node. diff --git a/docs/get-started/validator-node.md b/docs/get-started/validator-node.md index 33b624dcb..5f8563b96 100644 --- a/docs/get-started/validator-node.md +++ b/docs/get-started/validator-node.md @@ -74,7 +74,7 @@ Please note the **amount** needs to be the **minimium unit** of IRIS. In this way, to stake 1IRIS, you need to do: ``` -iriscli stake create-validator --pubkey= --address-validator= --fee=40000000000000000iris --gas=2000000 --from= --chain-id=game-of-genesis --node=tcp://localhost:26657 --amount=1000000000000000000iris +iriscli stake create-validator --pubkey=pubkey --address-validator=account --fee=40000000000000000iris --gas=2000000 --from= --chain-id=game-of-genesis --node=tcp://localhost:26657 --amount=1000000000000000000iris ``` Don't forget the `fee` and `gas` field. To read more about fees in IRISHub, you should read [this](/modules/fee-token/feeToken.md) @@ -83,7 +83,7 @@ Don't forget the `fee` and `gas` field. To read more about fees in IRISHub, you View the validator's information with this command: ``` -iriscli stake validator --address-validator= --chain-id=game-of-genesis --node=tcp://localhost:26657 +iriscli stake validator --address-validator=account --chain-id=game-of-genesis --node=tcp://localhost:26657 ``` The `` is start with config.toml @@ -106,8 +106,8 @@ You can edit your validator's public description. This info is to identify your You should put your name of your team in `details`. ``` -iriscli stake edit-validator --address-validator= --moniker="choose a moniker" --website="https://irisnet.org" --details="team" --chain-id=game-of-genesis - --name= --node=tcp://localhost:26657 --fee=40000000000000000iris --gas=2000000 +iriscli stake edit-validator --address-validator=account --moniker="choose a moniker" --website="https://irisnet.org" --details="team" --chain-id=game-of-genesis + --name=key_name --node=tcp://localhost:26657 --fee=40000000000000000iris --gas=2000000 ``` ### View Validator Description