Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ manner. We might ask you to provide additional logs and data (teragrid & app)
in a case of bug.
-->

**Tendermint version** (use `teragrid version` or `git rev-parse --verify HEAD` if installed from source):
**Teragrid version** (use `teragrid version` or `git rev-parse --verify HEAD` if installed from source):


**Asura app** (name for built-in, URL for self-written if it's publicly available):
Expand Down
4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ These are the policies for upholding our community’s standards of conduct. If

8. Moderators are held to a higher standard than other community members. If a moderator creates an inappropriate situation, they should expect less leeway than others.

In the Teragrid/COSMOS community we strive to go the extra step to look out for each other. Don’t just aim to be technically unimpeachable, try to be your best self. In particular, avoid flirting with offensive or sensitive issues, particularly if they’re off-topic; this all too often leads to unnecessary fights, hurt feelings, and damaged trust; worse, it can drive people away from the community entirely.
In the Teragrid community we strive to go the extra step to look out for each other. Don’t just aim to be technically unimpeachable, try to be your best self. In particular, avoid flirting with offensive or sensitive issues, particularly if they’re off-topic; this all too often leads to unnecessary fights, hurt feelings, and damaged trust; worse, it can drive people away from the community entirely.

And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you could’ve communicated better — remember that it’s your responsibility to make your fellow Cosmonauts comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust.

The enforcement policies listed above apply to all official Teragrid/COSMOS venues.For other projects adopting the Teragrid/COSMOS Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.
The enforcement policies listed above apply to all official Teragrid venues.For other projects adopting the Teragrid Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.

*Adapted from the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling), the [Contributor Covenant v1.3.0](http://contributor-covenant.org/version/1/3/0/) and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ For instance, to create a fork and work on a branch of it, I would:
* Create the fork on github, using the fork button.
* Go to the original repo checked out locally (ie. `$GOPATH/src/github.com/teragrid/teragrid`)
* `git remote rename origin upstream`
* `git remote add origin git@github.com:ebuchman/basecoin.git`
* `git remote add origin git@github.com:ebuchman/teracoin.git`

Now `origin` refers to my fork and `upstream` refers to the teragrid version.
So I can `git push -u origin master` to update my fork, and make pull requests to teragrid from there.
Expand Down
49 changes: 25 additions & 24 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Or [Blockchain](https://en.wikipedia.org/wiki/Blockchain_(database)) for short.
https://teragrid.network/api/docs
)](https://godoc.org/github.com/teragrid/teragrid)
[![Go version](https://img.shields.io/badge/go-1.9.2-blue.svg)](https://github.com/moovweb/gvm)
[![Rocket.Chat](https://demo.rocket.chat/images/join-chat.svg)](https://cosmos.rocket.chat/)
[![license](https://img.shields.io/github/license/teragrid/teragrid.svg)](https://github.com/teragrid/teragrid/blob/master/LICENSE)
[![](https://tokei.rs/b1/github/teragrid/teragrid?category=lines)](https://github.com/teragrid/teragrid)

Expand Down Expand Up @@ -51,7 +50,7 @@ All resources involving the use of, building application on, or developing for,
### Sub-projects

* [Asura](http://github.com/teragrid/asura), the Application Blockchain Interface
* [Parkhill](http://github.com/teragrid/parkhill), a D-Apps MVC Framwork for rapid development and adoptation
* [Parkhill](http://github.com/teragrid/parkhill), a D-Apps MVC Framework for rapid development and adoptation

### Tools
* [Deployment, Benchmarking, and Monitoring](http://teragrid.readthedocs.io/projects/tools/en/develop/index.html#teragrid-tools)
Expand Down
2 changes: 1 addition & 1 deletion blockchain/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func makeStateAndBlockStore(logger log.Logger) (sm.State, *BlockStore) {
blockStore := NewBlockStore(blockDB)
state, err := sm.LoadStateFromDBOrGenesisFile(stateDB, config.GenesisFile())
if err != nil {
panic(cmn.ErrorWrap(err, "error constructing state from genesis file"))
panic(cmn.ErrorWrap(err, "error constructing state from genesis file "+config.GenesisFile()))
}
return state, blockStore
}
Expand Down
18 changes: 10 additions & 8 deletions cmd/teragrid/commands/gen_node_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ var GenNodeKeyCmd = &cobra.Command{
}

func genNodeKey(cmd *cobra.Command, args []string) error {
nodeKeyFile := config.NodeKeyFile()
if cmn.FileExists(nodeKeyFile) {
return fmt.Errorf("node key at %s already exists", nodeKeyFile)
}
for _, config := range mainConfig.ChainConfigs {
nodeKeyFile := config.NodeKeyFile()
if cmn.FileExists(nodeKeyFile) {
return fmt.Errorf("node key at %s already exists", nodeKeyFile)
}

nodeKey, err := p2p.LoadOrGenNodeKey(nodeKeyFile)
if err != nil {
return err
nodeKey, err := p2p.LoadOrGenNodeKey(nodeKeyFile)
if err != nil {
return err
}
fmt.Println(nodeKey.ID())
}
fmt.Println(nodeKey.ID())
return nil
}
4 changes: 2 additions & 2 deletions cmd/teragrid/commands/gen_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/spf13/cobra"

pvm "github.com/teragrid/teragrid/types/priv_validator"
"github.com/teragrid/teragrid/types/priv_validator"
)

// GenValidatorCmd allows the generation of a keypair for a
Expand All @@ -17,7 +17,7 @@ var GenValidatorCmd = &cobra.Command{
}

func genValidator(cmd *cobra.Command, args []string) {
pv := pvm.GenFilePV("")
pv := privval.GenFilePV("")
jsbz, err := cdc.MarshalJSON(pv)
if err != nil {
panic(err)
Expand Down
81 changes: 43 additions & 38 deletions cmd/teragrid/commands/init.go
Original file line number Diff line number Diff line change
@@ -1,67 +1,72 @@
package commands

import (
"time"

"github.com/spf13/cobra"

cfg "github.com/teragrid/teragrid/config"
"github.com/teragrid/teragrid/p2p"
"github.com/teragrid/teragrid/types"
pvm "github.com/teragrid/teragrid/types/priv_validator"
"github.com/teragrid/teragrid/types/priv_validator"
cmn "github.com/teragrid/teralibs/common"
)

// InitFilesCmd initialises a fresh teragrid Core instance.
// InitFilesCmd initialises a fresh Teragrid Core instance.
var InitFilesCmd = &cobra.Command{
Use: "init",
Short: "Initialize teragrid",
Short: "Initialize Teragrid",
RunE: initFiles,
}

func initFiles(cmd *cobra.Command, args []string) error {
return initFilesWithConfig(config)
return initFilesWithConfig(mainConfig)
}

func initFilesWithConfig(config *cfg.Config) error {
// private validator
privValFile := config.PrivValidatorFile()
var pv *pvm.FilePV
if cmn.FileExists(privValFile) {
pv = pvm.LoadFilePV(privValFile)
logger.Info("Found private validator", "path", privValFile)
} else {
pv = pvm.GenFilePV(privValFile)
pv.Save()
logger.Info("Generated private validator", "path", privValFile)
}

nodeKeyFile := config.NodeKeyFile()
if cmn.FileExists(nodeKeyFile) {
logger.Info("Found node key", "path", nodeKeyFile)
} else {
if _, err := p2p.LoadOrGenNodeKey(nodeKeyFile); err != nil {
return err
config.SetRoot(config.RootDir)
for _, chain := range config.ChainConfigs {
privValFile := chain.PrivValidatorFile()
var pv *privval.FilePV
if cmn.FileExists(privValFile) {
pv = privval.LoadFilePV(privValFile)
logger.Info("Found private validator", "path", privValFile)
} else {
pv = privval.GenFilePV(privValFile)
pv.Save()
logger.Info("Generated private validator", "path", privValFile)
}
logger.Info("Generated node key", "path", nodeKeyFile)
}

// genesis file
genFile := config.GenesisFile()
if cmn.FileExists(genFile) {
logger.Info("Found genesis file", "path", genFile)
} else {
genDoc := types.GenesisDoc{
ChainID: cmn.Fmt("test-chain-%v", cmn.RandStr(6)),
nodeKeyFile := chain.NodeKeyFile()
if cmn.FileExists(nodeKeyFile) {
logger.Info("Found node key", "path", nodeKeyFile)
} else {
if _, err := p2p.LoadOrGenNodeKey(nodeKeyFile); err != nil {
return err
}
logger.Info("Generated node key", "path", nodeKeyFile)
}
genDoc.Validators = []types.GenesisValidator{{
PubKey: pv.GetPubKey(),
Power: 10,
}}

if err := genDoc.SaveAs(genFile); err != nil {
return err
// genesis file
genFile := chain.GenesisFile()
if cmn.FileExists(genFile) {
logger.Info("Found genesis file", "path", genFile)
} else {
genDoc := types.GenesisDoc{
ChainID: cmn.Fmt("test-chain-%v", cmn.RandStr(6)),
GenesisTime: time.Now(),
}
genDoc.Validators = []types.GenesisValidator{{
PubKey: pv.GetPubKey(),
Power: 10,
}}

if err := genDoc.SaveAs(genFile); err != nil {
return err
}
logger.Info("Generated genesis file", "path", genFile)
}
logger.Info("Generated genesis file", "path", genFile)
}

return nil
}
Loading