This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DefaultChannelPipeline implements ChannelPipeline { | |
@Override | |
public ChannelPromise bind(SocketAddress localAddress) { | |
return this.tailContext.bind(localAddress); | |
} | |
@Override | |
public ChannelPromise bind(SocketAddress localAddress, ChannelPromise promise) { | |
return this.tailContext.bind(localAddress, promise); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DefaultChannelPipeline implements ChannelPipeline { | |
private final Channel channel; | |
private final HeadContext headContext; | |
private final TailContext tailContext; | |
public DefaultChannelPipeline(Channel channel) { | |
this.channel = channel; | |
this.tailContext = new TailContext(this); | |
this.headContext = new HeadContext(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface ChannelPipeline | |
extends ChannelInboundInvoker, ChannelOutboundInvoker, Iterable<Entry<String, ChannelHandler>> { | |
/** Add handlers to its handler chain at the end. */ | |
ChannelPipeline addLast(ChannelHandler... handlers); | |
/** Remove handler */ | |
ChannelPipeline remove(ChannelHandler handler); | |
/** Returns channel it binds to. */ | |
Channel channel(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Channel { | |
/** Returns the assigned {@link ChannelPipeline} */ | |
ChannelPipeline pipeline(); | |
/** Returns {@code true} if the {@link Channel} is open and may get active later */ | |
boolean isOpen(); | |
/** Returns {@code true} if the {@link Channel} is registered with an {@link ChannelEventLoop} */ | |
boolean isRegistered(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export SIMAPPD_V1_HOME=/path/to/simappd-v1 | |
export SIMAPP_V1_BIN=$SIMAPPD_V1_HOME/cosmovisor/genesis/bin/cored | |
export DAEMON_HOME=/path/to/simappd-home | |
# Send SoftwareUpgrade proposal - Upgrade Name: v2.0.0 | |
$SIMAPP_V1_BIN tx gov submit-proposal software-upgrade v2.0.0 --title v2.0.0 --description v2.0.0 --upgrade-height 40 --from validator1 --yes --home $DAEMON_HOME --chain-id app_9000-1 | |
# Deposit for the proposal - Proposal ID: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export DAEMON_NAME=simappd | |
export SIMAPPD_V1_HOME=/path/to/simappd-v1 | |
export SIMAPPD_V2_HOME=/path/to/simappd-v2 | |
export DAEMON_HOME=/path/to/simappd-home | |
# Tmp cosmovisor directory. In this directory, we are going to | |
# setup Cosmovisor directory structures and copy this directory | |
# into $DAEMON_HOME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package app // upgrades.go | |
func (app *App) setupUpgradeHandlers( | |
configurator module.Configurator, | |
... | |
) { | |
app.UpgradeKeeper.SetUpgradeHandler( | |
v2.UpgradeName, | |
v2.CreateUpgradeHandler(app.mm, configurator, ...), | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (m Manager) RunMigrations(ctx sdk.Context, cfg Configurator, fromVM VersionMap) (VersionMap, error) { | |
... | |
updatedVM := VersionMap{} | |
for _, moduleName := range modules { | |
module := m.Modules[moduleName] | |
fromVersion, exists := fromVM[moduleName] | |
toVersion := module.ConsensusVersion() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package foo | |
// RegisterServices registers a GRPC query service to respond to the | |
// module-specific GRPC queries. | |
func (am AppModule) RegisterServices(cfg module.Configurator) { | |
... | |
migrator := keeper.NewMigrator(am.keeper) | |
// register v1 -> v2 migration | |
if err := cfg.RegisterMigration(types.ModuleName, 1, migrator.Migrate1to2); err != nil { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package v2 // migrations.go | |
func UpdateParams(ctx sdk.Context, paramStore *paramtypes.Subspace) error { | |
... | |
paramStore.Set(ctx, types.KeyValue, "foobar") | |
return nil | |
} | |
func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec) error { |