Skip to content

Commit

Permalink
Renamed eth to quai in api and backend
Browse files Browse the repository at this point in the history
  • Loading branch information
gameofpointers committed Jan 11, 2024
1 parent 7296fb5 commit 43ec3bc
Show file tree
Hide file tree
Showing 47 changed files with 186 additions and 187 deletions.
15 changes: 7 additions & 8 deletions cmd/utils/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import (

"github.com/dominant-strategies/go-quai/common"
"github.com/dominant-strategies/go-quai/core/vm"
"github.com/dominant-strategies/go-quai/eth"
quai "github.com/dominant-strategies/go-quai/eth"
"github.com/dominant-strategies/go-quai/eth/ethconfig"
"github.com/dominant-strategies/go-quai/internal/quaiapi"
"github.com/dominant-strategies/go-quai/log"
"github.com/dominant-strategies/go-quai/node"
"github.com/dominant-strategies/go-quai/params"
"github.com/dominant-strategies/go-quai/quai"
"github.com/dominant-strategies/go-quai/quai/quaiconfig"
"github.com/dominant-strategies/go-quai/quaistats"
"github.com/spf13/viper"
"io"
Expand All @@ -25,7 +24,7 @@ type quaistatsConfig struct {
}

type quaiConfig struct {
Quai ethconfig.Config
Quai quaiconfig.Config
Node node.Config
Ethstats quaistatsConfig
}
Expand Down Expand Up @@ -62,7 +61,7 @@ func StartQuaiBackend() (*quai.QuaiBackend, error) {
stackZone.Wait()
}()

return &eth.QuaiBackend{}, nil
return &quai.QuaiBackend{}, nil
}

func StartNode(stack *node.Node) {
Expand All @@ -76,7 +75,7 @@ func StartNode(stack *node.Node) {
func makeConfigNode(nodeLocation common.Location) (*node.Node, quaiConfig) {
// Load defaults.
cfg := quaiConfig{
Quai: ethconfig.Defaults,
Quai: quaiconfig.Defaults,
Node: defaultNodeConfig(),
}

Expand Down Expand Up @@ -129,8 +128,8 @@ func makeFullNode(nodeLocation common.Location) *node.Node {
// RegisterQuaiService adds a Quai client to the stack.
// The second return value is the full node instance, which may be nil if the
// node is running as a light client.
func RegisterQuaiService(stack *node.Node, cfg ethconfig.Config, nodeCtx int) (quaiapi.Backend, error) {
backend, err := eth.New(stack, &cfg, nodeCtx)
func RegisterQuaiService(stack *node.Node, cfg quaiconfig.Config, nodeCtx int) (quaiapi.Backend, error) {
backend, err := quai.New(stack, &cfg, nodeCtx)
if err != nil {
Fatalf("Failed to register the Quai service: %v", err)
}
Expand Down
22 changes: 11 additions & 11 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import (
"github.com/dominant-strategies/go-quai/common/fdlimit"
"github.com/dominant-strategies/go-quai/core"
"github.com/dominant-strategies/go-quai/core/rawdb"
"github.com/dominant-strategies/go-quai/eth/ethconfig"
"github.com/dominant-strategies/go-quai/eth/gasprice"
"github.com/dominant-strategies/go-quai/ethdb"
"github.com/dominant-strategies/go-quai/log"
"github.com/dominant-strategies/go-quai/node"
"github.com/dominant-strategies/go-quai/params"
"github.com/dominant-strategies/go-quai/quai/gasprice"
"github.com/dominant-strategies/go-quai/quai/quaiconfig"
"github.com/pelletier/go-toml/v2"
gopsutil "github.com/shirou/gopsutil/mem"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -852,7 +852,7 @@ func setWS(cfg *node.Config, nodeLocation common.Location) {
}

// setDomUrl sets the dominant chain websocket url.
func setDomUrl(cfg *ethconfig.Config, nodeLocation common.Location) {
func setDomUrl(cfg *quaiconfig.Config, nodeLocation common.Location) {
// only set the dom url if the node is not prime
if nodeLocation != nil {
if len(nodeLocation) == 1 {
Expand All @@ -865,7 +865,7 @@ func setDomUrl(cfg *ethconfig.Config, nodeLocation common.Location) {
}

// setSubUrls sets the subordinate chain urls
func setSubUrls(cfg *ethconfig.Config, nodeLocation common.Location) {
func setSubUrls(cfg *quaiconfig.Config, nodeLocation common.Location) {
// only set the sub urls if its not the zone
if len(nodeLocation) != 2 {
if nodeLocation == nil {
Expand All @@ -878,7 +878,7 @@ func setSubUrls(cfg *ethconfig.Config, nodeLocation common.Location) {

// setGasLimitCeil sets the gas limit ceils based on the network that is
// running
func setGasLimitCeil(cfg *ethconfig.Config) {
func setGasLimitCeil(cfg *quaiconfig.Config) {
switch {
case viper.GetBool(ColosseumFlag.Name):
cfg.Miner.GasCeil = params.ColosseumGasCeil
Expand All @@ -903,7 +903,7 @@ func makeSubUrls() []string {
}

// setSlicesRunning sets the slices running flag
func setSlicesRunning(cfg *ethconfig.Config) {
func setSlicesRunning(cfg *quaiconfig.Config) {
slices := strings.Split(viper.GetString(SlicesRunningFlag.Name), ",")

// Sanity checks
Expand Down Expand Up @@ -946,7 +946,7 @@ func HexAddress(account string, nodeLocation common.Location) (common.Address, e

// setEtherbase retrieves the etherbase either from the directly specified
// command line flags or from the keystore if CLI indexed.
func setEtherbase(cfg *ethconfig.Config) {
func setEtherbase(cfg *quaiconfig.Config) {
coinbaseMap, err := ParseCoinbaseAddresses()
if err != nil {
log.Fatalf("error parsing coinbase addresses: %s", err)
Expand Down Expand Up @@ -1102,7 +1102,7 @@ func setTxPool(cfg *core.TxPoolConfig, nodeLocation common.Location) {
}
}

func setConsensusEngineConfig(cfg *ethconfig.Config) {
func setConsensusEngineConfig(cfg *quaiconfig.Config) {
if cfg.ConsensusEngine == "blake3" {
// Override any default configs for hard coded networks.
switch {
Expand Down Expand Up @@ -1173,7 +1173,7 @@ func setConsensusEngineConfig(cfg *ethconfig.Config) {
}
}

func setWhitelist(cfg *ethconfig.Config) {
func setWhitelist(cfg *quaiconfig.Config) {
whitelist := viper.GetString(WhitelistFlag.Name)
if whitelist == "" {
return
Expand Down Expand Up @@ -1235,8 +1235,8 @@ func CheckExclusive(args ...interface{}) {
}
}

// SetQuaiConfig applies eth-related command line flags to the config.
func SetQuaiConfig(stack *node.Node, cfg *ethconfig.Config, nodeLocation common.Location) {
// SetQuaiConfig applies quai-related command line flags to the config.
func SetQuaiConfig(stack *node.Node, cfg *quaiconfig.Config, nodeLocation common.Location) {
// Avoid conflicting network flags
CheckExclusive(ColosseumFlag, DeveloperFlag, GardenFlag, OrchardFlag, LocalFlag, LighthouseFlag)
CheckExclusive(DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer
Expand Down
2 changes: 1 addition & 1 deletion internal/quaiapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ import (
"github.com/dominant-strategies/go-quai/core/types"
"github.com/dominant-strategies/go-quai/core/vm"
"github.com/dominant-strategies/go-quai/crypto"
"github.com/dominant-strategies/go-quai/eth/abi"
"github.com/dominant-strategies/go-quai/log"
"github.com/dominant-strategies/go-quai/params"
"github.com/dominant-strategies/go-quai/quai/abi"
"github.com/dominant-strategies/go-quai/rlp"
"github.com/dominant-strategies/go-quai/rpc"
)
Expand Down
4 changes: 2 additions & 2 deletions p2p/node/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (

"github.com/dominant-strategies/go-quai/cmd/utils"
"github.com/dominant-strategies/go-quai/core/types"
"github.com/dominant-strategies/go-quai/eth"
"github.com/dominant-strategies/go-quai/log"
"github.com/dominant-strategies/go-quai/p2p"
quaiprotocol "github.com/dominant-strategies/go-quai/p2p/protocol"
"github.com/dominant-strategies/go-quai/quai"

"github.com/dominant-strategies/go-quai/common"
pubsub "github.com/libp2p/go-libp2p-pubsub"
Expand Down Expand Up @@ -94,7 +94,7 @@ func (p *P2PNode) Stop() error {
}
}

func (p *P2PNode) SetConsensusBackend(be eth.ConsensusAPI) {
func (p *P2PNode) SetConsensusBackend(be quai.ConsensusAPI) {
p.consensus = be
}

Expand Down
4 changes: 2 additions & 2 deletions p2p/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"github.com/dominant-strategies/go-quai/cmd/utils"
"github.com/dominant-strategies/go-quai/common"
"github.com/dominant-strategies/go-quai/core/types"
"github.com/dominant-strategies/go-quai/eth"
"github.com/dominant-strategies/go-quai/log"
"github.com/dominant-strategies/go-quai/p2p/protocol"
"github.com/dominant-strategies/go-quai/p2p/pubsubManager"
"github.com/dominant-strategies/go-quai/quai"
lru "github.com/hashicorp/golang-lru/v2"
)

Expand All @@ -35,7 +35,7 @@ type P2PNode struct {
host.Host

// Backend for handling consensus data
consensus eth.ConsensusAPI
consensus quai.ConsensusAPI

// List of peers to introduce us to the network
bootpeers []peer.AddrInfo
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 43ec3bc

Please sign in to comment.