Giter Site home page Giter Site logo

terra-money / classic-core Goto Github PK

View Code? Open in Web Editor NEW
980.0 91.0 289.0 110.93 MB

GO implementation of the Terra Protocol

Home Page: https://www.terra.money

License: Other

Makefile 0.31% Go 36.54% Dockerfile 0.07% Shell 0.58% Python 0.44% HTML 0.07% JavaScript 61.98%

classic-core's Introduction

What is Terra Classic?

Terra is a public, open-source blockchain protocol that provides fundamental infrastructure for a decentralized economy and enables open participation in the creation of new financial primitives to power the innovation of money.

Classic is the reference implementation of the Terra protocol, written in Golang. Terra Core is built atop Cosmos SDK and uses Tendermint BFT consensus. If you intend to work on Terra Core source, it is recommended that you familiarize yourself with the concepts in those projects.

Upon the implosion of Terra, a group of rebels seized control of the blockchain. Terra's future is uncertain, but the rebels are now firmly in control.

Installation

Binaries

The easiest way to get started is by downloading a pre-built binary for your operating system. You can find the latest binaries on the releases page.

From Source

Step 1. Install Golang

Go v1.18 is required for Terra Core.

If you haven't already, install Golang by following the official docs. Make sure that your GOPATH and GOBIN environment variables are properly set up.

Step 2: Get Terra Core source code

Use git to retrieve Terra Core from the official repo and checkout the main branch. This branch contains the latest stable release, which will install the terrad binary.

git clone https://github.com/classic-terra/core/
cd core
git checkout main

Step 3: Build Terra core

Run the following command to install the executable terrad to your GOPATH and build Terra Core. terrad is the node daemon and CLI for interacting with a Terra node.

# COSMOS_BUILD_OPTIONS=rocksdb make install
make install

Step 4: Verify your installation

Verify that you've installed terrad successfully by running the following command:

terrad version --long

If terrad is installed correctly, the following information is returned:

name: terra
server_name: terrad
version: 1.0.5
commit: 8bb56e9919ecf5234a3239a6a351b509451f9d5d
build_tags: netgo,ledger
go: go version go1.18.1 linux/amd64

terrad

NOTE: terracli has been deprecated and all of its functionalities have been merged into terrad.

terrad is the all-in-one command for operating and interacting with a running Terra node. For comprehensive coverage on each of the available functions, see the terrad reference information. To view various subcommands and their expected arguments, use the $ terrad --help command:

        
$ terrad --help Stargate Terra App Usage: terrad [command] Available Commands: add-genesis-account Add a genesis account to genesis.json collect-gentxs Collect genesis txs and output a genesis.json file debug Tool for helping with debugging your application export Export state to JSON gentx Generate a genesis tx carrying a self delegation help Help about any command init Initialize private validator, p2p, genesis, and application configuration files keys Manage your application's keys migrate Migrate genesis to a specified target version query Querying subcommands rosetta spin up a rosetta server start Run the full node status Query remote node for status tendermint Tendermint subcommands testnet Initialize files for a terrad testnet tx Transactions subcommands unsafe-reset-all Resets the blockchain database, removes address book files, and resets data/priv_validator_state.json to the genesis state validate-genesis validates the genesis file at the default location or at the location passed as an arg version Print the application binary version information Flags: -h, --help help for terrad --home string directory for config and data (default "/Users/$HOME/.terra") --log_format string The logging format (json|plain) (default "plain") --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) (default "info") --trace print out full stack trace on errors Use "terrad [command] --help" for more information about a command.

Node Setup

Once you have terrad installed, you will need to set up your node to be part of the network.

Join the mainnet

The following requirements are recommended for running a columbus-5 mainnet node:

  • 4 or more CPU cores
  • At least 2TB of disk storage
  • At least 100mbps network bandwidth
  • An Linux distribution

For configuration and migration instructions for setting up a Columbus-5 mainnet node, visit The mainnet repo.

Terra Node Quick Start

terrad init nodename
wget -O ~/.terra/config/genesis.json https://cloudflare-ipfs.com/ipfs/QmZAMcdu85Qr8saFuNpL9VaxVqqLGWNAs72RVFhchL9jWs
curl https://network.terra.dev/addrbook.json > ~/.terrad/config/addrbook.json
terrad start

Join a testnet

Several testnets might exist simultaneously. Ensure that your version of terrad is compatible with the network you want to join.

To set up a node on the latest testnet, visit the testnet repo.

Run a local testnet

The easiest way to set up a local testing environment is to run LocalTerra, which automatically orchestrates a complete testing environment suited for development with zero configuration.

Run a single node testnet

You can also run a local testnet using a single node. On a local testnet, you will be the sole validator signing blocks.

Step 1. Create network and account

First, initialize your genesis file to bootstrap your network. Create a name for your local testnet and provide a moniker to refer to your node:

terrad init --chain-id=<testnet_name> <node_moniker>

Next, create a Terra account by running the following command:

terrad keys add <account_name>

Step 2. Add account to genesis

Next, add your account to genesis and set an initial balance to start. Run the following commands to add your account and set the initial balance:

terrad add-genesis-account $(terrad keys show <account_name> -a) 100000000uluna,1000usd
terrad gentx <account_name> 10000000uluna --chain-id=<testnet_name>
terrad collect-gentxs

Step 3. Run Terra daemon

Now you can start your private Terra network:

terrad start

Your terrad node will be running a node on tcp://localhost:26656, listening for incoming transactions and signing blocks.

Congratulations, you've successfully set up your local Terra network!

Set up a production environment

NOTE: This guide only covers general settings for a production-level full node. You can find further details on considerations for operating a validator node by visiting the Terra validator guide.

This guide has been tested against Linux distributions only. To ensure you successfully set up your production environment, consider setting it up on an Linux system.

Increase maximum open files

terrad can't open more than 1024 files (the default maximum) concurrently.

You can increase this limit by modifying /etc/security/limits.conf and raising the nofile capability.

*                soft    nofile          65535
*                hard    nofile          65535

Create a dedicated user

It is recommended that you run terrad as a normal user. Super-user accounts are only recommended during setup to create and modify files.

Port configuration

terrad uses several TCP ports for different purposes.

  • 26656: The default port for the P2P protocol. Use this port to communicate with other nodes. While this port must be open to join a network, it does not have to be open to the public. Validator nodes should configure persistent_peers and close this port to the public.

  • 26657: The default port for the RPC protocol. This port is used for querying / sending transactions and must be open to serve queries from terrad. DO NOT open this port to the public unless you are planning to run a public node.

  • 1317: The default port for Lite Client Daemon (LCD), which can be enabled in ~/.terra/config/app.toml. The LCD provides an HTTP RESTful API layer to allow applications and services to interact with your terrad instance through RPC. Check the Terra REST API for usage examples. Don't open this port unless you need to use the LCD.

  • 26660: The default port for interacting with the Prometheus database. You can use Promethues to monitor an environment. This port is closed by default.

Run the server as a daemon

Important:

Keep terrad running at all times. The simplest solution is to register terrad as a systemd service so that it automatically starts after system reboots and other events.

Register terrad as a service

First, create a service definition file in /etc/systemd/system.

Sample file: /etc/systemd/system/terrad.service

[Unit]
Description=Terra Daemon
After=network.target

[Service]
Type=simple
User=terra
ExecStart=/data/terra/go/bin/terrad start
Restart=on-abort

[Install]
WantedBy=multi-user.target

[Service]
LimitNOFILE=65535

Modify the Service section from the given sample above to suit your settings. Note that even if you raised the number of open files for a process, you still need to include LimitNOFILE.

After creating a service definition file, you should execute systemctl daemon-reload.

Start, stop, or restart service

Use systemctl to control (start, stop, restart)

# Start
systemctl start terrad
# Stop
systemctl stop terrad
# Restart
systemctl restart terrad

Access logs

# Entire log
journalctl -t terrad
# Entire log reversed
journalctl -t terrad -r
# Latest and continuous
journalctl -t terrad -f

Using docker-compose

  1. Install Docker

  2. Create a new folder on your local machine and copy docker-compose\docker-compose.yml

  3. Review the docker-compose.yml contents

  4. Bring up your stack by running

    docker-compose up -d
  5. Add your wallet

    docker-compose exec node sh /keys-add.sh
  6. Copy your terra wallet address and go to the terra faucet here -> http://45.79.139.229:3000/ Put your address in and give yourself luna coins.

  7. Start the validator

    docker-compose exec node sh /create-validator.sh

Cheat Sheet:

Start

docker-compose up -d

Stop

docker-compose down

View Logs

docker-compose logs -f

Run Terrad Commands Example

docker-compose exec node terrad status

Upgrade

docker-compose down
docker-compose pull
docker-compose up -d

Build from source

make build-all -f contrib/terra-operator/Makefile

Resources

Community

Contributing

If you are interested in contributing to Terra Core source, please review our code of conduct.

License

This software is licensed under the Apache 2.0 license. Read more about it here.

© 2022 Terraform Labs, PTE LTD


 

Powering the innovation of money.

classic-core's People

Contributors

bluedisk avatar caramis avatar catshaark avatar chinoman10 avatar dependabot[bot] avatar dokwon avatar dongsam avatar edk208 avatar erain9 avatar etienne-napoleone avatar evanorti avatar faddat avatar fragwuerdig avatar gregnuj avatar hanjukim avatar hendrikhofstadt avatar hipercube avatar inon-man avatar jonchoi avatar junbeomlee avatar nghuyenthevinh2000 avatar octalmage avatar ouiliame avatar pea-io avatar pea-skillz avatar pluto9r avatar sydneyitguy avatar yun-yeo avatar ziwon avatar zmanian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

classic-core's Issues

fee amount is null but paid

Summary.

I didn't set the fee when I sent the tx.
The fee is Null but paid(1000mluna).

Terra Version.

terrad version --long

cosmos-sdk: 0.0.7-5-g2fb73e4
git commit:
vendor hash:
build tags:
go version go1.12.1 linux/amd64

Steps.

1. terracli q account terra1nvtzp6jk50q734lpvsxf84d3pezg85p8lqgnyf --chain-id=soju-0007 --output=json | jq

{
"type": "auth/Account",
"value": {
"address": "terra1nvtzp6jk50q734lpvsxf84d3pezg85p8lqgnyf",
"coins": [
{
"denom": "mluna",
"amount": "10000000"
}
],
"public_key": null,
"account_number": "39",
"sequence": "0"
}
}

2. terracli tx send terra1tusfpgvjrplqg2fm7wacy4slzjmnzswcfn9puj 1000000mluna --from=J $chain

{"chain_id":"soju-0007","account_number":"39","sequence":"0","fee":{"amount":null,"gas":"200000"},"msgs":[{"type":"cosmos-sdk/MsgSend","value":{"from_address":"terra1nvtzp6jk50q734lpvsxf84d3pezg85p8lqgnyf","to_address":"terra1tusfpgvjrplqg2fm7wacy4slzjmnzswcfn9puj","amount":[{"denom":"mluna","amount":"1000000"}]}}],"memo":""}

"fee":{"amount":null,"gas":"200000"},"

3. terracli q account terra1nvtzp6jk50q734lpvsxf84d3pezg85p8lqgnyf --chain-id=soju-0007 --output=json | jq

{
"type": "auth/Account",
"value": {
"address": "terra1nvtzp6jk50q734lpvsxf84d3pezg85p8lqgnyf",
"coins": [
{
"denom": "mluna",
"amount": "8999000"
}
],
"public_key": {
"type": "tendermint/PubKeySecp256k1",
"value": "A0HT0WtwAFbNtkm1T7AQ6w2xJpVjDKRhyaHK4DzJSfWx"
},
"account_number": "39",
"sequence": "1"
}
}

Align comment formats

We are currently missing comments / have misaligned formats in major modules. This should change.

RPC return panic error sometimes on broadcastTxCommit request from LCD

returned error message from LCD is following:

E[2019-04-23|17:10:35.750] Panic in RPC HTTP handler                    module=rest-server err="runtime error: invalid memory address or nil pointer dereference" stack="
 runtime error: invalid memory address or nil pointer dereference" stack="goroutine 5559 [running]:
 runtime/debug.Stack(0xc0020aead0, 0x4a30980, 0x57dab20)
 	/usr/local/go/src/runtime/debug/stack.go:24 +0x9d
 github.com/tendermint/tendermint/rpc/lib/server.RecoverAndLogHandler.func1.1(0xc0032d54a0, 0x505bbe0, 0xc000c08fb0, 0xbf27cf6d52818898, 0x7383d94f45f, 0x57f3f60, 0xc002bd0000)
 	go/pkg/mod/github.com/tendermint/[email protected]/rpc/lib/server/http_server.go:140 +0x552
 panic(0x4a30980, 0x57dab20)
 	/usr/local/go/src/runtime/panic.go:522 +0x1b5
 github.com/cosmos/cosmos-sdk/types.NewResponseFormatBroadcastTxCommit(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
 	go/pkg/mod/github.com/cosmos/[email protected]/types/result.go:110 +0x58
 github.com/cosmos/cosmos-sdk/client/context.CLIContext.BroadcastTxCommit(0xc0001e4ee0, 0xc000c08f70, 0x5074f40, 0xc000c0d520, 0x0, 0x0, 0x50416c0, 0xc0000ce000, 0x4b4a524, 0x4, ...)
 	go/pkg/mod/github.com/cosmos/[email protected]/client/context/broadcast.go:46 +0x3f1
 github.com/cosmos/cosmos-sdk/client/context.CLIContext.BroadcastTx(0xc0001e4ee0, 0xc000c08f70, 0x5074f40, 0xc000c0d520, 0x0, 0x0, 0x50416c0, 0xc0000ce000, 0x4b4a524, 0x4, ...)
 	go/pkg/mod/github.com/cosmos/[email protected]/client/context/broadcast.go:23 +0x212
 github.com/cosmos/cosmos-sdk/client/tx.BroadcastTxRequest.func1(0x5056ae0, 0xc0032d54a0, 0xc002bd0200)
 	go/pkg/mod/github.com/cosmos/[email protected]/client/tx/broadcast.go:54 +0x2b6
 net/http.HandlerFunc.ServeHTTP(0xc000c0d040, 0x5056ae0, 0xc0032d54a0, 0xc002bd0200)
 	/usr/local/go/src/net/http/server.go:1995 +0x44
 github.com/gorilla/mux.(*Router).ServeHTTP(0xc0001c8e40, 0x5056ae0, 0xc0032d54a0, 0xc002bd0000)
 	go/pkg/mod/github.com/gorilla/[email protected]/mux.go:212 +0xe3
 github.com/tendermint/tendermint/rpc/lib/server.maxBytesHandler.ServeHTTP(0x5040500, 0xc0001c8e40, 0xf4240, 0x5056ae0, 0xc0032d54a0, 0xc002bd0000)
 	go/pkg/mod/github.com/tendermint/[email protected]/rpc/lib/server/http_server.go:185 +0xd0
 github.com/tendermint/tendermint/rpc/lib/server.RecoverAndLogHandler.func1(0x5057160, 0xc002857ea0, 0xc002bd0000)
 	go/pkg/mod/github.com/tendermint/[email protected]/rpc/lib/server/http_server.go:158 +0x317
 net/http.HandlerFunc.ServeHTTP(0xc00099e060, 0x5057160, 0xc002857ea0, 0xc002bd0000)
 	/usr/local/go/src/net/http/server.go:1995 +0x44
 net/http.serverHandler.ServeHTTP(0xc0000ec410, 0x5057160, 0xc002857ea0, 0xc002bd0000)
 	/usr/local/go/src/net/http/server.go:2774 +0xa8
 net/http.(*conn).serve(0xc002bce000, 0x505b060, 0xc002bac180)
 	/usr/local/go/src/net/http/server.go:1878 +0x851
 created by net/http.(*Server).Serve
 	/usr/local/go/src/net/http/server.go:2884 +0x2f4
"

[bank/send] Records tax amount to transaction msg log

Problem

For some ecosystem, they need to know exact amount of tax they paid. However, currently there is no way to know it except calculating with two more query (tax-rate and tax-cap).

Proposal

Records exact tax amount to transaction log per msg.

terracli.md

--amount and --validator are unknown flags for

terracli tx staking delegate
--amount=10luna
--validator=
--from=<key_name>
--chain-id=<chain_id>

Shouldn't it be?
terracli tx staking delegate [validator] [amount]
--from=<key_name>
--chain-id=<chain_id>

Change unit indicators to be computed over bondedtokens not totaltokens

Summary

unit indicators (TRL, SRL, MRL) in treasury are currently being computed over the total issuance of Luna; this should be computed over the total count of bonded tokens, as per research's direction

Proposal

Add stakingKeeper.GetValidatorSet() to the treasuryKeeper, and have unitIndicator() function div over the size of the totalbondedtokens of the valset instead of the total Luna issuance in the mint module.

how to build on windows?

On Windows10, I executed

git clone -b develop --single-branch https://github.com/terra-project/core

in c:/go/src

and executed

go build

in c:/go/src/core

then there is a message like :

can't load package: package github.com/terra-project/core: unknown import path "github.com/terra-project/core": cannot find module providing package github.com/terra-project/core

Change assets to 10^-6 of actual value

Related issues on cosmos side:

cosmos/cosmos-sdk#3510
cosmos/cosmos-sdk#2321

Solution: we will be representing all assets on Columbus to be 10^-6 the value of the actual asset (for example, 10^6 "luna" coins on the mainnet will be 1 Luna token traded on an exchange). This is conceptually similar to Bitcoin's satoshis and Eth's Gwei.

TODO: think of new names for Luna and Terra's dust tokens.

resolved by #35

CandQueueIterateExpired incorrect range iteration

In /x/budget/keeper.go:203, CandQueueIterateExpired function iterates wrong range.

Status:
[candidate-queue:1000001:1,
candidate-queue:1000002:2]

Given Param:
(endBlock = 2)

Expectation:
empty iteration

Real:
[candidate-queue:1000001:1,
candidate-queue:1000002:2]

Reason:
candiate-queue:1 < [candidate-queue:1000001:1, candidate-queue:1000002:2] < candidate-queue:2

Suggestion:
Change CandQueueIterateExpired to iterate only for the given {endBlock} or fill "0"s.

Change SMR computation in updateRewardPolicy

Summary

smrAvgMonth is currently computed as the rolling average of individual smr's. The correct implementation separately sums seigniorage and taxes over the month, then computes the appropriate ratio once.

Proposal

Sum seigniorage over the month (S)
Sum taxes over the month (T)
Return S / (S + T)

Fix on deploy-testnet.md

Request

  1. Wrong link address on "Supporting code can be found in the networks directory and additionally..."
  2. Wrong link address on "From the networks/local directory"
  3. Wrong link address on "The following should be run from the networks directory."

Add circleCI

Summary

We have no continuous integration frameworks set up. We should integrate circleCI for all pushes to the develop branch.

Fix on terracli.md

Request

  1. Broken link on "Please refer to the Validator Setup section ...."
  2. Broken link on "These delegators can receive part of the validator's fee revenue."

How can i join testnet?

Hello, Terra-project team.

I want to connect terra testnet(soju-0006).

So, i built terra core from master branch and performed "terrad init {myname}".

And i changed ~/.terra/config/genesis.json to genesis.json of soju-0006 (https://github.com/terra-project/networks/blob/master/soju-0006/genesis.json).

Also i added seeds and persistent_peers at config.toml

But my terra node can not connect to soju-0006...

How can i join testnet?

P.S. I can not access at https://explorer.terra.money/validators

E[2019-04-11|02:19:09.692] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=0
E[2019-04-11|02:19:09.696] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=0
E[2019-04-11|02:19:09.697] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=0
E[2019-04-11|02:19:09.697] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=0
E[2019-04-11|02:19:10.401] Error dialing peer module=p2p err="auth failure: secrect conn failed: EOF"
E[2019-04-11|02:19:11.955] Error dialing peer module=p2p err="auth failure: secrect conn failed: EOF"
E[2019-04-11|02:19:12.273] Error dialing peer module=p2p err="auth failure: secrect conn failed: EOF"
E[2019-04-11|02:19:12.319] Error dialing peer module=p2p err="auth failure: secrect conn failed: EOF"
E[2019-04-11|02:19:39.692] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=1
E[2019-04-11|02:19:39.697] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=1
E[2019-04-11|02:19:39.697] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=1
E[2019-04-11|02:19:39.697] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=1
E[2019-04-11|02:20:09.692] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=2
E[2019-04-11|02:20:09.696] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=2
E[2019-04-11|02:20:09.696] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=2
E[2019-04-11|02:20:09.696] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=2
E[2019-04-11|02:20:39.692] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=3
E[2019-04-11|02:20:39.696] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=3
E[2019-04-11|02:20:39.696] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=3
E[2019-04-11|02:20:39.697] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=3
E[2019-04-11|02:21:09.692] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=4
E[2019-04-11|02:21:09.696] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=4
E[2019-04-11|02:21:09.696] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=4
E[2019-04-11|02:21:09.697] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=4
E[2019-04-11|02:21:15.523] Failed to reconnect to peer. Beginning exponential backoff module=p2p [email protected]:26656 elapsed=2m3.249245147s
E[2019-04-11|02:21:21.549] Failed to reconnect to peer. Beginning exponential backoff module=p2p [email protected]:26656 elapsed=2m9.230493235s
E[2019-04-11|02:21:22.503] Failed to reconnect to peer. Beginning exponential backoff module=p2p [email protected]:26656 elapsed=2m12.10110046s
E[2019-04-11|02:21:23.689] Failed to reconnect to peer. Beginning exponential backoff module=p2p [email protected]:26656 elapsed=2m11.734292071s

Fix on users.md

Request

  1. Broken link on "make sure you have set up a way to access the Terra Protocol network :::"

[oracle/swap] discussion topic on oracle/swap mechanism

  1. Current structure of oracle/swap
  • Current oracle/swap function execute instant payout of swap transaction with most recent oracle price rate.
  • Oracle price is outdated(maximum around 15minutes) when swap execution happens
  1. Weak point 1 : unnecessary cost upon LUNA holders from frequent arbitrage opportunities
  • Because of short term(<15minutes) volatility of LUNA market price, arbitrage opportunities are frequently created even though when terra tokens stay at target stability price.
  • Those arbitrage trades does not help stability of terra token prices.
  • Those profit earned by arbitrage traders will result in costs of community caused by minting activities with unfair swap prices.(put it another way : swap price deviated from fair market price)
  1. Weak point 2 : relatively easy oracle price manipulation attack vector
  • The oracle voting timing and price are fairly observable and predictable in real-time.
  • The timing and price are dependent to very instant moment, which is relatively easy for manipulators to intentionally distort the instant market price of LUNA.
  1. Possible suggestions on oracle pricing & swap execution mechanism
  • Gather swap requests during an oracle period without swap price or immediate execution.
  • At the end of the oracle period, determine swap price by VWAP(volume weighted average price) during the recent oracle period and distribute all swap transactions requested during the oracle period.
  • Maximum amount of swap requests in given oracle period should not exceed X * current_oracle_period_volume_sum. X can be determined by governance which should be less than 1.0
  1. Effect
  • Prevent unnecessary arbitrage opportunities which will result in cost of community.
  • Prevent market(hence oracle) price manipulation.
  • Limit on swap amount for each round for sounder practice of swap functionality.

I hope this topic leads to fruitful discussion among validator community members for better possible adjustment strategies.

Fix on join-network.md

Request

  1. Fix "Add seed nodes, Run a Full node" part on join-network.md since Terra finder currently not supporting node listing function yet.
  2. Change the link on " Please skip to Genesis & Seeds."

Change oracle tally method to prevent multiple votes

Summary

Currently, MsgPriceFeed tallies the moment the vote is submitted. This can allow validators to redelegate their stake to another affiliated miner, thereby voting multiple times.

Problem statement

MsgPriceFeed tallies to a PriceVote object, and the vote's weight is computed and stored to be the validator's BondedTokens() weight at the moment the vote is stored. This allows the validator to redelegate tokens to another validator ad infinitum (might be limits, but doubt it) to profit. In the lighter case, this will allow crafty validators to reap a higher reward, and in the more aggregious case allow them to corrupt the oracle price feed.

Proposal

Mirror the tally method for the budget module, for storing the address of the validator when the msg is handled, and tally the weights for each validator during the oracle settlement period.

Error on terracli query distr validator-outstanding-rewards

Network: columbus-drill
CLI Version: 0.1.0-rc0

$ terracli query distr validator-outstanding-rewards --trust-node
ERROR: {"codespace":"sdk","code":6,"message":"incorrectly formatted request data; UnmarshalJSON cannot decode empty bytes"}

Also, isn't it outstanding-rewards not validator-outstanding-rewards?

[Pay] Transferring Luna results in ErrInsufficientSwapBalance

Summary

Transferring Luna results in an error in the pay module

Problem Statement

Currently the pay module tries to levy a tax on all token transfers. In order to do so, it queries the oracle module for the correct exchange rate between TerraSDR and the target asset to compute the tax cap. Given that Luna is not tracked by the oracle, this results in an error.

Proposal

Add an escape condition for Luna transfers (perhaps luna transfers should not be taxed?)

@nplatias please weigh in

Resolved by #41

Suggestion of safety limits on swapcoin

Reasoning

  1. Current swapcoin function does not have any safety feature to protect from abuse or manipulation of oracle&swapcoin

  2. Lacking of safety feature might result in catastrophic minting with inappropriate exchange rates.

  3. Introduction of safety limits can restrict the magnitude of risk and gives time to prevent further manipulations.

Example of possible risk

  1. Oracle script or market price api malfunctioning which leads to huge distortion of exchange rates -> arbitrageur abuse the distorted oracle price to make huge gains from swapcoin

  2. Cartelling of oracle voters to distort oracle price resulting in execution of unfair swapcoin

  3. Instant market price manipulation leads to temporarily popped exchange ratio which might lead to excessive minting from distorted market prices.

  4. Frequent abuse of swapcoin might result in unreasonably strong dilution effect on Luna because of too much minting in short time.

Suggestion of safety limits on swapcoin

  1. 24h limit on swapcoin minting : 24h maximum amount of minting of each token by swapcoin methodology.

  2. Halt mechanism on excessive volatility of Luna : temporary(24h) halt mechanism of swapcoin method when the percentage change of oracle price of Luna in 1h exceeds certain limit.

  3. Above limit parameters should be chosen by governance voting after proper discussion and can be changed also via governance.

Update install / deployment docs

Summary

The current docs do not currently reflect our deployment schemes.

Proposal

The following scenarios should be updated in the docs:

  1. How to install terra
  2. How to deploy own testnet
  3. How to join the network as a node
  4. How to deploy a validator
  5. How to delegate tokens to a validator

docs branches currently has the setup mirroring Cosmos' gaia testnet.

Swagger update

REST API updates(budget, market, oracle, treasury) need to be applied to Swagger

build error

when i use 'make' command

(60/60) Wrote gonum.org/v1/gonum@master
go install -tags "netgo" -ldflags "-X github.com/terra-project/terra/version.Version=0.0.3-201-g7105278 -X terra/version.Version=0.0.3-201-g7105278" ./cmd/terrad
cmd/terrad/main.go:22:2: cannot find package "terra/app" in any of:
/home/eunsung/go/src/core/vendor/terra/app (vendor tree)
/usr/lib/go-1.10/src/terra/app (from $GOROOT)
/home/eunsung/go/src/terra/app (from $GOPATH)
cmd/terrad/main.go:23:2: cannot find package "terra/cmd/init" in any of:
/home/eunsung/go/src/core/vendor/terra/cmd/init (vendor tree)
/usr/lib/go-1.10/src/terra/cmd/init (from $GOROOT)
/home/eunsung/go/src/terra/cmd/init (from $GOPATH)
cmd/terrad/main.go:6:2: cannot find package "terra/types/util" in any of:
/home/eunsung/go/src/core/vendor/terra/types/util (vendor tree)
/usr/lib/go-1.10/src/terra/types/util (from $GOROOT)
/home/eunsung/go/src/terra/types/util (from $GOPATH)
cmd/terrad/main.go:7:2: cannot find package "terra/version" in any of:
/home/eunsung/go/src/core/vendor/terra/version (vendor tree)
/usr/lib/go-1.10/src/terra/version (from $GOROOT)
/home/eunsung/go/src/terra/version (from $GOPATH)
Makefile:39: recipe for target 'install' failed
make: *** [install] Error 1

Terrad can't start

How to start the terrad main network
Startup error now:

[2019-05-08|11:44:32.079] Starting ABCI with Tendermint module=main
ERROR: Error during handshake: Error on replay: Validator set is nil in genesis and still empty after InitChain

Clean up branches

Summary

Currently we have multiple branches used in development - delete all and leave only develop and master

Add Terra specific docs

Summary

The current docs are centered around deployment of tokens. We need docs that display core functionality of the Terra ecosystem.

Proposal

Create docs that mirror key functions explained in the white paper.

  • Market (Terra <> terra swaps, Terra <> Luna swaps at 0% spread). Explain settlement and remittance use cases.
  • Oracle (as a way to make extra revenue by validators)
  • Budget (apply to get funded for growth by the Terra ecosystem)
  • Mining (how a validator in the ecosystem can generate returns)
  • Treasury (concept of stability via reducing volatility in MRL)

Change gaiad.toml to terrad.toml

Just a branding issue, but we are currently pulling in gaiad.toml instead of our own terrad.toml. Let's host terrad.toml on our github and pull from there instead.

miss formatted response tag

Description

Some response tag is formatted as bytes of variable raw value.

Proposal

Response tag should be formatted as string or bytes of string.

resolved by #30

Enable batched transactions on x/pay/handler for Chai integration

Summary

Batching Chai transaction errs on MsgMultiSend

Problem Definition

For MsgMultiSend transactions on Chai, the system errors with ErrInsufficientBalance the user does not have the balance for a transaction.

User flow:

  • the user has 0 Terra balance
  • the user tops up x Terra, and uses it immediately to spend x terra on a partner platform
  • both transactions get batched into one MsgMultiSend
  • given that inputs get processed first, the user does not have a sufficient balance to process a msgMultisend, and the handler returns an error.

Proposal

Edit x/pay/handler.go#handleMsgMultiSend to balance out transactions (cancel out inputs and outputs) to not return an insufficientBalanceError

Fix on validators.md

Request

  1. Broken link on "tip Information on how to join the current testnet (genesis.json file and seeds) is held in our testnet repo. "
  2. Broken link on "Validators are responsible for committing new blocks to,,,"

Implement vesting accounts for pre-sale investors

Summary

Currently the cosmos vesting account has cliffs and daily linear vesting. We need a more complicated vesting structure for Terra presale investors.

Proposal

  • Create a vestingaccount that grants a certain percentage of tokens at specificed timestamps from TGE
  • the timstamp : token grant percentage pairs to be organized in a json format

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.