aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-03-17 09:12:50 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:23 +0800
commit9493109f2be4507605e6b17e406bf8fd147ab3c8 (patch)
tree84fee3d1fb2095ff5ba793bdfccba89970bc8f89 /cmd/utils
parent9ee92eff068b09246ab6446efa39abfc0c7bd8a8 (diff)
downloadgo-tangerine-9493109f2be4507605e6b17e406bf8fd147ab3c8.tar
go-tangerine-9493109f2be4507605e6b17e406bf8fd147ab3c8.tar.gz
go-tangerine-9493109f2be4507605e6b17e406bf8fd147ab3c8.tar.bz2
go-tangerine-9493109f2be4507605e6b17e406bf8fd147ab3c8.tar.lz
go-tangerine-9493109f2be4507605e6b17e406bf8fd147ab3c8.tar.xz
go-tangerine-9493109f2be4507605e6b17e406bf8fd147ab3c8.tar.zst
go-tangerine-9493109f2be4507605e6b17e406bf8fd147ab3c8.zip
dex: implement recovery mechanism (#258)
* dex: implement recovery mechanism The DEXON recovery protocol allows us to use the Ethereum blockchain as a fallback consensus chain to coordinate recovery. * fix
Diffstat (limited to 'cmd/utils')
-rw-r--r--cmd/utils/flags.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index c6d60d0bb..6b0c682a7 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -664,6 +664,13 @@ var (
Usage: "External indexer plugin's flags if needed",
Value: "",
}
+
+ // Dexcon settings.
+ RecoveryNetworkRPCFlag = cli.StringFlag{
+ Name: "recovery.network-rpc",
+ Usage: "RPC URL of the recovery network",
+ Value: "https://mainnet.infura.io",
+ }
)
// MakeDataDir retrieves the currently requested data directory, terminating
@@ -1257,27 +1264,41 @@ func SetDexConfig(ctx *cli.Context, stack *node.Node, cfg *dex.Config) {
cfg.RPCGasCap = new(big.Int).SetUint64(ctx.GlobalUint64(RPCGlobalGasCap.Name))
}
+ cfg.RecoveryNetworkRPC = ctx.GlobalString(RecoveryNetworkRPCFlag.Name)
+
// Override any default configs for hard coded networks.
switch {
case ctx.GlobalBool(TestnetFlag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 238
}
+ if !ctx.GlobalIsSet(RecoveryNetworkRPCFlag.Name) {
+ cfg.RecoveryNetworkRPC = "http://rinkeby.infura.io"
+ }
cfg.Genesis = core.DefaultTestnetGenesisBlock()
case ctx.GlobalBool(TaipeiFlag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 239
}
+ if !ctx.GlobalIsSet(RecoveryNetworkRPCFlag.Name) {
+ cfg.RecoveryNetworkRPC = "http://rinkeby.infura.io"
+ }
cfg.Genesis = core.DefaultTaipeiGenesisBlock()
case ctx.GlobalBool(YilanFlag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 240
}
+ if !ctx.GlobalIsSet(RecoveryNetworkRPCFlag.Name) {
+ cfg.RecoveryNetworkRPC = "http://rinkeby.infura.io"
+ }
cfg.Genesis = core.DefaultYilanGenesisBlock()
case ctx.GlobalBool(DeveloperFlag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 1337
}
+ if !ctx.GlobalIsSet(RecoveryNetworkRPCFlag.Name) {
+ cfg.RecoveryNetworkRPC = "http://rinkeby.infura.io"
+ }
// Create new developer account or reuse existing one
var (
developer accounts.Account