Skip to content

Add app/consumer and app/provider example apps#13

Open
giuliostramondo wants to merge 24 commits intomainfrom
giuliostramondo/tests/app
Open

Add app/consumer and app/provider example apps#13
giuliostramondo wants to merge 24 commits intomainfrom
giuliostramondo/tests/app

Conversation

@giuliostramondo
Copy link

This PR adds producer and consumer apps, and makefile targets to spawn a localnet

  • app/README.md describes how to start the local VAAS testnet.

Closes #1

Copy link
Contributor

@tbruyelle tbruyelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this should run in the CI so I was expecting something similar to what we have in atomone/tests/e2e. But for the first iteration this is good enough, we can migrate to an automated test later.

I'll test it locally but thanks for the amazing work!

@giuliostramondo
Copy link
Author

@tbruyelle this is just to verify that the apps work as expected, for the e2e tests we have issue #4 , I am working on it now.

@tbruyelle
Copy link
Contributor

@tbruyelle this is just to verify that the apps work as expected, for the e2e tests we have issue #4 , I am working on it now.

Oh yes ofc there is a separate issue, all good then 🙏

Copy link
Contributor

@Pantani Pantani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK!!
nice work!!!

Copy link
Contributor

@tbruyelle tbruyelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this tedious task!

@giuliostramondo giuliostramondo force-pushed the giuliostramondo/tests/app branch from a1aab5a to 87dd624 Compare February 9, 2026 14:35
@Pantani
Copy link
Contributor

Pantani commented Feb 11, 2026

make localnet-start is returning an error for me:

rm -rf ~/.consumer-localnet
./build/consumer --home ~/.consumer-localnet init localnet --default-denom uatone --chain-id consumer-localnet
WARNING:(ast) sonic only supports go1.17~1.23, but your environment is not suitable
{
 "moniker": "localnet",
 "chain_id": "consumer-localnet",
 "node_id": "8c827ac14339ab0ea8acc8a59cca8fd788c72cfc",
 "gentxs_dir": "",
 "app_message": {
  "07-tendermint": null,
  "auth": {
   "params": {
    "max_memo_characters": "256",
    "tx_sig_limit": "7",
    "tx_size_cost_per_byte": "10",
    "sig_verify_cost_ed25519": "590",
    "sig_verify_cost_secp256k1": "1000"
   },
   "accounts": []
  },
  "bank": {
   "params": {
    "send_enabled": [],
    "default_send_enabled": true
   },
   "balances": [],
   "supply": [],
   "denom_metadata": [],
   "send_enabled": []
  },
  "genutil": {
   "gen_txs": []
  },
  "ibc": {
   "client_genesis": {
    "clients": [],
    "clients_consensus": [],
    "clients_metadata": [],
    "params": {
     "allowed_clients": [
      "*"
     ]
    },
    "create_localhost": false,
    "next_client_sequence": "0"
   },
   "connection_genesis": {
    "connections": [],
    "client_connection_paths": [],
    "next_connection_sequence": "0",
    "params": {
     "max_expected_time_per_block": "30000000000"
    }
   },
   "channel_genesis": {
    "channels": [],
    "acknowledgements": [],
    "commitments": [],
    "receipts": [],
    "send_sequences": [],
    "recv_sequences": [],
    "ack_sequences": [],
    "next_channel_sequence": "0"
   },
   "client_v2_genesis": {
    "counterparty_infos": []
   },
   "channel_v2_genesis": {
    "acknowledgements": [],
    "commitments": [],
    "receipts": [],
    "async_packets": [],
    "send_sequences": []
   }
  },
  "params": null,
  "slashing": {
   "params": {
    "signed_blocks_window": "100",
    "min_signed_per_window": "0.500000000000000000",
    "downtime_jail_duration": "600s",
    "slash_fraction_double_sign": "0.050000000000000000",
    "slash_fraction_downtime": "0.010000000000000000"
   },
   "signing_infos": [],
   "missed_blocks": []
  },
  "transfer": {
   "port_id": "transfer",
   "denoms": [],
   "params": {
    "send_enabled": true,
    "receive_enabled": true
   },
   "total_escrowed": []
  },
  "upgrade": {},
  "vaasconsumer": {
   "params": {
    "enabled": false,
    "vaas_timeout_period": "2419200s",
    "historical_entries": "10000",
    "unbonding_period": "1728000s"
   },
   "provider": {
    "client_state": null,
    "consensus_state": null,
    "initial_val_set": []
   },
   "new_chain": false,
   "preVAAS": false,
   "connection_id": ""
  },
  "vesting": {}
 }
}
./build/consumer --home ~/.consumer-localnet config set client chain-id consumer-localnet
WARNING:(ast) sonic only supports go1.17~1.23, but your environment is not suitable
./build/consumer --home ~/.consumer-localnet config set client keyring-backend test
WARNING:(ast) sonic only supports go1.17~1.23, but your environment is not suitable
./build/consumer --home ~/.consumer-localnet keys add user
WARNING:(ast) sonic only supports go1.17~1.23, but your environment is not suitable

- address: cosmos10h8pqaegccpevm7747qma9yctwzvvv22x4yzr9
  name: user
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AyK3rY6ZCnUO2BvJBZ9lxhgVOOKx9SHzXL0kDWD1vYHl"}'
  type: local


**Important** write this mnemonic phrase in a safe place.
It is the only way to recover your account if you ever forget your password.

pencil success scale rice donate side drift person size decline degree film giant style asset kiss jacket soldier seek base inner legal forest kiss
WARNING:(ast) sonic only supports go1.17~1.23, but your environment is not suitable

- address: cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl
  name: relayer
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"ArpmqEz3g5rxcqE+f8n15wCMuLyhWF+PO6+zA57aPB/d"}'
  type: local

Relayer key added. Address:
WARNING:(ast) sonic only supports go1.17~1.23, but your environment is not suitable
cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl
./build/consumer --home ~/.consumer-localnet genesis add-genesis-account user 1000000000uatone
WARNING:(ast) sonic only supports go1.17~1.23, but your environment is not suitable
./build/consumer --home ~/.consumer-localnet genesis add-genesis-account relayer 100000000uatone
WARNING:(ast) sonic only supports go1.17~1.23, but your environment is not suitable
# Set gas prices
sed -i.bak 's#^minimum-gas-prices = .*#minimum-gas-prices = "0.01uatone,0.01uphoton"#g' ~/.consumer-localnet/config/app.toml
# Use different ports to avoid conflicts with provider
sed -i.bak 's#tcp://127.0.0.1:26657#tcp://127.0.0.1:26667#g' ~/.consumer-localnet/config/config.toml
sed -i.bak 's#tcp://0.0.0.0:26656#tcp://0.0.0.0:26666#g' ~/.consumer-localnet/config/config.toml
sed -i.bak 's#tcp://127.0.0.1:26658#tcp://127.0.0.1:26668#g' ~/.consumer-localnet/config/config.toml
sed -i.bak 's#tcp://localhost:26657#tcp://localhost:26667#g' ~/.consumer-localnet/config/client.toml
sed -i.bak 's#localhost:9090#localhost:9092#g' ~/.consumer-localnet/config/app.toml
sed -i.bak 's#localhost:1317#localhost:1318#g' ~/.consumer-localnet/config/app.toml
sed -i.bak 's#localhost:6060#localhost:6062#g' ~/.consumer-localnet/config/config.toml
Consumer initialized. Now run 'make consumer-create' on provider to register the consumer chain.
Creating consumer chain on provider...
./build/provider --home ~/.provider-localnet tx provider create-consumer /tmp/vaas-test/create_consumer.json --from val --gas auto --gas-adjustment 1.5 --fees 10000uatone -y
WARNING:(ast) sonic only supports go1.17~1.23, but your environment is not suitable
Usage:
  simd tx provider create-consumer [consumer-parameters] [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
      --aux                      Generate aux signer data instead of sending a tx
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async) (default "sync")
      --chain-id string          The network chain ID
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible)
      --fee-granter string       Fee granter grants fees for the transaction
      --fee-payer string         Fee payer pays fees for the transaction instead of deducting from the signer
      --fees string              Fees to pay along with transaction; eg: 10uatom
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000)
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name)
  -h, --help                     help for create-consumer
      --keyring-backend string   Select keyring's backend (os|file|kwallet|pass|test|memory) (default "os")
      --keyring-dir string       The client Keyring directory; if omitted, the default 'home' directory will be used
      --ledger                   Use a connected Ledger device
      --node string              <host>:<port> to CometBFT rpc interface for this chain (default "tcp://localhost:26657")
      --note string              Note to add a description to the transaction (previously --memo)
      --offline                  Offline mode (does not allow any online functionality)
  -o, --output string            Output format (text|json) (default "json")
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --sign-mode string         Choose sign mode (direct|amino-json|direct-aux|textual), this is an advanced feature
      --timeout-height uint      Set a block timeout height to prevent the tx from being committed past a certain height
      --tip string               Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator
  -y, --yes                      Skip tx broadcasting prompt confirmation

Global Flags:
      --home string         directory for config and data (default "/Users/danilopantani/.vaas-provider")
      --log_format string   The logging format (json|plain) (default "plain")
      --log_level string    The logging level (trace|debug|info|warn|error|fatal|panic|disabled or '*:<level>,<key>:<level>') (default "info")
      --log_no_color        Disable colored logs
      --trace               print out full stack trace on errors

rpc error: code = NotFound desc = rpc error: code = NotFound desc = account cosmos1xemw8zjae3yhshtqvd7zz6wul9lervpaeazn73 not found: key not found
make[1]: *** [consumer-create] Error 1

@Pantani
Copy link
Contributor

Pantani commented Feb 12, 2026

Screenshot 2026-02-12 at 11 15 06

Another thing, I don't think it's an issue for this PR, but the build isn't working if built in the new go 1.26. The github.com/bytedance/sonic v1.12.7 and v1.14.x versions don't support Go 1.26.

@giuliostramondo
Copy link
Author

giuliostramondo commented Feb 13, 2026

Screenshot 2026-02-12 at 11 15 06 Another thing, I don't think it's an issue for this PR, but the build isn't working if built in the new `go 1.26`. The `github.com/bytedance/sonic v1.12.7` and `v1.14.x` versions don't support `Go 1.26`.

@Pantani I changed the sonic version to v1.15.0, this one should work with go 1.26.

@giuliostramondo
Copy link
Author

make localnet-start is returning an error for me:

rm -rf ~/.consumer-localnet
./build/consumer --home ~/.consumer-localnet init localnet --default-denom uatone --chain-id consumer-localnet
WARNING:(ast) sonic only supports go1.17~1.23, but your environment is not suitable
{
 "moniker": "localnet",
 "chain_id": "consumer-localnet",
 "node_id": "8c827ac14339ab0ea8acc8a59cca8fd788c72cfc",
 "gentxs_dir": "",
 "app_message": {
  "07-tendermint": null,
  "auth": {
   "params": {
    "max_memo_characters": "256",
    "tx_sig_limit": "7",
    "tx_size_cost_per_byte": "10",
    "sig_verify_cost_ed25519": "590",
    "sig_verify_cost_secp256k1": "1000"
   },
   "accounts": []
  },
  "bank": {
   "params": {
    "send_enabled": [],
    "default_send_enabled": true
   },
   "balances": [],
   "supply": [],
   "denom_metadata": [],
   "send_enabled": []
  },
  "genutil": {
   "gen_txs": []
  },
  "ibc": {
   "client_genesis": {
    "clients": [],
    "clients_consensus": [],
    "clients_metadata": [],
    "params": {
     "allowed_clients": [
      "*"
     ]
    },
    "create_localhost": false,
    "next_client_sequence": "0"
   },
   "connection_genesis": {
    "connections": [],
    "client_connection_paths": [],
    "next_connection_sequence": "0",
    "params": {
     "max_expected_time_per_block": "30000000000"
    }
   },
   "channel_genesis": {
    "channels": [],
    "acknowledgements": [],
    "commitments": [],
    "receipts": [],
    "send_sequences": [],
    "recv_sequences": [],
    "ack_sequences": [],
    "next_channel_sequence": "0"
   },
   "client_v2_genesis": {
    "counterparty_infos": []
   },
   "channel_v2_genesis": {
    "acknowledgements": [],
    "commitments": [],
    "receipts": [],
    "async_packets": [],
    "send_sequences": []
   }
  },
  "params": null,
  "slashing": {
   "params": {
    "signed_blocks_window": "100",
    "min_signed_per_window": "0.500000000000000000",
    "downtime_jail_duration": "600s",
    "slash_fraction_double_sign": "0.050000000000000000",
    "slash_fraction_downtime": "0.010000000000000000"
   },
   "signing_infos": [],
   "missed_blocks": []
  },
  "transfer": {
   "port_id": "transfer",
   "denoms": [],
   "params": {
    "send_enabled": true,
    "receive_enabled": true
   },
   "total_escrowed": []
  },
  "upgrade": {},
  "vaasconsumer": {
   "params": {
    "enabled": false,
    "vaas_timeout_period": "2419200s",
    "historical_entries": "10000",
    "unbonding_period": "1728000s"
   },
   "provider": {
    "client_state": null,
    "consensus_state": null,
    "initial_val_set": []
   },
   "new_chain": false,
   "preVAAS": false,
   "connection_id": ""
  },
  "vesting": {}
 }
}
./build/consumer --home ~/.consumer-localnet config set client chain-id consumer-localnet
WARNING:(ast) sonic only supports go1.17~1.23, but your environment is not suitable
./build/consumer --home ~/.consumer-localnet config set client keyring-backend test
WARNING:(ast) sonic only supports go1.17~1.23, but your environment is not suitable
./build/consumer --home ~/.consumer-localnet keys add user
WARNING:(ast) sonic only supports go1.17~1.23, but your environment is not suitable

- address: cosmos10h8pqaegccpevm7747qma9yctwzvvv22x4yzr9
  name: user
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AyK3rY6ZCnUO2BvJBZ9lxhgVOOKx9SHzXL0kDWD1vYHl"}'
  type: local


**Important** write this mnemonic phrase in a safe place.
It is the only way to recover your account if you ever forget your password.

pencil success scale rice donate side drift person size decline degree film giant style asset kiss jacket soldier seek base inner legal forest kiss
WARNING:(ast) sonic only supports go1.17~1.23, but your environment is not suitable

- address: cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl
  name: relayer
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"ArpmqEz3g5rxcqE+f8n15wCMuLyhWF+PO6+zA57aPB/d"}'
  type: local

Relayer key added. Address:
WARNING:(ast) sonic only supports go1.17~1.23, but your environment is not suitable
cosmos1r5v5srda7xfth3hn2s26txvrcrntldjumt8mhl
./build/consumer --home ~/.consumer-localnet genesis add-genesis-account user 1000000000uatone
WARNING:(ast) sonic only supports go1.17~1.23, but your environment is not suitable
./build/consumer --home ~/.consumer-localnet genesis add-genesis-account relayer 100000000uatone
WARNING:(ast) sonic only supports go1.17~1.23, but your environment is not suitable
# Set gas prices
sed -i.bak 's#^minimum-gas-prices = .*#minimum-gas-prices = "0.01uatone,0.01uphoton"#g' ~/.consumer-localnet/config/app.toml
# Use different ports to avoid conflicts with provider
sed -i.bak 's#tcp://127.0.0.1:26657#tcp://127.0.0.1:26667#g' ~/.consumer-localnet/config/config.toml
sed -i.bak 's#tcp://0.0.0.0:26656#tcp://0.0.0.0:26666#g' ~/.consumer-localnet/config/config.toml
sed -i.bak 's#tcp://127.0.0.1:26658#tcp://127.0.0.1:26668#g' ~/.consumer-localnet/config/config.toml
sed -i.bak 's#tcp://localhost:26657#tcp://localhost:26667#g' ~/.consumer-localnet/config/client.toml
sed -i.bak 's#localhost:9090#localhost:9092#g' ~/.consumer-localnet/config/app.toml
sed -i.bak 's#localhost:1317#localhost:1318#g' ~/.consumer-localnet/config/app.toml
sed -i.bak 's#localhost:6060#localhost:6062#g' ~/.consumer-localnet/config/config.toml
Consumer initialized. Now run 'make consumer-create' on provider to register the consumer chain.
Creating consumer chain on provider...
./build/provider --home ~/.provider-localnet tx provider create-consumer /tmp/vaas-test/create_consumer.json --from val --gas auto --gas-adjustment 1.5 --fees 10000uatone -y
WARNING:(ast) sonic only supports go1.17~1.23, but your environment is not suitable
Usage:
  simd tx provider create-consumer [consumer-parameters] [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
      --aux                      Generate aux signer data instead of sending a tx
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async) (default "sync")
      --chain-id string          The network chain ID
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible)
      --fee-granter string       Fee granter grants fees for the transaction
      --fee-payer string         Fee payer pays fees for the transaction instead of deducting from the signer
      --fees string              Fees to pay along with transaction; eg: 10uatom
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000)
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name)
  -h, --help                     help for create-consumer
      --keyring-backend string   Select keyring's backend (os|file|kwallet|pass|test|memory) (default "os")
      --keyring-dir string       The client Keyring directory; if omitted, the default 'home' directory will be used
      --ledger                   Use a connected Ledger device
      --node string              <host>:<port> to CometBFT rpc interface for this chain (default "tcp://localhost:26657")
      --note string              Note to add a description to the transaction (previously --memo)
      --offline                  Offline mode (does not allow any online functionality)
  -o, --output string            Output format (text|json) (default "json")
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --sign-mode string         Choose sign mode (direct|amino-json|direct-aux|textual), this is an advanced feature
      --timeout-height uint      Set a block timeout height to prevent the tx from being committed past a certain height
      --tip string               Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator
  -y, --yes                      Skip tx broadcasting prompt confirmation

Global Flags:
      --home string         directory for config and data (default "/Users/danilopantani/.vaas-provider")
      --log_format string   The logging format (json|plain) (default "plain")
      --log_level string    The logging level (trace|debug|info|warn|error|fatal|panic|disabled or '*:<level>,<key>:<level>') (default "info")
      --log_no_color        Disable colored logs
      --trace               print out full stack trace on errors

rpc error: code = NotFound desc = rpc error: code = NotFound desc = account cosmos1xemw8zjae3yhshtqvd7zz6wul9lervpaeazn73 not found: key not found
make[1]: *** [consumer-create] Error 1

@Pantani I am unable to replicate this, did you pull the latest version and ran make localnet-clean before make localnet-start?

@Pantani
Copy link
Contributor

Pantani commented Feb 13, 2026

Oh, nice.
@giuliostramondo is working now after make localnet-clean. Thanks.

Copy link
Contributor

@Pantani Pantani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add app/consumer and app/provider example apps

3 participants