-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ce6193
commit 54bacba
Showing
31 changed files
with
1,701 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
test/testdata/* | ||
test/resources/kzg/SRSTables/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule eigenlayer-contracts
updated
35 files
Submodule openzeppelin-contracts
updated
581 files
Submodule openzeppelin-contracts-upgradeable
updated
589 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
setup-geth: | ||
cd testbed/geth && rm -rf data && ./run.sh setup 40 ./secret/private-keys.txt ./secret/geth-account-password | ||
|
||
start-chain: | ||
cd testbed && docker compose up -d | ||
cd testbed && ./wait-for http://0.0.0.0:8545 -- echo "Geth up" | ||
|
||
stop-chain: | ||
cd testbed && docker compose down | ||
|
||
new-exp: | ||
./new-exp.sh | ||
|
||
run-exp: | ||
./run-exp.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"flag" | ||
|
||
"github.com/Layr-Labs/eigenda/test/deploy" | ||
) | ||
|
||
const ( | ||
pathFlagName = "path" | ||
pathEnvName = "EIGENDA_TESTDATA_PATH" | ||
) | ||
|
||
var pathFlag string | ||
|
||
func init() { | ||
flag.StringVar(&pathFlag, pathFlagName, "", "path at which to read config. Alternatively, set the "+pathEnvName+" environment variable") | ||
} | ||
|
||
func main() { | ||
|
||
flag.Parse() | ||
|
||
if pathFlag == "" { | ||
pathFlag = os.Getenv(pathEnvName) | ||
} | ||
|
||
if pathFlag == "" { | ||
fmt.Println("No config path received. Exiting.") | ||
return | ||
} | ||
|
||
testEnv := deploy.NewTestConfig(pathFlag) | ||
testEnv.DeployExperiment() | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
package main | ||
|
||
import ( | ||
"bytes" | ||
"fmt" | ||
"log" | ||
"os" | ||
"text/template" | ||
|
||
dis "github.com/Layr-Labs/eigenda/disperser/cmd/basic/flags" | ||
opr "github.com/Layr-Labs/eigenda/node/flags" | ||
|
||
"github.com/urfave/cli" | ||
) | ||
|
||
var myTemplate = ` | ||
type {{.Name}} struct{ | ||
{{range $var := .Fields}} | ||
{{$var.EnvVar}} string | ||
{{end}} | ||
} | ||
func (vars {{.Name}}) getEnvMap() map[string]string { | ||
v := reflect.ValueOf(vars) | ||
envMap := make(map[string]string) | ||
for i := 0; i < v.NumField(); i++ { | ||
envMap[v.Type().Field(i).Name] = v.Field(i).String() | ||
} | ||
return envMap | ||
} | ||
` | ||
|
||
type ServiceConfig struct { | ||
Name string | ||
Fields []Flag | ||
} | ||
|
||
type Flag struct { | ||
Name string | ||
EnvVar string | ||
} | ||
|
||
func getFlag(flag cli.Flag) Flag { | ||
strFlag, ok := flag.(cli.StringFlag) | ||
if ok { | ||
return Flag{strFlag.Name, strFlag.EnvVar} | ||
} | ||
boolFlag, ok := flag.(cli.BoolFlag) | ||
if ok { | ||
return Flag{boolFlag.Name, boolFlag.EnvVar} | ||
} | ||
intFlag, ok := flag.(cli.IntFlag) | ||
if ok { | ||
return Flag{intFlag.Name, intFlag.EnvVar} | ||
} | ||
uint64Flag, ok := flag.(cli.Uint64Flag) | ||
if ok { | ||
return Flag{uint64Flag.Name, uint64Flag.EnvVar} | ||
} | ||
durationFlag, ok := flag.(cli.DurationFlag) | ||
if ok { | ||
return Flag{durationFlag.Name, durationFlag.EnvVar} | ||
} | ||
log.Fatalln("Type not found", flag) | ||
return Flag{} | ||
} | ||
|
||
func genVars(name string, flags []cli.Flag) string { | ||
|
||
t, err := template.New("vars").Parse(myTemplate) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
vars := make([]Flag, 0) | ||
for _, flag := range flags { | ||
vars = append(vars, getFlag(flag)) | ||
} | ||
|
||
var doc bytes.Buffer | ||
err = t.Execute(&doc, ServiceConfig{name, vars}) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
return doc.String() | ||
|
||
} | ||
|
||
func main() { | ||
|
||
configs := `package deploy | ||
import "reflect" | ||
` | ||
|
||
configs += genVars("DisperserVars", dis.Flags) | ||
configs += genVars("OperatorVars", opr.Flags) | ||
|
||
fmt.Println(configs) | ||
|
||
err := os.WriteFile("../env_vars.go", []byte(configs), 0644) | ||
if err != nil { | ||
log.Panicf("Failed to write file. Err: %s", err) | ||
} | ||
} |
Oops, something went wrong.