elastic subnets

This commit is contained in:
sukantoraymond
2023-04-13 10:30:43 -04:00
parent f90b84b044
commit d3539705db
8 changed files with 1570 additions and 757 deletions
+21
View File
@@ -3,6 +3,7 @@ package network
import (
"context"
"errors"
"time"
"github.com/ava-labs/avalanche-network-runner/network/node"
"github.com/ava-labs/avalanchego/ids"
@@ -14,6 +15,24 @@ var (
ErrNodeNotFound = errors.New("node not found in network")
)
type ElasticSubnetSpec struct {
SubnetID *string
AssetName string
AssetSymbol string
InitialSupply uint64
MaxSupply uint64
MinConsumptionRate uint64
MaxConsumptionRate uint64
MinValidatorStake uint64
MaxValidatorStake uint64
MinStakeDuration time.Duration
MaxStakeDuration time.Duration
MinDelegationFee uint32
MinDelegatorStake uint64
MaxValidatorWeightFactor byte
UptimeRequirement uint32
}
type SubnetSpec struct {
Participants []string
SubnetConfig []byte
@@ -77,4 +96,6 @@ type Network interface {
CreateBlockchains(context.Context, []BlockchainSpec) ([]ids.ID, error)
// Create the given numbers of subnets
CreateSubnets(context.Context, []SubnetSpec) ([]ids.ID, error)
// Transform subnet into elastic subnet
TransformSubnet(context.Context, []ElasticSubnetSpec) error
}