Skip to content

Commit

Permalink
Launch euler-2 testnet (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
hleb-albau committed Feb 23, 2019
1 parent 7f7aa02 commit b7897fe
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ jobs:
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker tag build/cyberd cyberd/cyberd:euler-$CIRCLE_TAG
docker push cyberd/cyberd:euler-$CIRCLE_TAG
docker tag build/cyberd cyberd/cyberd:euler-1
docker push cyberd/cyberd:euler-1
docker tag build/cyberd cyberd/cyberd:euler-2
docker push cyberd/cyberd:euler-2
no_output_timeout: 30m


Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends wget curl
# Download genesis file and links file from IPFS
###############################################################################
# To slow using ipget, currently we use gateway
RUN wget -O /genesis.json https://ipfs.io/ipfs/QmSFTpNaXB3FhB4EWjsrUydupZXTL8Z44c2j18o5CGnN5h
RUN wget -O /links https://ipfs.io/ipfs/QmepwmLe7vQcK2W6WmvfEk46de3cJ4Jp6jXRXNhuR2AfJ9
RUN wget -O /config.toml https://ipfs.io/ipfs/QmVVVnAM8TuheEq1gu3nNhz3MxcjB3XAEEzQgzyerp967c
RUN wget -O /genesis.json https://ipfs.io/ipfs/QmQ88ZGztF7QvZc9nHnXZ161jn8WWDzfaAQyxPtAm8TDfh
RUN wget -O /links https://ipfs.io/ipfs/QmWMF9e4vJdz4UES4w6nJAnN8yfFP2qCugpVM6sRJ3hNVp
RUN wget -O /config.toml https://ipfs.io/ipfs/QmRgCPd5oeXAcSP5nJaNZpaXjy2Aefj6qFoPh4Wy1mTQEG

WORKDIR /

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# cyberd. Knowledge consensus computer
![banner](logo.png)

[![testnet](https://img.shields.io/badge/testnet-euler--1-green.svg?style=flat-square)](https://github.com/cybercongress/cyberd/blob/master/docs/run_validator.md)
[![testnet](https://img.shields.io/badge/testnet-euler--2-green.svg?style=flat-square)](https://github.com/cybercongress/cyberd/blob/master/docs/run_validator.md)
[![version](https://img.shields.io/github/release/cybercongress/cyberd.svg?style=flat-square)](https://github.com/cybercongress/cyberd/releases/latest)
[![CircleCI](https://img.shields.io/circleci/project/github/cybercongress/cyberd.svg?style=flat-square)](https://circleci.com/gh/cybercongress/cyberd/tree/master)
[![license](https://img.shields.io/badge/License-Cyber-brightgreen.svg?style=flat-square)](https://github.com/cybercongress/cyberd/blob/master/LICENSE)
Expand Down
1 change: 1 addition & 0 deletions app/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func NewDefaultGenesisState() GenesisState {
Params: types.Params{
UnbondingTime: defaultUnbondingTime,
MaxValidators: 146,
MaxEntries: 7,
BondDenom: coin.CYB,
},
},
Expand Down
4 changes: 4 additions & 0 deletions daemon/cmd/gentx.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const (
defaultCommissionRate = "0.1"
defaultCommissionMaxRate = "0.2"
defaultCommissionMaxChangeRate = "0.01"
defaultMinSelfDelegation = "1"
)

// GenTxCmd builds the cyberd gentx command.
Expand Down Expand Up @@ -211,6 +212,9 @@ func prepareFlagsForTxCreateValidator(config *cfg.Config, nodeID, ip, chainID st
if viper.GetString(cli.FlagCommissionMaxChangeRate) == "" {
viper.Set(cli.FlagCommissionMaxChangeRate, defaultCommissionMaxChangeRate)
}
if viper.GetString(cli.FlagMinSelfDelegation) == "" {
viper.Set(cli.FlagMinSelfDelegation, defaultMinSelfDelegation)
}
}

func readUnsignedGenTxFile(cdc *codec.Codec, r io.Reader) (auth.StdTx, error) {
Expand Down
2 changes: 1 addition & 1 deletion daemon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func exportAppStateAndTMValidators(
logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailWhiteList []string,
) (json.RawMessage, []tmtypes.GenesisValidator, error) {

capp := app.NewCyberdApp(logger, db, app.Options{})
capp := app.NewCyberdApp(logger, db, app.Options{ComputeUnit: rank.GPU})
return capp.ExportAppStateAndValidators()
}

Expand Down
2 changes: 1 addition & 1 deletion docs/run_validator.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Join Cyberd Network As Validator

**Note**. Currently active dev testnet is `euler-1` (substitute <testnet_chain_id> with that value).
**Note**. Currently active dev testnet is `euler-2` (substitute <testnet_chain_id> with that value).

## Prepare your server

Expand Down
2 changes: 1 addition & 1 deletion start_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if [ $status -ne 0 ]; then
fi

# Start the second process
cyberdcli rest-server --cors=* --trust-node --chain-id=euler-1 --laddr=tcp://0.0.0.0:1317 --indent --insecure --home=/root/.cyberdcli_fakepath . &
cyberdcli rest-server --cors=* --trust-node --chain-id=euler-2 --laddr=tcp://0.0.0.0:1317 --indent --home=/root/.cyberdcli_fakepath . &
status=$?
if [ $status -ne 0 ]; then
echo "Failed to start cyberd light-client: $status"
Expand Down
8 changes: 4 additions & 4 deletions testnet/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ laddr = "tcp://0.0.0.0:26656"
external_address = ""

# Comma separated list of seed nodes to connect to
seeds = "be8abfd40b22c253180136df5cf56c0dbedee20c@86.57.254.202:26656,20ed708df6c30183e384bbdd65ee27f60bbb0df4@93.125.26.210:34656"
seeds = "be8abfd40b22c253180136df5cf56c0dbedee20c@86.57.254.202:26656,880e8eb37fd0fa3aaeb82778d273d5beb5bb9fa8@93.125.26.210:34656"

# Comma separated list of nodes to keep persistent connections to
persistent_peers = ""
Expand All @@ -131,7 +131,7 @@ addr_book_strict = true
max_num_inbound_peers = 40

# Maximum number of outbound peers to connect to, excluding persistent peers
max_num_outbound_peers = 10
max_num_outbound_peers = 40

# Time to wait before flushing messages out on the connection
flush_throttle_timeout = "100ms"
Expand All @@ -140,10 +140,10 @@ flush_throttle_timeout = "100ms"
max_packet_msg_payload_size = 1024

# Rate at which packets can be sent, in bytes/second
send_rate = 5120000
send_rate = 40960000

# Rate at which packets can be received, in bytes/second
recv_rate = 5120000
recv_rate = 40960000

# Set true to enable the peer-exchange reactor
pex = true
Expand Down
2 changes: 2 additions & 0 deletions x/rank/calculate.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package rank

import (
"encoding/hex"
"github.com/tendermint/tendermint/libs/log"
"time"
)
Expand All @@ -22,6 +23,7 @@ func CalculateRank(ctx *CalculationContext, unit ComputeUnit, logger log.Logger)
}
logger.Info(
"Rank calculated", "time", time.Since(start), "links", ctx.linksCount, "cids", ctx.cidsCount,
"hash", hex.EncodeToString(rank.MerkleTree.RootHash()),
)
return
}
Expand Down
2 changes: 1 addition & 1 deletion x/rank/calculate_cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func step(ctx *CalculationContext, defaultRankWithCorrection float64, prevrank [
_, sortedCids, ok := ctx.GetSortedInLinks(i)

if !ok {
rank[i] = defaultRankWithCorrection
return
} else {
ksum := float64(0)
for _, j := range sortedCids {
Expand Down

0 comments on commit b7897fe

Please sign in to comment.