Skip to content

Commit

Permalink
custom allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
bianyuanop committed Dec 19, 2024
1 parent 87b80c5 commit a7ba8af
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions actions/rollup_register.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ func (r *RollupRegistration) Execute(
if r.Info.ExitEpoch < rollupInfoExists.StartEpoch || r.Info.ExitEpoch < Epoch(hght, rules.GetEpochLength())+2 {
return nil, fmt.Errorf("(EXIT)epoch number is not valid, minimum: %d, actual: %d, start: %d", Epoch(hght, rules.GetEpochLength())+2, r.Info.ExitEpoch, rollupInfoExists.StartEpoch)
}

// overwrite StartEpoch
r.Info.StartEpoch = rollupInfoExists.StartEpoch

if err := storage.SetRollupInfo(ctx, mu, r.Namespace, &r.Info); err != nil {
return nil, fmt.Errorf("unable to set rollup info(EXIT): %s", err.Error())
}
Expand Down
6 changes: 4 additions & 2 deletions cmd/seq-cli/cmd/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ var rollupCmd = &cobra.Command{
return err
}

op, err := handler.Root().PromptChoice("(0)create (1)delete (2)update", 3)
op, err := handler.Root().PromptChoice("(0)create (1)exit (2)update", 3)
if err != nil {
return err
}
Expand All @@ -133,7 +133,9 @@ var rollupCmd = &cobra.Command{
FeeRecipient: feeRecipient,
Namespace: namespace,
AuthoritySEQAddress: feeRecipient,
StartEpoch: e + 4,
SequencerPublicKey: feeRecipient[:],
StartEpoch: e + 10,
ExitEpoch: 0,
}
// Generate transaction
_, err = sendAndWait(ctx, []chain.Action{&actions.RollupRegistration{
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,4 @@ require (

// replace github.com/ava-labs/coreth => github.com/AnomalyFi/coreth v0.12.5-rc.6.1

// replace github.com/AnomalyFi/hypersdk => ../hypersdk
replace github.com/AnomalyFi/hypersdk => ../hypersdk
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7
filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek=
filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
github.com/AnomalyFi/hypersdk v0.9.7-arcadia.13 h1:jZJXZpW6gQkfH0draUp5fQLwCfKzRYhNLHDxz33ncOs=
github.com/AnomalyFi/hypersdk v0.9.7-arcadia.13/go.mod h1:0Vj2PdwSFN7pat4Sno39IfmtOiv/gO9mxZXyRKnoKtI=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
Expand Down
6 changes: 5 additions & 1 deletion scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,13 @@ find "${TMPDIR}"/avalanchego-"${VERSION}"
# Make sure to replace this address with your own address
# if you are starting your own devnet (otherwise anyone can access
# funds using the included demo.pk)
# total stake can allocate: 10000000000000000000, make sure it is below this or genesis won't load
echo "creating allocations file"
cat <<EOF > "${TMPDIR}"/allocations.json
[{"address":"${ADDRESS}", "balance":10000000000000000000}]
[
{"address":"${ADDRESS}", "balance":1000000000000000000},
{"address":"seq1qy94dndd0wzru9gvq3ayw52ngcd2fuhyptt58f4a3eppjzpx573qg9cr7sm", "balance":1000000000000000000}
]
EOF

GENESIS_PATH=$2
Expand Down

0 comments on commit a7ba8af

Please sign in to comment.