Skip to content

Commit b83a410

Browse files
author
Devon Bear
committed
fix(naming): sg->pol
1 parent f1773a6 commit b83a410

File tree

21 files changed

+95
-100
lines changed

21 files changed

+95
-100
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</h1>
77

88
<div>
9-
<a href="https://codecov.io/gh/berachain/stargazer" >
10-
<img src="https://codecov.io/gh/berachain/stargazer/branch/main/graph/badge.svg?token=0DYQAKBGVW"/>
9+
<a href="https://codecov.io/gh/berachain/polaris" >
10+
<img src="https://codecov.io/gh/berachain/polaris/branch/main/graph/badge.svg?token=0DYQAKBGVW"/>
1111
</a>
1212
<a href="https://pkg.go.dev/pkg.berachain.dev/polaris">
1313
<img src="https://pkg.go.dev/badge/pkg.berachain.dev/polaris.svg" alt="Go Reference">
@@ -28,7 +28,7 @@
2828

2929
### From Binary
3030

31-
The easiest way to install a Cosmos-SDK Blockchain running Polaris is to download a pre-built binary. You can find the latest binaries on the [releases](https://github.com/stargazer/releases) page.
31+
The easiest way to install a Cosmos-SDK Blockchain running Polaris is to download a pre-built binary. You can find the latest binaries on the [releases](https://github.com/polaris/releases) page.
3232

3333
### From Source
3434

@@ -65,28 +65,28 @@ Go v1.20+ or higher is required for Polaris
6565
[Foundry](https://book.getfoundry.sh/getting-started/installation) is required for Polaris
6666

6767
3. Install Foundry:
68-
68+
polaris
6969
```sh
7070
curl -L https://foundry.paradigm.xyz | bash
7171
```
7272

7373
**Step 2: Get Polaris source code**
7474

75-
Clone the `stargazer` repo from the [official repo](https://github.com/berachain/stargazer/) and check
75+
Clone the `polaris` repo from the [official repo](https://github.com/berachain/polaris/) and check
7676
out the `main` branch for the latest stable release.
7777
Build the binary.
7878

7979
```bash
8080
cd $HOME
81-
git clone https://github.com/berachain/stargazer
82-
cd stargazer
81+
git clone https://github.com/berachain/polaris
82+
cd polaris
8383
git checkout main
8484
go run build/setup.go
8585
```
8686

8787
**Step 3: Build the Node Software**
8888

89-
Run the following command to install `stargazerd` to your `GOPATH` and build the node. `stargazerd` is the node daemon and CLI for interacting with a stargazer node.
89+
Run the following command to install `polard` to your `GOPATH` and build the node. `polard` is the node daemon and CLI for interacting with a polaris node.
9090

9191
```bash
9292
mage install
@@ -97,14 +97,14 @@ mage install
9797
Verify your installation with the following command:
9898

9999
```bash
100-
stargazerd version --long
100+
polard version --long
101101
```
102102

103103
A successful installation will return the following:
104104

105105
```bash
106106
name: berachain
107-
server_name: stargazerd
107+
server_name: polard
108108
version: <x.x.x>
109109
commit: <Commit hash>
110110
build_tags: netgo,ledger

build/mage/build.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func All() error {
6666
}
6767

6868
func BuildPolarisApp() error {
69-
cmd := "stargazerd"
69+
cmd := "polard"
7070
args := []string{
7171
generateBuildTags(),
7272
generateLinkerFlags(production, statically),
@@ -127,7 +127,7 @@ func Install() error {
127127
args := []string{
128128
generateBuildTags(),
129129
generateLinkerFlags(production, statically),
130-
"./runtime/cmd/stargazerd",
130+
"./runtime/cmd/polard",
131131
}
132132

133133
return goInstall(args...)

eth/rpc/backend.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func (b *backend) SetHead(number uint64) {
167167

168168
// `HeaderByNumber` returns the block header at the given block number.
169169
func (b *backend) HeaderByNumber(_ context.Context, number BlockNumber) (*types.Header, error) {
170-
block, err := b.stargazerBlockByNumber(number)
170+
block, err := b.polarisBlockByNumber(number)
171171
if err != nil {
172172
b.logger.Error("eth.rpc.backend.HeaderByNumber", "number", number, "err", err)
173173
return nil, err
@@ -178,7 +178,7 @@ func (b *backend) HeaderByNumber(_ context.Context, number BlockNumber) (*types.
178178

179179
// `HeaderByHash` returns the block header with the given hash.
180180
func (b *backend) HeaderByHash(_ context.Context, hash common.Hash) (*types.Header, error) {
181-
block, err := b.stargazerBlockByHash(hash)
181+
block, err := b.polarisBlockByHash(hash)
182182
if err != nil {
183183
b.logger.Error("eth.rpc.backend.HeaderByHash", "hash", hash, "err", err)
184184
return nil, errorslib.Wrapf(ErrBlockNotFound, "HeaderByHash [%s]", hash.String())
@@ -191,7 +191,7 @@ func (b *backend) HeaderByHash(_ context.Context, hash common.Hash) (*types.Head
191191
func (b *backend) HeaderByNumberOrHash(_ context.Context,
192192
blockNrOrHash BlockNumberOrHash,
193193
) (*types.Header, error) {
194-
block, err := b.stargazerBlockByNumberOrHash(blockNrOrHash)
194+
block, err := b.polarisBlockByNumberOrHash(blockNrOrHash)
195195
if err != nil {
196196
b.logger.Error("eth.rpc.backend.HeaderByNumberOrHash", "blockNrOrHash", blockNrOrHash, "err", err)
197197
return nil, err
@@ -225,7 +225,7 @@ func (b *backend) CurrentBlock() *types.Block {
225225

226226
// `BlockByNumber` returns the block identified by `number`.
227227
func (b *backend) BlockByNumber(_ context.Context, number BlockNumber) (*types.Block, error) {
228-
block, err := b.stargazerBlockByNumber(number)
228+
block, err := b.polarisBlockByNumber(number)
229229
if err != nil {
230230
b.logger.Error("eth.rpc.backend.BlockByNumber", "number", number, "err", err)
231231
return nil, errorslib.Wrapf(err, "BlockByNumber [%d]", number)
@@ -237,7 +237,7 @@ func (b *backend) BlockByNumber(_ context.Context, number BlockNumber) (*types.B
237237

238238
// `BlockByHash` returns the block with the given `hash`.
239239
func (b *backend) BlockByHash(_ context.Context, hash common.Hash) (*types.Block, error) {
240-
block, err := b.stargazerBlockByHash(hash)
240+
block, err := b.polarisBlockByHash(hash)
241241
b.logger.Info("BlockByHash", "hash", hash, "block", block)
242242
if err != nil {
243243
b.logger.Error("eth.rpc.backend.BlockByHash", "hash", hash, "err", err)
@@ -252,7 +252,7 @@ func (b *backend) BlockByHash(_ context.Context, hash common.Hash) (*types.Block
252252
func (b *backend) BlockByNumberOrHash(_ context.Context,
253253
blockNrOrHash BlockNumberOrHash,
254254
) (*types.Block, error) {
255-
block, err := b.stargazerBlockByNumberOrHash(blockNrOrHash)
255+
block, err := b.polarisBlockByNumberOrHash(blockNrOrHash)
256256
if err != nil {
257257
b.logger.Error("eth.rpc.backend.BlockByNumberOrHash", "blockNrOrHash", blockNrOrHash, "err", err)
258258
return nil, err
@@ -270,7 +270,7 @@ func (b *backend) StateAndHeaderByNumber(
270270
b.logger.Error("eth.rpc.backend.StateAndHeaderByNumber", "number", number, "err", err)
271271
return nil, nil, err
272272
}
273-
block, err := b.stargazerBlockByNumber(number)
273+
block, err := b.polarisBlockByNumber(number)
274274
if err != nil {
275275
b.logger.Error("eth.rpc.backend.StateAndHeaderByNumber", "number", number, "err", err)
276276
return nil, nil, err
@@ -290,15 +290,15 @@ func (b *backend) StateAndHeaderByNumberOrHash(
290290
if inputNum, ok := blockNrOrHash.Number(); ok {
291291
// Try to resolve by block number first.
292292
number = inputNum.Int64()
293-
block, err = b.stargazerBlockByNumber(inputNum)
293+
block, err = b.polarisBlockByNumber(inputNum)
294294
if err != nil {
295295
b.logger.Error("eth.rpc.backend.StateAndHeaderByNumberOrHash", "number", inputNum,
296296
"err", err)
297297
return nil, nil, err
298298
}
299299
} else if hash, ok = blockNrOrHash.Hash(); ok {
300300
// Try to resolve by hash next.
301-
block, err = b.stargazerBlockByHash(hash)
301+
block, err = b.polarisBlockByHash(hash)
302302
if err != nil {
303303
b.logger.Error("eth.rpc.backend.StateAndHeaderByNumberOrHash", "hash", hash,
304304
"err", err)
@@ -458,7 +458,7 @@ func (b *backend) GetBody(_ context.Context, hash common.Hash,
458458
b.logger.Error("eth.rpc.backend.GetBody", "number", number, "hash", hash)
459459
return nil, errors.New("invalid arguments; expect hash and no special block numbers")
460460
}
461-
block, err := b.stargazerBlockByNumberOrHash(BlockNumberOrHash{BlockNumber: &number, BlockHash: &hash})
461+
block, err := b.polarisBlockByNumberOrHash(BlockNumberOrHash{BlockNumber: &number, BlockHash: &hash})
462462
if err != nil {
463463
b.logger.Error("eth.rpc.backend.GetBody", "number", number, "hash", hash)
464464
return nil, err
@@ -527,16 +527,16 @@ func (b *backend) PeerCount() hexutil.Uint {
527527
// Polaris Helpers
528528
// ==============================================================================
529529

530-
// `stargazerBlockByNumberOrHash` returns the block identified by `number` or `hash`.
531-
func (b *backend) stargazerBlockByNumberOrHash(
530+
// `polarisBlockByNumberOrHash` returns the block identified by `number` or `hash`.
531+
func (b *backend) polarisBlockByNumberOrHash(
532532
blockNrOrHash BlockNumberOrHash,
533533
) (*types.Block, error) {
534534
// First we try to get by hash.
535535
if hash, ok := blockNrOrHash.Hash(); ok {
536536
block, err := b.chain.GetPolarisBlockByHash(hash)
537537
if err != nil {
538538
return nil, errorslib.Wrapf(ErrBlockNotFound,
539-
"stargazerBlockByNumberOrHash: hash [%s]", hash.String())
539+
"polarisBlockByNumberOrHash: hash [%s]", hash.String())
540540
}
541541

542542
// If the has is found, we have the canonical chain.
@@ -545,30 +545,30 @@ func (b *backend) stargazerBlockByNumberOrHash(
545545
}
546546
if blockNrOrHash.RequireCanonical {
547547
return nil, errorslib.Wrapf(ErrHashNotCanonical,
548-
"stargazerBlockByNumberOrHash: hash [%s]", hash.String())
548+
"polarisBlockByNumberOrHash: hash [%s]", hash.String())
549549
}
550550
// If not we try to query by number as a backup.
551551
}
552552

553553
// Then we try to get the block by number
554554
if blockNr, ok := blockNrOrHash.Number(); ok {
555-
block, err := b.stargazerBlockByNumber(blockNr)
555+
block, err := b.polarisBlockByNumber(blockNr)
556556
if err != nil {
557557
return nil, errorslib.Wrapf(ErrBlockNotFound,
558-
"stargazerBlockByNumberOrHash: number [%d]", blockNr)
558+
"polarisBlockByNumberOrHash: number [%d]", blockNr)
559559
}
560560
return block, nil
561561
}
562562
return nil, errors.New("invalid arguments; neither block nor hash specified")
563563
}
564564

565-
// `stargazerBlockByHash` returns the stargazer block identified by `hash`.
566-
func (b *backend) stargazerBlockByHash(hash common.Hash) (*types.Block, error) {
565+
// `polarisBlockByHash` returns the polaris block identified by `hash`.
566+
func (b *backend) polarisBlockByHash(hash common.Hash) (*types.Block, error) {
567567
return b.chain.GetPolarisBlockByHash(hash)
568568
}
569569

570-
// `stargazerBlockByNumber` returns the stargazer block identified by `number.
571-
func (b *backend) stargazerBlockByNumber(number BlockNumber) (*types.Block, error) {
570+
// `polarisBlockByNumber` returns the polaris block identified by `number.
571+
func (b *backend) polarisBlockByNumber(number BlockNumber) (*types.Block, error) {
572572
switch number { //nolint:nolintlint,exhaustive // golangci-lint bug?
573573
case SafeBlockNumber, FinalizedBlockNumber:
574574
return b.chain.FinalizedBlock()

lib/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# stargazer-lib
1+
# polaris-lib
22

33
## TODO: move this folder to another repo later on.

runtime/Dockerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ ARG GO_VERSION
2323
# Use the latest foundry image
2424
FROM ghcr.io/foundry-rs/foundry as foundry
2525

26-
WORKDIR /stargazer
26+
WORKDIR /polaris
2727

2828
# Build and test the source code
2929
ARG PRECOMPILE_CONTRACTS_DIR
3030
COPY ${PRECOMPILE_CONTRACTS_DIR} ${PRECOMPILE_CONTRACTS_DIR}
31-
WORKDIR /stargazer/${PRECOMPILE_CONTRACTS_DIR}
31+
WORKDIR /polaris/${PRECOMPILE_CONTRACTS_DIR}
3232

3333
RUN forge build
3434

@@ -40,7 +40,7 @@ RUN forge build
4040
FROM golang:${GO_VERSION}-alpine as builder
4141

4242
# Copy our source code into the container
43-
WORKDIR /stargazer
43+
WORKDIR /polaris
4444
COPY . .
4545

4646
# Setup some alpine stuff that nobody really knows why we need other
@@ -56,7 +56,7 @@ RUN apk add linux-headers
5656

5757
# Copy the forge output
5858
ARG PRECOMPILE_CONTRACTS_DIR
59-
# COPY --from=foundry /stargazer/${PRECOMPILE_CONTRACTS_DIR}/out /stargazer//${PRECOMPILE_CONTRACTS_DIR}/out
59+
# COPY --from=foundry /polaris/${PRECOMPILE_CONTRACTS_DIR}/out /polaris//${PRECOMPILE_CONTRACTS_DIR}/out
6060

6161
# Copy the go mod and sum files
6262
COPY go.mod ./
@@ -81,7 +81,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
8181
-X github.com/cosmos/cosmos-sdk/types.DBBackend="pebbledb" \
8282
-w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \
8383
-trimpath \
84-
-o /stargazer/bin/ \
84+
-o /polaris/bin/ \
8585
./...
8686

8787
#######################################################
@@ -93,12 +93,12 @@ FROM golang:${GO_VERSION}-alpine
9393
RUN apk add --no-cache bash
9494
RUN apk add --no-cache jq
9595

96-
WORKDIR /stargazer
96+
WORKDIR /polaris
9797

98-
COPY --from=builder /stargazer/bin/stargazerd /bin/
99-
COPY --from=builder /stargazer/init.sh /stargazer/
98+
COPY --from=builder /polaris/bin/polard /bin/
99+
COPY --from=builder /polaris/init.sh /polaris/
100100

101-
ENV HOME /stargazer
101+
ENV HOME /polaris
102102
WORKDIR $HOME
103103

104104
# TODO: reduce ports and clarify

runtime/app.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ type PolarisApp struct {
177177
GroupKeeper groupkeeper.Keeper
178178
ConsensusParamsKeeper consensuskeeper.Keeper
179179

180-
// stargazer keepers
180+
// polaris keepers
181181
EVMKeeper *evmkeeper.Keeper
182182

183183
// simulation manager
@@ -191,7 +191,7 @@ func init() {
191191
panic(err)
192192
}
193193

194-
DefaultNodeHome = filepath.Join(userHomeDir, ".stargazerapp")
194+
DefaultNodeHome = filepath.Join(userHomeDir, ".polard")
195195
}
196196

197197
// NewPolarisApp returns a reference to an initialized PolarisApp.
@@ -454,7 +454,7 @@ func (app *PolarisApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.AP
454454
if err := server.RegisterSwaggerAPI(apiSvr.ClientCtx, apiSvr.Router, apiConfig.Swagger); err != nil {
455455
panic(err)
456456
}
457-
// Register Ethereum JSON-RPC API as needed by stargazer.
457+
// Register Ethereum JSON-RPC API as needed by polaris.
458458
evmrpc.RegisterJSONRPCServer(apiSvr.ClientCtx, apiSvr.Router, app.EVMKeeper.GetRPCProvider())
459459
}
460460

runtime/cmd/stargazerd/cmd/root.go renamed to runtime/cmd/polard/cmd/root.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ import (
7575
// WithKeyringOptions(hd.EthSecp256k1Option()).
7676
// WithViper(EnvPrefix)
7777

78-
// NewRootCmd creates a new root command for stargazerd. It is called once in the
78+
// NewRootCmd creates a new root command for polard. It is called once in the
7979
// main function.
8080
func NewRootCmd() *cobra.Command {
8181
// we "pre"-instantiate the application for getting the injected/configured encoding configuration
@@ -100,7 +100,7 @@ func NewRootCmd() *cobra.Command {
100100
WithViper("") // In simapp, we don't use any prefix for env variables.
101101

102102
rootCmd := &cobra.Command{
103-
Use: "stargazerd",
103+
Use: "polard",
104104
Short: "simulation app",
105105
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
106106
// set the default command outputs
@@ -215,7 +215,7 @@ func addModuleInitFlags(startCmd *cobra.Command) {
215215
crisis.AddModuleInitFlags(startCmd)
216216
}
217217

218-
// genesisCommand builds genesis-related `stargazerd genesis` command. Users may provide application specific commands as a parameter.
218+
// genesisCommand builds genesis-related `polard genesis` command. Users may provide application specific commands as a parameter.
219219
func genesisCommand(encodingConfig params.EncodingConfig, cmds ...*cobra.Command) *cobra.Command {
220220
cmd := genutilcli.GenesisCoreCommand(encodingConfig.TxConfig, runtime.ModuleBasics, runtime.DefaultNodeHome)
221221

@@ -301,7 +301,7 @@ func appExport(
301301
appOpts servertypes.AppOptions,
302302
modulesToExport []string,
303303
) (servertypes.ExportedApp, error) {
304-
var stargazerApp *runtime.PolarisApp
304+
var polarisApp *runtime.PolarisApp
305305

306306
// this check is necessary as we use the flag in x/upgrade.
307307
// we can exit more gracefully by checking the flag here.
@@ -320,20 +320,20 @@ func appExport(
320320
appOpts = viperAppOpts
321321

322322
if height != -1 {
323-
stargazerApp = runtime.NewPolarisApp(logger, db, traceStore, false, appOpts)
323+
polarisApp = runtime.NewPolarisApp(logger, db, traceStore, false, appOpts)
324324

325-
if err := stargazerApp.LoadHeight(height); err != nil {
325+
if err := polarisApp.LoadHeight(height); err != nil {
326326
return servertypes.ExportedApp{}, err
327327
}
328328
} else {
329-
stargazerApp = runtime.NewPolarisApp(logger, db, traceStore, true, appOpts)
329+
polarisApp = runtime.NewPolarisApp(logger, db, traceStore, true, appOpts)
330330
}
331331

332-
return stargazerApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport)
332+
return polarisApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport)
333333
}
334334

335335
var tempDir = func() string {
336-
dir, err := os.MkdirTemp("", "stargazerapp")
336+
dir, err := os.MkdirTemp("", "polarisApp")
337337
if err != nil {
338338
dir = runtime.DefaultNodeHome
339339
}

0 commit comments

Comments
 (0)