-
Notifications
You must be signed in to change notification settings - Fork 28
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
Problem: New validator projection. Implement migration scripts and views [Part 2] #684
base: feature/652-validator-delegation
Are you sure you want to change the base?
Changes from all commits
fe5ce23
1670d06
9dcbc8a
cd561ef
23000b2
69ad576
46f686e
2413edf
50e375b
0e75837
24c890e
826fc25
1d33b46
c321a08
467494f
5387cab
541bf2e
886dd28
0081eeb
0e0c234
f5211d1
720b1da
38ae3fe
d80fba5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
build: chain-indexing-app | ||
chain-indexing-app: | ||
build: example-app | ||
example-app: | ||
go build ./app/example-app/ | ||
clean: | ||
rm -i example-app |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package config | ||
|
||
import ( | ||
"github.com/crypto-com/chain-indexing/external/bridges/parsers" | ||
"github.com/crypto-com/chain-indexing/external/bridges/parsers/cronos" | ||
"github.com/crypto-com/chain-indexing/infrastructure/httpapi/handlers" | ||
) | ||
|
||
type BridgesAPIConfig struct { | ||
Networks []BridgeNetworkConfig `yaml:"networks"` | ||
Chains []handlers.BridgeChainConfig `yaml:"chains"` | ||
} | ||
|
||
type BridgeNetworkConfig struct { | ||
ChainName string `yaml:"chain_name" mapstructure:"chain_name"` | ||
// Chain network unique abbreviation, used in URL query params | ||
Abbreviation handlers.NetworkAbbreviation `yaml:"abbreviation" mapstructure:"abbreviation"` | ||
MaybeAddressHookKey *string `yaml:"maybe_address_hook_key"` | ||
MaybeCronosAccountAddressPrefix *string `yaml:"maybe_cronos_account_address_prefix"` | ||
} | ||
|
||
var BridgeAddressHooks = (func() map[string]func( | ||
networkConfig *BridgeNetworkConfig, | ||
) handlers.AddressHook { | ||
hooks := make(map[string]func(config *BridgeNetworkConfig) handlers.AddressHook, 0) | ||
|
||
hooks["DefaultLowercaseAddressHook"] = func(_ *BridgeNetworkConfig) handlers.AddressHook { | ||
return parsers.DefaultLowercaseAddressHook | ||
} | ||
hooks["DefaultCronosEVMAddressHookGenerator"] = func(config *BridgeNetworkConfig) handlers.AddressHook { | ||
return cronos.DefaultCronosEVMAddressHookGenerator(*config.MaybeCronosAccountAddressPrefix) | ||
} | ||
|
||
return hooks | ||
})() | ||
|
||
func ParseBridgesConfig(rawConfig *BridgesAPIConfig) handlers.BridgesConfig { | ||
config := handlers.BridgesConfig{ | ||
Networks: make([]handlers.BridgeNetworkConfig, 0, len(rawConfig.Networks)), | ||
Chains: rawConfig.Chains, | ||
} | ||
|
||
for i, network := range rawConfig.Networks { | ||
if network.MaybeAddressHookKey == nil { | ||
config.Networks = append(config.Networks, handlers.BridgeNetworkConfig{ | ||
ChainName: network.ChainName, | ||
Abbreviation: network.Abbreviation, | ||
}) | ||
} else { | ||
hook := BridgeAddressHooks[*network.MaybeAddressHookKey](&rawConfig.Networks[i]) | ||
config.Networks = append(config.Networks, handlers.BridgeNetworkConfig{ | ||
ChainName: network.ChainName, | ||
Abbreviation: network.Abbreviation, | ||
MaybeAddressHook: &hook, | ||
}) | ||
} | ||
} | ||
|
||
return config | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,22 +28,28 @@ index_service: | |
"Validator", | ||
"ValidatorStats", | ||
"NFT", | ||
# "CryptoComNFT", | ||
# "CryptoComNFT", | ||
"IBCChannel", | ||
# "IBCChannelTxMsgTrace", | ||
# "IBCChannelTxMsgTrace", | ||
"IBCChannelMessage", | ||
"BridgePendingActivity", | ||
"Example", | ||
] | ||
# "ValidatorDelegation", | ||
] | ||
extra_configs: | ||
BridgePendingActivity: | ||
this_chain_id: "testnet-croeseid-4" | ||
this_chain_name: "Crypto.org-Chain" | ||
counterparty_chain_name: "Cronos" | ||
channel_id: "channel-131" | ||
starting_height: 899374 | ||
ValidatorDelegation: | ||
unbonding_time: "2419200000000000ns" | ||
slash_fraction_double_sign: "0.050000000000000000" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May i know that are those slash fractions can be change by proposal? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://crypto.org/explorer/proposals You can check those proposals there. So there are different type of proposals. And there are module params that could be configured through |
||
slash_fraction_downtime: "0.000000000000000000" | ||
default_power_reduction: "1000000" | ||
cronjob: | ||
enables: [ ] | ||
enables: [] | ||
cosmos_version_enabled_height: | ||
v0_42_7: 0 | ||
github_api: | ||
|
@@ -59,9 +65,10 @@ http_service: | |
# A list of origins a cross-domain request is allowed to be requested from | ||
# Default value '[]' disables CORS support | ||
# Use '["*"]' to allow request from any origin | ||
cors_allowed_origins: [ ] | ||
cors_allowed_methods: [ "HEAD", "GET" ] | ||
cors_allowed_headers: [ "Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time" ] | ||
cors_allowed_origins: [] | ||
cors_allowed_methods: ["HEAD", "GET"] | ||
cors_allowed_headers: | ||
["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time"] | ||
|
||
tendermint_app: | ||
http_rpc_url: "https://testnet-croeseid-4.crypto.org:26657" | ||
|
@@ -105,4 +112,4 @@ prometheus: | |
|
||
# Custom config for example | ||
server_github_api: | ||
migration_repo_ref: "" | ||
migration_repo_ref: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest to change to ms / s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh this is from Crypto.org genesis. I just copied from the genesis.
Later when we support proposals updaing params in this projection, we will remove this config.