From 474df83a59ac547bd172a7d102c500d84ad6d455 Mon Sep 17 00:00:00 2001 From: daniel1302 Date: Tue, 27 Jun 2023 13:48:35 +0200 Subject: [PATCH 1/5] fix: respect --do-not-stop-on-failure flag --- cmd/nodes_start.go | 7 ++++++- nomad/job_runner.go | 15 ++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/cmd/nodes_start.go b/cmd/nodes_start.go index 5fb495bb..2063b908 100644 --- a/cmd/nodes_start.go +++ b/cmd/nodes_start.go @@ -63,6 +63,11 @@ func init() { "", "Path of Vega binary to be used to start the node", ) + nodesStartCmd.PersistentFlags().BoolVar(&doNotStopAllJobsOnFailure, + "do-not-stop-on-failure", + false, + "Do not stop partially running network when failed to start", + ) nodesStartCmd.MarkFlagRequired("name") } @@ -96,7 +101,7 @@ func nodesStartNode(ctx context.Context, nodeSet *types.NodeSet, conf *config.Co } } - res, err := nomadRunner.RunNodeSets(ctx, []types.NodeSet{*nodeSet}) + res, err := nomadRunner.RunNodeSets(ctx, []types.NodeSet{*nodeSet}, !doNotStopAllJobsOnFailure) if err != nil { return "", fmt.Errorf("failed to start nomad node set %q : %w", nodeSet.Name, err) } diff --git a/nomad/job_runner.go b/nomad/job_runner.go index 3019cdad..4db20659 100644 --- a/nomad/job_runner.go +++ b/nomad/job_runner.go @@ -100,7 +100,7 @@ type jobWithPreProbe struct { // RunNodeSets returns list of started jobs. // When one of the jobs fails during startup it returns jobs that has alredy started before that. -func (r *JobRunner) RunNodeSets(ctx context.Context, nodeSets []types.NodeSet) ([]*api.Job, error) { +func (r *JobRunner) RunNodeSets(ctx context.Context, nodeSets []types.NodeSet, stopOnFailure bool) ([]*api.Job, error) { jobs := make([]jobWithPreProbe, 0, len(nodeSets)) for _, ns := range nodeSets { @@ -135,8 +135,12 @@ func (r *JobRunner) RunNodeSets(ctx context.Context, nodeSets []types.NodeSet) ( eg.Go(func() error { if err := r.runAndWait(ctx, j.Job, j.Probes); err != nil { - if _, err := r.stopJobsByIDs(ctx, []string{*j.Job.ID}); err != nil { - log.Printf("Failed to stop failed job %s, this job might need to be stopped manually. Reason %s", *j.Job.ID, err) + if stopOnFailure { + if _, err := r.stopJobsByIDs(ctx, []string{*j.Job.ID}); err != nil { + log.Printf("Failed to stop failed job %s, this job might need to be stopped manually. Reason %s", *j.Job.ID, err) + } + } else { + log.Println("The --do-not-stop-on-failure flag present. Nodeset won't be stopped") } return err @@ -253,7 +257,7 @@ func (r *JobRunner) StartNetwork( generatedSvcs *types.GeneratedServices, stopAllJobsOnFailure bool, ) (*types.NetworkJobs, error) { - netJobs, err := r.startNetwork(ctx, conf, generatedSvcs) + netJobs, err := r.startNetwork(ctx, conf, generatedSvcs, stopAllJobsOnFailure) if err != nil { if stopAllJobsOnFailure { if _, err := r.stopAllJobs(ctx); err != nil { @@ -309,6 +313,7 @@ func (r *JobRunner) startNetwork( gCtx context.Context, conf *config.Config, generatedSvcs *types.GeneratedServices, + stopOnFailure bool, ) (*types.NetworkJobs, error) { g, ctx := errgroup.WithContext(gCtx) @@ -365,7 +370,7 @@ func (r *JobRunner) startNetwork( } g.Go(func() error { - jobs, err := r.RunNodeSets(ctx, generatedSvcs.NodeSets.ToSlice()) + jobs, err := r.RunNodeSets(ctx, generatedSvcs.NodeSets.ToSlice(), stopOnFailure) lock.Lock() for _, job := range jobs { From 0870827bb0a23243d30892497a6874da36b8bc7d Mon Sep 17 00:00:00 2001 From: daniel1302 Date: Tue, 27 Jun 2023 17:02:57 +0200 Subject: [PATCH 2/5] feat: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdeff976..a96d2d89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - [384](https://github.com/vegaprotocol/vegacapsule/issues/384) Add command for stoping/starting a specific job ### 🐛 Fixes +- [394](https://github.com/vegaprotocol/vegacapsule/pull/394) Respect the `--do-not-stop-on-failure` flag ## v0.5.1 From b7b52769cb916700301ad861954d0a8ea6c36e5d Mon Sep 17 00:00:00 2001 From: daniel1302 Date: Tue, 27 Jun 2023 19:02:44 +0200 Subject: [PATCH 3/5] feat: add null-chain no erc20 config --- net_confs/config_nullchain_no_erc20.hcl | 78 ++++++++ .../nullchain/genesis_no_erc20.json.tmpl | 178 ++++++++++++++++++ .../nullchain/tendermint_validator.toml | 28 +++ .../nullchain/vega_validator_no_erc20.toml | 39 ++++ 4 files changed, 323 insertions(+) create mode 100644 net_confs/config_nullchain_no_erc20.hcl create mode 100644 net_confs/node_set_templates/nullchain/genesis_no_erc20.json.tmpl create mode 100644 net_confs/node_set_templates/nullchain/tendermint_validator.toml create mode 100644 net_confs/node_set_templates/nullchain/vega_validator_no_erc20.toml diff --git a/net_confs/config_nullchain_no_erc20.hcl b/net_confs/config_nullchain_no_erc20.hcl new file mode 100644 index 00000000..e5d19fa2 --- /dev/null +++ b/net_confs/config_nullchain_no_erc20.hcl @@ -0,0 +1,78 @@ +vega_binary_path = "vega" + +network "testnet" { + ethereum { + chain_id = "1440" + network_id = "1441" + endpoint = "ws://127.0.0.1:8545/" + } + + faucet "faucet-1" { + wallet_pass = "f4uc3tw4ll3t-v3g4-p4ssphr4e3" + + template = <<-EOT +[Node] + Port = 3002 + IP = "127.0.0.1" +EOT + } + + wallet "wallet-1" { + template = <<-EOT +Name = "DV" +Level = "info" +TokenExpiry = "168h0m0s" +Port = 1789 +Host = "0.0.0.0" + +[API] + [API.GRPC] + Hosts = [{{range $i, $v := .Validators}}{{if ne $i 0}},{{end}}"127.0.0.1:30{{$i}}2"{{end}}] + Retries = 5 +EOT + } + + pre_start { + docker_service "postgres-1" { + image = "vegaprotocol/timescaledb:2.8.0-pg14" + cmd = "postgres" + args = [] + env = { + POSTGRES_USER="vega" + POSTGRES_PASSWORD="vega" + POSTGRES_DBS="vega,vega0,vega1,vega2,vega3,vega4,vega5,vega6,vega7,vega8,vega9,vega10,vega11,vega12,vega13,vega14,vega15,vega16,vega17,vega18,vega19,vega20,vega21,vega22,vega23,vega24,vega25" + } + + static_port { + value = 5432 + to = 5432 + } + resources { + cpu = 600 + memory = 900 + } + + volume_mounts = ["${network_home_path}:${network_home_path}"] + + auth_soft_fail = true + } + } + + genesis_template_file = "./node_set_templates/nullchain/genesis_no_erc20.json.tmpl" + + node_set "validators" { + count = 1 + mode = "validator" + node_wallet_pass = "n0d3w4ll3t-p4ssphr4e3" + vega_wallet_pass = "w4ll3t-p4ssphr4e3" + ethereum_wallet_pass = "ch41nw4ll3t-3th3r3um-p4ssphr4e3" + use_data_node = false + + config_templates { + vega_file = "./node_set_templates/nullchain/vega_validator.toml" + tendermint_file = "./node_set_templates/nullchain/tendermint_validator.toml" + } + } + + smart_contracts_addresses_file = "./public_smart_contracts_addresses.json" +} diff --git a/net_confs/node_set_templates/nullchain/genesis_no_erc20.json.tmpl b/net_confs/node_set_templates/nullchain/genesis_no_erc20.json.tmpl new file mode 100644 index 00000000..5548594b --- /dev/null +++ b/net_confs/node_set_templates/nullchain/genesis_no_erc20.json.tmpl @@ -0,0 +1,178 @@ +{ + "app_state": { + "assets": { + "fBTC": { + "min_lp_stake": "1", + "decimals": 5, + "name": "BTC (fake)", + "symbol": "fBTC", + "total_supply": "21000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "1000000" + } + } + }, + "fDAI": { + "min_lp_stake": "1", + "decimals": 5, + "name": "DAI (fake)", + "symbol": "fDAI", + "total_supply": "1000000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "10000000000" + } + } + }, + "fEURO": { + "min_lp_stake": "1", + "decimals": 5, + "name": "EURO (fake)", + "symbol": "fEURO", + "total_supply": "1000000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "10000000000" + } + } + }, + "fUSDC": { + "min_lp_stake": "1", + "decimals": 5, + "name": "USDC (fake)", + "symbol": "fUSDC", + "total_supply": "1000000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "1000000000000" + } + } + }, + "XYZalpha": { + "min_lp_stake": "1", + "decimals": 5, + "name": "XYZ (α alpha)", + "symbol": "XYZalpha", + "total_supply": "1000000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "100000000000" + } + } + }, + "XYZbeta": { + "min_lp_stake": "1", + "decimals": 5, + "name": "XYZ (β beta)", + "symbol": "XYZbeta", + "total_supply": "1000000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "100000000000" + } + } + }, + "XYZgamma": { + "min_lp_stake": "1", + "decimals": 5, + "name": "XYZ (γ gamma)", + "symbol": "XYZgamma", + "total_supply": "1000000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "100000000000" + } + } + }, + "XYZdelta": { + "min_lp_stake": "1", + "decimals": 5, + "name": "XYZ (δ delta)", + "symbol": "XYZdelta", + "total_supply": "1000000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "100000000000" + } + } + }, + "XYZepsilon": { + "min_lp_stake": "1", + "decimals": 5, + "name": "XYZ (ε epsilon)", + "symbol": "XYZepsilon", + "total_supply": "1000000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "100000000000" + } + } + }, + "{{.GetVegaContractID "VEGA"}}": { + "min_lp_stake": "1", + "decimals": 18, + "name": "Vega", + "symbol": "VEGA", + "total_supply": "64999723000000000000000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "100000000000" + } + } + } + }, + "network": { + "ReplayAttackThreshold": 30 + }, + "network_parameters": { + "blockchains.ethereumConfig": "{\"network_id\": \"{{ .NetworkID }}\", \"chain_id\": \"{{ .ChainID }}\", \"collateral_bridge_contract\": { \"address\": \"{{.GetEthContractAddr "erc20_bridge_1"}}\" }, \"confirmations\": 3, \"staking_bridge_contract\": { \"address\": \"{{.GetEthContractAddr "staking_bridge"}}\", \"deployment_block_height\": 0}, \"token_vesting_contract\": { \"address\": \"{{.GetEthContractAddr "erc20_vesting"}}\", \"deployment_block_height\": 0 }, \"multisig_control_contract\": { \"address\": \"{{.GetEthContractAddr "MultisigControl"}}\", \"deployment_block_height\": 0 }}", + "governance.proposal.asset.minClose": "2s", + "governance.proposal.asset.minEnact": "2s", + "governance.proposal.asset.requiredParticipation": "0.00000000000000000000000015", + "governance.proposal.market.minClose": "2s", + "governance.proposal.market.minEnact": "2s", + "governance.proposal.market.requiredParticipation": "0.00000000000000000000000015", + "governance.proposal.updateMarket.minClose": "2s", + "governance.proposal.updateMarket.minEnact": "2s", + "governance.proposal.updateMarket.requiredParticipation": "0.00000000000000000000000015", + "governance.proposal.updateNetParam.minClose": "2s", + "governance.proposal.updateNetParam.minEnact": "2s", + "governance.proposal.updateNetParam.requiredParticipation": "0.00000000000000000000000015", + "market.auction.minimumDuration": "3s", + "market.fee.factors.infrastructureFee": "0.001", + "market.fee.factors.makerFee": "0.004", + "market.liquidity.stakeToCcyVolume": "0.3", + "market.liquidity.targetstake.triggering.ratio": "0.7", + "network.checkpoint.timeElapsedBetweenCheckpoints": "10s", + "reward.asset": "{{.GetVegaContractID "VEGA"}}", + "reward.staking.delegation.competitionLevel": "3.1", + "reward.staking.delegation.delegatorShare": "0.883", + "reward.staking.delegation.maxPayoutPerParticipant": "700000000000000000000", + "reward.staking.delegation.minimumValidatorStake": "3000000000000000000000", + "reward.staking.delegation.payoutDelay": "5m", + "reward.staking.delegation.payoutFraction": "0.007", + "spam.protection.delegation.min.tokens": "1000000000000000000", + "spam.protection.max.delegations": "390", + "spam.protection.max.proposals": "100", + "spam.protection.max.votes": "100", + "spam.protection.proposal.min.tokens": "1000000000000000000", + "spam.protection.voting.min.tokens": "1000000000000000000", + "validators.delegation.minAmount": "100000000000000000", + "validators.epoch.length": "5s", + "snapshot.interval.length": "100", + "validators.vote.required": "0.67" + }, + "network_limits": { + "propose_asset_enabled": true, + "propose_asset_enabled_from": "2021-09-01T00:00:00Z", + "propose_market_enabled": true, + "propose_market_enabled_from": "2021-09-01T00:00:00Z" + } + }, + "consensus_params": { + "block": { + "time_iota_ms": "1" + } + } +} \ No newline at end of file diff --git a/net_confs/node_set_templates/nullchain/tendermint_validator.toml b/net_confs/node_set_templates/nullchain/tendermint_validator.toml new file mode 100644 index 00000000..574de1a3 --- /dev/null +++ b/net_confs/node_set_templates/nullchain/tendermint_validator.toml @@ -0,0 +1,28 @@ +log_level = "info" + +proxy_app = "tcp://127.0.0.1:266{{.NodeNumber}}8" +moniker = "{{.TendermintNodePrefix}}-{{.NodeNumber}}" + +[rpc] + laddr = "tcp://0.0.0.0:266{{.NodeNumber}}7" + unsafe = true + +[p2p] + laddr = "tcp://0.0.0.0:266{{.NodeNumber}}6" + addr_book_strict = false + max_packet_msg_payload_size = 4096 + pex = false + allow_duplicate_ip = true + + persistent_peers = "{{- range $i, $peer := .NodePeers -}} + {{- if ne $i 0 }},{{end -}} + {{- $peer.ID}}@127.0.0.1:266{{$peer.Index}}6 + {{- end -}}" + + +[mempool] + size = 10000 + cache_size = 20000 + +[consensus] + skip_timeout_commit = false \ No newline at end of file diff --git a/net_confs/node_set_templates/nullchain/vega_validator_no_erc20.toml b/net_confs/node_set_templates/nullchain/vega_validator_no_erc20.toml new file mode 100644 index 00000000..5fed50a2 --- /dev/null +++ b/net_confs/node_set_templates/nullchain/vega_validator_no_erc20.toml @@ -0,0 +1,39 @@ +[Admin] + [Admin.Server] + SocketPath = "/tmp/vega-{{.NodeNumber}}.sock" + Enabled = true + +[API] + Port = {{add 300 .NodeNumber}}2 + [API.REST] + Port = {{add 300 .NodeNumber}}3 + +[Blockchain] + ChainProvider = "nullchain" + [Blockchain.Tendermint] + RPCAddr = "tcp://127.0.0.1:266{{.NodeNumber}}7" + [Blockchain.Null] + Level = "Debug" + BlockDuration = "1s" + TransactionsPerBlock = 1 + IP = "0.0.0.0" + Port = 31{{.NodeNumber}}1 + GenesisFile = "{{.NodeSet.Tendermint.GenesisFilePath}}" + +[EvtForward] + Level = "Info" + RetryRate = "1s" + {{if .FaucetPublicKey}} + BlockchainQueueAllowlist = ["{{ .FaucetPublicKey }}"] + {{end}} + +[Ethereum] + RPCEndpoint = "" + +[Processor] + [Processor.Ratelimit] + Requests = 10000 + PerNBlocks = 1 + +[Snapshot] + Level = "Debug" \ No newline at end of file From 5abad310ab0811c53868d90542435e0b25b8f41e Mon Sep 17 00:00:00 2001 From: daniel1302 Date: Tue, 27 Jun 2023 19:17:18 +0200 Subject: [PATCH 4/5] feat: add data-node to nullchain no erc20 --- net_confs/config_nullchain_no_erc20.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net_confs/config_nullchain_no_erc20.hcl b/net_confs/config_nullchain_no_erc20.hcl index e5d19fa2..ba300cf0 100644 --- a/net_confs/config_nullchain_no_erc20.hcl +++ b/net_confs/config_nullchain_no_erc20.hcl @@ -66,7 +66,7 @@ EOT node_wallet_pass = "n0d3w4ll3t-p4ssphr4e3" vega_wallet_pass = "w4ll3t-p4ssphr4e3" ethereum_wallet_pass = "ch41nw4ll3t-3th3r3um-p4ssphr4e3" - use_data_node = false + use_data_node = true config_templates { vega_file = "./node_set_templates/nullchain/vega_validator.toml" From 0dbfb053e4324c32d98c5aa5bc0bdfefb12b7a41 Mon Sep 17 00:00:00 2001 From: daniel1302 Date: Tue, 27 Jun 2023 21:13:09 +0200 Subject: [PATCH 5/5] feat: add null blockchain config with erc20 support --- net_confs/config_nullchain.hcl | 186 ++++---------- .../nullchain/data_node.tmpl | 48 ++++ .../nullchain/genesis.json.tmpl | 226 ++++++++++++++++++ .../nullchain/vega_validator.toml | 39 +++ 4 files changed, 361 insertions(+), 138 deletions(-) create mode 100644 net_confs/node_set_templates/nullchain/data_node.tmpl create mode 100644 net_confs/node_set_templates/nullchain/genesis.json.tmpl create mode 100644 net_confs/node_set_templates/nullchain/vega_validator.toml diff --git a/net_confs/config_nullchain.hcl b/net_confs/config_nullchain.hcl index d0f26541..0abf3513 100644 --- a/net_confs/config_nullchain.hcl +++ b/net_confs/config_nullchain.hcl @@ -1,7 +1,7 @@ vega_binary_path = "vega" network "testnet" { - ethereum { + ethereum { chain_id = "1440" network_id = "1441" endpoint = "ws://127.0.0.1:8545/" @@ -32,9 +32,50 @@ Host = "0.0.0.0" EOT } - pre_start {} + pre_start { + docker_service "ganache-1" { + image = "vegaprotocol/ganache:latest" + cmd = "ganache-cli" + args = [ + "--blockTime", "1", + "--chainId", "1440", + "--networkId", "1441", + "-h", "0.0.0.0", + "-p", "8545", + "-m", "ozone access unlock valid olympic save include omit supply green clown session", + "--db", "/app/ganache-db", + ] + static_port { + value = 8545 + to = 8545 + } + auth_soft_fail = true + } + + docker_service "postgres-1" { + image = "vegaprotocol/timescaledb:2.8.0-pg14" + cmd = "postgres" + args = [] + env = { + POSTGRES_USER="vega" + POSTGRES_PASSWORD="vega" + POSTGRES_DBS="vega" + } + + static_port { + value = 5332 + to = 5432 + } + resources { + cpu = 600 + memory = 900 + } + + auth_soft_fail = true + } + } - genesis_template_file = "./genesis.tmpl" + genesis_template_file = "./node_set_templates/nullchain/genesis.json.tmpl" node_set "validators" { count = 1 @@ -43,144 +84,13 @@ EOT vega_wallet_pass = "w4ll3t-p4ssphr4e3" ethereum_wallet_pass = "ch41nw4ll3t-3th3r3um-p4ssphr4e3" use_data_node = true - nomad_job_template_file = "./jobs/node_set_nullchain.tmpl" config_templates { - -// ============================ -// ===== VegaNode Config ====== -// ============================ - - vega = <<-EOT -[Admin] - [Admin.Server] - SocketPath = "/tmp/vega-{{.NodeNumber}}.sock" - Enabled = true - -[API] - Port = 30{{.NodeNumber}}2 - [API.REST] - Port = 30{{.NodeNumber}}3 - -[Blockchain] - ChainProvider = "nullchain" - [Blockchain.Tendermint] - RPCAddr = "tcp://127.0.0.1:266{{.NodeNumber}}7" - [Blockchain.Null] - Level = "Debug" - BlockDuration = "1s" - TransactionsPerBlock = 1 - IP = "0.0.0.0" - Port = 31{{.NodeNumber}}1 - GenesisFile = "{{.NodeSet.Tendermint.GenesisFilePath}}" - -[EvtForward] - Level = "Info" - RetryRate = "1s" - {{if .FaucetPublicKey}} - BlockchainQueueAllowlist = ["{{ .FaucetPublicKey }}"] - {{end}} - -[Ethereum] - RPCEndpoint = "{{.ETHEndpoint}}" - -[Broker] - [Broker.Socket] - Port = 30{{.NodeNumber}}5 - Enabled = true - -[Processor] - [Processor.Ratelimit] - Requests = 10000 - PerNBlocks = 1 -EOT - -// ============================ -// ==== Tendermint Config ===== -// ============================ - - tendermint = <<-EOT -log_level = "info" - -proxy_app = "tcp://127.0.0.1:266{{.NodeNumber}}8" -moniker = "{{.TendermintNodePrefix}}-{{.NodeNumber}}" - -[rpc] - laddr = "tcp://0.0.0.0:266{{.NodeNumber}}7" - unsafe = true - -[p2p] - laddr = "tcp://0.0.0.0:266{{.NodeNumber}}6" - addr_book_strict = false - max_packet_msg_payload_size = 4096 - pex = false - allow_duplicate_ip = true - - persistent_peers = "{{- range $i, $peer := .NodePeers -}} - {{- if ne $i 0 }},{{end -}} - {{- $peer.ID}}@127.0.0.1:266{{$peer.Index}}6 - {{- end -}}" - - -[mempool] - size = 10000 - cache_size = 20000 - -[consensus] - skip_timeout_commit = false -EOT + vega_file = "./node_set_templates/nullchain/vega_validator.toml" + tendermint_file = "./node_set_templates/nullchain/tendermint_validator.toml" + data_node_file = "./node_set_templates/nullchain/data_node.tmpl" } } - - smart_contracts_addresses = <<-EOT -{ - "addr0": { - "priv": "adef89153e4bd6b43876045efdd6818cec359340683edaec5e8588e635e8428b", - "pub": "0xb89A165EA8b619c14312dB316BaAa80D2a98B493" - }, - "MultisigControl": { - "Ethereum": "0xa956B5c58B4Ac8Dd1D44Ade3e8972A16e9C917E4" - }, - "ERC20_Asset_Pool": { - "Ethereum": "0x3EA59801698c6820328597F26d29fC3EaAa17AcA" - }, - "erc20_bridge_1": { - "Ethereum": "0x0858D9BD11A4F6Bae8b979402550CA6c6ddB8332" - }, - "erc20_bridge_2": { - "Ethereum": "0x846087f262859fe6604e2e9f787a9F3f39296Ff8" - }, - "tBTC": { - "Ethereum": "0xc6a6000d740707edc35f75f42447320B60450c04", - "Vega": "0x5cfa87844724df6069b94e4c8a6f03af21907d7bc251593d08e4251043ee9f7c" - }, - "tDAI": { - "Ethereum": "0xE25F12E386Cd7F84c41B5210504d9743A35Badda", - "Vega": "0x6d9d35f657589e40ddfb448b7ad4a7463b66efb307527fedd2aa7df1bbd5ea61" - }, - "tEURO": { - "Ethereum": "0x7c23d674fED4500103A0b7e05b4A0da17291FCE9", - "Vega": "0x8b52d4a3a4b0ffe733cddbc2b67be273816cfeb6ca4c8b339bac03ffba08e4e4" - }, - "tUSDC": { - "Ethereum": "0xD76Bd796e117D54044E616ae42A3577256B601D1", - "Vega": "0x993ed98f4f770d91a796faab1738551193ba45c62341d20597df70fea6704ede" - }, - "VEGA": { - "Ethereum": "0xBC944ba38753A6fCAdd634Be98379330dbaB3Eb8", - "Vega": "0xb4f2726571fbe8e33b442dc92ed2d7f0d810e21835b7371a7915a365f07ccd9b" - }, - "VEGAv1": { - "Ethereum": "0xB69a81EE133d8c4dC4AeCB30af93bC8698118ccE", - "Vega": "0xc1607f28ec1d0a0b36842c8327101b18de2c5f172585870912f5959145a9176c" - }, - "erc20_vesting": { - "Ethereum": "0xB9f84835F00C0E4f494C51C945863109cF80754A" - }, - "staking_bridge": { - "Ethereum": "0xE4c9fB5955bAa8a7965D000afdCEFF25cfe0E8a3" - } -} -EOT + smart_contracts_addresses_file = "./public_smart_contracts_addresses.json" } diff --git a/net_confs/node_set_templates/nullchain/data_node.tmpl b/net_confs/node_set_templates/nullchain/data_node.tmpl new file mode 100644 index 00000000..d972f24e --- /dev/null +++ b/net_confs/node_set_templates/nullchain/data_node.tmpl @@ -0,0 +1,48 @@ +GatewayEnabled = true + +[SqlStore] + Level = "Info" + Enabled = false + WipeOnStartup = true + UseEmbedded = true + [SQLStore.ConnectionConfig] + Database = "vega" + Host = "localhost" + Password = "vega" + Port = 5332 + UseTransactions = true + Username = "vega" + +[API] + Level = "Info" + Port = {{add 300 .NodeNumber}}7 + CoreNodeGRPCPort = {{add 300 .NodeNumber}}2 + +[Pprof] + Level = "Info" + Enabled = true + Port = {{add 60 .NodeNumber}}60 + ProfilesDir = "{{.NodeHomeDir}}" + +[Gateway] + Level = "Info" + [Gateway.Node] + Port = {{add 300 .NodeNumber}}7 + [Gateway.GraphQL] + Port = {{add 300 .NodeNumber}}8 + [Gateway.REST] + Port = {{add 300 .NodeNumber}}9 + +[Metrics] + Level = "Info" + Timeout = "5s" + Port = {{add 210 .NodeNumber}}2 + Enabled = false +[Broker] + Level = "Info" + UseEventFile = false + [Broker.SocketConfig] + Port = {{add 300 .NodeNumber}}5 + +[NetworkHistory] + Enabled = false \ No newline at end of file diff --git a/net_confs/node_set_templates/nullchain/genesis.json.tmpl b/net_confs/node_set_templates/nullchain/genesis.json.tmpl new file mode 100644 index 00000000..0daf8108 --- /dev/null +++ b/net_confs/node_set_templates/nullchain/genesis.json.tmpl @@ -0,0 +1,226 @@ +{ + "app_state": { + "assets": { + "fBTC": { + "min_lp_stake": "1", + "decimals": 5, + "name": "BTC (fake)", + "symbol": "fBTC", + "total_supply": "21000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "1000000" + } + } + }, + "fDAI": { + "min_lp_stake": "1", + "decimals": 5, + "name": "DAI (fake)", + "symbol": "fDAI", + "total_supply": "1000000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "10000000000" + } + } + }, + "fEURO": { + "min_lp_stake": "1", + "decimals": 5, + "name": "EURO (fake)", + "symbol": "fEURO", + "total_supply": "1000000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "10000000000" + } + } + }, + "fUSDC": { + "min_lp_stake": "1", + "decimals": 5, + "name": "USDC (fake)", + "symbol": "fUSDC", + "total_supply": "1000000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "1000000000000" + } + } + }, + "XYZalpha": { + "min_lp_stake": "1", + "decimals": 5, + "name": "XYZ (α alpha)", + "symbol": "XYZalpha", + "total_supply": "1000000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "100000000000" + } + } + }, + "XYZbeta": { + "min_lp_stake": "1", + "decimals": 5, + "name": "XYZ (β beta)", + "symbol": "XYZbeta", + "total_supply": "1000000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "100000000000" + } + } + }, + "XYZgamma": { + "min_lp_stake": "1", + "decimals": 5, + "name": "XYZ (γ gamma)", + "symbol": "XYZgamma", + "total_supply": "1000000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "100000000000" + } + } + }, + "XYZdelta": { + "min_lp_stake": "1", + "decimals": 5, + "name": "XYZ (δ delta)", + "symbol": "XYZdelta", + "total_supply": "1000000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "100000000000" + } + } + }, + "XYZepsilon": { + "min_lp_stake": "1", + "decimals": 5, + "name": "XYZ (ε epsilon)", + "symbol": "XYZepsilon", + "total_supply": "1000000000", + "source": { + "builtin_asset": { + "max_faucet_amount_mint": "100000000000" + } + } + }, + "{{.GetVegaContractID "tBTC"}}": { + "min_lp_stake": "1", + "decimals": 5, + "name": "BTC (local)", + "symbol": "tBTC", + "total_supply": "0", + "source": { + "erc20": { + "contract_address": "{{.GetEthContractAddr "tBTC"}}" + } + } + }, + "{{.GetVegaContractID "tDAI"}}": { + "min_lp_stake": "1", + "decimals": 5, + "name": "DAI (local)", + "symbol": "tDAI", + "total_supply": "0", + "source": { + "erc20": { + "contract_address": "{{.GetEthContractAddr "tDAI"}}" + } + } + }, + "{{.GetVegaContractID "tEURO"}}": { + "min_lp_stake": "1", + "decimals": 5, + "name": "EURO (local)", + "symbol": "tEURO", + "total_supply": "0", + "source": { + "erc20": { + "contract_address": "{{.GetEthContractAddr "tEURO"}}" + } + } + }, + "{{.GetVegaContractID "tUSDC"}}": { + "min_lp_stake": "1", + "decimals": 5, + "name": "USDC (local)", + "symbol": "tUSDC", + "total_supply": "0", + "source": { + "erc20": { + "contract_address": "{{.GetEthContractAddr "tUSDC"}}" + } + } + }, + "{{.GetVegaContractID "VEGA"}}": { + "min_lp_stake": "1", + "decimals": 18, + "name": "Vega", + "symbol": "VEGA", + "total_supply": "64999723000000000000000000", + "source": { + "erc20": { + "contract_address": "{{.GetEthContractAddr "VEGA"}}" + } + } + } + }, + "network": { + "ReplayAttackThreshold": 30 + }, + "network_parameters": { + "blockchains.ethereumConfig": "{\"network_id\": \"{{ .NetworkID }}\", \"chain_id\": \"{{ .ChainID }}\", \"collateral_bridge_contract\": { \"address\": \"{{.GetEthContractAddr "erc20_bridge_1"}}\" }, \"confirmations\": 3, \"staking_bridge_contract\": { \"address\": \"{{.GetEthContractAddr "staking_bridge"}}\", \"deployment_block_height\": 0}, \"token_vesting_contract\": { \"address\": \"{{.GetEthContractAddr "erc20_vesting"}}\", \"deployment_block_height\": 0 }, \"multisig_control_contract\": { \"address\": \"{{.GetEthContractAddr "MultisigControl"}}\", \"deployment_block_height\": 0 }}", + "governance.proposal.asset.minClose": "2s", + "governance.proposal.asset.minEnact": "2s", + "governance.proposal.asset.requiredParticipation": "0.00000000000000000000000015", + "governance.proposal.market.minClose": "2s", + "governance.proposal.market.minEnact": "2s", + "governance.proposal.market.requiredParticipation": "0.00000000000000000000000015", + "governance.proposal.updateMarket.minClose": "2s", + "governance.proposal.updateMarket.minEnact": "2s", + "governance.proposal.updateMarket.requiredParticipation": "0.00000000000000000000000015", + "governance.proposal.updateNetParam.minClose": "2s", + "governance.proposal.updateNetParam.minEnact": "2s", + "governance.proposal.updateNetParam.requiredParticipation": "0.00000000000000000000000015", + "market.auction.minimumDuration": "3s", + "market.fee.factors.infrastructureFee": "0.001", + "market.fee.factors.makerFee": "0.004", + "market.liquidity.stakeToCcyVolume": "0.3", + "market.liquidity.targetstake.triggering.ratio": "0.7", + "network.checkpoint.timeElapsedBetweenCheckpoints": "10s", + "reward.asset": "{{.GetVegaContractID "VEGA"}}", + "reward.staking.delegation.competitionLevel": "3.1", + "reward.staking.delegation.delegatorShare": "0.883", + "reward.staking.delegation.maxPayoutPerParticipant": "700000000000000000000", + "reward.staking.delegation.minimumValidatorStake": "3000000000000000000000", + "reward.staking.delegation.payoutDelay": "5m", + "reward.staking.delegation.payoutFraction": "0.007", + "spam.protection.delegation.min.tokens": "1000000000000000000", + "spam.protection.max.delegations": "390", + "spam.protection.max.proposals": "100", + "spam.protection.max.votes": "100", + "spam.protection.proposal.min.tokens": "1000000000000000000", + "spam.protection.voting.min.tokens": "1000000000000000000", + "validators.delegation.minAmount": "100000000000000000", + "validators.epoch.length": "5s", + "snapshot.interval.length": "100", + "validators.vote.required": "0.67" + }, + "network_limits": { + "propose_asset_enabled": true, + "propose_asset_enabled_from": "2021-09-01T00:00:00Z", + "propose_market_enabled": true, + "propose_market_enabled_from": "2021-09-01T00:00:00Z" + } + }, + "consensus_params": { + "block": { + "time_iota_ms": "1" + } + } +} \ No newline at end of file diff --git a/net_confs/node_set_templates/nullchain/vega_validator.toml b/net_confs/node_set_templates/nullchain/vega_validator.toml new file mode 100644 index 00000000..67f2c10a --- /dev/null +++ b/net_confs/node_set_templates/nullchain/vega_validator.toml @@ -0,0 +1,39 @@ +[Admin] + [Admin.Server] + SocketPath = "/tmp/vega-{{.NodeNumber}}.sock" + Enabled = true + +[API] + Port = {{add 300 .NodeNumber}}2 + [API.REST] + Port = {{add 300 .NodeNumber}}3 + +[Blockchain] + ChainProvider = "nullchain" + [Blockchain.Tendermint] + RPCAddr = "tcp://127.0.0.1:266{{.NodeNumber}}7" + [Blockchain.Null] + Level = "Debug" + BlockDuration = "1s" + TransactionsPerBlock = 1 + IP = "0.0.0.0" + Port = 31{{.NodeNumber}}1 + GenesisFile = "{{.NodeSet.Tendermint.GenesisFilePath}}" + +[EvtForward] + Level = "Info" + RetryRate = "1s" + {{if .FaucetPublicKey}} + BlockchainQueueAllowlist = ["{{ .FaucetPublicKey }}"] + {{end}} + +[Ethereum] + RPCEndpoint = "{{.ETHEndpoint}}" + +[Processor] + [Processor.Ratelimit] + Requests = 10000 + PerNBlocks = 1 + +[Snapshot] + Level = "Debug" \ No newline at end of file