Skip to content

Commit

Permalink
Merge pull request #1 from simbadMarino/debug
Browse files Browse the repository at this point in the history
Merge debug into main
  • Loading branch information
simbadMarino authored Oct 15, 2022
2 parents d6c1283 + 151b5ab commit 879fa17
Show file tree
Hide file tree
Showing 34 changed files with 540 additions and 374 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion chain/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var (
bttcTestBatchAddress = common.HexToAddress("0x0c9de531dcb38b758fe8a2c163444a5e54ee0db2")
bttcTestVaultLogicAddressV1 = common.HexToAddress("0x212324b18255593AdE87597Fa37C2c582aD72d24")
bttcTestVaultLogicAddress = common.HexToAddress("0x73bcbE03999913dB7229FD5dC485cf23247c58B5") // https://testnet.bttcscan.com/address/0x73bcbE03999913dB7229FD5dC485cf23247c58B5
bttcTestStatusAddress = common.HexToAddress("0x8226b334C441095215Ae58eD9396a55a9D80bFD5")
bttcTestStatusAddress = common.HexToAddress("0x38d1fF2C2e9744273E4531FA4608eB6432c1F26A")

bttcFactoryAddressV1 = common.HexToAddress("0x9AF4bEc1A30BeC47756Ecef4cf43B91592121bC9")
bttcFactoryAddress = common.HexToAddress("0x763d7858287B9a33F4bE5bb3df0241dACc59BCc7") // https://bttcscan.com/address/0x763d7858287B9a33F4bE5bb3df0241dACc59BCc7
Expand Down
11 changes: 10 additions & 1 deletion chain/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/base64"
"errors"
"fmt"
config "github.com/TRON-US/go-btfs-config"
"io/ioutil"
"math/rand"
"os"
Expand Down Expand Up @@ -232,7 +233,7 @@ func SetReportStatusListOK(r *LevelDbReportStatusInfo) ([]*LevelDbReportStatusIn
rList := make([]*LevelDbReportStatusInfo, 0)
err := StateStore.Get(keyReportStatusList, &rList)
if err != nil {
if err.Error() == "storage: not found" {
if errors.Is(err, storage.ErrNotFound) {
init = true
// continue
} else {
Expand Down Expand Up @@ -307,3 +308,11 @@ func StoreOnline(lastOnlineInfo *LastOnlineInfo) error {

return nil
}

func GetOnlineServer(chainId int64) string {
if chainId == 199 {
return config.DefaultServicesConfig().OnlineServerDomain
} else {
return config.DefaultServicesConfigTestnet().OnlineServerDomain
}
}
26 changes: 18 additions & 8 deletions cmd/btfs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ANDROID_OUT=./jniLibs
ANDROID_SDK=$(HOME)/Library/Android/sdk
NDK_BIN=$(ANDROID_SDK)/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin

WASM_OUT=./wasmBinary

ios-arm64:
CGO_ENABLED=1 \
Expand All @@ -12,7 +12,7 @@ ios-arm64:
SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk \
CC=$(PWD)/clangwrap.sh \
CGO_CFLAGS="-fembed-bitcode -Wno-undef-prefix" \
go build -buildmode=c-archive -tags ios -o $(IOS_OUT)/arm64.a .
go build -buildmode=c-archive -tags ios -ldflags="-s -w" -o $(IOS_OUT)/arm64.a .

ios-x86_64:
CGO_ENABLED=1 \
Expand All @@ -21,40 +21,50 @@ ios-x86_64:
SDK=iphonesimulator \
CGO_CFLAGS="-Wno-undef-prefix" \
CC=$(PWD)/clangwrap.sh \
go build -buildmode=c-archive -tags ios -o $(IOS_OUT)/x86_64.a .
go build -buildmode=c-archive -tags ios -ldflags="-s -w" -o $(IOS_OUT)/x86_64.a .

ios: ios-arm64 ios-x86_64
lipo $(IOS_OUT)/x86_64.a $(IOS_OUT)/arm64.a -create -output $(IOS_OUT)/btfs.a
cp $(IOS_OUT)/arm64.h $(IOS_OUT)/btfs.h


android-armv7a:
CGO_ENABLED=1 \
GOOS=android \
GOARCH=arm \
GOARM=7 \
CGO_CFLAGS="-fembed-bitcode" \
CC=$(NDK_BIN)/armv7a-linux-androideabi21-clang \
go build -buildmode=c-shared -o $(ANDROID_OUT)/armeabi-v7a/libfoo.so .
go build -buildmode=c-shared -trimpath -ldflags="-s -w" -o $(ANDROID_OUT)/armeabi-v7a/libbtfs.so .


android-arm64:
CGO_ENABLED=1 \
GOOS=android \
GOARCH=arm64 \
CGO_CFLAGS="-fembed-bitcode" \
CC=$(NDK_BIN)/aarch64-linux-android21-clang \
go build -buildmode=c-shared -o $(ANDROID_OUT)/arm64-v8a/libfoo.so .
go build -buildmode=c-shared -trimpath -ldflags="-s -w" -o $(ANDROID_OUT)/arm64-v8a/libbtfs.so .


android-x86:
CGO_ENABLED=1 \
GOOS=android \
GOARCH=386 \
CC=$(NDK_BIN)/i686-linux-android21-clang \
go build -buildmode=c-shared -o $(ANDROID_OUT)/x86/libfoo.so .
go build -buildmode=c-shared -trimpath -ldflags="-s -w" -o $(ANDROID_OUT)/x86/libbtfs.so .

android-x86_64:
CGO_ENABLED=1 \
GOOS=android \
GOARCH=amd64 \
CC=$(NDK_BIN)/x86_64-linux-android21-clang \
go build -buildmode=c-shared -o $(ANDROID_OUT)/x86_64/libfoo.so .
go build -buildmode=c-shared -trimpath -ldflags="-s -w" -o $(ANDROID_OUT)/x86_64/libbtfs.so .

android: android-armv7a android-arm64 android-x86 android-x86_64

wasm:
CGO_ENABLED=1 \
GOOS=js \
GOARCH=wasm \
go build -o $(WASM_OUT)/btfs.wasm .
75 changes: 0 additions & 75 deletions cmd/btfs/_btfs_fat.h

This file was deleted.

Loading

0 comments on commit 879fa17

Please sign in to comment.