Andromeda
ADO LibraryBuild AppsDevelop ADOsCLIWeb Application Docs
Andromeda
Andromeda
  • Platform and Framework
    • Introduction to AndromedaOS
    • ADO Classes
    • Andromeda Messaging Protocol
      • Kernel
      • ADO Database
      • Economics Engine
      • Virtual File System
    • ADO Base
      • AndromedaMsg
      • AndromedaQuery
    • Common Types
    • Deployed Contracts
    • ADO Versions
  • Andromeda Digital Objects
    • Introduction to ADOs
    • Address List
    • Auction
    • App
    • Curve
    • CW20
    • CW20 Staking
    • CW721
    • CW20 Exchange
    • Fixed Amount Splitter
    • Graph
    • Lockdrop
    • Marketplace
    • Merkle-Airdrop
    • Point
    • Primitive
    • Rates
    • Splitter
    • Timelock
    • Validator Staking
    • Vesting
  • Andromeda Apps
    • Introduction to Apps
    • Auctioning App
    • Cw20 Staking App
    • Marketplace App
  • Developing an ADO
    • Getting Started
      • Instantiation
      • Execution
      • Queries
      • Testing
    • Error Handling and Migrate Function
    • CW3 EXAMPLE
      • InstantiateMsg
      • ExecuteMsg
      • QueryMsg
      • Testing
    • ADO Submissions
  • Andromeda CLI
    • Introduction
    • Help and Shortcuts
    • ADO
    • Bank
    • Chain
    • Env
    • Gql
    • Tx
    • OS
    • Wallet
    • Wasm
    • Clearing CLI Data
    • Clear and Exit
  • Chain
    • Running a Node
    • Staking and Rewards
  • Andromeda Dashboard
    • Tokenomics Dashboard
    • Dashboard API
  • Andromeda Changelog
    • Newest Releases
  • Additional Resources
    • GitHub
    • Website
    • White Paper
Powered by GitBook

Additional Resources

  • Github
  • Website

Community

  • Discord
  • Telegram

Socials

  • Twitter
  • Medium
  • Youtube
On this page
  • Introduction
  • InstantiateMsg
  • ExecuteMsg
  • AMPReceive
  • Send
  • Create
  • UpsertKeyAddress
  • AssignChannels
  • Recover
  • UpdateChainName
  • RegisterUserCrossChain
  • Ownership
  • QueryMsg
  • KeyAddress
  • VerifyAddress
  • ChannelInfo
  • Recoveries
  • ChainName
  • ChainNameByChannel
  • PendingPackets
  • PendingPacketsResponse
  • GetEnv
  • Recoveries
  • Version
  • Owner
  • Type

Was this helpful?

  1. Platform and Framework
  2. Andromeda Messaging Protocol

Kernel

PreviousAndromeda Messaging ProtocolNextADO Database

Last updated 1 month ago

Was this helpful?

Introduction

The Andromeda Kernel acts as the core of the operating system.

The Kernel receives and handles packets from ADOs to be relayed to a specified recipient. The Kernel keeps track of the original sender of the message. It also verifies that the packet is sent by an Andromeda certified ADO before relaying the message.

The Kernel is also responsible for:

  • Relaying any IBC messages across any two chains that have an Andromeda Kernel deployed and a channel set up.

  • Keeping track of the other AMP ADOs such as the ADODB, VFS, and Economics.

All of our ADOs have an execute message to handle receiving packets from the Kernel.

The Kernels are set up by the Andromeda team on each chain. This means that as a regular user, you will not need to interact with this ADO yourself in most cases. This page serves as additional information on how it works for people that are interested into getting a deep understanding of our system.

The only only message that users will be calling is the execute message that will recover IBC funds sent in case the IBC message fails.

InstantiateMsg

pub struct InstantiateMsg {
    pub owner: Option<String>,
    pub chain_name: String
}
Name
Type
Description

owner

Option<String>

Optional address to specify as the owner of the ADO being created. Defaults to the sender if not specified.

chain_name

String

The name of the chain we are deploying this kernel for.

ExecuteMsg

AMPReceive

Receives an AMP packet from another ADO. The packet is received, unpacked and the messages are relayed to their intended destination.

Only an AMPPkt sent from one of the Andromeda ADOs is accepted.

pub enum ExecuteMsg {
    AMPReceive(AMPPkt),
    }

Send

Constructs an AMPPkt with a given AMPMsg and sends it to the recipient.

pub enum ExecuteMsg {
       Send {
        message: AMPMsg,
    },
}
Name
Type
Description

message

The message to send.

Create

Creates an ADO with the given type and message.

pub enum ExecuteMsg {
Create {
        ado_type: String,
        msg: Binary,
        owner: Option<AndrAddr>,
        chain: Option<String>,
    },
 }

UpsertKeyAddress

Only available to the owner of the Kernel.

pub enum ExecuteMsg {
    UpsertKeyAddress {
        key: String,
        value: String,
    }
}
Name
Type
Description

key

String

The name of the AMP ADO we want to save the address for.

value

String

The address of the ADO.

AssignChannels

Assigns a given channel between the current chain and the specified target chain. For a successfull channel to be set up, both the channel ids need to be specified.

Only available to the owner of the Kernel.

Calling this message again, will override any previously set channels.

pub enum ExecuteMsg {
 AssignChannels {
        ics20_channel_id: Option<String>,
        direct_channel_id: Option<String>,
        chain: String,
        kernel_address: String,
    },
  }
Name
Type
Description

isc20_channel_id

Option<String>

The id of the ics20 channel.

direct_channel_id

Option<String>

The direct channel id.

chain

String

The name of the target chain.

kernel_address

String

The Kernel address of the target chain.

Recover

Recovers sent IBC funds to the user in case an IBC message fails.

pub enum ExecuteMsg {
    Recover {},
}
{
"recover":{}
}

UpdateChainName

Update the name of the chain the kernel is deployed on. This name is initially specified at instantiation.

Only available to the owner of the Kernel ADO.

pub enum ExecuteMsg {
   UpdateChainName {
        chain_name: String,
    },
}
{
"update_chain_name":{
    "chain_name":"andromeda"
    }
}
Name
Type
Description

chain_name

String

The new assigned name of the chain the kernel is deployed on.

RegisterUserCrossChain

Used to register a VFS username cross-chain.

pub enum ExecuteMsg {
 RegisterUserCrossChain {
        username: String,
        address: String,
        chain: String,
    },
  }
Name
Type
Description

username

String

The username to be registerd.

address

String

The address on the other chain to save the username to.

chain

String

The name of the second chain.

Ownership

QueryMsg

KeyAddress

Queries the address of the specified key.

pub enum QueryMsg{  
   #[returns(Addr)]
    KeyAddress { key: String }
    }
{
"key_address":{
    "key":"adodb"
    }
}
Name
Type
Description

key

String

The key to get the address for.

Returns the address in a string.

VerifyAddress

pub enum QueryMsg{
    #[returns(bool)]
    VerifyAddress { address: String },
    }
{
"verify_address":{
    "address":"andr1..."
    }
}
Name
Type
Description

address

String

The address to check.

Returns true if the address was created by an Andromeda ADO and false otherwise.

ChannelInfo

Gets the saved channel information such as channel ids for the specified chain.

pub enum QueryMsg {
    #[returns(Option<ChannelInfoResponse>)]
    ChannelInfo { chain: String }
    }
{
"channel_info":{
    "chain":"juno"
    }
}
Name
Type
Description

chain

String

The name of the chain to get the channel information for.

ChannelInfoResponse

pub struct ChannelInfoResponse {
    pub ics20: Option<String>,
    pub direct: Option<String>,
    pub kernel_address: String,
    pub supported_modules: Vec<String>,
}
Name
Type
Description

ics20

Option<String>

The ics20 id.

direct

Option<String>

The direct channel id.

kernel_address

String

The kernel address of the specifed chain.

supported_modules

Vec<String>

A list of supported modules by the specified chain.

Recoveries

Gets any fund recoveries available for the specified address.

pub enum QueryMsg {   
    #[returns(Vec<::cosmwasm_std::Coin>)]
    Recoveries { addr: Addr },
    }
}
{
"recoveries":{
    "addr":"andr1..."
    }
}
Name
Type
Description

addr

Addr

The address to check recoveries for.

ChainName

Returns the saved chain name specified at instantiation.

pub enum QueryMsg {
    #[returns(ChainNameResponse)]
    ChainName {},
    }
{
"chain_name":{}
}

ChainNameResponse

pub struct ChainNameResponse {
    pub chain_name: String,
}
{
"chain_name:"andr1..."
}
Name
Type
Description

chain_name

String

The name of the chain the kernel is deployed on.

ChainNameByChannel

Gets the chain name assosiated with the specified channel Id.

pub enum AndromedaQuery {
   #[returns(Option<String>)]
    ChainNameByChannel { channel: String },
     }
{
"chain_name_by_channel":{
    "channel":"channel-2"
    }
}
Name
Type
Description

channel

String

The channel id of the channel to query.

Returns the chain name as a string.

PendingPackets

Queries information on any pending packets on the specified channel.

pub enum AndromedaQuery {
    #[returns(PendingPacketResponse)]
    PendingPackets { channel_id: Option<String> },
    }
{
"pending_packets":{
    "channel_id":"channel-4",
    }
}

PendingPacketsResponse

pub struct PendingPacketResponse {
    pub packets: Vec<PacketInfoAndSequence>,
}

pub struct PacketInfoAndSequence {
    pub packet_info: Ics20PacketInfo,
    pub sequence: u64,
}


pub struct Ics20PacketInfo {
    pub sender: String,
    pub recipient: AndrAddr,
    pub message: Binary,
    pub funds: Coin,
    pub channel: String,
    pub pending: bool,
}
Name
Type
Description

sender

Addr

The address to check recovery funds for.

recipient

The address receiving the packet.

message

Binary

The attached message in the packet.

funds

Any funds attached with the packet.

channel

String

The channel being used to send the packet.

pending

bool

Whether this packet has been processed.

GetEnv

Queries the value for the specified env variable.

The variable name must be uppercase and can only contain letters, numbers, and underscores.

enum AndromedaQuery {
 #[returns(EnvResponse)]
    GetEnv { variable: String },
    }
{
"get_env":{
    "variable":"ENV_3"
    }
}
Name
Type
Description

variable

String

The variable name.

Returns the value in a String.

Recoveries

Queries any recovery funds (funds returned for a failed tx) for the specified address.

pub enum AndromedaQuery {
 #[returns(Vec<::cosmwasm_std::Coin>)]
    Recoveries { addr: Addr },
     }
{
"version":{}
}
Name
Type
Description

addr

Addr

The address to check recovery funds for.

Version

Queries the version of the ADO.

pub enum AndromedaQuery {
     #[returns(VersionResponse)]
     Version {}
     }
{
"version":{}
}

VersionResponse

pub struct VersionResponse {
    pub version: String,
}
{
"version": "0.1.0"
}
Name
Type
Descripton

version

String

The version of the ADO.

Owner

Queries the owner of the contract.

pub enum AndromedaQuery{
    #[returns(ContractOwnerResponse)]
    Owner{}
}
{
  "owner":{}
  }
}

ContractOwnerResponse

pub struct ContractOwnerResponse {
    pub owner: String
}
{
"owner":"andr1..."
}

Type

Queries the ADO type.

pub enum AndromedaQuery {
    #[returns(TypeResponse)]
    Type {}
}
{
"type":{}
}

TypeResponse

pub struct TypeResponse {
    pub ado_type: String,
    }
{
"ado_type":"auction"
}
Name
Type
Description

ado_type

String

The type of the ado.

Information about the AMPPkt struct can be found .

Used to save the addresses of the AMP ADOs that the Kernel will be interacting with such as the , , and .

This message can only be called by the .

The set of ownerhsip messages. These messages are the same as the ones found in the .

Currently there are three keys that can be used: vfs : Gets the address of the ADO used by the kernel.

adodb: Gets the address of the ADO used by the kernel.

economics: Gets the address of the ADO used by the kernel.

Checks if the specified address was created by an Andromeda ADO by checking and comparing the code_Id of the address with the code_Ids stored in the .

Returns a Vec<> containing the recoverable funds.

Returns the denom and amounts of the recovery funds in a struct.

ADODB
Economics
VFS
VFS
VFS
ADODB
Economics
ADODB
Recover
here
AMPMsg
ADO base section
Coin
Coin
AndrAddr
Coin
AMPReceive