-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- All major features, enhancements, and bug fixes are included in this commit. - Ready for deployment and further integration. Co-authored-by: Shobhit Sharma <shobhitsks29@gmail.com> Co-authored-by: Kritarth Agrawal <singhalkritarth@gmail.com> Co-authored-by: Shubham Sharma <samwodson@gmail.com> Co-authored-by: Uddesh Jaiswal <uddeshjais.21@gmail.com> Co-authored-by: Rahul Singh Maraskole <rsm050501@gmail.com> Co-authored-by: Aakash Singh Rajput <aakash4dev.crypto@gmail.com>
- Loading branch information
Showing
34 changed files
with
1,544 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Compiled binary files | ||
air-zk | ||
|
||
# Configuration files | ||
config | ||
|
||
|
||
# Log files | ||
evm-chain | ||
cosmwasm-chain | ||
solana-chain | ||
|
||
/dos/farf/ | ||
/farf/ | ||
/solana-release/ | ||
/solana-release.tar.bz2 | ||
/solana-metrics/ | ||
/solana-metrics.tar.bz2 | ||
/target/ | ||
/test-ledger/ | ||
|
||
**/*.rs.bk | ||
.cargo | ||
|
||
/config/ | ||
|
||
.cache | ||
|
||
# log files | ||
*.log | ||
log-*.txt | ||
|
||
# intellij files | ||
.idea/ | ||
/solana.iml | ||
/.vscode/ | ||
|
||
# fetch-spl.sh artifacts | ||
/spl-genesis-args.sh | ||
/spl_*.so | ||
|
||
.DS_Store | ||
# scripts that may be generated by cargo *-bpf commands | ||
**/cargo-*-bpf-child-script-*.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,7 @@ | ||
Co-authored-by: Shobhit Sharma <shobhitsks29@gmail.com> | ||
Co-authored-by: Kritarth Agrawal <singhalkritarth@gmail.com> | ||
Co-authored-by: Shubham Sharma <samwodson@gmail.com> | ||
Co-authored-by: Uddesh Jaiswal <uddeshjais.21@gmail.com> | ||
Co-authored-by: Rahul Singh Maraskole <rsm050501@gmail.com> | ||
Co-authored-by: Aakash Singh Rajput <aakash4dev.crypto@gmail.com> | ||
|
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,7 @@ | ||
# Makefile for installing dependencies | ||
|
||
.PHONY: deps | ||
|
||
deps: | ||
@echo "Installing dependencies..." | ||
|
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,195 @@ | ||
package client | ||
|
||
import ( | ||
"airchains/utils" | ||
"airchains/utils/cosmwasm" | ||
"fmt" | ||
"os" | ||
"strings" | ||
|
||
"github.com/manifoldco/promptui" | ||
) | ||
|
||
func CosmWasmInitialiazation() { | ||
data := map[string]interface{}{ | ||
"chainInfo": CosmWasmChainInfo(), | ||
"daInfo": cosmwasmDAType(), | ||
"sequencerInfo": cosmwasmSequencerType(), | ||
} | ||
utils.CreateFolderAndJSONFile(data, "config", "config.json") | ||
daType := data["daInfo"].(map[string]interface{})["daSelected"].(string) | ||
daTypetoLower := strings.ToLower(daType) | ||
daTypeSend := "http://localhost:5050/" + daTypetoLower | ||
fmt.Println(daTypeSend) | ||
utils.ENVSetup("cosmwasm-sequencer-node", "26657", daTypetoLower) | ||
|
||
} | ||
|
||
func CosmWasmChainInfo() map[string]interface{} { | ||
var chainInfoKeyValue map[string]interface{} | ||
|
||
// First question | ||
validate1 := func(input string) error { | ||
trimmedInput := strings.TrimSpace(input) | ||
|
||
if len(trimmedInput) == 0 { | ||
return fmt.Errorf("input cannot be empty") | ||
} | ||
|
||
if len(trimmedInput) < 3 { | ||
return fmt.Errorf("input must be at least 3 characters") | ||
} | ||
|
||
if trimmedInput == "dummyname" { | ||
return fmt.Errorf("please provide a custom account name other than dummyname") | ||
} | ||
|
||
return nil | ||
} | ||
|
||
prompt1 := promptui.Prompt{ | ||
Label: fmt.Sprintf("What do you want your account name to be? (e.g., %s)", "dummyname"), | ||
Validate: validate1, | ||
} | ||
accountName, err := prompt1.Run() | ||
if err != nil { | ||
fmt.Printf("Prompt failed %v\n", err) | ||
os.Exit(1) | ||
} | ||
|
||
// Second question | ||
validate2 := func(input string) error { | ||
trimmedInput := strings.TrimSpace(input) | ||
|
||
if len(trimmedInput) == 0 { | ||
return fmt.Errorf("input cannot be empty") | ||
} | ||
|
||
if len(trimmedInput) < 3 { | ||
return fmt.Errorf("input must be at least 3 characters") | ||
} | ||
|
||
if trimmedInput == "dummyname" { | ||
return fmt.Errorf("please provide a custom account name other than dummyname") | ||
} | ||
|
||
return nil | ||
} | ||
prompt2 := promptui.Prompt{ | ||
Label: fmt.Sprintf("What is the chain ID of your chain? (e.g., %s)", "aircosmic_5501-1107"), | ||
Validate: validate2, | ||
} | ||
chainID, err := prompt2.Run() | ||
if err != nil { | ||
fmt.Printf("Prompt failed %v\n", err) | ||
os.Exit(1) | ||
} | ||
|
||
// Third question | ||
validate3 := func(input string) error { | ||
trimmedInput := strings.TrimSpace(input) | ||
|
||
if len(trimmedInput) == 0 { | ||
return fmt.Errorf("input cannot be empty") | ||
} | ||
|
||
if len(trimmedInput) < 3 { | ||
return fmt.Errorf("input must be at least 3 characters") | ||
} | ||
|
||
if trimmedInput == "My Chain" { | ||
return fmt.Errorf("please provide a custom account name other than dummyname") | ||
} | ||
|
||
return nil | ||
|
||
} | ||
prompt3 := promptui.Prompt{ | ||
Label: fmt.Sprintf("What do you want the name of your chain? (e.g., %s)", "dummyname"), | ||
Validate: validate3, | ||
} | ||
chainName, err := prompt3.Run() | ||
if err != nil { | ||
fmt.Printf("Prompt failed %v\n", err) | ||
os.Exit(1) | ||
} | ||
|
||
chainInfoKeyValue = map[string]interface{}{ | ||
|
||
"key": accountName, | ||
"chainID": chainID, | ||
"moniker": chainName, | ||
} | ||
utils.DelayLoader() | ||
|
||
return chainInfoKeyValue | ||
} | ||
|
||
func cosmwasmDAType() map[string]interface{} { | ||
var chainInfoKeyValue map[string]interface{} | ||
|
||
prompt := promptui.Select{ | ||
Label: "Select your DA type : ", | ||
Items: []string{"Celestia", "Avail", "Eigen Layer"}, | ||
Templates: &promptui.SelectTemplates{ | ||
Label: "{{ . | cyan }}", | ||
Active: "\U000025B6 {{ if eq . \"Eigen Layer\" }}{{ . | red | cyan }} (Coming Soon){{ else }}{{ . | green }}{{ end }}", | ||
Inactive: " {{ . | black }}", | ||
Selected: "\U000025B6 {{ . | cyan | cyan }}", | ||
}, | ||
} | ||
_, daTech, err := prompt.Run() | ||
|
||
if err != nil { | ||
fmt.Printf("Prompt failed %v\n", err) | ||
return evmDAType() | ||
} | ||
if daTech == "Eigen Layer" { | ||
fmt.Printf("Eigen Layer is coming soon. Please select other DAs for now\n") | ||
evmDAType() | ||
} else { | ||
fmt.Printf("You selected %s\n", daTech) | ||
utils.DaRPC() | ||
utils.SettlementRPC() | ||
} | ||
|
||
chainInfoKeyValue = map[string]interface{}{ | ||
"daSelected": daTech, | ||
} | ||
|
||
utils.DelayLoader() | ||
return chainInfoKeyValue | ||
} | ||
|
||
func cosmwasmSequencerType() map[string]interface{} { | ||
var sequencerKeyValue map[string]interface{} | ||
prompt := promptui.Select{ | ||
Label: "Select your sequencer type : ", | ||
Items: []string{"Air Sequencer", "Espresso Sequencer"}, | ||
Templates: &promptui.SelectTemplates{ | ||
Label: "{{ . | cyan }}", | ||
Active: "\U000025B6 {{ if eq . \"Espresso Sequencer\" }}{{ . | red | cyan }} (Coming Soon){{ else }}{{ . | green }}{{ end }}", | ||
Inactive: " {{ . | black }}", | ||
Selected: "\U000025B6 {{ . | cyan | cyan }}", | ||
}, | ||
} | ||
_, sequencerValue, err := prompt.Run() | ||
|
||
if err != nil { | ||
fmt.Printf("Prompt failed %v\n", err) | ||
evmSequencerType() | ||
} | ||
if sequencerValue == "Espresso Sequencer" { | ||
fmt.Printf("Espresso Sequencer is coming soon. Only air sequencer is available for now\n") | ||
evmSequencerType() | ||
} else { | ||
fmt.Printf("You selected %s\n", sequencerValue) | ||
cosmwasm.CosmwasmSequencerClone() | ||
} | ||
sequencerKeyValue = map[string]interface{}{ | ||
"sequencerType": sequencerValue, | ||
} | ||
|
||
utils.DelayLoader() | ||
return sequencerKeyValue | ||
} |
Oops, something went wrong.