Skip to content

Commit

Permalink
feat: add check billing (#173)
Browse files Browse the repository at this point in the history
* feat: add check billing

* fix: update by comment tips

* fix: fix ec piece key error

* fix: polish by comment tips

* fix: update comments content

---------

Co-authored-by: joeylichang <[email protected]>
  • Loading branch information
will-2012 and joeylichang committed Mar 13, 2023
1 parent e720277 commit e332362
Show file tree
Hide file tree
Showing 40 changed files with 396 additions and 420 deletions.
1 change: 0 additions & 1 deletion config/subconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ func (cfg *StorageProviderConfig) MakeUploaderConfig() (*uploader.UploaderConfig
func (cfg *StorageProviderConfig) MakeDownloaderConfig() (*downloader.DownloaderConfig, error) {
dCfg := &downloader.DownloaderConfig{
SpDBConfig: cfg.SpDBConfig,
ChainConfig: cfg.ChainConfig,
PieceStoreConfig: cfg.PieceStoreConfig,
}
if _, ok := cfg.GRPCAddress[model.DownloaderService]; ok {
Expand Down
11 changes: 6 additions & 5 deletions deployment/localup/localup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ make_config() {
sed -i -e "s/9533/$(($cur_port+533))/g" config.toml
sed -i -e "s/9633/$(($cur_port+633))/g" config.toml
sed -i -e "s/9733/$(($cur_port+733))/g" config.toml
sed -i -e "s/SP_OPERATOR_PUB_KEY/${OPERATOR_ADDRESS}/g" config.toml
sed -i -e "s/SpOperatorAddress = \".*\"/SpOperatorAddress = \"${OPERATOR_ADDRESS}\"/g" config.toml
sed -i -e "s/OperatorPrivateKey = \".*\"/OperatorPrivateKey = \"${OPERATOR_PRIVATE_KEY}\"/g" config.toml
sed -i -e "s/FundingPrivateKey = \".*\"/FundingPrivateKey = \"${FUNDING_PRIVATE_KEY}\"/g" config.toml
sed -i -e "s/SealPrivateKey = \".*\"/SealPrivateKey = \"${SEAL_PRIVATE_KEY}\"/g" config.toml
Expand All @@ -91,7 +91,7 @@ make_config() {
sed -i -e "s/localhost\:9090/${CHAIN_GRPC_ENDPOINT}/g" config.toml
sed -i -e "s/localhost\:26750/${CHAIN_HTTP_ENDPOINT}/g" config.toml
echo "succeed to generate config.toml in "${sp_dir}
cd -
cd - >/dev/null
index=$(($index+1))
done
}
Expand All @@ -104,7 +104,8 @@ start_sp() {
for sp_dir in ${workspace}/${SP_DEPLOY_DIR}/* ; do
cd ${sp_dir}
nohup ./${sp_bin_name}${index} --config config.toml </dev/null >log.txt 2>&1&
cd -
echo "succeed to start sp in "${sp_dir}
cd - >/dev/null
index=$(($index+1))
done
echo "succeed to start storage providers"
Expand All @@ -130,7 +131,7 @@ reset_db() {
mysql -u ${USER} -h ${hostname} -P ${port} -p${PWD} -e "drop database if exists ${DATABASE}"
mysql -u ${USER} -h ${hostname} -P ${port} -p${PWD} -e "create database ${DATABASE}"
echo "succeed to reset db in "${sp_dir}
cd -
cd - >/dev/null
done
}

Expand All @@ -142,7 +143,7 @@ reset_store() {
cd ${sp_dir}
rm -rf ./data
echo "succeed to reset store in "${sp_dir}
cd -
cd - >/dev/null
done
}

Expand Down
29 changes: 14 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,27 @@ module github.com/bnb-chain/greenfield-storage-provider
go 1.19

replace (
// TODO: point to develop branch, will be changed to v0.0.6 after greenfield v0.0.6 released
github.com/bnb-chain/greenfield => github.com/bnb-chain/greenfield v0.0.0-20230220084048-b09d0197ee41
// TODO: point to develop branch, will be changed to v0.0.6 after greenfield-sdk-go v0.0.6 released
cosmossdk.io/math => github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230228075616-68ac309b432c
github.com/bnb-chain/greenfield => github.com/bnb-chain/greenfield v0.0.7
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
// TODO: point to develop branch, will be changed to v0.0.7 after greenfield-sdk-go v0.0.7 released
github.com/cosmos/cosmos-sdk => github.com/bnb-chain/gnfd-cosmos-sdk v0.0.2-0.20230216105555-b94a14479b11
//github.com/cosmos/cosmos-sdk => github.com/bnb-chain/gnfd-cosmos-sdk v0.0.9
github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v0.0.9
github.com/forbole/juno/v4 => github.com/bnb-chain/juno/v4 v4.0.0-20230223090130-98858670d635
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/tendermint/tendermint => github.com/bnb-chain/gnfd-tendermint v0.0.1
github.com/tendermint/tendermint => github.com/bnb-chain/gnfd-tendermint v0.0.2
)

require (
cosmossdk.io/math v1.0.0-beta.6
github.com/aws/aws-sdk-go v1.44.159
github.com/bnb-chain/greenfield v0.0.5
github.com/bnb-chain/greenfield v0.0.6
github.com/bnb-chain/greenfield-common/go v0.0.0-20230227091017-b60c7936a1c6
github.com/bnb-chain/greenfield-go-sdk v0.0.5
github.com/bytedance/gopkg v0.0.0-20221122125632-68358b8ecec6
github.com/cloudflare/cfssl v1.6.3
github.com/cosmos/cosmos-proto v1.0.0-beta.1
github.com/cosmos/cosmos-sdk v0.46.7
github.com/cosmos/gogoproto v1.4.4
github.com/cosmos/gogoproto v1.4.6
github.com/ethereum/go-ethereum v1.10.19
github.com/forbole/juno/v4 v4.0.0-00010101000000-000000000000
github.com/gin-gonic/gin v1.8.2
Expand All @@ -42,8 +41,8 @@ require (
github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8
go.uber.org/multierr v1.9.0
go.uber.org/zap v1.24.0
golang.org/x/exp v0.0.0-20230111222715-75897c7a292a
google.golang.org/grpc v1.52.3
golang.org/x/exp v0.0.0-20230131160201-f062dba9d201
google.golang.org/grpc v1.53.0
gorm.io/driver/mysql v1.4.6
gorm.io/gorm v1.24.5
)
Expand All @@ -63,7 +62,7 @@ require (
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
github.com/confio/ics23/go v0.9.0 // indirect
Expand Down Expand Up @@ -99,9 +98,10 @@ require (
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/gateway v1.1.0 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
Expand Down Expand Up @@ -188,13 +188,12 @@ require (
go.etcd.io/bbolt v1.3.6 // indirect
go.uber.org/atomic v1.10.0 // indirect
golang.org/x/crypto v0.4.0 // indirect
golang.org/x/net v0.6.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 // indirect
google.golang.org/genproto v0.0.0-20230223222841-637eb2293923 // indirect
google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading

0 comments on commit e332362

Please sign in to comment.