Skip to content

Commit

Permalink
Rename networks to colosseum and garden
Browse files Browse the repository at this point in the history
Updated chain ID for Garden testnet to 12000.

squash: readme update
  • Loading branch information
0xalank authored and wizeguyy committed Jan 25, 2023
1 parent 3f4e260 commit b8d77bd
Show file tree
Hide file tree
Showing 19 changed files with 121 additions and 166 deletions.
77 changes: 16 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,90 +51,45 @@ directory.
| `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://eth.wiki/en/fundamentals/rlp)) dumps (data encoding used by the Ethereum protocol both network as well as consensus wise) to user-friendlier hierarchical representation (e.g. `rlpdump --hex CE0183FFFFFFC4C304050583616263`). |
| `puppeth` | a CLI wizard that aids in creating a new Ethereum network. |

## Running `geth`
## Running `go-quai`

Going through all the possible command line flags is out of scope here (please consult our
[CLI Wiki page](https://geth.ethereum.org/docs/interface/command-line-options)),
but we've enumerated a few common parameter combos to get you up to speed quickly
on how you can run your own `geth` instance.
on how you can run your own `go-quai` instance.

### Full node on the main Ethereum network
### Full node on the main Quai network

By far the most common scenario is people wanting to simply interact with the Ethereum
By far the most common scenario is people wanting to simply interact with the Quai
network: create accounts; transfer funds; deploy and interact with contracts. For this
particular use-case the user doesn't care about years-old historical data, so we can
fast-sync quickly to the current state of the network. To do so:

```shell
$ geth console
$ go-quai console
```

This command will:
* Start `geth` in snap sync mode (default, can be changed with the `--syncmode` flag),
* Start `go-quai` in snap sync mode (default, can be changed with the `--syncmode` flag),
causing it to download more data in exchange for avoiding processing the entire history
of the Ethereum network, which is very CPU intensive.
* Start up `geth`'s built-in interactive [JavaScript console](https://geth.ethereum.org/docs/interface/javascript-console),
(via the trailing `console` subcommand) through which you can interact using [`web3` methods](https://web3js.readthedocs.io/en/)
(note: the `web3` version bundled within `geth` is very old, and not up to date with official docs),
as well as `geth`'s own [management APIs](https://geth.ethereum.org/docs/rpc/server).
of the Quai network, which is very CPU intensive.
* Start up `go-quai`'s built-in interactive [JavaScript console](https://geth.ethereum.org/docs/interface/javascript-console),
(via the trailing `console` subcommand) through which you can interact using [`web3` methods](https://web3js.readthedocs.io/en/)
(note: the `web3` version bundled within `quai` is very old, and not up to date with official docs),
as well as `go-quai`'s own [management APIs](https://geth.ethereum.org/docs/rpc/server).
This tool is optional and if you leave it out you can always attach to an already running
`geth` instance with `geth attach`.
`go-quai` instance with `go-quai attach`.

### A Full node on the Görli test network

Transitioning towards developers, if you'd like to play around with creating Ethereum
contracts, you almost certainly would like to do that without any real money involved until
you get the hang of the entire system. In other words, instead of attaching to the main
network, you want to join the **test** network with your node, which is fully equivalent to
the main network, but with play-Ether only.

```shell
$ geth --goerli console
```

The `console` subcommand has the exact same meaning as above and they are equally
useful on the testnet too. Please, see above for their explanations if you've skipped here.

Specifying the `--goerli` flag, however, will reconfigure your `geth` instance a bit:

* Instead of connecting the main Ethereum network, the client will connect to the Görli
test network, which uses different P2P bootnodes, different network IDs and genesis
states.
* Instead of using the default data directory (`~/.ethereum` on Linux for example), `geth`
will nest itself one level deeper into a `goerli` subfolder (`~/.ethereum/goerli` on
Linux). Note, on OSX and Linux this also means that attaching to a running testnet node
requires the use of a custom endpoint since `geth attach` will try to attach to a
production node endpoint by default, e.g.,
`geth attach <datadir>/goerli/geth.ipc`. Windows users are not affected by
this.

*Note: Although there are some internal protective measures to prevent transactions from
crossing over between the main network and test network, you should make sure to always
use separate accounts for play-money and real-money. Unless you manually move
accounts, `geth` will by default correctly separate the two networks and will not make any
accounts available between them.*

### Full node on the Rinkeby test network

Go Ethereum also supports connecting to the older proof-of-authority based test network
called [*Rinkeby*](https://www.rinkeby.io) which is operated by members of the community.

```shell
$ geth --rinkeby console
```

### Full node on the Ropsten test network

In addition to Görli and Rinkeby, Geth also supports the ancient Ropsten testnet. The
Ropsten test network is based on the Ethash proof-of-work consensus algorithm. As such,
### Full node on the Garden test network
Garden test network is based on the Blake3 proof-of-work consensus algorithm. As such,
it has certain extra overhead and is more susceptible to reorganization attacks due to the
network's low difficulty/security.

```shell
$ geth --ropsten console
$ geth --garden console
```

*Note: Older Geth configurations store the Ropsten database in the `testnet` subdirectory.*
*Note: Older Geth configurations store the Garden database in the `testnet` subdirectory.*

### Configuration

Expand Down
4 changes: 2 additions & 2 deletions cmd/go-quai/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ It expects the genesis file as argument.`,
Usage: "Dumps genesis block JSON configuration to stdout",
ArgsUsage: "",
Flags: []cli.Flag{
utils.MainnetFlag,
utils.RopstenFlag,
utils.ColosseumFlag,
utils.GardenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
utils.CalaverasFlag,
Expand Down
2 changes: 1 addition & 1 deletion cmd/go-quai/dao_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestDAOForkBlockNewChain(t *testing.T) {
expectVote bool
}{
// Test DAO Default Mainnet
{"", params.MainnetChainConfig.DAOForkBlock, true},
{"", params.ColosseumChainConfig.DAOForkBlock, true},
// test DAO Init Old Privnet
{daoOldGenesis, nil, false},
// test DAO Default No Fork Privnet
Expand Down
18 changes: 9 additions & 9 deletions cmd/go-quai/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ var (
utils.NodeKeyFileFlag,
utils.NodeKeyHexFlag,
utils.DNSDiscoveryFlag,
utils.MainnetFlag,
utils.ColosseumFlag,
utils.DeveloperFlag,
utils.DeveloperPeriodFlag,
utils.RopstenFlag,
utils.GardenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
utils.CalaverasFlag,
Expand Down Expand Up @@ -226,8 +226,8 @@ func main() {
func prepare(ctx *cli.Context) {
// If we're running a known preset, log it for convenience.
switch {
case ctx.GlobalIsSet(utils.RopstenFlag.Name):
log.Info("Starting Quai on Ropsten testnet...")
case ctx.GlobalIsSet(utils.GardenFlag.Name):
log.Info("Starting Quai on Garden testnet...")

case ctx.GlobalIsSet(utils.RinkebyFlag.Name):
log.Info("Starting Quai on Rinkeby testnet...")
Expand All @@ -242,14 +242,14 @@ func prepare(ctx *cli.Context) {
log.Info("Starting Quai in ephemeral dev mode...")

case !ctx.GlobalIsSet(utils.NetworkIdFlag.Name):
log.Info("Starting Quai on mainnet...")
log.Info("Starting Quai on Colosseum testnet...")
}
// If we're a full node on mainnet without --cache specified, bump default cache allowance
// If we're a full node on colosseum without --cache specified, bump default cache allowance
if ctx.GlobalString(utils.SyncModeFlag.Name) != "light" && !ctx.GlobalIsSet(utils.CacheFlag.Name) && !ctx.GlobalIsSet(utils.NetworkIdFlag.Name) {
// Make sure we're not on any supported preconfigured testnet either
if !ctx.GlobalIsSet(utils.RopstenFlag.Name) && !ctx.GlobalIsSet(utils.RinkebyFlag.Name) && !ctx.GlobalIsSet(utils.GoerliFlag.Name) && !ctx.GlobalIsSet(utils.DeveloperFlag.Name) {
// Nope, we're really on mainnet. Bump that cache up!
log.Info("Bumping default cache on mainnet", "provided", ctx.GlobalInt(utils.CacheFlag.Name), "updated", 4096)
if !ctx.GlobalIsSet(utils.GardenFlag.Name) && !ctx.GlobalIsSet(utils.RinkebyFlag.Name) && !ctx.GlobalIsSet(utils.GoerliFlag.Name) && !ctx.GlobalIsSet(utils.DeveloperFlag.Name) {
// Nope, we're really on colosseum. Bump that cache up!
log.Info("Bumping default cache on colosseum", "provided", ctx.GlobalInt(utils.CacheFlag.Name), "updated", 4096)
ctx.GlobalSet(utils.CacheFlag.Name, strconv.Itoa(4096))
}
}
Expand Down
10 changes: 5 additions & 5 deletions cmd/go-quai/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var (
Flags: []cli.Flag{
utils.DataDirFlag,
utils.AncientFlag,
utils.RopstenFlag,
utils.GardenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
utils.CacheTrieJournalFlag,
Expand Down Expand Up @@ -90,7 +90,7 @@ the trie clean cache with default directory will be deleted.
Flags: []cli.Flag{
utils.DataDirFlag,
utils.AncientFlag,
utils.RopstenFlag,
utils.GardenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
},
Expand All @@ -110,7 +110,7 @@ In other words, this command does the snapshot to trie conversion.
Flags: []cli.Flag{
utils.DataDirFlag,
utils.AncientFlag,
utils.RopstenFlag,
utils.GardenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
},
Expand All @@ -132,7 +132,7 @@ It's also usable without snapshot enabled.
Flags: []cli.Flag{
utils.DataDirFlag,
utils.AncientFlag,
utils.RopstenFlag,
utils.GardenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
},
Expand All @@ -155,7 +155,7 @@ It's also usable without snapshot enabled.
Flags: []cli.Flag{
utils.DataDirFlag,
utils.AncientFlag,
utils.RopstenFlag,
utils.GardenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
utils.ExcludeCodeFlag,
Expand Down
4 changes: 2 additions & 2 deletions cmd/go-quai/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ var AppHelpFlagGroups = []flags.FlagGroup{
utils.KeyStoreDirFlag,
utils.USBFlag,
utils.NetworkIdFlag,
utils.MainnetFlag,
utils.ColosseumFlag,
utils.GoerliFlag,
utils.RinkebyFlag,
utils.CalaverasFlag,
utils.RopstenFlag,
utils.GardenFlag,
utils.SyncModeFlag,
utils.ExitWhenSyncedFlag,
utils.GCModeFlag,
Expand Down
54 changes: 27 additions & 27 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ var (
}
NetworkIdFlag = cli.Uint64Flag{
Name: "networkid",
Usage: "Explicitly set network id (integer)(For testnets: use --ropsten, --rinkeby, --goerli instead)",
Usage: "Explicitly set network id (integer)(For testnets: use --garden)",
Value: ethconfig.Defaults.NetworkId,
}
MainnetFlag = cli.BoolFlag{
Name: "mainnet",
Usage: "Ethereum mainnet",
ColosseumFlag = cli.BoolFlag{
Name: "colosseum",
Usage: "Quai Colosseum testnet",
}
GoerliFlag = cli.BoolFlag{
Name: "goerli",
Expand All @@ -146,9 +146,9 @@ var (
Name: "rinkeby",
Usage: "Rinkeby network: pre-configured proof-of-authority test network",
}
RopstenFlag = cli.BoolFlag{
Name: "ropsten",
Usage: "Ropsten network: pre-configured proof-of-work test network",
GardenFlag = cli.BoolFlag{
Name: "garden",
Usage: "Garden network: pre-configured proof-of-work test network",
}
DeveloperFlag = cli.BoolFlag{
Name: "dev",
Expand Down Expand Up @@ -291,7 +291,7 @@ var (
// Performance tuning settings
CacheFlag = cli.IntFlag{
Name: "cache",
Usage: "Megabytes of memory allocated to internal caching (default = 4096 mainnet full node, 128 light mode)",
Usage: "Megabytes of memory allocated to internal caching (default = 4096 quai full node, 128 light mode)",
Value: 1024,
}
CacheDatabaseFlag = cli.IntFlag{
Expand Down Expand Up @@ -667,10 +667,10 @@ var (
// then a subdirectory of the specified datadir will be used.
func MakeDataDir(ctx *cli.Context) string {
if path := ctx.GlobalString(DataDirFlag.Name); path != "" {
if ctx.GlobalBool(RopstenFlag.Name) {
if ctx.GlobalBool(GardenFlag.Name) {
// Maintain compatibility with older Geth configurations storing the
// Ropsten database in `testnet` instead of `ropsten`.
path = filepath.Join(path, "ropsten")
// Garden database in `testnet` instead of `garden`.
path = filepath.Join(path, "garden")
} else if ctx.GlobalBool(RinkebyFlag.Name) {
path = filepath.Join(path, "rinkeby")
} else if ctx.GlobalBool(GoerliFlag.Name) {
Expand Down Expand Up @@ -732,12 +732,12 @@ func setNodeUserIdent(ctx *cli.Context, cfg *node.Config) {
// setBootstrapNodes creates a list of bootstrap nodes from the command line
// flags, reverting to pre-configured ones if none have been specified.
func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
urls := params.MainnetBootnodes
urls := params.ColosseumBootnodes
switch {
case ctx.GlobalIsSet(BootnodesFlag.Name):
urls = SplitAndTrim(ctx.GlobalString(BootnodesFlag.Name))
case ctx.GlobalBool(RopstenFlag.Name):
urls = params.RopstenBootnodes
case ctx.GlobalBool(GardenFlag.Name):
urls = params.GardenBootnodes
case ctx.GlobalBool(RinkebyFlag.Name):
urls = params.RinkebyBootnodes
case ctx.GlobalBool(GoerliFlag.Name):
Expand Down Expand Up @@ -1091,8 +1091,8 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) {
cfg.DataDir = ctx.GlobalString(DataDirFlag.Name)
case ctx.GlobalBool(DeveloperFlag.Name):
cfg.DataDir = "" // unless explicitly requested, use memory databases
case ctx.GlobalBool(RopstenFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "ropsten")
case ctx.GlobalBool(GardenFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "garden")
case ctx.GlobalBool(RinkebyFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "rinkeby")
case ctx.GlobalBool(GoerliFlag.Name) && cfg.DataDir == node.DefaultDataDir():
Expand Down Expand Up @@ -1287,7 +1287,7 @@ func SetGlobalVars(ctx *cli.Context) {
// SetEthConfig applies eth-related command line flags to the config.
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
// Avoid conflicting network flags
CheckExclusive(ctx, MainnetFlag, DeveloperFlag, RopstenFlag, RinkebyFlag, GoerliFlag, CalaverasFlag)
CheckExclusive(ctx, ColosseumFlag, DeveloperFlag, GardenFlag, RinkebyFlag, GoerliFlag, CalaverasFlag)
CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer

if ctx.GlobalString(GCModeFlag.Name) == "archive" && ctx.GlobalUint64(TxLookupLimitFlag.Name) != 0 {
Expand Down Expand Up @@ -1410,18 +1410,18 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
}
// Override any default configs for hard coded networks.
switch {
case ctx.GlobalBool(MainnetFlag.Name):
case ctx.GlobalBool(ColosseumFlag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 1
}
cfg.Genesis = core.DefaultGenesisBlock()
SetDNSDiscoveryDefaults(cfg, params.MainnetGenesisHash)
case ctx.GlobalBool(RopstenFlag.Name):
SetDNSDiscoveryDefaults(cfg, params.ColosseumGenesisHash)
case ctx.GlobalBool(GardenFlag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 3
cfg.NetworkId = 2
}
cfg.Genesis = core.DefaultRopstenGenesisBlock()
SetDNSDiscoveryDefaults(cfg, params.RopstenGenesisHash)
cfg.Genesis = core.DefaultGardenGenesisBlock()
SetDNSDiscoveryDefaults(cfg, params.GardenGenesisHash)
case ctx.GlobalBool(RinkebyFlag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 4
Expand Down Expand Up @@ -1459,7 +1459,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
}
default:
if cfg.NetworkId == 1 {
SetDNSDiscoveryDefaults(cfg, params.MainnetGenesisHash)
SetDNSDiscoveryDefaults(cfg, params.ColosseumGenesisHash)
}
}
}
Expand Down Expand Up @@ -1561,10 +1561,10 @@ func MakeChainDatabase(ctx *cli.Context, stack *node.Node, readonly bool) ethdb.
func MakeGenesis(ctx *cli.Context) *core.Genesis {
var genesis *core.Genesis
switch {
case ctx.GlobalBool(MainnetFlag.Name):
case ctx.GlobalBool(ColosseumFlag.Name):
genesis = core.DefaultGenesisBlock()
case ctx.GlobalBool(RopstenFlag.Name):
genesis = core.DefaultRopstenGenesisBlock()
case ctx.GlobalBool(GardenFlag.Name):
genesis = core.DefaultGardenGenesisBlock()
case ctx.GlobalBool(RinkebyFlag.Name):
genesis = core.DefaultRinkebyGenesisBlock()
case ctx.GlobalBool(GoerliFlag.Name):
Expand Down
Loading

0 comments on commit b8d77bd

Please sign in to comment.