Skip to content

IssueTransformSubnetTx - failed to fetch subnet  #1245

@izzetemredemir

Description

@izzetemredemir

Describe the bug
I am trying to send transformSubnetTx and getting this error:
I have tried sending this tx several valid subnetIDs on fuji testnet.

avalanchego % go run wallet/subnet/primary/examples/transform-subnettx/main.go
# command-line-arguments
ld: warning: could not create compact unwind for _blst_sha256_block_data_order: does not use RBP or RSP based frame
2023/03/15 17:57:04 synced wallet in 1.165945792s
2023/03/15 17:57:04 failed to issue tranformSubnetTxId failed to fetch subnet "9m6a3Qte8FaRbLZixLhh8Ptdkemm4csNaLwQeKkENx5wskbWP": not found
exit status 1

To Reproduce

Just try send IssueTransformSubnetTx given code:

package main

import (
	"context"
	"log"
	"time"

	"github.com/ava-labs/avalanchego/genesis"
	"github.com/ava-labs/avalanchego/ids"
	"github.com/ava-labs/avalanchego/vms/platformvm/reward"
	"github.com/ava-labs/avalanchego/vms/secp256k1fx"
	"github.com/ava-labs/avalanchego/wallet/subnet/primary"
)

func main() {

	ctx := context.Background()
	kc := secp256k1fx.NewKeychain(genesis.EWOQKey)

	walletSyncStartTime := time.Now()
	wallet, err := primary.NewWalletWithTxs(ctx, primary.FujiAPIURI, kc)

	if err != nil {
		log.Fatalf("failed to initialize wallet: %s\n", err)
	}
	log.Printf("synced wallet in %s\n", time.Since(walletSyncStartTime))

	pWallet := wallet.P()

	subnetIDStr := "" //YourSubnetID

	subnetID, err := ids.FromString(subnetIDStr)
	if err != nil {
		log.Fatalf("failed to parse subnet ID: %s\n", err)
	}
	assetIDStr := "" //YourAssetId

	assetID, err := ids.FromString(assetIDStr)
	if err != nil {
		log.Fatalf("failed to parse subnet ID: %s\n", err)
	}

	var (
		InitialSupply            uint64        = 10
		MaximumSupply            uint64        = 10
		MinConsumptionRate       uint64        = 10
		MaxConsumptionRate       uint64        = reward.PercentDenominator
		MinValidatorStake        uint64        = 2
		MaxValidatorStake        uint64        = 10
		MinStakeDuration         time.Duration = 1 * time.Minute
		MaxStakeDuration         time.Duration = 2 * time.Minute
		MinDelegationFee         uint32        = reward.PercentDenominator
		MinDelegatorStake        uint64        = 1
		MaxValidatorWeightFactor byte          = 1
		UptimeRequirement        uint32        = reward.PercentDenominator
	)

	tranformSubnetTxId, err := pWallet.IssueTransformSubnetTx(subnetID, assetID, InitialSupply, MaximumSupply, MinConsumptionRate, MaxConsumptionRate, MinValidatorStake, MaxValidatorStake, MinStakeDuration, MaxStakeDuration, MinDelegationFee, MinDelegatorStake, MaxValidatorWeightFactor, UptimeRequirement)

	if err != nil {
		log.Fatalf("failed to issue tranformSubnetTxId %s\n", err)
	}
	log.Printf("tranformSubnetTxId", tranformSubnetTxId)

}

Operating System
Apple M1 Pro

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions