diff --git a/api/artela/types/account.pulsar.go b/api/artela/types/account.pulsar.go index 7a75832..dff3a94 100644 --- a/api/artela/types/account.pulsar.go +++ b/api/artela/types/account.pulsar.go @@ -584,7 +584,7 @@ var file_artela_types_account_proto_rawDesc = []byte{ 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe5, 0x01, 0x0a, 0x0a, + 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xde, 0x01, 0x0a, 0x0a, 0x45, 0x74, 0x68, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x60, 0x0a, 0x0c, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, @@ -595,20 +595,20 @@ var file_artela_types_account_proto_rawDesc = []byte{ 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x14, 0xf2, 0xde, 0x1f, 0x10, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x22, 0x52, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x3a, - 0x42, 0x88, 0xa0, 0x1f, 0x00, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0xca, 0xb4, 0x2d, - 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, - 0x61, 0x75, 0x74, 0x68, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x49, 0x42, 0x90, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x72, 0x74, 0x65, - 0x6c, 0x61, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x42, 0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x72, 0x74, 0x65, 0x6c, - 0x61, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0xa2, 0x02, 0x03, 0x41, 0x54, 0x58, 0xaa, 0x02, 0x0c, - 0x41, 0x72, 0x74, 0x65, 0x6c, 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x73, 0xca, 0x02, 0x0c, 0x41, - 0x72, 0x74, 0x65, 0x6c, 0x61, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0xe2, 0x02, 0x18, 0x41, 0x72, - 0x74, 0x65, 0x6c, 0x61, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x41, 0x72, 0x74, 0x65, 0x6c, 0x61, 0x3a, - 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x3b, 0x88, 0xa0, 0x1f, 0x00, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0xca, 0xb4, 0x2d, + 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x42, 0x90, 0x01, 0x0a, + 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x72, 0x74, 0x65, 0x6c, 0x61, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x42, 0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x72, 0x74, 0x65, 0x6c, 0x61, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0xa2, 0x02, 0x03, 0x41, 0x54, 0x58, 0xaa, 0x02, 0x0c, 0x41, 0x72, 0x74, 0x65, 0x6c, 0x61, 0x2e, + 0x54, 0x79, 0x70, 0x65, 0x73, 0xca, 0x02, 0x0c, 0x41, 0x72, 0x74, 0x65, 0x6c, 0x61, 0x5c, 0x54, + 0x79, 0x70, 0x65, 0x73, 0xe2, 0x02, 0x18, 0x41, 0x72, 0x74, 0x65, 0x6c, 0x61, 0x5c, 0x54, 0x79, + 0x70, 0x65, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x0d, 0x41, 0x72, 0x74, 0x65, 0x6c, 0x61, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/app_config.go b/app/app_config.go index 633a7bf..24b3518 100644 --- a/app/app_config.go +++ b/app/app_config.go @@ -11,6 +11,8 @@ import ( _ "github.com/artela-network/artela-rollkit/x/fee/module" // import for side-effects feemoduletypes "github.com/artela-network/artela-rollkit/x/fee/types" + _ "github.com/artela-network/artela-rollkit/ethereum/types" + runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1" appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" diff --git a/app/codec.go b/app/codec.go new file mode 100644 index 0000000..86a5633 --- /dev/null +++ b/app/codec.go @@ -0,0 +1,14 @@ +package app + +import ( + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + + crypto "github.com/artela-network/artela-rollkit/ethereum/crypto/codec" + "github.com/artela-network/artela-rollkit/ethereum/types" +) + +// RegisterInterfaces registers Interfaces from types, crypto, and SDK std. +func RegisterInterfaces(interfaceRegistry codectypes.InterfaceRegistry) { + crypto.RegisterInterfaces(interfaceRegistry) + types.RegisterInterfaces(interfaceRegistry) +} diff --git a/cmd/artelad/cmd/commands.go b/cmd/artelad/cmd/commands.go index fff4744..e33235e 100644 --- a/cmd/artelad/cmd/commands.go +++ b/cmd/artelad/cmd/commands.go @@ -25,6 +25,8 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" + _ "github.com/artela-network/artela-rollkit/ethereum/types" + "github.com/artela-network/artela-rollkit/app" artclient "github.com/artela-network/artela-rollkit/client" eth "github.com/artela-network/artela-rollkit/ethereum/server/flags" @@ -41,13 +43,13 @@ func initRootCmd( ) { rootCmd.AddCommand( genutilcli.InitCmd(basicManager, app.DefaultNodeHome), - genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome, genutiltypes.DefaultMessageValidator, address.NewBech32Codec(app.AccountAddressPrefix)), + genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome, genutiltypes.DefaultMessageValidator, address.NewBech32Codec(app.AccountAddressPrefix+"valoper")), genutilcli.GenTxCmd( basicManager, txConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome, - address.NewBech32Codec(app.AccountAddressPrefix), + address.NewBech32Codec(app.AccountAddressPrefix+"valoper"), ), genutilcli.ValidateGenesisCmd(basicManager), debug.Cmd(), diff --git a/cmd/artelad/cmd/root.go b/cmd/artelad/cmd/root.go index ee78413..2597a8d 100644 --- a/cmd/artelad/cmd/root.go +++ b/cmd/artelad/cmd/root.go @@ -148,6 +148,8 @@ func ProvideClientContext( txConfig client.TxConfig, legacyAmino *codec.LegacyAmino, ) client.Context { + app.RegisterInterfaces(interfaceRegistry) + clientCtx := client.Context{}. WithCodec(appCodec). WithInterfaceRegistry(interfaceRegistry). diff --git a/ethereum/types/account.pb.go b/ethereum/types/account.pb.go index e5572f7..3957fb7 100644 --- a/ethereum/types/account.pb.go +++ b/ethereum/types/account.pb.go @@ -73,28 +73,28 @@ func init() { func init() { proto.RegisterFile("artela/types/account.proto", fileDescriptor_4d1beb7419d32c57) } var fileDescriptor_4d1beb7419d32c57 = []byte{ - // 327 bytes of a gzipped FileDescriptorProto - 0x1f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x59, 0x12, 0x8f, 0xfc, 0x7d, 0x0d, 0x7f, 0x5c, - 0x0f, 0xff, 0x26, 0x9b, 0x03, 0xaf, 0x16, 0xc9, 0x29, 0x9f, 0x08, 0xa6, 0x44, 0xfb, 0x5f, 0x17, - 0xf6, 0x6a, 0x41, 0x6b, 0x5b, 0xe0, 0x43, 0xbb, 0xf8, 0x4b, 0xf9, 0xe3, 0x83, 0x5d, 0x7d, 0xc9, - 0x94, 0x18, 0x05, 0x8f, 0x1b, 0x0c, 0x9e, 0x37, 0x18, 0x7c, 0x6d, 0x30, 0x78, 0x7b, 0xe9, 0x0f, - 0x67, 0x73, 0x2d, 0xb2, 0x90, 0x44, 0x32, 0x71, 0x27, 0xba, 0xa7, 0xaf, 0xa6, 0x0b, 0xfa, 0x60, - 0xc3, 0x31, 0x79, 0x11, 0xe7, 0x7a, 0x15, 0x5c, 0xbf, 0x96, 0x08, 0xe6, 0x25, 0x82, 0x1f, 0x25, - 0x82, 0x4f, 0x15, 0x02, 0x79, 0x85, 0xc0, 0x7b, 0x85, 0xc0, 0xcd, 0xd9, 0x9e, 0x9a, 0xcd, 0xba, - 0xbf, 0xe4, 0xfa, 0x5e, 0xa6, 0x8b, 0x1f, 0x98, 0xca, 0x38, 0x5e, 0xcc, 0x35, 0xe5, 0x5a, 0xf0, - 0x94, 0x67, 0x89, 0xd5, 0x0e, 0xff, 0x9b, 0x04, 0x4f, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xa8, - 0x9e, 0xe0, 0xd0, 0xbe, 0x01, 0x00, 0x00, + // 322 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x50, 0xb1, 0x4e, 0xc3, 0x30, + 0x10, 0xb5, 0x19, 0x10, 0x4d, 0x3b, 0xa0, 0xd2, 0xa1, 0x14, 0xc9, 0xae, 0x32, 0x55, 0x42, 0xb5, + 0x55, 0x18, 0x90, 0xca, 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 0xdb, 0xfa, 0x86, 0x29, + 0x31, 0xbe, 0x7c, 0xce, 0x30, 0x78, 0xcd, 0x30, 0xf8, 0xce, 0x30, 0xf8, 0x78, 0x1b, 0x9e, 0xce, + 0x17, 0x5a, 0xa4, 0x3e, 0x09, 0x64, 0x6c, 0x4f, 0xb4, 0xcf, 0x50, 0xcd, 0x42, 0x13, 0x22, 0xb1, + 0x76, 0xb7, 0xde, 0xdd, 0x7b, 0x89, 0x60, 0x5e, 0x22, 0xf8, 0x55, 0x22, 0xf8, 0x52, 0x21, 0x90, + 0x57, 0x08, 0x7c, 0x56, 0x08, 0xdc, 0x5f, 0xec, 0xc8, 0x98, 0x90, 0x87, 0x4b, 0xae, 0x9f, 0x64, + 0x12, 0xfe, 0xc2, 0x44, 0x46, 0x51, 0xb8, 0xd0, 0x94, 0x6b, 0xc1, 0x13, 0x9e, 0xc6, 0x46, 0xdb, + 0xdf, 0xaf, 0xa3, 0x3b, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x69, 0xcc, 0xad, 0xdb, 0xb7, 0x01, + 0x00, 0x00, } func (m *EthAccount) Marshal() (dAtA []byte, err error) { diff --git a/ethereum/types/codec.go b/ethereum/types/codec.go index 2877163..efd89f2 100644 --- a/ethereum/types/codec.go +++ b/ethereum/types/codec.go @@ -2,6 +2,7 @@ package types import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -10,7 +11,7 @@ import ( // implementations and interfaces. func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations( - (*authtypes.AccountI)(nil), + (*types.AccountI)(nil), &EthAccount{}, ) registry.RegisterImplementations( diff --git a/init.sh b/init.sh index 25b73a7..e4c0180 100755 --- a/init.sh +++ b/init.sh @@ -37,10 +37,10 @@ if [ -d "$folder_path" ]; then fi fi -echo artela-rollkitd config set client keyring-backend $KEYRING -artela-rollkitd config set client keyring-backend $KEYRING echo artela-rollkitd config set client chain-id $CHAINID artela-rollkitd config set client chain-id $CHAINID +echo artela-rollkitd config set client keyring-backend $KEYRING +artela-rollkitd config set client keyring-backend $KEYRING # if $KEY exists it should be deleted artela-rollkitd keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO @@ -74,9 +74,9 @@ artela-rollkitd add-genesis-account $KEY 100000000000000000000000000aart --keyri artela-rollkitd add-genesis-account $KEY2 100000000000000000000000000aart --keyring-backend $KEYRING artela-rollkitd add-genesis-account $KEY3 100000000000000000000000000aart --keyring-backend $KEYRING artela-rollkitd add-genesis-account $KEY4 100000000000000000000000000aart --keyring-backend $KEYRING -echo artela-rollkitd add-genesis-account $KEY 100000000000000000000000000aart --keyring-backend $KEYRING # Sign genesis transaction +echo gentx $KEY 1000000000000000000000aart --keyring-backend $KEYRING --chain-id $CHAINID artela-rollkitd gentx $KEY 1000000000000000000000aart --keyring-backend $KEYRING --chain-id $CHAINID # Collect genesis tx diff --git a/proto/artela/types/account.proto b/proto/artela/types/account.proto index c29a769..d0e320f 100644 --- a/proto/artela/types/account.proto +++ b/proto/artela/types/account.proto @@ -16,7 +16,7 @@ message EthAccount { option (gogoproto.equal) = false; option (cosmos_proto.implements_interface) = - "github.com/cosmos/cosmos-sdk/x/auth/types.AccountI"; + "github.com/cosmos/cosmos-sdk/types.AccountI"; // base_account is an authtypes.BaseAccount cosmos.auth.v1beta1.BaseAccount base_account = 1 [