diff --git a/.gitignore b/.gitignore index c537798..45b56c7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ provingKey.txt verificationKey.txt verificationKey.json .idea +.DS_Store diff --git a/config/chainInfo.json b/config/chainInfo.json new file mode 100644 index 0000000..df12007 --- /dev/null +++ b/config/chainInfo.json @@ -0,0 +1,15 @@ +{ + "chainInfo": { + "chainID": "aircosmic_2605-1107", + "key": "AccountName", + "moniker": "ChainName" + }, + "daInfo": { + "daSelected": "Celestia", + "daWalletAddress": "0xaddress", + "daWalletKeypair": "0xaddress" + }, + "sequencerInfo": { + "sequencerType": "Air Sequencer" + } +} \ No newline at end of file diff --git a/handlers/settlement-client/addExecutionLayer.go b/handlers/settlement-client/addExecutionLayer.go index 9a1fd44..12e75b6 100644 --- a/handlers/settlement-client/addExecutionLayer.go +++ b/handlers/settlement-client/addExecutionLayer.go @@ -37,7 +37,7 @@ func AddExecutionLayer() string { verificationKeyContentsAsString := string(verificationKeyContents) - chainInfoFile, err := os.ReadFile("data/chainInfo.json") + chainInfoFile, err := os.ReadFile("config/chainInfo.json") if err != nil { fmt.Println("Error reading file:", err) logs.Log.Error("Error reading chainInfo.json file") @@ -54,6 +54,10 @@ func AddExecutionLayer() string { } chainInfoAsString, err := json.Marshal(chainInfo.ChainInfo) + if err != nil { + fmt.Println("Error marshalling chain info:", err) + return "nil" + } postAddExecutionLayerStruct := PostAddExecutionLayerStruct{ VerificationKey: verificationKeyContentsAsString, diff --git a/scripts/init_dir.sh b/scripts/init_dir.sh new file mode 100644 index 0000000..fe5d732 --- /dev/null +++ b/scripts/init_dir.sh @@ -0,0 +1,13 @@ +sudo rm -rf data/leveldb +mkdir -p data/leveldb/batches +mkdir -p data/leveldb/blocks +mkdir -p data/leveldb/proof +mkdir -p data/leveldb/publicWitness +mkdir -p data/leveldb/static +mkdir -p data/leveldb/tx +touch data/blockCount.txt +touch data/transactionCount.txt +touch data/batchCount.txt +echo "0" > data/blockCount.txt +echo "0" > data/transactionCount.txt +echo "0" > data/batchCount.txt \ No newline at end of file