Skip to content

Commit

Permalink
Merge pull request ethereum#17 from goerli/multi-geth
Browse files Browse the repository at this point in the history
Kotti "Görli Classic" Testnet Support
  • Loading branch information
sorpaas authored Jan 23, 2019
2 parents a78fd63 + 4053f5f commit 0605a5b
Show file tree
Hide file tree
Showing 14 changed files with 104 additions and 23 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ For a full list of networks supported by multi-geth, take a look at the command-
--mix MIX network: pre-configured MIX mainnet
--ethersocial Ethersocial network: pre-configured Ethersocial mainnet
--rinkeby Rinkeby network: pre-configured proof-of-authority test network
--kotti Kotti network: cross-client proof-of-authority test network
```

### Configuration
Expand Down
38 changes: 19 additions & 19 deletions cmd/clef/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ Clef can be used to sign transactions and data and is meant as a replacement for
This allows DApps not to depend on geth's account management. When a DApp wants to sign data it can send the data to
the signer, the signer will then provide the user with context and asks the user for permission to sign the data. If
the users grants the signing request the signer will send the signature back to the DApp.

This setup allows a DApp to connect to a remote Ethereum node and send transactions that are locally signed. This can
help in situations when a DApp is connected to a remote node because a local Ethereum node is not available, not
synchronised with the chain or a particular Ethereum node that has no built-in (or limited) account management.

Clef can run as a daemon on the same machine, or off a usb-stick like [usb armory](https://inversepath.com/usbarmory),
or a separate VM in a [QubesOS](https://www.qubes-os.org/) type os setup.

Check out
Check out

* the [tutorial](tutorial.md) for some concrete examples on how the signer works.
* the [setup docs](docs/setup.md) for some information on how to configure it to work on QubesOS or USBArmory.
* the [setup docs](docs/setup.md) for some information on how to configure it to work on QubesOS or USBArmory.


## Command line flags
Expand All @@ -31,7 +31,7 @@ GLOBAL OPTIONS:
--loglevel value log level to emit to the screen (default: 4)
--keystore value Directory for the keystore (default: "$HOME/.ethereum/keystore")
--configdir value Directory for clef configuration (default: "$HOME/.clef")
--networkid value Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby) (default: 1)
--networkid value Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby, 6=Kotti) (default: 1)
--lightkdf Reduce key-derivation RAM & CPU usage at some expense of KDF strength
--nousb Disables monitoring for and managing USB hardware wallets
--rpcaddr value HTTP-RPC server listening interface (default: "localhost")
Expand Down Expand Up @@ -180,7 +180,7 @@ None
#### Result
- address [string]: account address that is derived from the generated key
- url [string]: location of the keyfile

#### Sample call
```json
{
Expand Down Expand Up @@ -212,9 +212,9 @@ None
#### Result
- array with account records:
- account.address [string]: account address that is derived from the generated key
- account.type [string]: type of the
- account.type [string]: type of the account
- account.url [string]: location of the account

#### Sample call
```json
{
Expand Down Expand Up @@ -261,7 +261,7 @@ None

#### Result
- signed transaction in RLP encoded form [data]

#### Sample call
```json
{
Expand Down Expand Up @@ -358,7 +358,7 @@ Bash example:

#### Result
- calculated signature [data]

#### Sample call
```json
{
Expand All @@ -385,14 +385,14 @@ Response

#### Recover address
Derive the address from the account that was used to sign data from the data and signature.

#### Arguments
- data [data]: data that was signed
- signature [data]: the signature to verify

#### Result
- derived account [address]

#### Sample call
```json
{
Expand Down Expand Up @@ -421,16 +421,16 @@ Response
#### Import account
Import a private key into the keystore. The imported key is expected to be encrypted according to the web3 keystore
format.

#### Arguments
- account [object]: key in [web3 keystore format](https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition) (retrieved with account_export)
- account [object]: key in [web3 keystore format](https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition) (retrieved with account_export)

#### Result
- imported key [object]:
- key.address [address]: address of the imported key
- key.type [string]: type of the account
- key.url [string]: key URL

#### Sample call
```json
{
Expand Down Expand Up @@ -481,14 +481,14 @@ Response
#### Export account from keystore
Export a private key from the keystore. The exported private key is encrypted with the original passphrase. When the
key is imported later this passphrase is required.

#### Arguments
- account [address]: export private key that is associated with this account

#### Result
- exported key, see [web3 keystore format](https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition) for
more information

#### Sample call
```json
{
Expand Down Expand Up @@ -866,9 +866,9 @@ A UI should conform to the following rules.
along with the UI.


### UI Implementations
### UI Implementations

There are a couple of implementation for a UI. We'll try to keep this list up to date.
There are a couple of implementation for a UI. We'll try to keep this list up to date.

| Name | Repo | UI type| No external resources| Blocky support| Verifies permissions | Hash information | No secondary storage | Statically linked| Can modify parameters|
| ---- | ---- | -------| ---- | ---- | ---- |---- | ---- | ---- | ---- |
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ The export-preimages command export hash preimages to an RLP encoded stream`,
utils.SocialFlag,
utils.EthersocialFlag,
utils.RinkebyFlag,
utils.KottiFlag,
},
Category: "BLOCKCHAIN COMMANDS",
Description: `
Expand Down
2 changes: 2 additions & 0 deletions cmd/geth/consolecmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ func remoteConsole(ctx *cli.Context) error {
path = filepath.Join(path, "testnet")
} else if ctx.GlobalBool(utils.RinkebyFlag.Name) {
path = filepath.Join(path, "rinkeby")
} else if ctx.GlobalBool(utils.KottiFlag.Name) {
path = filepath.Join(path, "kotti")
} else if ctx.GlobalBool(utils.EllaismFlag.Name) {
path = filepath.Join(path, "ellaism")
} else if ctx.GlobalBool(utils.ClassicFlag.Name) {
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ var (
utils.MixFlag,
utils.EthersocialFlag,
utils.RinkebyFlag,
utils.KottiFlag,
utils.VMEnableDebugFlag,
utils.NetworkIdFlag,
utils.ConstantinopleOverrideFlag,
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ var AppHelpFlagGroups = []flagGroup{
utils.MixFlag,
utils.EthersocialFlag,
utils.RinkebyFlag,
utils.KottiFlag,
utils.SyncModeFlag,
utils.GCModeFlag,
utils.EthStatsURLFlag,
Expand Down
24 changes: 22 additions & 2 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ var (
}
NetworkIdFlag = cli.Uint64Flag{
Name: "networkid",
Usage: "Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby)",
Usage: "Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby, 6=Kotti)",
Value: eth.DefaultConfig.NetworkId,
}
TestnetFlag = cli.BoolFlag{
Expand Down Expand Up @@ -160,6 +160,10 @@ var (
Name: "rinkeby",
Usage: "Rinkeby network: pre-configured proof-of-authority test network",
}
KottiFlag = cli.BoolFlag{
Name: "kotti",
Usage: "Kotti network: cross-client proof-of-authority test network",
}
ConstantinopleOverrideFlag = cli.Uint64Flag{
Name: "override.constantinople",
Usage: "Manually specify constantinople fork-block, overriding the bundled setting",
Expand Down Expand Up @@ -682,6 +686,9 @@ func MakeDataDir(ctx *cli.Context) string {
if ctx.GlobalBool(RinkebyFlag.Name) {
return filepath.Join(path, "rinkeby")
}
if ctx.GlobalBool(KottiFlag.Name) {
return filepath.Join(path, "kotti")
}
return path
}
Fatalf("Cannot determine default data directory, please set manually (--datadir)")
Expand Down Expand Up @@ -746,6 +753,8 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
urls = params.EthersocialBootnodes
case ctx.GlobalBool(RinkebyFlag.Name):
urls = params.RinkebyBootnodes
case ctx.GlobalBool(KottiFlag.Name):
urls = params.KottiBootnodes
case cfg.BootstrapNodes != nil:
return // already set, don't apply defaults.
}
Expand Down Expand Up @@ -773,6 +782,8 @@ func setBootstrapNodesV5(ctx *cli.Context, cfg *p2p.Config) {
}
case ctx.GlobalBool(RinkebyFlag.Name):
urls = params.RinkebyBootnodes
case ctx.GlobalBool(KottiFlag.Name):
urls = params.KottiBootnodes
case cfg.BootstrapNodesV5 != nil:
return // already set, don't apply defaults.
}
Expand Down Expand Up @@ -1058,6 +1069,8 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) {
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "ethersocial")
case ctx.GlobalBool(RinkebyFlag.Name):
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "rinkeby")
case ctx.GlobalBool(KottiFlag.Name):
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "kotti")
}
}

Expand Down Expand Up @@ -1214,7 +1227,7 @@ func SetShhConfig(ctx *cli.Context, stack *node.Node, cfg *whisper.Config) {
// SetEthConfig applies eth-related command line flags to the config.
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
// Avoid conflicting network flags
checkExclusive(ctx, DeveloperFlag, TestnetFlag, RinkebyFlag, EllaismFlag, ClassicFlag, SocialFlag, MixFlag, EthersocialFlag)
checkExclusive(ctx, DeveloperFlag, TestnetFlag, RinkebyFlag, KottiFlag, EllaismFlag, ClassicFlag, SocialFlag, MixFlag, EthersocialFlag)
checkExclusive(ctx, LightServFlag, SyncModeFlag, "light")

if ctx.GlobalIsSet(EllaismFlag.Name) {
Expand Down Expand Up @@ -1337,6 +1350,11 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
cfg.NetworkId = 4
}
cfg.Genesis = core.DefaultRinkebyGenesisBlock()
case ctx.GlobalBool(KottiFlag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 6
}
cfg.Genesis = core.DefaultKottiGenesisBlock()
case ctx.GlobalBool(MixFlag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 76
Expand Down Expand Up @@ -1492,6 +1510,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis {
genesis = core.DefaultEthersocialGenesisBlock()
case ctx.GlobalBool(RinkebyFlag.Name):
genesis = core.DefaultRinkebyGenesisBlock()
case ctx.GlobalBool(KottiFlag.Name):
genesis = core.DefaultKottiGenesisBlock()
case ctx.GlobalBool(DeveloperFlag.Name):
Fatalf("Developer chains are ephemeral")
}
Expand Down
12 changes: 12 additions & 0 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,18 @@ func DefaultRinkebyGenesisBlock() *Genesis {
}
}

// DefaultKottiGenesisBlock returns the Kotti network genesis block.
func DefaultKottiGenesisBlock() *Genesis {
return &Genesis{
Config: params.KottiChainConfig,
Timestamp: 1546461831,
ExtraData: hexutil.MustDecode("0x000000000000000000000000000000000000000000000000000000000000000025b7955e43adf9c2a01a9475908702cce67f302a6aaf8cba3c9255a2b863415d4db7bae4f4bbca020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
GasLimit: 10485760,
Difficulty: big.NewInt(1),
Alloc: decodePrealloc(kottiAllocData),
}
}

// DeveloperGenesisBlock returns the 'geth --dev' genesis block. Note, this must
// be seeded with the
func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis {
Expand Down
1 change: 1 addition & 0 deletions core/genesis_alloc.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion eth/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ func (pm *ProtocolManager) txBroadcastLoop() {
// NodeInfo represents a short summary of the Ethereum sub-protocol metadata
// known about the host peer.
type NodeInfo struct {
Network uint64 `json:"network"` // Ethereum network ID (1=Frontier, 2=Morden, Ropsten=3, Rinkeby=4)
Network uint64 `json:"network"` // Ethereum network ID (1=Frontier, 2=Morden, Ropsten=3, Rinkeby=4, Kotti=6)
Difficulty *big.Int `json:"difficulty"` // Total difficulty of the host's blockchain
Genesis common.Hash `json:"genesis"` // SHA3 hash of the host's genesis block
Config *params.ChainConfig `json:"config"` // Chain configuration for the fork rules
Expand Down
2 changes: 1 addition & 1 deletion les/commons.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type lesCommons struct {
// NodeInfo represents a short summary of the Ethereum sub-protocol metadata
// known about the host peer.
type NodeInfo struct {
Network uint64 `json:"network"` // Ethereum network ID (1=Frontier, 2=Morden, Ropsten=3, Rinkeby=4)
Network uint64 `json:"network"` // Ethereum network ID (1=Frontier, 2=Morden, Ropsten=3, Rinkeby=4, Kotti=6)
Difficulty *big.Int `json:"difficulty"` // Total difficulty of the host's blockchain
Genesis common.Hash `json:"genesis"` // SHA3 hash of the host's genesis block
Config *params.ChainConfig `json:"config"` // Chain configuration for the fork rules
Expand Down
9 changes: 9 additions & 0 deletions mobile/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ func RinkebyGenesis() string {
return string(enc)
}

// KottiGenesis returns the JSON spec to use for the Kotti test network
func KottiGenesis() string {
enc, err := json.Marshal(core.DefaultKottiGenesisBlock())
if err != nil {
panic(err)
}
return string(enc)
}

// FoundationBootnodes returns the enode URLs of the P2P bootstrap nodes operated
// by the foundation running the V5 discovery protocol.
func FoundationBootnodes() *Enodes {
Expand Down
7 changes: 7 additions & 0 deletions params/bootnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ var RinkebyBootnodes = []string{
"enode://b6b28890b006743680c52e64e0d16db57f28124885595fa03a562be1d2bf0f3a1da297d56b13da25fb992888fd556d4c1a27b1f39d531bde7de1921c90061cc6@159.89.28.211:30303", // AKASHA
}

// KottiBootnodes are the enode URLs of the P2P bootstrap nodes running on the
// Kotti test network.
var KottiBootnodes = []string{
"enode://06333009fc9ef3c9e174768e495722a7f98fe7afd4660542e983005f85e556028410fd03278944f44cfe5437b1750b5e6bd1738f700fe7da3626d52010d2954c@51.141.15.254:30303",
"enode://ae8658da8d255d1992c3ec6e62e11d6e1c5899aa1566504bc1ff96a0c9c8bd44838372be643342553817f5cc7d78f1c83a8093dee13d77b3b0a583c050c81940@18.232.185.151:30303",
}

// DiscoveryV5Bootnodes are the enode URLs of the P2P bootstrap nodes for the
// experimental RLPx v5 topic-discovery network.
var DiscoveryV5Bootnodes = []string{
Expand Down
26 changes: 26 additions & 0 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var (
MixGenesisHash = common.HexToHash("0x4fa57903dad05875ddf78030c16b5da886f7d81714cf66946a4c02566dbb2af5")
EthersocialGenesisHash = common.HexToHash("0x310dd3c4ae84dd89f1b46cfdd5e26c8f904dfddddc73f323b468127272e20e9f")
RinkebyGenesisHash = common.HexToHash("0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177")
KottiGenesisHash = common.HexToHash("0x14c2283285a88fe5fce9bf5c573ab03d6616695d717b12a127188bcacfc743c4")
)

var (
Expand Down Expand Up @@ -217,6 +218,31 @@ var (
BloomRoot: common.HexToHash("0xff45a6f807138a2cde0cea0c209d9ce5ad8e43ccaae5a7c41af801bb72a1ef96"),
}

// KottiChainConfig is the chain parameters to run a node on the Ellaism main network.
KottiChainConfig = &ChainConfig{
ChainID: big.NewInt(6),
HomesteadBlock: big.NewInt(0),
DAOForkBlock: nil,
DAOForkSupport: false,
EIP150Block: big.NewInt(0),
EIP150Hash: common.HexToHash("0x14c2283285a88fe5fce9bf5c573ab03d6616695d717b12a127188bcacfc743c4"),
EIP155Block: big.NewInt(0),
EIP158Block: nil,
ByzantiumBlock: nil,
DisposalBlock: big.NewInt(0),
SocialBlock: nil,
EthersocialBlock: nil,
ConstantinopleBlock: nil,
ECIP1017EraRounds: big.NewInt(5000000),
EIP160Block: big.NewInt(0),
ECIP1010PauseBlock: big.NewInt(0),
ECIP1010Length: big.NewInt(2000000),
Clique: &CliqueConfig{
Period: 15,
Epoch: 30000,
},
}

// AllEthashProtocolChanges contains every protocol change (EIPs) introduced
// and accepted by the Ethereum core developers into the Ethash consensus.
//
Expand Down

0 comments on commit 0605a5b

Please sign in to comment.