Commit 479f6761 authored by Sean Rowan's avatar Sean Rowan
Browse files

Merge branch '18-19-validator-changeover-merge' into 'master'

Resolve "Flare validator changeover mechanism using the underlying chain miner weighting"

Closes #18

See merge request !26
parents d9015b70 5ca319ab
......@@ -17,7 +17,7 @@
],
"flare": {
"gas": "200000",
"gasPrice": "500000000000",
"gasPrice": "225000000000",
"chainId": 16,
"url": "http://127.0.0.1:9650/ext/bc/C/rpc"
}
......
......@@ -257,15 +257,25 @@ async function web3Config() {
chainId: config.flare.chainId,
},
'petersburg',);
// Read the compiled contract code
let source = fs.readFileSync("../bin/contracts/StateConnector.json");
let contract = JSON.parse(source);
// Create Contract proxy class
stateConnector = new web3.eth.Contract(contract.abi);
// Smart contract EVM bytecode as hex
stateConnector.options.data = '0x' + contract.deployedBytecode;
stateConnector.options.from = config.accounts[0].address;
stateConnector.options.address = stateConnectorContract;
web3.eth.getBalance(config.accounts[0].address)
.then(balance => {
if (parseInt(web3.utils.fromWei(balance, "ether")) < 1000000) {
console.log("Not enough FLR reserved in your account, need 1M FLR.");
sleep(5000);
process.exit();
} else {
// Read the compiled contract code
let source = fs.readFileSync("../bin/contracts/StateConnector.json");
let contract = JSON.parse(source);
// Create Contract proxy class
stateConnector = new web3.eth.Contract(contract.abi);
// Smart contract EVM bytecode as hex
stateConnector.options.data = '0x' + contract.deployedBytecode;
stateConnector.options.from = config.accounts[0].address;
stateConnector.options.address = stateConnectorContract;
}
})
}
async function processFailure(error) {
......
......@@ -44,7 +44,7 @@ cd - &> /dev/null
--snow-quorum-size=2 \
--http-port=9650 \
--staking-port=9651 \
--db-dir=db/node04/ \
--db-dir=$(pwd)/db/node04/ \
--staking-enabled=true \
--p2p-tls-enabled=true \
--network-id=coston \
......@@ -53,6 +53,6 @@ cd - &> /dev/null
--staking-tls-cert-file=$(pwd)/config/keys/node04/node.crt \
--staking-tls-key-file=$(pwd)/config/keys/node04/node.key \
--log-level=debug \
--validators-file=$(pwd)/config/validators/validators_0001.json \
--validators-file=$(pwd)/config/validators/coston/1619180000.json \
--alert-apis=https://flare.network \
--xrp-apis=$XRP_APIs_JOINED
{
"startTime": 1619180000,
"intervalTime": 1000000000000,
"validators": [
{
"nodeID": "NodeID-HLnQwRPbn2TTBXkt7XAEoRVWCDpcVPaSh",
"weighting": 1
},
{
"nodeID": "NodeID-3VN9WkyTVGCRQHUrXtmJdxLdZRJe3Le8o",
"weighting": 1
},
{
"nodeID": "NodeID-2n6kTM5Jti4phzkv5bSjGk8q4fe9VSr82",
"weighting": 1
},
{
"nodeID": "NodeID-C8ggpWRpiMnouswVxonFc88iCPqyhs5JD",
"weighting": 1
}
]
}
\ No newline at end of file
{
"startTime": 1619370000,
"intervalTime": 1000000000,
"validators": [
{
"nodeID": "NodeID-D4jrXzkioNZkqbPNuPmk3hR9Ee8oXLvDJ",
"weighting": 1
}
]
}
}
\ No newline at end of file
{
"startTime": 1619186000,
"intervalTime": 1000000000000,
"validators": [
{
"nodeID": "NodeID-D4jrXzkioNZkqbPNuPmk3hR9Ee8oXLvDJ",
"weighting": 1
},
{
"nodeID": "NodeID-257bLqY4Kw6rn5kq8J5MVfcSk5F2fMENM",
"weighting": 1
},
{
"nodeID": "NodeID-KVRtwzzMyWVTdmCrd8BxK79PQZt7RQVFb",
"weighting": 1
},
{
"nodeID": "NodeID-Ehm2orFaPru8QwaecbzTQrrYFLfQiyztu",
"weighting": 1
}
]
}
{
"startTime": 1619370000,
"intervalTime": 1000000000,
"validators": [
{
"nodeID": "NodeID-D4jrXzkioNZkqbPNuPmk3hR9Ee8oXLvDJ",
"weighting": 1
}
]
}
\ No newline at end of file
{
"validators": [
{
"nodeID": "NodeID-D4jrXzkioNZkqbPNuPmk3hR9Ee8oXLvDJ",
"weighting": 1
},
{
"nodeID": "NodeID-257bLqY4Kw6rn5kq8J5MVfcSk5F2fMENM",
"weighting": 1
},
{
"nodeID": "NodeID-KVRtwzzMyWVTdmCrd8BxK79PQZt7RQVFb",
"weighting": 1
},
{
"nodeID": "NodeID-Ehm2orFaPru8QwaecbzTQrrYFLfQiyztu",
"weighting": 1
}
]
}
\ No newline at end of file
{
"validators": [
{
"nodeID": "NodeID-HLnQwRPbn2TTBXkt7XAEoRVWCDpcVPaSh",
"weighting": 1
},
{
"nodeID": "NodeID-3VN9WkyTVGCRQHUrXtmJdxLdZRJe3Le8o",
"weighting": 1
},
{
"nodeID": "NodeID-2n6kTM5Jti4phzkv5bSjGk8q4fe9VSr82",
"weighting": 1
},
{
"nodeID": "NodeID-C8ggpWRpiMnouswVxonFc88iCPqyhs5JD",
"weighting": 1
}
]
}
\ No newline at end of file
......@@ -28,7 +28,9 @@ var (
)
type ValidatorConfig struct {
Validators []Validator `json:"validators"`
StartTime uint64 `json:"startTime"`
IntervalTime uint64 `json:"intervalTime"`
Validators []Validator `json:"validators"`
}
type Validator struct {
......
......@@ -14,6 +14,7 @@ import (
"os"
"path"
"path/filepath"
"strconv"
"strings"
"time"
......@@ -735,7 +736,22 @@ func setNodeConfig(v *viper.Viper) error {
}
xrpAPIsString = strings.ReplaceAll(xrpAPIsString, " ", "")
Config.CorethConfig = corethAPIstate + " " + alertAPIsString + " " + xrpAPIsString
if string(Config.DBPath[0]) != "/" {
return fmt.Errorf("incomplete db path, append $(pwd)/ as prefix to --db-dir flag input")
}
if string(Config.DBPath[len(Config.DBPath)-1]) != "/" {
Config.DBPath = Config.DBPath + "/"
}
// Search for ValidatorTimeBound
validatorTimeBoundPath := Config.DBPath + "ValidatorTimeBound"
_, err = os.Stat(validatorTimeBoundPath)
validatorTimeBound := []byte("0")
if err == nil {
validatorTimeBound, err = ioutil.ReadFile(validatorTimeBoundPath)
if err != nil {
return fmt.Errorf("error reading ValidatorTimeBound")
}
}
validatorsFilePath := v.GetString(validatorsFileKey)
if validatorsFilePath == defaultString {
......@@ -751,6 +767,9 @@ func setNodeConfig(v *viper.Viper) error {
}
var validators ids.ValidatorConfig
json.Unmarshal(validatorsFile, &validators)
if string(validatorTimeBound) != "0" && string(validatorTimeBound) != strconv.FormatUint(validators.StartTime, 10) {
return fmt.Errorf("validators.StartTime != validatorTimeBound, check validator config")
}
for i, validator := range validators.Validators {
validators.Validators[i].ShortNodeID, err = ids.ShortFromPrefixedString(validator.NodeID, constants.NodeIDPrefix)
if err != nil {
......@@ -758,7 +777,7 @@ func setNodeConfig(v *viper.Viper) error {
}
}
Config.ValidatorConfig = validators
Config.CorethConfig = corethAPIstate + " " + strconv.FormatUint(validators.StartTime+validators.IntervalTime, 10) + " " + validatorTimeBoundPath + " " + alertAPIsString + " " + xrpAPIsString
return nil
}
......
......@@ -17,11 +17,18 @@ import (
"github.com/ethereum/go-ethereum/crypto"
)
// Fixed gas used for custom block.coinbase operations
func GetDataFee(blockNumber *big.Int) uint64 {
func GetMinReserve(blockNumber *big.Int) *big.Int {
switch {
default:
return 1000
minReserve, _ := new(big.Int).SetString("1000000000000000000000000", 10)
return minReserve
}
}
func GetInflationSchedule(blockTime uint64) *big.Int {
switch {
default:
return new(big.Int).SetUint64(1)
}
}
......@@ -339,5 +346,5 @@ func ReadChain(blockNumber *big.Int, functionSelector []byte, checkRet []byte, a
// Verify proof against underlying chain
func StateConnectorCall(blockNumber *big.Int, functionSelector []byte, checkRet []byte, stateConnectorConfig []string) bool {
return ReadChain(blockNumber, functionSelector, checkRet, stateConnectorConfig[0], stateConnectorConfig[1:])
return ReadChain(blockNumber, functionSelector, checkRet, stateConnectorConfig[2], stateConnectorConfig[3:])
}
......@@ -262,30 +262,27 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
return nil, ErrInsufficientFundsForTransfer
}
var (
ret []byte
vmerr error // vm errors do not effect consensus and are therefore not assigned to err
ret []byte
vmerr error // vm errors do not effect consensus and are therefore not assigned to err
selectClaimPeriodFinality bool
selectPaymentFinality bool
selectAddChain bool
)
if contractCreation == false && *msg.To() == common.HexToAddress(GetStateConnectorContractAddr(st.evm.Context.BlockNumber)) && (bytes.Equal(st.data[0:4], GetProveClaimPeriodFinalitySelector(st.evm.Context.BlockNumber)) ||
bytes.Equal(st.data[0:4], GetProvePaymentFinalitySelector(st.evm.Context.BlockNumber)) ||
bytes.Equal(st.data[0:4], GetAddChainSelector(st.evm.Context.BlockNumber))) {
if bytes.Equal(st.data[0:4], GetProveClaimPeriodFinalitySelector(st.evm.Context.BlockNumber)) ||
bytes.Equal(st.data[0:4], GetProvePaymentFinalitySelector(st.evm.Context.BlockNumber)) {
if !contractCreation && *msg.To() == common.HexToAddress(GetStateConnectorContractAddr(st.evm.Context.BlockNumber)) {
selectClaimPeriodFinality = bytes.Equal(st.data[0:4], GetProveClaimPeriodFinalitySelector(st.evm.Context.BlockNumber))
selectPaymentFinality = bytes.Equal(st.data[0:4], GetProvePaymentFinalitySelector(st.evm.Context.BlockNumber))
selectAddChain = bytes.Equal(st.data[0:4], GetAddChainSelector(st.evm.Context.BlockNumber))
}
if selectClaimPeriodFinality || selectPaymentFinality || selectAddChain {
if selectClaimPeriodFinality || selectPaymentFinality {
// Increment the nonce for the next transaction
st.state.SetNonce(msg.From(), st.state.GetNonce(sender.Address())+1)
// Fee charged for attempting to perform an underlying chain state check
dataFee := new(big.Int).Mul(new(big.Int).SetUint64(GetDataFee(st.evm.Context.BlockNumber)), st.gasPrice)
if st.state.GetBalance(st.msg.From()).Cmp(dataFee) < 0 {
return nil, ErrInsufficientFundsForTransfer
}
st.state.SubBalance(st.msg.From(), dataFee)
st.state.AddBalance(common.HexToAddress(GetGovernanceContractAddr(st.evm.Context.BlockNumber)), dataFee)
checkRet, _, checkVmerr := st.evm.Call(sender, st.to(), st.data, st.gas, st.value)
if checkVmerr == nil {
if checkVmerr == nil && (selectPaymentFinality || st.state.GetBalance(st.msg.From()).Cmp(GetMinReserve(st.evm.Context.BlockNumber)) >= 0) {
chainConfig := st.evm.ChainConfig()
if StateConnectorCall(st.evm.Context.BlockNumber, st.data[0:4], checkRet, *chainConfig.StateConnectorConfig) == true {
if StateConnectorCall(st.evm.Context.BlockNumber, st.data[0:4], checkRet, *chainConfig.StateConnectorConfig) {
originalCoinbase := st.evm.Context.Coinbase
defer func() {
st.evm.Context.Coinbase = originalCoinbase
......@@ -294,7 +291,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
}
}
ret, st.gas, vmerr = st.evm.Call(sender, st.to(), st.data, st.gas, st.value)
} else if bytes.Equal(st.data[0:4], GetAddChainSelector(st.evm.Context.BlockNumber)) {
} else if selectAddChain {
checkRet, _, checkVmerr := st.evm.Call(sender, st.to(), st.data, st.gas, st.value)
if checkVmerr == nil {
if binary.BigEndian.Uint32(checkRet[28:32])+1 <= GetMaxAllowedChains(st.evm.Context.BlockNumber) {
......@@ -317,10 +314,11 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
}
}
st.refundGas(apricotPhase1)
st.state.AddBalance(common.HexToAddress(GetGovernanceContractAddr(st.evm.Context.BlockNumber)), new(big.Int).Mul(new(big.Int).SetUint64(st.gasUsed()), st.gasPrice))
st.state.AddBalance(st.evm.Context.Coinbase, new(big.Int).Mul(new(big.Int).SetUint64(st.gasUsed()), st.gasPrice))
if vmerr == nil {
_, _, triggerErr := st.evm.Call(vm.AccountRef(common.HexToAddress(GetSystemTriggerContractAddr(st.evm.Context.BlockNumber))), common.HexToAddress(GetSystemTriggerContractAddr(st.evm.Context.BlockNumber)), GetSystemTriggerSelector(st.evm.Context.BlockNumber), ^uint64(0), big.NewInt(0))
systemTriggerContract := common.HexToAddress(GetSystemTriggerContractAddr(st.evm.Context.BlockNumber))
_, _, triggerErr := st.evm.Call(vm.AccountRef(systemTriggerContract), systemTriggerContract, GetSystemTriggerSelector(st.evm.Context.BlockNumber), ^uint64(0), big.NewInt(0))
if triggerErr != nil {
// Errors were not properly handled in try/catch statements in the trigger contracts
}
......
......@@ -9,8 +9,8 @@ import "math/big"
var (
// MinGasPrice is the number of nAVAX required per gas unit for a
// transaction to be valid, measured in wei
LaunchMinGasPrice = big.NewInt(1)
ApricotPhase1MinGasPrice = big.NewInt(1)
LaunchMinGasPrice = big.NewInt(225 * GWei)
ApricotPhase1MinGasPrice = big.NewInt(225 * GWei)
ApricotPhase1GasLimit uint64 = 8_000_000
)
......@@ -7,7 +7,9 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"math/big"
"strconv"
"strings"
"sync"
"time"
......@@ -118,6 +120,7 @@ var (
errInvalidMixDigest = errors.New("invalid mix digest")
errInvalidExtDataHash = errors.New("invalid extra data hash")
errHeaderExtraDataTooBig = errors.New("header extra data too big")
errValidatorChangeTime = errors.New("invalid validator change time")
)
// mayBuildBlockStatus denotes whether the engine should be notified
......@@ -235,6 +238,9 @@ type VM struct {
shutdownWg sync.WaitGroup
fx secp256k1fx.Fx
validatorChangeTime uint64
validatorTimeBoundPath string
}
func (vm *VM) getAtomicTx(block *types.Block) (*Tx, error) {
......@@ -284,6 +290,13 @@ func (vm *VM) Initialize(
return vm.CLIConfig.ParsingError
}
validatorChangeTime, err := strconv.ParseUint(vm.CLIConfig.StateConnectorConfig[0], 10, 64)
if err != nil {
return errValidatorChangeTime
}
vm.validatorChangeTime = validatorChangeTime
vm.validatorTimeBoundPath = vm.CLIConfig.StateConnectorConfig[1]
if len(fxs) > 0 {
return errUnsupportedFXs
}
......@@ -946,7 +959,19 @@ func (vm *VM) setLastAccepted(blk *Block) error {
if err != nil {
return err
}
return vm.chaindb.Put(lastAcceptedKey, b)
err = vm.chaindb.Put(lastAcceptedKey, b)
if err != nil {
return err
}
if blk.ethBlock.Time() >= vm.validatorChangeTime {
defer vm.Shutdown()
// Write vm.validatorChangeTime to ValidatorTimeBound
err := ioutil.WriteFile(vm.validatorTimeBoundPath, []byte(strconv.FormatUint(vm.validatorChangeTime, 10)), 0644)
if err != nil {
return nil
}
}
return nil
}
// awaitTxPoolStabilized waits for a txPoolHead channel event
......
......@@ -37,25 +37,25 @@ fi
# NODE 1
printf "Launching Node 1 at 127.0.0.1:9650\n"
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9670 --staking-port=9671 --db-dir=db/node00/ --staking-enabled=true --network-id=ftsomvp --bootstrap-ips= --bootstrap-ids= --staking-tls-cert-file=$(pwd)/config/keys/node00/node.crt --staking-tls-key-file=$(pwd)/config/keys/node00/node.key --log-level=info --validators-file=$(pwd)/config/validators/validators_0000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED &> $LOG_DIR/node00/launch.out & echo $! > $LOG_DIR/node00/launch.pid
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9670 --staking-port=9671 --db-dir=$(pwd)/db/node00/ --staking-enabled=true --network-id=ftsomvp --bootstrap-ips= --bootstrap-ids= --staking-tls-cert-file=$(pwd)/config/keys/node00/node.crt --staking-tls-key-file=$(pwd)/config/keys/node00/node.key --log-level=info --validators-file=$(pwd)/config/validators/local/1619186000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED &> $LOG_DIR/node00/launch.out & echo $! > $LOG_DIR/node00/launch.pid
NODE_00_PID=`cat $LOG_DIR/node00/launch.pid`
sleep 5
# NODE 2
printf "Launching Node 2 at 127.0.0.1:9652\n"
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9672 --staking-port=9673 --db-dir=db/node01/ --staking-enabled=true --network-id=ftsomvp --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=$(cat $(pwd)/config/keys/node00/node.txt) --staking-tls-cert-file=$(pwd)/config/keys/node01/node.crt --staking-tls-key-file=$(pwd)/config/keys/node01/node.key --log-level=info --validators-file=$(pwd)/config/validators/validators_0000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED --coreth-config="api-disabled" &> $LOG_DIR/node01/launch.out & echo $! > $LOG_DIR/node01/launch.pid
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9672 --staking-port=9673 --db-dir=$(pwd)/db/node01/ --staking-enabled=true --network-id=ftsomvp --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=$(cat $(pwd)/config/keys/node00/node.txt) --staking-tls-cert-file=$(pwd)/config/keys/node01/node.crt --staking-tls-key-file=$(pwd)/config/keys/node01/node.key --log-level=info --validators-file=$(pwd)/config/validators/local/1619186000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED --coreth-config="api-disabled" &> $LOG_DIR/node01/launch.out & echo $! > $LOG_DIR/node01/launch.pid
NODE_01_PID=`cat $LOG_DIR/node01/launch.pid`
sleep 5
# NODE 3
printf "Launching Node 3 at 127.0.0.1:9654\n"
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9674 --staking-port=9675 --db-dir=db/node02/ --staking-enabled=true --network-id=ftsomvp --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=$(cat $(pwd)/config/keys/node00/node.txt) --staking-tls-cert-file=$(pwd)/config/keys/node02/node.crt --staking-tls-key-file=$(pwd)/config/keys/node02/node.key --log-level=info --validators-file=$(pwd)/config/validators/validators_0000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED --coreth-config="api-disabled" &> $LOG_DIR/node02/launch.out & echo $! > $LOG_DIR/node02/launch.pid
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9674 --staking-port=9675 --db-dir=$(pwd)/db/node02/ --staking-enabled=true --network-id=ftsomvp --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=$(cat $(pwd)/config/keys/node00/node.txt) --staking-tls-cert-file=$(pwd)/config/keys/node02/node.crt --staking-tls-key-file=$(pwd)/config/keys/node02/node.key --log-level=info --validators-file=$(pwd)/config/validators/local/1619186000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED --coreth-config="api-disabled" &> $LOG_DIR/node02/launch.out & echo $! > $LOG_DIR/node02/launch.pid
NODE_02_PID=`cat $LOG_DIR/node02/launch.pid`
sleep 5
# NODE 4
printf "Launching Node 4 at 127.0.0.1:9656\n"
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9676 --staking-port=9677 --db-dir=db/node03/ --staking-enabled=true --network-id=ftsomvp --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=$(cat $(pwd)/config/keys/node00/node.txt) --staking-tls-cert-file=$(pwd)/config/keys/node03/node.crt --staking-tls-key-file=$(pwd)/config/keys/node03/node.key --log-level=info --validators-file=$(pwd)/config/validators/validators_0000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED --coreth-config="api-disabled" &> $LOG_DIR/node03/launch.out & echo $! > $LOG_DIR/node03/launch.pid
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9676 --staking-port=9677 --db-dir=$(pwd)/db/node03/ --staking-enabled=true --network-id=ftsomvp --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=$(cat $(pwd)/config/keys/node00/node.txt) --staking-tls-cert-file=$(pwd)/config/keys/node03/node.crt --staking-tls-key-file=$(pwd)/config/keys/node03/node.key --log-level=info --validators-file=$(pwd)/config/validators/local/1619186000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED --coreth-config="api-disabled" &> $LOG_DIR/node03/launch.out & echo $! > $LOG_DIR/node03/launch.pid
NODE_03_PID=`cat $LOG_DIR/node03/launch.pid`
sleep 5
......
......@@ -50,7 +50,7 @@ printf "Launching Node 1 at 127.0.0.1:9670\n"
--snow-quorum-size=1 \
--http-port=9670 \
--staking-port=9671 \
--db-dir=db/node00/ \
--db-dir=$(pwd)/db/node00/ \
--staking-enabled=true \
--network-id=ftsomvp \
--bootstrap-ips= \
......@@ -58,6 +58,6 @@ printf "Launching Node 1 at 127.0.0.1:9670\n"
--staking-tls-cert-file=$(pwd)/config/keys/node00/node.crt \
--staking-tls-key-file=$(pwd)/config/keys/node00/node.key \
--log-level=debug \
--validators-file=$(pwd)/config/validators/validator_local.json \
--validators-file=$(pwd)/config/validators/ftsomvp/1619370000.json \
--alert-apis="https://flare.network" \
--xrp-apis=$XRP_APIs_JOINED > $LOG_DIR/node00/launch.out
......@@ -37,25 +37,25 @@ fi
# NODE 1
printf "Launching Node 1 at 127.0.0.1:9650\n"
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9650 --staking-port=9651 --db-dir=db/node00/ --staking-enabled=true --network-id=coston --bootstrap-ips= --bootstrap-ids= --staking-tls-cert-file=$(pwd)/config/keys/node00/node.crt --staking-tls-key-file=$(pwd)/config/keys/node00/node.key --log-level=info --validators-file=$(pwd)/config/validators/validators_0000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED &> $LOG_DIR/node00/launch.out & echo $! > $LOG_DIR/node00/launch.pid
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9650 --staking-port=9651 --db-dir=db/node00/ --staking-enabled=true --network-id=coston --bootstrap-ips= --bootstrap-ids= --staking-tls-cert-file=$(pwd)/config/keys/node00/node.crt --staking-tls-key-file=$(pwd)/config/keys/node00/node.key --log-level=info --validators-file=$(pwd)/config/validators/local/1619186000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED &> $LOG_DIR/node00/launch.out & echo $! > $LOG_DIR/node00/launch.pid
NODE_00_PID=`cat $LOG_DIR/node00/launch.pid`
sleep 5
# NODE 2
printf "Launching Node 2 at 127.0.0.1:9652\n"
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9652 --staking-port=9653 --db-dir=db/node01/ --staking-enabled=true --network-id=coston --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=$(cat $(pwd)/config/keys/node00/node.txt) --staking-tls-cert-file=$(pwd)/config/keys/node01/node.crt --staking-tls-key-file=$(pwd)/config/keys/node01/node.key --log-level=info --validators-file=$(pwd)/config/validators/validators_0000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED --coreth-config="api-disabled" &> $LOG_DIR/node01/launch.out & echo $! > $LOG_DIR/node01/launch.pid
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9652 --staking-port=9653 --db-dir=db/node01/ --staking-enabled=true --network-id=coston --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=$(cat $(pwd)/config/keys/node00/node.txt) --staking-tls-cert-file=$(pwd)/config/keys/node01/node.crt --staking-tls-key-file=$(pwd)/config/keys/node01/node.key --log-level=info --validators-file=$(pwd)/config/validators/local/1619186000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED --coreth-config="api-disabled" &> $LOG_DIR/node01/launch.out & echo $! > $LOG_DIR/node01/launch.pid
NODE_01_PID=`cat $LOG_DIR/node01/launch.pid`
sleep 5
# NODE 3
printf "Launching Node 3 at 127.0.0.1:9654\n"
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9654 --staking-port=9655 --db-dir=db/node02/ --staking-enabled=true --network-id=coston --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=$(cat $(pwd)/config/keys/node00/node.txt) --staking-tls-cert-file=$(pwd)/config/keys/node02/node.crt --staking-tls-key-file=$(pwd)/config/keys/node02/node.key --log-level=info --validators-file=$(pwd)/config/validators/validators_0000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED --coreth-config="api-disabled" &> $LOG_DIR/node02/launch.out & echo $! > $LOG_DIR/node02/launch.pid
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9654 --staking-port=9655 --db-dir=db/node02/ --staking-enabled=true --network-id=coston --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=$(cat $(pwd)/config/keys/node00/node.txt) --staking-tls-cert-file=$(pwd)/config/keys/node02/node.crt --staking-tls-key-file=$(pwd)/config/keys/node02/node.key --log-level=info --validators-file=$(pwd)/config/validators/local/1619186000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED --coreth-config="api-disabled" &> $LOG_DIR/node02/launch.out & echo $! > $LOG_DIR/node02/launch.pid
NODE_02_PID=`cat $LOG_DIR/node02/launch.pid`
sleep 5
# NODE 4
printf "Launching Node 4 at 127.0.0.1:9656\n"
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9656 --staking-port=9657 --db-dir=db/node03/ --staking-enabled=true --network-id=coston --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=$(cat $(pwd)/config/keys/node00/node.txt) --staking-tls-cert-file=$(pwd)/config/keys/node03/node.crt --staking-tls-key-file=$(pwd)/config/keys/node03/node.key --log-level=info --validators-file=$(pwd)/config/validators/validators_0000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED --coreth-config="api-disabled" &> $LOG_DIR/node03/launch.out & echo $! > $LOG_DIR/node03/launch.pid
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9656 --staking-port=9657 --db-dir=db/node03/ --staking-enabled=true --network-id=coston --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=$(cat $(pwd)/config/keys/node00/node.txt) --staking-tls-cert-file=$(pwd)/config/keys/node03/node.crt --staking-tls-key-file=$(pwd)/config/keys/node03/node.key --log-level=info --validators-file=$(pwd)/config/validators/local/1619186000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED --coreth-config="api-disabled" &> $LOG_DIR/node03/launch.out & echo $! > $LOG_DIR/node03/launch.pid
NODE_03_PID=`cat $LOG_DIR/node03/launch.pid`
sleep 5
......
......@@ -37,25 +37,25 @@ fi
# NODE 1
printf "Launching Node 1 at 127.0.0.1:9650\n"
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9660 --staking-port=9661 --db-dir=db/node00/ --staking-enabled=true --network-id=scdev --bootstrap-ips= --bootstrap-ids= --staking-tls-cert-file=$(pwd)/config/keys/node00/node.crt --staking-tls-key-file=$(pwd)/config/keys/node00/node.key --log-level=debug --validators-file=$(pwd)/config/validators/validators_0000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED &> $LOG_DIR/node00/launch.out & echo $! > $LOG_DIR/node00/launch.pid
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9660 --staking-port=9661 --db-dir=$(pwd)/db/node00/ --staking-enabled=true --network-id=scdev --bootstrap-ips= --bootstrap-ids= --staking-tls-cert-file=$(pwd)/config/keys/node00/node.crt --staking-tls-key-file=$(pwd)/config/keys/node00/node.key --log-level=debug --validators-file=$(pwd)/config/validators/local/1619186000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED &> $LOG_DIR/node00/launch.out & echo $! > $LOG_DIR/node00/launch.pid
NODE_00_PID=`cat $LOG_DIR/node00/launch.pid`
sleep 5
# NODE 2
printf "Launching Node 2 at 127.0.0.1:9652\n"
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9662 --staking-port=9663 --db-dir=db/node01/ --staking-enabled=true --network-id=scdev --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=$(cat $(pwd)/config/keys/node00/node.txt) --staking-tls-cert-file=$(pwd)/config/keys/node01/node.crt --staking-tls-key-file=$(pwd)/config/keys/node01/node.key --log-level=debug --validators-file=$(pwd)/config/validators/validators_0000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED --coreth-config="api-disabled" &> $LOG_DIR/node01/launch.out & echo $! > $LOG_DIR/node01/launch.pid
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9662 --staking-port=9663 --db-dir=$(pwd)/db/node01/ --staking-enabled=true --network-id=scdev --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=$(cat $(pwd)/config/keys/node00/node.txt) --staking-tls-cert-file=$(pwd)/config/keys/node01/node.crt --staking-tls-key-file=$(pwd)/config/keys/node01/node.key --log-level=debug --validators-file=$(pwd)/config/validators/local/1619186000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED --coreth-config="api-disabled" &> $LOG_DIR/node01/launch.out & echo $! > $LOG_DIR/node01/launch.pid
NODE_01_PID=`cat $LOG_DIR/node01/launch.pid`
sleep 5
# NODE 3
printf "Launching Node 3 at 127.0.0.1:9654\n"
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9664 --staking-port=9665 --db-dir=db/node02/ --staking-enabled=true --network-id=scdev --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=$(cat $(pwd)/config/keys/node00/node.txt) --staking-tls-cert-file=$(pwd)/config/keys/node02/node.crt --staking-tls-key-file=$(pwd)/config/keys/node02/node.key --log-level=debug --validators-file=$(pwd)/config/validators/validators_0000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED --coreth-config="api-disabled" &> $LOG_DIR/node02/launch.out & echo $! > $LOG_DIR/node02/launch.pid
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9664 --staking-port=9665 --db-dir=$(pwd)/db/node02/ --staking-enabled=true --network-id=scdev --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=$(cat $(pwd)/config/keys/node00/node.txt) --staking-tls-cert-file=$(pwd)/config/keys/node02/node.crt --staking-tls-key-file=$(pwd)/config/keys/node02/node.key --log-level=debug --validators-file=$(pwd)/config/validators/local/1619186000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED --coreth-config="api-disabled" &> $LOG_DIR/node02/launch.out & echo $! > $LOG_DIR/node02/launch.pid
NODE_02_PID=`cat $LOG_DIR/node02/launch.pid`
sleep 5
# NODE 4
printf "Launching Node 4 at 127.0.0.1:9656\n"
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9666 --staking-port=9667 --db-dir=db/node03/ --staking-enabled=true --network-id=scdev --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=$(cat $(pwd)/config/keys/node00/node.txt) --staking-tls-cert-file=$(pwd)/config/keys/node03/node.crt --staking-tls-key-file=$(pwd)/config/keys/node03/node.key --log-level=debug --validators-file=$(pwd)/config/validators/validators_0000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED --coreth-config="api-disabled" &> $LOG_DIR/node03/launch.out & echo $! > $LOG_DIR/node03/launch.pid
nohup ./build/avalanchego --public-ip=127.0.0.1 --snow-sample-size=2 --snow-quorum-size=2 --http-port=9666 --staking-port=9667 --db-dir=$(pwd)/db/node03/ --staking-enabled=true --network-id=scdev --bootstrap-ips=127.0.0.1:9651 --bootstrap-ids=$(cat $(pwd)/config/keys/node00/node.txt) --staking-tls-cert-file=$(pwd)/config/keys/node03/node.crt --staking-tls-key-file=$(pwd)/config/keys/node03/node.key --log-level=debug --validators-file=$(pwd)/config/validators/local/1619186000.json --alert-apis="https://flare.network" --xrp-apis=$XRP_APIs_JOINED --coreth-config="api-disabled" &> $LOG_DIR/node03/launch.out & echo $! > $LOG_DIR/node03/launch.pid
NODE_03_PID=`cat $LOG_DIR/node03/launch.pid`
sleep 5
......
......@@ -50,7 +50,7 @@ printf "Launching Node 1 at 127.0.0.1:9660\n"
--snow-quorum-size=1 \
--http-port=9660 \
--staking-port=9661 \
--db-dir=db/node00/ \
--db-dir=$(pwd)/db/node00/ \
--staking-enabled=true \
--network-id=scdev \
--bootstrap-ips= \
......@@ -58,6 +58,6 @@ printf "Launching Node 1 at 127.0.0.1:9660\n"
--staking-tls-cert-file=$(pwd)/config/keys/node00/node.crt \
--staking-tls-key-file=$(pwd)/config/keys/node00/node.key \
--log-level=debug \
--validators-file=$(pwd)/config/validators/validator_local.json \
--validators-file=$(pwd)/config/validators/scdev/1619370000.json \
--alert-apis="https://flare.network" \
--xrp-apis=$XRP_APIs_JOINED
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment