Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v0.9.x #88

Merged
merged 89 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
8adfed0
chore: enable events
soring323 Mar 6, 2024
e697bbf
chore: update pfm version
soring323 Mar 11, 2024
ce140f0
feat: disable pfm
soring323 Mar 11, 2024
a2a6469
Merge branch 'main' into dev
liangping May 8, 2024
b66d2c4
add protobuf for bitcoin light client
liangping May 9, 2024
1d8c567
complete bitcoin light client
liangping May 11, 2024
fa76f87
add module integration
liangping May 13, 2024
cde3180
remove debug
liangping May 14, 2024
22727df
add version to header
liangping May 15, 2024
423f2cb
add parameters
liangping May 15, 2024
0955b91
add btc transaction
liangping May 17, 2024
3062f2b
completed mint
liangping May 24, 2024
0ff99ba
complete bitcoin deposit
liangping May 24, 2024
1979e74
add withdraw msg
liangping May 24, 2024
c1915b1
added withdraw logic
liangping May 29, 2024
40c0f4f
remove unfinished code
liangping May 29, 2024
d28422c
add utxo
liangping Jun 8, 2024
3099232
store utxo
keithsue Jun 12, 2024
fff5b81
add utxo keeper interfaces
keithsue Jun 12, 2024
6fa2f9d
separate bitcoin prefix and side.
liangping Jun 13, 2024
32c558e
disable utxo for now
liangping Jun 13, 2024
c7ee688
implement utxo keeper
keithsue Jun 13, 2024
82cf5df
rename field of signing request, use psbt instead of rawTransaction
liangping Jun 14, 2024
7c74685
rename module to btcbridge
liangping Jun 14, 2024
9d843c6
complete btc withdrawal
keithsue Jun 14, 2024
9955bdc
optimize btc deposit
keithsue Jun 14, 2024
7913236
merge upstream
keithsue Jun 14, 2024
9aadd23
comment out SetBtcChainCfg for now
keithsue Jun 14, 2024
662da08
improve utxos spending logic
keithsue Jun 15, 2024
3cfc0c9
Merge pull request #79 from keithsue/sufay/bridge
liangping Jun 16, 2024
d1b9f2a
use pbst instead rawtransaction
liangping Jun 16, 2024
778a35b
refactor process transaction and vaults
liangping Jun 17, 2024
03ac966
add pubkey to vault
liangping Jun 17, 2024
800cd18
check vault by pubkey
keithsue Jun 17, 2024
c6f2dc6
Merge pull request #80 from keithsue/sufay/check-vault-by-pubkey
liangping Jun 17, 2024
495dbc9
add duplicated mining check
liangping Jun 17, 2024
61cd4c5
remove prev transaction
liangping Jun 17, 2024
96c96b3
save minted tx hash
keithsue Jun 17, 2024
d84a77d
Merge pull request #81 from keithsue/sufay/save-minted-tx
liangping Jun 17, 2024
aac555b
add duplicating error handler
liangping Jun 17, 2024
8eba492
add default blockheader for networks
liangping Jun 17, 2024
4b40b8c
rename field
liangping Jun 17, 2024
a4b809b
Enable signet for dev
liangping Jun 17, 2024
f76ce8d
rename module name
liangping Jun 18, 2024
5e986c2
improve config
liangping Jun 18, 2024
22ba397
fix typo
liangping Jun 18, 2024
3fca5d2
remove hex field
liangping Jun 18, 2024
e25a18e
fixed wrong pubkey
liangping Jun 18, 2024
6b698f7
change chain-id
liangping Jun 18, 2024
d533029
setup vault pubkey
liangping Jun 18, 2024
44ab334
get chaincfg of current selected network
liangping Jun 18, 2024
454a233
improved deposit check
liangping Jun 18, 2024
1de67db
add withdraw btc cmd to cli
keithsue Jun 19, 2024
0eea210
fixed issues on deposit
liangping Jun 19, 2024
9ea20a9
Merge pull request #83 from keithsue/sufay/add-withdraw-btc-cli
liangping Jun 19, 2024
80cf31e
pre-allocated sat in genesis
liangping Jun 19, 2024
7b83fb4
add utxo and signing request query cli
keithsue Jun 19, 2024
d1cd74b
denom
liangping Jun 19, 2024
e0cc49e
Merge branch 'sufay/add-utxo-query-cli' into dev
keithsue Jun 19, 2024
9b209c8
add utxo and signing request query cli
keithsue Jun 19, 2024
6905a35
add launch
liangping Jun 19, 2024
df601c1
Merge remote-tracking branch 'upstream/dev' into dev
keithsue Jun 19, 2024
44456c4
fix address issue
liangping Jun 19, 2024
385b97e
Merge remote-tracking branch 'upstream/dev' into dev
keithsue Jun 19, 2024
5a077b1
add submit signed psbt cmd
keithsue Jun 19, 2024
ebc4880
rename module
liangping Jun 19, 2024
11705cf
Merge pull request #84 from keithsue/sufay/add-utxo-query-cli
liangping Jun 19, 2024
f664af5
Merge branch 'dev' into sufay/add-submit-signed-tx-cli
liangping Jun 19, 2024
e49f171
Merge pull request #85 from keithsue/sufay/add-submit-signed-tx-cli
liangping Jun 19, 2024
8602fbd
Merge remote-tracking branch 'upstream/dev' into dev
keithsue Jun 19, 2024
bfb04b5
Merge remote-tracking branch 'upstream/dev' into dev
keithsue Jun 19, 2024
3a5962f
fixed issue
liangping Jun 19, 2024
b4d9f09
optimize
keithsue Jun 19, 2024
435fa43
Merge remote-tracking branch 'upstream/dev' into dev
keithsue Jun 19, 2024
b56f77f
Merge branch 'dev' into sufay/optimize-btc-bridge
keithsue Jun 19, 2024
7de13d9
used the third key as relayer
liangping Jun 20, 2024
626399e
update status of withdraw: broadcasted
liangping Jun 20, 2024
063df80
update status
liangping Jun 20, 2024
4239823
mark change out minted
keithsue Jun 20, 2024
d85b2b2
Merge pull request #86 from keithsue/sufay/optimize-btc-bridge
liangping Jun 20, 2024
29d13c5
update confirmed status of withdrawal
liangping Jun 20, 2024
d01be72
remove status check for now
liangping Jun 20, 2024
ea52281
added permission check
liangping Jun 20, 2024
56cdfe6
verfiy the signature
liangping Jun 20, 2024
a4814e5
add psbt signature verification
keithsue Jun 20, 2024
f6eff15
Merge pull request #87 from keithsue/sufay/verify-signatures
liangping Jun 20, 2024
2b42a69
update git version
liangping Jun 20, 2024
fd035dd
update replace
liangping Jun 20, 2024
e70c608
update denpendency
liangping Jun 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*.swl
*.swm
*.swn
.vscode
# .vscode
.idea
*.pyc
*.exe
Expand Down Expand Up @@ -85,4 +85,4 @@ contracts/@openzeppelin/*

# Ignore deploy script
development/setup_testnet.sh
development/join_testnet.sh
development/join_testnet.sh
33 changes: 33 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"name": "Query Best Block",
"type": "go",
"request": "launch",
"mode": "auto",
"args": ["q", "btclightclient", "best-block"],
"program": "cmd/sided/main.go --home ~/.side"
},
{
"name": "Query Block",
"type": "go",
"request": "launch",
"mode": "auto",
"args": ["q", "btclightclient", "block", "000000006c52128fcccbc0e5d9311cb9ffdfd3d6655dabc63c2871718c278b5f"],
"program": "cmd/sided/main.go"
},
{
"name": "Start Blockchain",
"type": "go",
"request": "launch",
"mode": "auto",
"args": ["start"],
"program": "cmd/sided/main.go"
}
]
}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/make -f

PACKAGES_NOSIMULATION=$(shell go list ./... | grep -v '/simulation')
VERSION ?= $(shell echo $(shell git describe --tags --always) | sed 's/^v//')
VERSION ?= $(shell echo $(shell git tag --sort=creatordate | tail -1) | sed 's/^v//')
TMVERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::')
COMMIT := $(shell git log -1 --format='%H')
LEDGER_ENABLED ?= true
Expand Down Expand Up @@ -623,4 +623,4 @@ split-test-packages:$(BUILDDIR)/packages.txt
$(SPLIT_CMD) -d -n l/$(NUM_SPLIT) $< $<.

test-group-%:split-test-packages
cat $(BUILDDIR)/packages.txt.$* | xargs go test -mod=readonly -timeout=10m -race -coverprofile=$(BUILDDIR)/$*.profile.out
cat $(BUILDDIR)/packages.txt.$* | xargs go test -mod=readonly -timeout=10m -race -coverprofile=$(BUILDDIR)/$*.profile.out
6 changes: 4 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/spf13/cast"

btcbridgetypes "github.com/sideprotocol/side/x/btcbridge/types"
gmmmoduletypes "github.com/sideprotocol/side/x/gmm/types"

yieldmoduletypes "github.com/sideprotocol/side/x/yield/types"
Expand All @@ -84,8 +85,8 @@ import (
)

const (
AccountAddressPrefix = "bc"
Name = "side"
// AccountAddressPrefix = "bc"
Name = "side"
)

var Upgrades = []upgrades.Upgrade{v1.Upgrade, v2.Upgrade}
Expand Down Expand Up @@ -270,6 +271,7 @@ func New(
wasmTypes.ModuleName,
gmmmoduletypes.ModuleName,
yieldmoduletypes.ModuleName,
btcbridgetypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/initGenesis
}
app.mm.SetOrderInitGenesis(OrderInitGenesis()...)
Expand Down
17 changes: 14 additions & 3 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ import (
yieldmodulekeeper "github.com/sideprotocol/side/x/yield/keeper"
yieldmoduletypes "github.com/sideprotocol/side/x/yield/types"

btcbridgekeeper "github.com/sideprotocol/side/x/btcbridge/keeper"
btcbridgetypes "github.com/sideprotocol/side/x/btcbridge/types"

// this line is used by starport scaffolding # stargate/app/moduleImport

appparams "github.com/sideprotocol/side/app/params"
Expand Down Expand Up @@ -126,9 +129,9 @@ type AppKeepers struct {
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
scopedWasmKeeper capabilitykeeper.ScopedKeeper

GmmKeeper gmmmodulekeeper.Keeper

YieldKeeper yieldmodulekeeper.Keeper
GmmKeeper gmmmodulekeeper.Keeper
YieldKeeper yieldmodulekeeper.Keeper
BtcBridgeKeeper btcbridgekeeper.Keeper

// keys to access the substores
keys map[string]*storetypes.KVStoreKey
Expand Down Expand Up @@ -389,6 +392,13 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
appKeepers.IcacallbacksKeeper,
)

appKeepers.BtcBridgeKeeper = *btcbridgekeeper.NewKeeper(
appCodec,
appKeepers.keys[btcbridgetypes.StoreKey],
appKeepers.keys[btcbridgetypes.StoreKey],
appKeepers.BankKeeper,
)

// The last arguments can contain custom message handlers, and custom query handlers,
// if we want to allow any custom callbacks
supportedFeatures := "iterator,staking,stargate,side,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_4"
Expand Down Expand Up @@ -493,6 +503,7 @@ func KVStoreKeys() []string {
ibcfeetypes.StoreKey,
gmmmoduletypes.StoreKey,
yieldmoduletypes.StoreKey,
btcbridgetypes.StoreKey,
}
}

Expand Down
2 changes: 2 additions & 0 deletions app/keepers/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (

yieldmodule "github.com/sideprotocol/side/x/yield"

btcmodule "github.com/sideprotocol/side/x/btcbridge"
// this line is used by starport scaffolding # stargate/app/moduleImport

// wasmd module integrate
Expand Down Expand Up @@ -74,6 +75,7 @@ var AppModuleBasics = module.NewBasicManager(
wasm.AppModuleBasic{},
gmmmodule.AppModuleBasic{},
yieldmodule.AppModuleBasic{},
btcmodule.AppModuleBasic{},
)

func getGovProposalHandlers() []govclient.ProposalHandler {
Expand Down
8 changes: 8 additions & 0 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ import (
yieldmodule "github.com/sideprotocol/side/x/yield"
yieldmoduletypes "github.com/sideprotocol/side/x/yield/types"

btcbridge "github.com/sideprotocol/side/x/btcbridge"
btcbridgetypes "github.com/sideprotocol/side/x/btcbridge/types"

// this line is used by starport scaffolding # stargate/app/moduleImport

appparams "github.com/sideprotocol/side/app/params"
Expand All @@ -92,6 +95,7 @@ var moduleAccountPermissions = map[string][]string{
wasmTypes.ModuleName: {authtypes.Burner},
gmmmoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking},
yieldmoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking},
btcbridgetypes.ModuleName: {authtypes.Minter, authtypes.Burner},
}

// appModules return modules to initialize module manager.
Expand Down Expand Up @@ -138,6 +142,7 @@ func appModules(
icaModule,
gmmModule,
yieldModule,
btcbridge.NewAppModule(appCodec, app.BtcBridgeKeeper),
// this line is used by starport scaffolding # stargate/app/appModule

crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), // always be last to make sure that it checks for all invariants and not only part of them
Expand Down Expand Up @@ -173,6 +178,7 @@ func orderBeginBlockers() []string {
wasmTypes.ModuleName,
gmmmoduletypes.ModuleName,
yieldmoduletypes.ModuleName,
btcbridgetypes.ModuleName,
}
return ord
}
Expand Down Expand Up @@ -205,6 +211,7 @@ func OrderEndBlockers() []string {
wasmTypes.ModuleName,
gmmmoduletypes.ModuleName,
yieldmoduletypes.ModuleName,
btcbridgetypes.ModuleName,
}
return ord
}
Expand Down Expand Up @@ -242,6 +249,7 @@ func OrderInitGenesis() []string {
wasmTypes.ModuleName,
gmmmoduletypes.ModuleName,
yieldmoduletypes.ModuleName,
btcbridgetypes.ModuleName,
}
}

Expand Down
6 changes: 3 additions & 3 deletions app/test_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)

const Bech32Prefix = "cosmos"
const bech32Prefix = "cosmos"

func init() {
SetupConfig()
Expand All @@ -37,8 +37,8 @@ func SetupConfig() {
config := sdk.GetConfig()
valoper := sdk.PrefixValidator + sdk.PrefixOperator
valoperpub := sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic
config.SetBech32PrefixForAccount(Bech32Prefix, Bech32Prefix+sdk.PrefixPublic)
config.SetBech32PrefixForValidator(Bech32Prefix+valoper, Bech32Prefix+valoperpub)
config.SetBech32PrefixForAccount(bech32Prefix, bech32Prefix+sdk.PrefixPublic)
config.SetBech32PrefixForValidator(bech32Prefix+valoper, bech32Prefix+valoperpub)

config.SetCoinType(84) // use the same coin type as bitcoin

Expand Down
17 changes: 9 additions & 8 deletions cmd/sided/cmd/config.go
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
package cmd

import (
"github.com/btcsuite/btcd/chaincfg"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/sideprotocol/side/app"
)

func initSDKConfig() {
// Set prefixes
accountPubKeyPrefix := app.AccountAddressPrefix + "pub"
validatorAddressPrefix := app.AccountAddressPrefix + "valoper"
validatorPubKeyPrefix := app.AccountAddressPrefix + "valoperpub"
consNodeAddressPrefix := app.AccountAddressPrefix + "valcons"
consNodePubKeyPrefix := app.AccountAddressPrefix + "valconspub"
bech32Prefix := "side"
accountPubKeyPrefix := bech32Prefix + "pub"
validatorAddressPrefix := bech32Prefix + "valoper"
validatorPubKeyPrefix := bech32Prefix + "valoperpub"
consNodeAddressPrefix := bech32Prefix + "valcons"
consNodePubKeyPrefix := bech32Prefix + "valconspub"

// Set and seal config
config := sdk.GetConfig()
config.SetBech32PrefixForAccount(app.AccountAddressPrefix, accountPubKeyPrefix)
config.SetBech32PrefixForAccount(bech32Prefix, accountPubKeyPrefix)
config.SetBech32PrefixForValidator(validatorAddressPrefix, validatorPubKeyPrefix)
config.SetBech32PrefixForConsensusNode(consNodeAddressPrefix, consNodePubKeyPrefix)
config.SetBtcChainCfg(&chaincfg.SigNetParams)

config.Seal()
}
14 changes: 9 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,12 @@ require (
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/aead/siphash v1.0.1 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/aws/aws-sdk-go v1.44.203 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
github.com/btcsuite/btcd v0.24.1-0.20240318151728-2fc99e0496d2 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/btcsuite/btcd/btcutil v1.1.5 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f // indirect
github.com/bufbuild/connect-go v1.0.0 // indirect
github.com/bufbuild/protocompile v0.8.0 // indirect
Expand Down Expand Up @@ -131,6 +128,7 @@ require (
github.com/jhump/protoreflect v1.15.6 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
github.com/kr/pretty v0.3.1 // indirect
Expand Down Expand Up @@ -174,6 +172,7 @@ require (
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/viper v1.16.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
Expand Down Expand Up @@ -216,6 +215,11 @@ require (
github.com/CosmWasm/wasmd v0.45.0
github.com/CosmWasm/wasmvm v1.5.2
github.com/Stride-Labs/stride/v16 v16.0.0
github.com/btcsuite/btcd v0.24.1-0.20240318151728-2fc99e0496d2
github.com/btcsuite/btcd/btcec/v2 v2.3.2
github.com/btcsuite/btcd/btcutil v1.1.5
github.com/btcsuite/btcd/btcutil/psbt v1.1.9
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
github.com/bufbuild/buf v1.7.0
github.com/cosmos/cosmos-proto v1.0.0-beta.4
github.com/cosmos/ics23/go v0.10.0
Expand All @@ -230,7 +234,7 @@ require (
)

replace (
github.com/cosmos/cosmos-sdk => github.com/sideprotocol/cosmos-sdk v0.47.116
github.com/cosmos/cosmos-sdk => github.com/sideprotocol/cosmos-sdk v0.47.11-btc1
// github.com/cosmos/cosmos-sdk => ../cosmos-sdk
github.com/cosmos/interchain-security/v3 => github.com/Stride-Labs/interchain-security/v3 v3.1.0-remove-validation-bug-7d3d9d
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
Expand Down
8 changes: 6 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ github.com/Stride-Labs/stride/v16 v16.0.0/go.mod h1:0I+YGZ6EiuN8XCbeg+KHpo+gge+R
github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE=
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I=
github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg=
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
Expand Down Expand Up @@ -281,6 +282,8 @@ github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9Ur
github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE=
github.com/btcsuite/btcd/btcutil v1.1.5 h1:+wER79R5670vs/ZusMTF1yTcRYE5GUsFbdjdisflzM8=
github.com/btcsuite/btcd/btcutil v1.1.5/go.mod h1:PSZZ4UitpLBWzxGd5VGOrLnmOjtPP/a6HaFo12zMs00=
github.com/btcsuite/btcd/btcutil/psbt v1.1.9 h1:UmfOIiWMZcVMOLaN+lxbbLSuoINGS1WmK1TZNI0b4yk=
github.com/btcsuite/btcd/btcutil/psbt v1.1.9/go.mod h1:ehBEvU91lxSlXtA+zZz3iFYx7Yq9eqnKx4/kSrnsvMY=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6sjybR934QNHSJZPTQ=
Expand Down Expand Up @@ -754,6 +757,7 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 h1:FOOIBWrEkLgmlgGfMuZT83xIwfPDxEI2OHu6xUmJMFE=
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
Expand Down Expand Up @@ -973,8 +977,8 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sideprotocol/cosmos-sdk v0.47.116 h1:9qXEko5qj+RVHR5a01dheCjqzw5MlnYqxu36fqJm5MU=
github.com/sideprotocol/cosmos-sdk v0.47.116/go.mod h1:Ql8d4j8oRXssuNQfVIaa6LRo7VsFMJgSy2Qckd/dcr0=
github.com/sideprotocol/cosmos-sdk v0.47.11-btc1 h1:I34aYrAD/kvm6OqB7dlCterLNSLGwo0CSFzkMuQeCDA=
github.com/sideprotocol/cosmos-sdk v0.47.11-btc1/go.mod h1:lZq3Vdy3Mph8+unX5Afbmf1hsvj9FaYGMLEdCGjOY6g=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
Expand Down
16 changes: 14 additions & 2 deletions local_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ CHAINID="S2-testnet-1"
MONIKER="Side Labs"
BINARY="$HOME/go/bin/sided"
DENOM_STR="uside,ubtct,uusdc,uusdc.axl,uusdc.noble,uusdt,uusdt.kava,uusdt.axl,uwbtc.axl,uwbtc.osmo,uwbtc"

INITIAL_ACCOUNT_STR="bc1q4h88d5xg2cxxcm2kaej32lx6gkdfrxslfaxm8n"
set -f
IFS=,
DENOMS=($DENOM_STR)
INITIAL_ACCOUNTS=($INITIAL_ACCOUNT_STR)

IFS=";"


INITIAL_SUPPLY="500000000000000"
BLOCK_GAS=10000000
MAX_GAS=10000000000
Expand Down Expand Up @@ -103,6 +103,18 @@ if [[ $overwrite == "y" || $overwrite == "Y" ]]; then
$BINARY add-genesis-account "$KEY" ${BALANCES:1} --keyring-backend $KEYRING --home "$HOMEDIR"
done

# Allocate genesis accounts (cosmos formatted addresses)
for ADDR in "${INITIAL_ACCOUNTS[@]}"; do
BALANCES=""
for key in "${!DENOMS[@]}"; do
BALANCES+=",${INITIAL_SUPPLY}${DENOMS[$key]}"
done
echo ${BALANCES:1}
$BINARY add-genesis-account "$ADDR" ${BALANCES:1} --home "$HOMEDIR"
done



# Sign genesis transaction
echo $INITIAL_SUPPLY${DENOMS[0]}
$BINARY gentx "${KEYS[0]}" $INITIAL_SUPPLY${DENOMS[0]} --keyring-backend $KEYRING --chain-id $CHAINID --identity "666AC57CC678BEC4" --website="https://side.one" --home "$HOMEDIR"
Expand Down
Loading
Loading