Skip to content

Commit

Permalink
chore: rename tendermint to ostracon
Browse files Browse the repository at this point in the history
  • Loading branch information
egonspace committed Jul 8, 2021
1 parent 39067a6 commit 7ea6e35
Show file tree
Hide file tree
Showing 118 changed files with 367 additions and 367 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ v without deliberation

<!-- Why do we need this feature?
What problems may be addressed by introducing this feature?
What benefits does Tendermint stand to gain by including this feature?
What benefits does Ostracon stand to gain by including this feature?
Are there any disadvantages of including this feature? -->

## Proposal
Expand Down
2 changes: 1 addition & 1 deletion .github/auto-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ pullRequestOpened: |
- [ ] Applied Appropriate Labels
Thank you for your contribution to Tendermint! :rocket:
Thank you for your contribution to Ostracon! :rocket:
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Lint
# Lint runs golangci-lint over the entire Tendermint repository
# Lint runs golangci-lint over the entire Ostracon repository
# This workflow is run on every pull request and push to master
# The `golangci` job will pass without running if no *.{go, mod, sum} files have been modified.
on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/proto-docker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build & Push TM Proto Builder
name: Build & Push OC Proto Builder
on:
pull_request:
paths:
Expand Down
8 changes: 4 additions & 4 deletions DOCKER/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ LABEL maintainer="hello@blockchain.line.me"
# private validator file into /ostracon/config.
#
# The /ostracon/data dir is used by ostracon to store state.
ENV TMHOME /ostracon
ENV OCHOME /ostracon

# OS environment setup
# Set user right away for determinism, create directory for persistence and give our user ownership
Expand All @@ -27,12 +27,12 @@ RUN apk update && \
apk upgrade && \
apk add --no-cache git make gcc libc-dev build-base curl jq bash file gmp-dev clang && \
addgroup ostracon && \
adduser -S -G ostracon ostracon -h "$TMHOME"
adduser -S -G ostracon ostracon -h "$OCHOME"

# Run the container with ostracon by default. (UID=100, GID=1000)
USER ostracon

WORKDIR $TMHOME
WORKDIR $OCHOME

# p2p, rpc and prometheus port
EXPOSE 26656 26657 26660
Expand All @@ -52,5 +52,5 @@ ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["node"]

# Expose the data directory as a volume since there's mutable state in there
VOLUME [ "$TMHOME" ]
VOLUME [ "$OCHOME" ]

8 changes: 4 additions & 4 deletions DOCKER/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e

if [ ! -d "$TMHOME/config" ]; then
if [ ! -d "$OCHOME/config" ]; then
echo "Running ostracon init to create (default) configuration for docker run."
ostracon init

Expand All @@ -13,11 +13,11 @@ if [ ! -d "$TMHOME/config" ]; then
-e 's/^index_all_tags\s*=.*/index_all_tags = true/' \
-e 's,^laddr = "tcp://127.0.0.1:26657",laddr = "tcp://0.0.0.0:26657",' \
-e 's/^prometheus\s*=.*/prometheus = true/' \
"$TMHOME/config/config.toml"
"$OCHOME/config/config.toml"

jq ".chain_id = \"$CHAIN_ID\" | .consensus_params.block.time_iota_ms = \"500\"" \
"$TMHOME/config/genesis.json" > "$TMHOME/config/genesis.json.new"
mv "$TMHOME/config/genesis.json.new" "$TMHOME/config/genesis.json"
"$OCHOME/config/genesis.json" > "$OCHOME/config/genesis.json.new"
mv "$OCHOME/config/genesis.json.new" "$OCHOME/config/genesis.json"
fi

exec ostracon "$@"
6 changes: 3 additions & 3 deletions abci/cmd/abci-cli/abci-cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ var RootCmd = &cobra.Command{
if err != nil {
return err
}
logger = log.NewFilter(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), allowLevel)
logger = log.NewFilter(log.NewOCLogger(log.NewSyncWriter(os.Stdout)), allowLevel)
}
if client == nil {
var err error
Expand Down Expand Up @@ -627,7 +627,7 @@ func cmdQuery(cmd *cobra.Command, args []string) error {

func cmdCounter(cmd *cobra.Command, args []string) error {
app := counter.NewApplication(flagSerial)
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
logger := log.NewOCLogger(log.NewSyncWriter(os.Stdout))

// Start the listener
srv, err := server.NewServer(flagAddress, flagAbci, app)
Expand All @@ -652,7 +652,7 @@ func cmdCounter(cmd *cobra.Command, args []string) error {
}

func cmdKVStore(cmd *cobra.Command, args []string) error {
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
logger := log.NewOCLogger(log.NewSyncWriter(os.Stdout))

// Create the application - in memory or persisted to disk
var app types.Application
Expand Down
2 changes: 1 addition & 1 deletion abci/tests/test_app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func startClient(abciType string) abcicli.Client {
if err != nil {
panic(err.Error())
}
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
logger := log.NewOCLogger(log.NewSyncWriter(os.Stdout))
client.SetLogger(logger.With("module", "abcicli"))
if err := client.Start(); err != nil {
panicf("connecting to abci_app: %v", err.Error())
Expand Down
2 changes: 1 addition & 1 deletion abci/types/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Application interface {
EndRecheckTx(RequestEndRecheckTx) ResponseEndRecheckTx // Signals the end of rechecking

// Consensus Connection
InitChain(RequestInitChain) ResponseInitChain // Initialize blockchain w validators/other info from TendermintCore
InitChain(RequestInitChain) ResponseInitChain // Initialize blockchain w validators/other info from OstraconCore
BeginBlock(RequestBeginBlock) ResponseBeginBlock // Signals the beginning of a block
DeliverTx(RequestDeliverTx) ResponseDeliverTx // Deliver a tx for full processing
EndBlock(RequestEndBlock) ResponseEndBlock // Signals the end of a block, returns changes to the validator set
Expand Down
2 changes: 1 addition & 1 deletion cmd/ostracon/commands/debug/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var (
flagProfAddr = "pprof-laddr"
flagFrequency = "frequency"

logger = log.NewTMLogger(log.NewSyncWriter(os.Stdout))
logger = log.NewOCLogger(log.NewSyncWriter(os.Stdout))
)

// DebugCmd defines the root command containing subcommands that assist in
Expand Down
2 changes: 1 addition & 1 deletion cmd/ostracon/commands/light.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func init() {

func runProxy(cmd *cobra.Command, args []string) error {
// Initialise logger.
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
logger := log.NewOCLogger(log.NewSyncWriter(os.Stdout))
var option log.Option
if verbose {
option, _ = log.AllowLevel("debug")
Expand Down
4 changes: 2 additions & 2 deletions cmd/ostracon/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

var (
config = cfg.DefaultConfig()
logger = log.NewTMLogger(log.NewSyncWriter(os.Stdout))
logger = log.NewOCLogger(log.NewSyncWriter(os.Stdout))
)

func init() {
Expand Down Expand Up @@ -58,7 +58,7 @@ var RootCmd = &cobra.Command{
}

if config.LogFormat == cfg.LogFormatJSON {
logger = log.NewTMJSONLogger(log.NewSyncWriter(os.Stdout))
logger = log.NewOCJSONLogger(log.NewSyncWriter(os.Stdout))
}

logger, err = tmflags.ParseLogLevel(config.LogLevel, logger, cfg.DefaultLogLevel)
Expand Down
16 changes: 8 additions & 8 deletions cmd/ostracon/commands/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ var (

// clearConfig clears env vars, the given root dir, and resets viper.
func clearConfig(dir string) {
if err := os.Unsetenv("TMHOME"); err != nil {
if err := os.Unsetenv("OCHOME"); err != nil {
panic(err)
}
if err := os.Unsetenv("TM_HOME"); err != nil {
if err := os.Unsetenv("OC_HOME"); err != nil {
panic(err)
}

Expand Down Expand Up @@ -55,7 +55,7 @@ func testSetup(rootDir string, args []string, env map[string]string) error {
clearConfig(defaultRoot)

rootCmd := testRootCmd()
cmd := cli.PrepareBaseCmd(rootCmd, "TM", defaultRoot)
cmd := cli.PrepareBaseCmd(rootCmd, "OC", defaultRoot)

// run with the args and env
args = append([]string{rootCmd.Use}, args...)
Expand All @@ -71,7 +71,7 @@ func TestRootHome(t *testing.T) {
}{
{nil, nil, defaultRoot},
{[]string{"--home", newRoot}, nil, newRoot},
{nil, map[string]string{"TMHOME": newRoot}, newRoot},
{nil, map[string]string{"OCHOME": newRoot}, newRoot},
}

for i, tc := range cases {
Expand Down Expand Up @@ -100,9 +100,9 @@ func TestRootFlagsEnv(t *testing.T) {
}{
{[]string{"--log", "debug"}, nil, defaultLogLvl}, // wrong flag
{[]string{"--log_level", "debug"}, nil, "debug"}, // right flag
{nil, map[string]string{"TM_LOW": "debug"}, defaultLogLvl}, // wrong env flag
{nil, map[string]string{"OC_LOW": "debug"}, defaultLogLvl}, // wrong env flag
{nil, map[string]string{"MT_LOG_LEVEL": "debug"}, defaultLogLvl}, // wrong env prefix
{nil, map[string]string{"TM_LOG_LEVEL": "debug"}, "debug"}, // right env
{nil, map[string]string{"OC_LOG_LEVEL": "debug"}, "debug"}, // right env
}

for i, tc := range cases {
Expand Down Expand Up @@ -131,7 +131,7 @@ func TestRootConfig(t *testing.T) {
}{
{nil, nil, nonDefaultLogLvl}, // should load config
{[]string{"--log_level=abc:info"}, nil, "abc:info"}, // flag over rides
{nil, map[string]string{"TM_LOG_LEVEL": "abc:info"}, "abc:info"}, // env over rides
{nil, map[string]string{"OC_LOG_LEVEL": "abc:info"}, "abc:info"}, // env over rides
}

for i, tc := range cases {
Expand All @@ -149,7 +149,7 @@ func TestRootConfig(t *testing.T) {
require.Nil(t, err)

rootCmd := testRootCmd()
cmd := cli.PrepareBaseCmd(rootCmd, "TM", defaultRoot)
cmd := cli.PrepareBaseCmd(rootCmd, "OC", defaultRoot)

// run with the args and env
tc.args = append([]string{rootCmd.Use}, tc.args...)
Expand Down
2 changes: 1 addition & 1 deletion cmd/ostracon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func main() {
rootCmd.AddCommand(cmd.NewInitCmd())
rootCmd.AddCommand(cmd.NewRunNodeCmd(nodeFunc))

cmd := cli.PrepareBaseCmd(rootCmd, "TM", os.ExpandEnv(filepath.Join("$HOME", cfg.DefaultOstraconDir)))
cmd := cli.PrepareBaseCmd(rootCmd, "OC", os.ExpandEnv(filepath.Join("$HOME", cfg.DefaultOstraconDir)))
if err := cmd.Execute(); err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/priv_val_server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func main() {
privValKeyPath = flag.String("priv-key", "", "priv val key file path")
privValStatePath = flag.String("priv-state", "", "priv val state file path")

logger = log.NewTMLogger(
logger = log.NewOCLogger(
log.NewSyncWriter(os.Stdout),
).With("module", "priv_val")
)
Expand Down
34 changes: 17 additions & 17 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ var (
defaultAddrBookPath = filepath.Join(defaultConfigDir, defaultAddrBookName)
)

// Config defines the top level configuration for a Tendermint node
// Config defines the top level configuration for a Ostracon node
type Config struct {
// Top level options use an anonymous struct
BaseConfig `mapstructure:",squash"`
Expand All @@ -75,7 +75,7 @@ type Config struct {
Instrumentation *InstrumentationConfig `mapstructure:"instrumentation"`
}

// DefaultConfig returns a default configuration for a Tendermint node
// DefaultConfig returns a default configuration for a Ostracon node
func DefaultConfig() *Config {
return &Config{
BaseConfig: DefaultBaseConfig(),
Expand Down Expand Up @@ -148,7 +148,7 @@ func (cfg *Config) ValidateBasic() error {
//-----------------------------------------------------------------------------
// BaseConfig

// BaseConfig defines the base configuration for a Tendermint node
// BaseConfig defines the base configuration for a Ostracon node
type BaseConfig struct { //nolint: maligned
// chainID is unexposed and immutable but here for convenience
chainID string
Expand All @@ -158,7 +158,7 @@ type BaseConfig struct { //nolint: maligned
RootDir string `mapstructure:"home"`

// TCP or UNIX socket address of the ABCI application,
// or the name of an ABCI application compiled in with the Tendermint binary
// or the name of an ABCI application compiled in with the Ostracon binary
ProxyApp string `mapstructure:"proxy_app"`

// A custom human readable name for this node
Expand Down Expand Up @@ -208,7 +208,7 @@ type BaseConfig struct { //nolint: maligned
// Path to the JSON file containing the last sign state of a validator
PrivValidatorState string `mapstructure:"priv_validator_state_file"`

// TCP or UNIX socket address for Tendermint to listen on for
// TCP or UNIX socket address for Ostracon to listen on for
// connections from an external PrivValidator process
PrivValidatorListenAddr string `mapstructure:"priv_validator_laddr"`

Expand Down Expand Up @@ -311,7 +311,7 @@ func (cfg BaseConfig) ValidateBasic() error {
//-----------------------------------------------------------------------------
// RPCConfig

// RPCConfig defines the configuration options for the Tendermint RPC server
// RPCConfig defines the configuration options for the Ostracon RPC server
type RPCConfig struct {
RootDir string `mapstructure:"home"`

Expand Down Expand Up @@ -400,20 +400,20 @@ type RPCConfig struct {
MaxHeaderBytes int `mapstructure:"max_header_bytes"`

// The path to a file containing certificate that is used to create the HTTPS server.
// Might be either absolute path or path related to Tendermint's config directory.
// Might be either absolute path or path related to Ostracon's config directory.
//
// If the certificate is signed by a certificate authority,
// the certFile should be the concatenation of the server's certificate, any intermediates,
// and the CA's certificate.
//
// NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server.
// NOTE: both tls_cert_file and tls_key_file must be present for Ostracon to create HTTPS server.
// Otherwise, HTTP server is run.
TLSCertFile string `mapstructure:"tls_cert_file"`

// The path to a file containing matching private key that is used to create the HTTPS server.
// Might be either absolute path or path related to tendermint's config directory.
// Might be either absolute path or path related to ostracon's config directory.
//
// NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server.
// NOTE: both tls_cert_file and tls_key_file must be present for Ostracon to create HTTPS server.
// Otherwise, HTTP server is run.
TLSKeyFile string `mapstructure:"tls_key_file"`

Expand Down Expand Up @@ -522,7 +522,7 @@ func (cfg RPCConfig) IsTLSEnabled() bool {
//-----------------------------------------------------------------------------
// P2PConfig

// P2PConfig defines the configuration options for the Tendermint peer-to-peer networking layer
// P2PConfig defines the configuration options for the Ostracon peer-to-peer networking layer
type P2PConfig struct { //nolint: maligned
RootDir string `mapstructure:"home"`

Expand Down Expand Up @@ -707,7 +707,7 @@ func DefaultFuzzConnConfig() *FuzzConnConfig {
//-----------------------------------------------------------------------------
// MempoolConfig

// MempoolConfig defines the configuration options for the Tendermint mempool
// MempoolConfig defines the configuration options for the Ostracon mempool
type MempoolConfig struct {
RootDir string `mapstructure:"home"`
Recheck bool `mapstructure:"recheck"`
Expand All @@ -734,7 +734,7 @@ type MempoolConfig struct {
MaxBatchBytes int `mapstructure:"max_batch_bytes"`
}

// DefaultMempoolConfig returns a default configuration for the Tendermint mempool
// DefaultMempoolConfig returns a default configuration for the Ostracon mempool
func DefaultMempoolConfig() *MempoolConfig {
return &MempoolConfig{
Recheck: true,
Expand All @@ -749,7 +749,7 @@ func DefaultMempoolConfig() *MempoolConfig {
}
}

// TestMempoolConfig returns a configuration for testing the Tendermint mempool
// TestMempoolConfig returns a configuration for testing the Ostracon mempool
func TestMempoolConfig() *MempoolConfig {
cfg := DefaultMempoolConfig()
cfg.CacheSize = 1000
Expand Down Expand Up @@ -787,7 +787,7 @@ func (cfg *MempoolConfig) ValidateBasic() error {
//-----------------------------------------------------------------------------
// StateSyncConfig

// StateSyncConfig defines the configuration for the Tendermint state sync service
// StateSyncConfig defines the configuration for the Ostracon state sync service
type StateSyncConfig struct {
Enable bool `mapstructure:"enable"`
TempDir string `mapstructure:"temp_dir"`
Expand Down Expand Up @@ -854,7 +854,7 @@ func (cfg *StateSyncConfig) ValidateBasic() error {
//-----------------------------------------------------------------------------
// FastSyncConfig

// FastSyncConfig defines the configuration for the Tendermint fast sync service
// FastSyncConfig defines the configuration for the Ostracon fast sync service
type FastSyncConfig struct {
Version string `mapstructure:"version"`
}
Expand Down Expand Up @@ -888,7 +888,7 @@ func (cfg *FastSyncConfig) ValidateBasic() error {
//-----------------------------------------------------------------------------
// ConsensusConfig

// ConsensusConfig defines the configuration for the Tendermint consensus service,
// ConsensusConfig defines the configuration for the Ostracon consensus service,
// including timeouts and details about the WAL and the block structure.
type ConsensusConfig struct {
RootDir string `mapstructure:"home"`
Expand Down
Loading

0 comments on commit 7ea6e35

Please sign in to comment.