Skip to content

Instantly share code, notes, and snippets.

View zmanian's full-sized avatar

Zaki Manian zmanian

View GitHub Profile
{
"genesis_time": "2018-08-06T08:00:00.123456789Z",
"chain_id": "gaia-7005",
"consensus_params": {
"block_size_params": {
"max_bytes": "22020096",
"max_txs": "10000",
"max_gas": "-1"
},
"tx_size_params": {

Cosmos signing

Cosmos transaction signing is a fairly simple process.

Every Cosmos transaction has a canonical json representation. The gaiacli and stargate rest interfaces provides canonical json representations of transactions and their broadcast function will provide compact amino(a protobuf like format) encoding translations.

Things to know when signing messages.

ChainWeb and IBC

ChainWeb is a multi chain braid that supports an IBC like interchain messaging protocol. This is minimally specified and implemented in the testnet. These is an intent to extend this messaging protocol beyond the braid to support other chains. This use case is basically identical to Cosmos.

Handshake

The current chain web protocol does not need an introduction/handshake because all chains in the braid are introduced to each other at genesis. Adding new chains to the braid requires a restart/hardfork.

Broadcast

The protocol supports asynchronous broadcast messages with origin and destination chains and origin and destination pact contracts. There is a protocol level system for authenticating messages that pact contracts can invoke.

Unmarshal/deserialize

val := types.MustUnmarshalValidator(cdc, res)

Now this is a very common construct in Go.

It consists of 3 key pieces

Using node config NodeConfig { base: BaseConfig { data_dir_path: "/home/zaki/node_config", temp_data_dir: None, node_sync_retries: 7, node_sync_channel_buffer_size: 10, node_async_log_chan_size: 256 }, metrics: MetricsConfig { dir: "metrics", collection_interval_ms: 1000, push_server_addr: "" }, execution: ExecutionConfig { address: "localhost", port: 55404, testnet_genesis: false, genesis_file_location: "genesis.blob" }, admission_control: AdmissionControlConfig { address: "0.0.0.0", admission_control_service_port: 55394, need_to_check_mempool_before_validation: false, upstream_proxy_timeout: 1s }, debug_interface: DebugInterfaceConfig { admission_control_node_debug_port: 55396, secret_service_node_debug_port: 55400, storage_node_debug_port: 55402, metrics_server_port: 55398, address: "0.0.0.0" }, storage: StorageConfig { address: "localhost", port: 55410, dir: "libradb/db", grpc_max_receive_len: Some(100000000) }, networks: [NetworkConfig { peer_id: "1e5d5a74b0fd09f601ac0fca2fe7d213704e02e51943d18cf25a546b8

A big part of Game of Zones is learning to use the relayer.

The relayer is pretty complex piece of software and documentation is still emerging. For the purposes of Game of Zones 1b, we want to players to pay close attention to how they initialize the connection on their relayer.

The trust period is a value in the on-chain light client that powers IBC. In a production IBC chain, the trust-period of a the on-chain light client should be slightly shorter the unbonding period of the chains. This means a period of 21 days for a chain connected to the Cosmos hub. When creating a client for IBC, the creator can choose any trust period they want.

As part of the Game of Zones, we are encouraging player to create make a choice. A shorter trust period will provide a high score in the phase 1b ranking and a longer trust period will cost less gas and be easier to maintain.

Connecting to the Game of Zones 1b Hub

The Game of Zones Hub for Phase 1b is launching on May 17th. The See Scoring guidlines below . The Genesis file is this repo. chain-id= gameofzoneshub-ab There is a node with open RPC on port 80 at http://35.190.35.11/ We are rate limiting connections so we recommend running your own full node.

Public available sentry nodes are available at

running 1 test
[tendermint/tests/integration.rs:168] &resp = JsonRPCBlockResult(
RPCBlockResult {
query: "tm.event=\'NewBlock\'",
data: BlockResultData {
data_type: "tendermint/event/NewBlock",
value: BlockValue {
block: Block {
header: Header {
version: Version {
kira-1-1b 4m0s gznznsajtk
supernovachain-1b 5m0s clkgzwcgfe
starcluster-1337-1b 6m0s uvzwirnwgo
interstation-1b 7m0s jacljmvdoa
Compass-1b 9m55s snkxcvarit
dawnsworld-1b 9m55s oziibvphlw
plex-1b 10m0s xypdggzvlb
kugs-030-1b 10m0s xbqxjatnnbq
stakebird-1b 10m0s lasmbeybiz
dos-ibc-1b 11m0s zxihpmutac
{"network":"freeflix-media-hub-2","node":"19A3E9203FF48BB6246B28A8A28D357FC11720CF","ts":"2020-05-26T16:23:19.109384462Z","msg":[{"event_ibc":{"PacketTransfer":{"data":{"send_packet.packet_data":["{\"type\":\"ibc/transfer/PacketDataTransfer\",\"value\":{\"amount\":[{\"amount\":\"1\",\"denom\":\"transfer/ortghghqqj/mdm\"}],\"receiver\":\"cosmos1ljd64u6uf5x23c85e6t0v7rquss3weqff6x3mj\",\"sender\":\"freeflix1slsg028uzam5ypcz8fdd8vved6k7smx3ycx35t\"}}"],"tm.event":["Tx"],"transfer.recipient":["freeflix17xpfvakm2amg962yls6f84z3kell8c5luku8d2","freeflix1qayej76lxrdpyg6uq9huaz4tmlsw08ke29xy49"],"message.sender":["freeflix1slsg028uzam5ypcz8fdd8vved6k7smx3ycx35t","freeflix1slsg028uzam5ypcz8fdd8vved6k7smx3ycx35t","freeflix1slsg028uzam5ypcz8fdd8vved6k7smx3ycx35t","freeflix1slsg028uzam5ypcz8fdd8vved6k7smx3ycx35t"],"send_packet.packet_dst_port":["transfer"],"send_packet.packet_dst_channel":["ortghghqqj"],"send_packet.packet_src_channel":["dehgzjabrr"],"send_packet.packet_sequence":["12831"],"transfer.amount":["200fmt","1m