From d113dab67bc09abebfe3fc1df62bd0ff1b164957 Mon Sep 17 00:00:00 2001 From: sweexordious Date: Thu, 23 Nov 2023 00:03:55 +0100 Subject: [PATCH] feat: add initial environment for demo --- demo/README.md | 1 + demo/celestia-app/genesis_template.json | 354 ------------------ .../validator/account-address-core0.txt | 1 - ...4a671b839639ed638fd4140f797ddadb3c2f1.json | 1 - .../validator/config/node_key.json | 1 - .../validator/config/priv_validator_key.json | 11 - ...bbbe830cda2fcd50a587f3c885d548fa12.address | 1 - .../validator/keyring-test/core0.info | 1 - demo/docker-compose.yml | 26 +- demo/scripts/start_validator.sh | 9 +- demo/sequencer/.gitignore | 1 + demo/sequencer/Dockerfile | 8 + demo/sequencer/Makefile | 53 +++ demo/sequencer/go.mod | 3 + demo/sequencer/go.sum | 0 demo/sequencer/main.go | 7 + demo/sequencer/sequencer/sequencer.go | 45 +++ demo/sequencer/sequencer/sequencer_test.go | 7 + demo/validator/account-address-validator.txt | 1 + .../config}/app.toml | 0 .../config}/config.toml | 0 .../config}/genesis.json | 94 ++--- ...0c5dcadcc4ec7a44069c2b3d01c99170177f4.json | 1 + demo/validator/config/node_key.json | 1 + demo/validator/config/priv_validator_key.json | 11 + ...8ea5ebbaf6cd5b553d930fe6419ade300c.address | 1 + demo/validator/keyring-test/validator.info | 1 + 27 files changed, 184 insertions(+), 456 deletions(-) create mode 100644 demo/README.md delete mode 100644 demo/celestia-app/genesis_template.json delete mode 100644 demo/celestia-app/validator/account-address-core0.txt delete mode 100644 demo/celestia-app/validator/config/gentx/gentx-de74a671b839639ed638fd4140f797ddadb3c2f1.json delete mode 100644 demo/celestia-app/validator/config/node_key.json delete mode 100644 demo/celestia-app/validator/config/priv_validator_key.json delete mode 100644 demo/celestia-app/validator/keyring-test/0a90c0bbbe830cda2fcd50a587f3c885d548fa12.address delete mode 100644 demo/celestia-app/validator/keyring-test/core0.info create mode 100644 demo/sequencer/.gitignore create mode 100644 demo/sequencer/Dockerfile create mode 100644 demo/sequencer/Makefile create mode 100644 demo/sequencer/go.mod create mode 100644 demo/sequencer/go.sum create mode 100644 demo/sequencer/main.go create mode 100644 demo/sequencer/sequencer/sequencer.go create mode 100644 demo/sequencer/sequencer/sequencer_test.go create mode 100644 demo/validator/account-address-validator.txt rename demo/{celestia-app => validator/config}/app.toml (100%) rename demo/{celestia-app => validator/config}/config.toml (100%) rename demo/{celestia-app => validator/config}/genesis.json (70%) create mode 100644 demo/validator/config/gentx/gentx-2530c5dcadcc4ec7a44069c2b3d01c99170177f4.json create mode 100644 demo/validator/config/node_key.json create mode 100644 demo/validator/config/priv_validator_key.json create mode 100644 demo/validator/keyring-test/3ddae98ea5ebbaf6cd5b553d930fe6419ade300c.address create mode 100644 demo/validator/keyring-test/validator.info diff --git a/demo/README.md b/demo/README.md new file mode 100644 index 00000000..eb2222d6 --- /dev/null +++ b/demo/README.md @@ -0,0 +1 @@ +# Blobstream rollup dev environment diff --git a/demo/celestia-app/genesis_template.json b/demo/celestia-app/genesis_template.json deleted file mode 100644 index a009ac65..00000000 --- a/demo/celestia-app/genesis_template.json +++ /dev/null @@ -1,354 +0,0 @@ -{ - "genesis_time": "2023-10-11T23:14:10.887740385Z", - "chain_id": "blobstream-e2e", - "initial_height": "1", - "consensus_params": { - "block": { - "max_bytes": "1974272", - "max_gas": "-1", - "time_iota_ms": "1" - }, - "evidence": { - "max_age_num_blocks": "120961", - "max_age_duration": "1814400000000000", - "max_bytes": "1048576" - }, - "validator": { - "pub_key_types": [ - "ed25519" - ] - }, - "version": { - "app_version": "1" - } - }, - "app_hash": "", - "app_state": { - "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": [ - { - "@type": "/cosmos.auth.v1beta1.BaseAccount", - "address": "celestia1p2gvpwa7svxd5t7d2zjc0u7gsh2537sjx3cq3a", - "pub_key": null, - "account_number": "0", - "sequence": "0" - }, - { - "@type": "/cosmos.auth.v1beta1.BaseAccount", - "address": "celestia15mwtw3nuqd9equzdsgteuc5nrl5zq49qgjcgzx", - "pub_key": null, - "account_number": "0", - "sequence": "0" - }, - { - "@type": "/cosmos.auth.v1beta1.BaseAccount", - "address": "celestia1ded973wv2vv6t54522w4ghfh0av40xkfc9zx5d", - "pub_key": null, - "account_number": "0", - "sequence": "0" - }, - { - "@type": "/cosmos.auth.v1beta1.BaseAccount", - "address": "celestia15nfz020trvnurxccqwxxtx4l4wgm6jjgtkd0mn", - "pub_key": null, - "account_number": "0", - "sequence": "0" - } - ] - }, - "authz": { - "authorization": [] - }, - "bank": { - "params": { - "send_enabled": [], - "default_send_enabled": true - }, - "balances": [ - { - "address": "celestia1p2gvpwa7svxd5t7d2zjc0u7gsh2537sjx3cq3a", - "coins": [ - { - "denom": "utia", - "amount": "1000000000000000" - } - ] - }, - { - "address": "celestia1ded973wv2vv6t54522w4ghfh0av40xkfc9zx5d", - "coins": [ - { - "denom": "utia", - "amount": "1000000000000000" - } - ] - }, - { - "address": "celestia15nfz020trvnurxccqwxxtx4l4wgm6jjgtkd0mn", - "coins": [ - { - "denom": "utia", - "amount": "1000000000000000" - } - ] - }, - { - "address": "celestia15mwtw3nuqd9equzdsgteuc5nrl5zq49qgjcgzx", - "coins": [ - { - "denom": "utia", - "amount": "1000000000000000" - } - ] - } - ], - "supply": [ - { - "denom": "utia", - "amount": "4000000000000000" - } - ], - "denom_metadata": [ - { - "description": "The native staking token of the Celestia network.", - "denom_units": [ - { - "denom": "utia", - "exponent": 0, - "aliases": [ - "microtia" - ] - }, - { - "denom": "TIA", - "exponent": 6, - "aliases": [] - } - ], - "base": "utia", - "display": "TIA", - "name": "TIA", - "symbol": "TIA", - "uri": "", - "uri_hash": "" - } - ] - }, - "blob": { - "params": { - "gas_per_blob_byte": 8, - "gov_max_square_size": "64" - } - }, - "capability": { - "index": "1", - "owners": [] - }, - "crisis": { - "constant_fee": { - "denom": "utia", - "amount": "1000" - } - }, - "distribution": { - "params": { - "community_tax": "0.020000000000000000", - "base_proposer_reward": "0.010000000000000000", - "bonus_proposer_reward": "0.040000000000000000", - "withdraw_addr_enabled": true - }, - "fee_pool": { - "community_pool": [] - }, - "delegator_withdraw_infos": [], - "previous_proposer": "", - "outstanding_rewards": [], - "validator_accumulated_commissions": [], - "validator_historical_rewards": [], - "validator_current_rewards": [], - "delegator_starting_infos": [], - "validator_slash_events": [] - }, - "evidence": { - "evidence": [] - }, - "feegrant": { - "allowances": [] - }, - "genutil": { - "gen_txs": [ - { - "body": { - "messages": [ - { - "@type": "/cosmos.staking.v1beta1.MsgCreateValidator", - "description": { - "moniker": "blobstream-e2e", - "identity": "", - "website": "", - "security_contact": "", - "details": "" - }, - "commission": { - "rate": "0.100000000000000000", - "max_rate": "0.200000000000000000", - "max_change_rate": "0.010000000000000000" - }, - "min_self_delegation": "1", - "delegator_address": "celestia1p2gvpwa7svxd5t7d2zjc0u7gsh2537sjx3cq3a", - "validator_address": "celestiavaloper1p2gvpwa7svxd5t7d2zjc0u7gsh2537sjrw6e8m", - "pubkey": { - "@type": "/cosmos.crypto.ed25519.PubKey", - "key": "bYso1zvhv8DD3mUM688cUff7U90670GM1fjnMzAbGfg=" - }, - "value": { - "denom": "utia", - "amount": "5000000000" - } - } - ], - "memo": "de74a671b839639ed638fd4140f797ddadb3c2f1@192.168.122.1:26656", - "timeout_height": "0", - "extension_options": [], - "non_critical_extension_options": [] - }, - "auth_info": { - "signer_infos": [ - { - "public_key": { - "@type": "/cosmos.crypto.secp256k1.PubKey", - "key": "AsIx/It5+oWua4C/oHtVy6Ns3/z3omXy10uuKSVINbas" - }, - "mode_info": { - "single": { - "mode": "SIGN_MODE_DIRECT" - } - }, - "sequence": "0" - } - ], - "fee": { - "amount": [], - "gas_limit": "210000", - "payer": "", - "granter": "" - }, - "tip": null - }, - "signatures": [ - "ixd1gyJnu7JHEHfrEkXoerUNjIDweOcyM87Hfp8ByHtG+wrXgjiNLxHV6MLg29CjiwgCj5EEeyc2o5Y8OJW5/w==" - ] - } - ] - }, - "gov": { - "starting_proposal_id": "1", - "deposits": [], - "votes": [], - "proposals": [], - "deposit_params": { - "min_deposit": [ - { - "denom": "utia", - "amount": "10000000000" - } - ], - "max_deposit_period": "172800s" - }, - "voting_params": { - "voting_period": "30s" - }, - "tally_params": { - "quorum": "0.000001", - "threshold": "0.000001", - "veto_threshold": "0.001" - } - }, - "ibc": { - "client_genesis": { - "clients": [], - "clients_consensus": [], - "clients_metadata": [], - "params": { - "allowed_clients": [ - "06-solomachine", - "07-tendermint" - ] - }, - "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" - } - }, - "mint": { - "bond_denom": "utia" - }, - "params": null, - "qgb": { - "params": { - "data_commitment_window": "101" - } - }, - "slashing": { - "params": { - "signed_blocks_window": "5000", - "min_signed_per_window": "0.750000000000000000", - "downtime_jail_duration": "60s", - "slash_fraction_double_sign": "0.020000000000000000", - "slash_fraction_downtime": "0.000000000000000000" - }, - "signing_infos": [], - "missed_blocks": [] - }, - "staking": { - "params": { - "unbonding_time": "1814400s", - "max_validators": 100, - "max_entries": 7, - "historical_entries": 10000, - "bond_denom": "utia", - "min_commission_rate": "0.000000000000000000" - }, - "last_total_power": "0", - "last_validator_powers": [], - "validators": [], - "delegations": [], - "unbonding_delegations": [], - "redelegations": [], - "exported": false - }, - "transfer": { - "port_id": "transfer", - "denom_traces": [], - "params": { - "send_enabled": true, - "receive_enabled": true - } - }, - "vesting": {} - } -} diff --git a/demo/celestia-app/validator/account-address-core0.txt b/demo/celestia-app/validator/account-address-core0.txt deleted file mode 100644 index 4e72e5d1..00000000 --- a/demo/celestia-app/validator/account-address-core0.txt +++ /dev/null @@ -1 +0,0 @@ -celestia1p2gvpwa7svxd5t7d2zjc0u7gsh2537sjx3cq3a diff --git a/demo/celestia-app/validator/config/gentx/gentx-de74a671b839639ed638fd4140f797ddadb3c2f1.json b/demo/celestia-app/validator/config/gentx/gentx-de74a671b839639ed638fd4140f797ddadb3c2f1.json deleted file mode 100644 index d6df2326..00000000 --- a/demo/celestia-app/validator/config/gentx/gentx-de74a671b839639ed638fd4140f797ddadb3c2f1.json +++ /dev/null @@ -1 +0,0 @@ -{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"blobstream-e2e","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"celestia1p2gvpwa7svxd5t7d2zjc0u7gsh2537sjx3cq3a","validator_address":"celestiavaloper1p2gvpwa7svxd5t7d2zjc0u7gsh2537sjrw6e8m","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"bYso1zvhv8DD3mUM688cUff7U90670GM1fjnMzAbGfg="},"value":{"denom":"utia","amount":"5000000000"}}],"memo":"de74a671b839639ed638fd4140f797ddadb3c2f1@192.168.122.1:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AsIx/It5+oWua4C/oHtVy6Ns3/z3omXy10uuKSVINbas"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"210000","payer":"","granter":""},"tip":null},"signatures":["ixd1gyJnu7JHEHfrEkXoerUNjIDweOcyM87Hfp8ByHtG+wrXgjiNLxHV6MLg29CjiwgCj5EEeyc2o5Y8OJW5/w=="]} diff --git a/demo/celestia-app/validator/config/node_key.json b/demo/celestia-app/validator/config/node_key.json deleted file mode 100644 index 7c7ec962..00000000 --- a/demo/celestia-app/validator/config/node_key.json +++ /dev/null @@ -1 +0,0 @@ -{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"e7Js9od4TAqfyihJrc3+zFo9bQCEX0PD0ho5NJ2jjCfMh/nz645apZWJLLnlFa1iP376gJrJLnpDUN4tfXPb3w=="}} \ No newline at end of file diff --git a/demo/celestia-app/validator/config/priv_validator_key.json b/demo/celestia-app/validator/config/priv_validator_key.json deleted file mode 100644 index b25f4db9..00000000 --- a/demo/celestia-app/validator/config/priv_validator_key.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "address": "EB7463ED828FEB5FED88364EBB272044A0FD2990", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "bYso1zvhv8DD3mUM688cUff7U90670GM1fjnMzAbGfg=" - }, - "priv_key": { - "type": "tendermint/PrivKeyEd25519", - "value": "itECjJ4X7YWn18RxDrNpQoXz8OI3VyBxv8PJOEGvUe5tiyjXO+G/wMPeZQzrzxxR9/tT3TrvQYzV+OczMBsZ+A==" - } -} \ No newline at end of file diff --git a/demo/celestia-app/validator/keyring-test/0a90c0bbbe830cda2fcd50a587f3c885d548fa12.address b/demo/celestia-app/validator/keyring-test/0a90c0bbbe830cda2fcd50a587f3c885d548fa12.address deleted file mode 100644 index 27e902c9..00000000 --- a/demo/celestia-app/validator/keyring-test/0a90c0bbbe830cda2fcd50a587f3c885d548fa12.address +++ /dev/null @@ -1 +0,0 @@ -eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMy0wOC0xOSAxMTozNjozOS43NDk5NjM1MjUgKzAyMDAgQ0VTVCBtPSswLjA2NzcyMjcwOSIsImVuYyI6IkEyNTZHQ00iLCJwMmMiOjgxOTIsInAycyI6Ik5RWWVyQjcyQXhfblVQcU8ifQ.4h9ZVKAhyE9ALQH2lAyQ6rkHaCQxsGU9rTKWo_AkcqGycpRHvxl9_A.loXzNYRdkoHiO_2N.2nEc1IZw4csAll7CBvAICc0HVmEyLR4zXFthbuETQcIxUPKNxBYfvFI6JHErIPx-fQ60EBk5oSH2PuXdKklHju5AbTPYmguAmVeDvsTznJcpqB_jhQCaQ7T4R5Jeln50qC48wMIMNpn35UTIId8SuFhGIZSCPpnIRbrFYupsyRZB6S5DPr0rbtOQ6bIENuvj0dMqcNfs1Gg9NROtkDkcbV_eN_zya0GK-ZU6Ob0tVXgGKtJgVZU.w4f79mmdL7m20fAHOT5Jkg \ No newline at end of file diff --git a/demo/celestia-app/validator/keyring-test/core0.info b/demo/celestia-app/validator/keyring-test/core0.info deleted file mode 100644 index b9b95c4b..00000000 --- a/demo/celestia-app/validator/keyring-test/core0.info +++ /dev/null @@ -1 +0,0 @@ -eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMy0wOC0xOSAxMTozNjozOS43NDU4ODQ2MTcgKzAyMDAgQ0VTVCBtPSswLjA2MzY0MzgwMSIsImVuYyI6IkEyNTZHQ00iLCJwMmMiOjgxOTIsInAycyI6InBmUGlyOEl1QTBBUjFCQ20ifQ.usbSHCcQLh_RnJ7Pt5-kqocbF6ExOtkKZL8RFdtMywnbruGcJXeOUQ.rQS87GlSaXrh1j1k.pwIFp8VRMDWrMVYHezMjv8PbSPe8zCYlSc-m3i3LVSWAPoymIT9kyRY-6y6ejI1mTDnzv173enX0hPH95lHYbG3tnOS9r4QQzpG57rDljbPZxuCn3g7OYwVMfEnD9UQCwMV0HHirEEupuAy-wdV9xtBCRmEZpJZYVDTO-REaaCCagkfkea3mQwlYDpoTVeTDZ-6MNhXPWz_vPzfXJROM_6aqI0iwRL20rjVUDgbNcKsBj9Q8h8Z89GnuHR51ee52UpdHaXhs-z6PvlVZ2JpeAbv2n9o-yv0v7jjMG3x4wp8PEEspBTVCDmIYdzhg0QTmn_Ea9lKMqnkInBIJTX5Uwc9_Nk-KNA5nSSRD4qPxbgcMGQPub6_ZvyDQTTRXORfFRFKSXIVjyjFF5sD5DSs9vMO96W3966Ku3Ai9oCtLaqr6ZCu-hVUjjYuJCas.vBT8VZtW_0kwVpQJnAoN2Q \ No newline at end of file diff --git a/demo/docker-compose.yml b/demo/docker-compose.yml index 86471d91..693832ba 100644 --- a/demo/docker-compose.yml +++ b/demo/docker-compose.yml @@ -18,13 +18,12 @@ services: # EVM Address: 0x966e6f22781EF6a6A82BBB4DB3df8E225DfD9488 # key: da6ed55cb2894ac2c9c10209c09de8e8b9d109b910338d5bf3d747a7e1fc9eb9 volumes: - - ${PWD}/celestia-app/validator/config/priv_validator_key.json:/opt/config/priv_validator_key.json:ro - - ${PWD}/celestia-app/validator/config/node_key.json:/opt/config/node_key.json:ro - - ${PWD}/celestia-app/validator/keyring-test:/opt/keyring-test:ro - - ${PWD}/celestia-app/config.toml:/opt/config/config.toml:ro - - ${PWD}/celestia-app/app.toml:/opt/config/app.toml:ro - - ${PWD}/celestia-app/genesis_template.json:/opt/config/genesis_template.json:ro - - ${PWD}/celestia-app/genesis.json:/opt/config/genesis.json:rw + - ${PWD}/validator/config/priv_validator_key.json:/opt/config/priv_validator_key.json:ro + - ${PWD}/validator/config/node_key.json:/opt/config/node_key.json:ro + - ${PWD}/validator/keyring-test:/opt/keyring-test:ro + - ${PWD}/validator/config/config.toml:/opt/config/config.toml:ro + - ${PWD}/validator/config/app.toml:/opt/config/app.toml:ro + - ${PWD}/validator/config/genesis.json:/opt/config/genesis.json:rw - ${PWD}/scripts/start_validator.sh:/opt/start_validator.sh:ro orchestrator: @@ -54,7 +53,7 @@ services: "/opt/start_orchestrator_after_validator_created.sh" ] volumes: - - ${PWD}/celestia-app/validator/keyring-test:/opt/keyring-test:ro + - ${PWD}/validator/keyring-test:/opt/keyring-test:ro - ${PWD}/scripts/start_orchestrator_after_validator_created.sh:/opt/start_orchestrator_after_validator_created.sh:ro ganache: @@ -123,9 +122,6 @@ services: - STARTING_NONCE=latest - P2P_BOOTSTRAPPERS=/dns/orchestrator/tcp/30000/p2p/12D3KooWBSMasWzRSRKXREhediFUwABNZwzJbkZcYz5rYr9Zdmfn - P2P_LISTEN=/ip4/0.0.0.0/tcp/30000 -# set the following environment variable to some value -# if you want to relay to an existing Blobstream contract -# - BLOBSTREAM_CONTRACT=0x123 entrypoint: [ "/bin/bash" ] @@ -135,3 +131,11 @@ services: volumes: - ${PWD}/scripts/start_relayer.sh:/opt/start_relayer.sh:ro - ${PWD}/scripts/deploy_blobstream_contract.sh:/opt/deploy_blobstream_contract.sh:ro + + sequencer: + container_name: sequencer + build: + context: ./sequencer + dockerfile: Dockerfile + depends_on: + - relayer diff --git a/demo/scripts/start_validator.sh b/demo/scripts/start_validator.sh index cac5f162..47ad1aa1 100644 --- a/demo/scripts/start_validator.sh +++ b/demo/scripts/start_validator.sh @@ -4,7 +4,8 @@ # set the genesis time to current time for pruning to work properly new_time=$(date -u +"%Y-%m-%dT%H:%M:%S.%N")"Z" -jq --arg new_time "$new_time" '.genesis_time = $new_time' /opt/config/genesis_template.json > /opt/config/genesis.json +cp /opt/config/genesis.json genesis.json +jq --arg new_time "$new_time" '.genesis_time = $new_time' genesis.json > /opt/config/genesis.json if [[ ! -f /opt/data/priv_validator_state.json ]] then @@ -30,13 +31,13 @@ fi sleep 2s done - VAL_ADDRESS=$(celestia-appd keys show core0 --keyring-backend test --bech=val --home /opt -a) + VAL_ADDRESS=$(celestia-appd keys show validator --keyring-backend test --bech=val --home /opt -a) # Register the validator EVM address celestia-appd tx qgb register \ "${VAL_ADDRESS}" \ 0x966e6f22781EF6a6A82BBB4DB3df8E225DfD9488 \ - --from core0 \ + --from validator \ --home /opt \ --fees "30000utia" \ -b block \ @@ -45,6 +46,6 @@ fi } & /bin/celestia-appd start \ - --moniker core0 \ + --moniker validator \ --rpc.laddr tcp://0.0.0.0:26657 \ --home /opt diff --git a/demo/sequencer/.gitignore b/demo/sequencer/.gitignore new file mode 100644 index 00000000..378eac25 --- /dev/null +++ b/demo/sequencer/.gitignore @@ -0,0 +1 @@ +build diff --git a/demo/sequencer/Dockerfile b/demo/sequencer/Dockerfile new file mode 100644 index 00000000..8894a418 --- /dev/null +++ b/demo/sequencer/Dockerfile @@ -0,0 +1,8 @@ +FROM docker.io/golang:1.21.4-alpine3.18 + +RUN apk update && apk --no-cache add make gcc musl-dev git bash +WORKDIR /opt +COPY . . +RUN make build + +CMD ["./build/demo"] \ No newline at end of file diff --git a/demo/sequencer/Makefile b/demo/sequencer/Makefile new file mode 100644 index 00000000..60f6c1d8 --- /dev/null +++ b/demo/sequencer/Makefile @@ -0,0 +1,53 @@ +#!/usr/bin/make -f + +DOCKER := $(shell which docker) + +install: mod-verify + @echo "--> Installing blobstream" + @go install -mod=readonly +.PHONY: install + +mod-verify: mod + @echo "--> Verifying dependencies have expected content" + GO111MODULE=on go mod verify +.PHONY: mod-verify + +mod: + @echo "--> Updating go.mod" + @go mod tidy +.PHONY: mod + +build: mod + @mkdir -p build/ + @go build -o build +.PHONY: build + +build-docker: + @echo "--> Building Docker image" + @$(DOCKER) build -t celestiaorg/blobstream-demo -f Dockerfile . +.PHONY: build-docker + +lint: + @echo "--> Running golangci-lint" + @golangci-lint run +.PHONY: lint + +fmt: + @echo "--> Running golangci-lint --fix" + @golangci-lint run --fix +.PHONY: fmt + +test: + @echo "--> Running unit tests" + @go test -mod=readonly ./... +.PHONY: test + +test-race: + @echo "--> Running tests with -race" + @go test -mod=readonly -race -test.short ./... +.PHONY: test-race + +benchmark: + @echo "--> Running tests with -bench" + @go test -mod=readonly -bench=. ./... +.PHONY: benchmark diff --git a/demo/sequencer/go.mod b/demo/sequencer/go.mod new file mode 100644 index 00000000..1c91cdfd --- /dev/null +++ b/demo/sequencer/go.mod @@ -0,0 +1,3 @@ +module demo + +go 1.21.1 diff --git a/demo/sequencer/go.sum b/demo/sequencer/go.sum new file mode 100644 index 00000000..e69de29b diff --git a/demo/sequencer/main.go b/demo/sequencer/main.go new file mode 100644 index 00000000..435d630e --- /dev/null +++ b/demo/sequencer/main.go @@ -0,0 +1,7 @@ +package main + +import "demo/sequencer" + +func main() { + sequencer.Start() +} diff --git a/demo/sequencer/sequencer/sequencer.go b/demo/sequencer/sequencer/sequencer.go new file mode 100644 index 00000000..edd32bbc --- /dev/null +++ b/demo/sequencer/sequencer/sequencer.go @@ -0,0 +1,45 @@ +package sequencer + +import ( + "context" + "fmt" + "time" +) + +func Start() { + fmt.Println("starting sequencer") + + ctx := context.Background() + + for { + select { + case <-ctx.Done(): + return + default: + time.Sleep(time.Second) + // insert sending transactions logic here + fmt.Println("doing something") + + // In this setup the following endpoints can be helpful: + // RPC: tcp://validator:26657 + // gRPC: validator:9090 + // Celestia funded account: + /* + -----BEGIN TENDERMINT PRIVATE KEY----- + kdf: bcrypt + salt: 643A75077C2ED9FE77FD9423D9E9F311 + type: secp256k1 + + XwNYAUs53nIeo43oZTzoWny2zw7RImFpBLsPFUw7xz6A9juwyrNzvSByVevbYLhD + vLmXAojArP/gftMzhjbKOtEBN8GeMyfNycrGFp0= + =9zVO + -----END TENDERMINT PRIVATE KEY----- + */ + // Passphrase: blobstream-demo + // Also, the keystore can be directly used from the demo/validator/keystore-test. + // Ganache RPC: ganache:8545 + // Ganache funded account private key: 0x0e9688e585562e828dcbd4f402d5eddf686f947fb6bf75894a85bf008b017401 + // Happy sequencing! + } + } +} diff --git a/demo/sequencer/sequencer/sequencer_test.go b/demo/sequencer/sequencer/sequencer_test.go new file mode 100644 index 00000000..fa986d40 --- /dev/null +++ b/demo/sequencer/sequencer/sequencer_test.go @@ -0,0 +1,7 @@ +package sequencer + +import "testing" + +func TestName(t *testing.T) { + +} diff --git a/demo/validator/account-address-validator.txt b/demo/validator/account-address-validator.txt new file mode 100644 index 00000000..01f8de8a --- /dev/null +++ b/demo/validator/account-address-validator.txt @@ -0,0 +1 @@ +celestia18hdwnr49awa0dn2m257exrlxgxdduvqv6myr2r diff --git a/demo/celestia-app/app.toml b/demo/validator/config/app.toml similarity index 100% rename from demo/celestia-app/app.toml rename to demo/validator/config/app.toml diff --git a/demo/celestia-app/config.toml b/demo/validator/config/config.toml similarity index 100% rename from demo/celestia-app/config.toml rename to demo/validator/config/config.toml diff --git a/demo/celestia-app/genesis.json b/demo/validator/config/genesis.json similarity index 70% rename from demo/celestia-app/genesis.json rename to demo/validator/config/genesis.json index 3c86f98c..b67b10ee 100644 --- a/demo/celestia-app/genesis.json +++ b/demo/validator/config/genesis.json @@ -1,6 +1,6 @@ { - "genesis_time": "2023-11-22T21:40:13.433854251Z", - "chain_id": "blobstream-e2e", + "genesis_time": "2023-11-22T22:49:24.309121593Z", + "chain_id": "demo", "initial_height": "1", "consensus_params": { "block": { @@ -35,28 +35,7 @@ "accounts": [ { "@type": "/cosmos.auth.v1beta1.BaseAccount", - "address": "celestia1p2gvpwa7svxd5t7d2zjc0u7gsh2537sjx3cq3a", - "pub_key": null, - "account_number": "0", - "sequence": "0" - }, - { - "@type": "/cosmos.auth.v1beta1.BaseAccount", - "address": "celestia15mwtw3nuqd9equzdsgteuc5nrl5zq49qgjcgzx", - "pub_key": null, - "account_number": "0", - "sequence": "0" - }, - { - "@type": "/cosmos.auth.v1beta1.BaseAccount", - "address": "celestia1ded973wv2vv6t54522w4ghfh0av40xkfc9zx5d", - "pub_key": null, - "account_number": "0", - "sequence": "0" - }, - { - "@type": "/cosmos.auth.v1beta1.BaseAccount", - "address": "celestia15nfz020trvnurxccqwxxtx4l4wgm6jjgtkd0mn", + "address": "celestia18hdwnr49awa0dn2m257exrlxgxdduvqv6myr2r", "pub_key": null, "account_number": "0", "sequence": "0" @@ -73,34 +52,7 @@ }, "balances": [ { - "address": "celestia1p2gvpwa7svxd5t7d2zjc0u7gsh2537sjx3cq3a", - "coins": [ - { - "denom": "utia", - "amount": "1000000000000000" - } - ] - }, - { - "address": "celestia1ded973wv2vv6t54522w4ghfh0av40xkfc9zx5d", - "coins": [ - { - "denom": "utia", - "amount": "1000000000000000" - } - ] - }, - { - "address": "celestia15nfz020trvnurxccqwxxtx4l4wgm6jjgtkd0mn", - "coins": [ - { - "denom": "utia", - "amount": "1000000000000000" - } - ] - }, - { - "address": "celestia15mwtw3nuqd9equzdsgteuc5nrl5zq49qgjcgzx", + "address": "celestia18hdwnr49awa0dn2m257exrlxgxdduvqv6myr2r", "coins": [ { "denom": "utia", @@ -112,12 +64,12 @@ "supply": [ { "denom": "utia", - "amount": "4000000000000000" + "amount": "1000000000000000" } ], "denom_metadata": [ { - "description": "The native staking token of the Celestia network.", + "description": "The native token of the Celestia network.", "denom_units": [ { "denom": "utia", @@ -160,8 +112,8 @@ "distribution": { "params": { "community_tax": "0.020000000000000000", - "base_proposer_reward": "0.010000000000000000", - "bonus_proposer_reward": "0.040000000000000000", + "base_proposer_reward": "0.000000000000000000", + "bonus_proposer_reward": "0.000000000000000000", "withdraw_addr_enabled": true }, "fee_pool": { @@ -190,7 +142,7 @@ { "@type": "/cosmos.staking.v1beta1.MsgCreateValidator", "description": { - "moniker": "blobstream-e2e", + "moniker": "demo", "identity": "", "website": "", "security_contact": "", @@ -202,11 +154,11 @@ "max_change_rate": "0.010000000000000000" }, "min_self_delegation": "1", - "delegator_address": "celestia1p2gvpwa7svxd5t7d2zjc0u7gsh2537sjx3cq3a", - "validator_address": "celestiavaloper1p2gvpwa7svxd5t7d2zjc0u7gsh2537sjrw6e8m", + "delegator_address": "celestia18hdwnr49awa0dn2m257exrlxgxdduvqv6myr2r", + "validator_address": "celestiavaloper18hdwnr49awa0dn2m257exrlxgxdduvqvlyx6u9", "pubkey": { "@type": "/cosmos.crypto.ed25519.PubKey", - "key": "bYso1zvhv8DD3mUM688cUff7U90670GM1fjnMzAbGfg=" + "key": "FDGPsQ3tBlv3w1xr4F+LxuX1qSLoFA2DHwImrgQQDk8=" }, "value": { "denom": "utia", @@ -214,7 +166,7 @@ } } ], - "memo": "de74a671b839639ed638fd4140f797ddadb3c2f1@192.168.122.1:26656", + "memo": "2530c5dcadcc4ec7a44069c2b3d01c99170177f4@10.68.33.42:26656", "timeout_height": "0", "extension_options": [], "non_critical_extension_options": [] @@ -224,7 +176,7 @@ { "public_key": { "@type": "/cosmos.crypto.secp256k1.PubKey", - "key": "AsIx/It5+oWua4C/oHtVy6Ns3/z3omXy10uuKSVINbas" + "key": "A89dy1FbRIHoQFteiT6iD86121C8XND511+yIpn16Isv" }, "mode_info": { "single": { @@ -243,7 +195,7 @@ "tip": null }, "signatures": [ - "ixd1gyJnu7JHEHfrEkXoerUNjIDweOcyM87Hfp8ByHtG+wrXgjiNLxHV6MLg29CjiwgCj5EEeyc2o5Y8OJW5/w==" + "+JTZor90PZqgM/ii6RUAXkOpLmfdxJhzAIlkhXJRBTktnJPiIJvko0K8mToodk5C0ildh1ep7MweyUnoOYsStQ==" ] } ] @@ -260,15 +212,15 @@ "amount": "10000000000" } ], - "max_deposit_period": "172800s" + "max_deposit_period": "604800s" }, "voting_params": { - "voting_period": "30s" + "voting_period": "604800s" }, "tally_params": { - "quorum": "0.000001", - "threshold": "0.000001", - "veto_threshold": "0.001" + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000" } }, "ibc": { @@ -290,7 +242,7 @@ "client_connection_paths": [], "next_connection_sequence": "0", "params": { - "max_expected_time_per_block": "30000000000" + "max_expected_time_per_block": "75000000000" } }, "channel_genesis": { @@ -310,7 +262,7 @@ "params": null, "qgb": { "params": { - "data_commitment_window": "101" + "data_commitment_window": "400" } }, "slashing": { @@ -331,7 +283,7 @@ "max_entries": 7, "historical_entries": 10000, "bond_denom": "utia", - "min_commission_rate": "0.000000000000000000" + "min_commission_rate": "0.050000000000000000" }, "last_total_power": "0", "last_validator_powers": [], diff --git a/demo/validator/config/gentx/gentx-2530c5dcadcc4ec7a44069c2b3d01c99170177f4.json b/demo/validator/config/gentx/gentx-2530c5dcadcc4ec7a44069c2b3d01c99170177f4.json new file mode 100644 index 00000000..d95644f0 --- /dev/null +++ b/demo/validator/config/gentx/gentx-2530c5dcadcc4ec7a44069c2b3d01c99170177f4.json @@ -0,0 +1 @@ +{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"demo","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"celestia18hdwnr49awa0dn2m257exrlxgxdduvqv6myr2r","validator_address":"celestiavaloper18hdwnr49awa0dn2m257exrlxgxdduvqvlyx6u9","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"FDGPsQ3tBlv3w1xr4F+LxuX1qSLoFA2DHwImrgQQDk8="},"value":{"denom":"utia","amount":"5000000000"}}],"memo":"2530c5dcadcc4ec7a44069c2b3d01c99170177f4@10.68.33.42:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A89dy1FbRIHoQFteiT6iD86121C8XND511+yIpn16Isv"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"210000","payer":"","granter":""},"tip":null},"signatures":["+JTZor90PZqgM/ii6RUAXkOpLmfdxJhzAIlkhXJRBTktnJPiIJvko0K8mToodk5C0ildh1ep7MweyUnoOYsStQ=="]} diff --git a/demo/validator/config/node_key.json b/demo/validator/config/node_key.json new file mode 100644 index 00000000..3dbc6fc4 --- /dev/null +++ b/demo/validator/config/node_key.json @@ -0,0 +1 @@ +{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"OKkYZUIO8+Y+7DEVQBqvjwgKXoqXkCdB7ZApqLCsvFJh4dydJNMhbFq1XPWbnDeE7pGOn6CyqkCfyUqmlx2bXg=="}} \ No newline at end of file diff --git a/demo/validator/config/priv_validator_key.json b/demo/validator/config/priv_validator_key.json new file mode 100644 index 00000000..8d496fac --- /dev/null +++ b/demo/validator/config/priv_validator_key.json @@ -0,0 +1,11 @@ +{ + "address": "432E9E8D91BAF1E5E0993BCF6895B0048E7FB273", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "FDGPsQ3tBlv3w1xr4F+LxuX1qSLoFA2DHwImrgQQDk8=" + }, + "priv_key": { + "type": "tendermint/PrivKeyEd25519", + "value": "rzUSak0bqa+kPVtxPPaztth2xLBbc0+64Vd4GblHX4QUMY+xDe0GW/fDXGvgX4vG5fWpIugUDYMfAiauBBAOTw==" + } +} \ No newline at end of file diff --git a/demo/validator/keyring-test/3ddae98ea5ebbaf6cd5b553d930fe6419ade300c.address b/demo/validator/keyring-test/3ddae98ea5ebbaf6cd5b553d930fe6419ade300c.address new file mode 100644 index 00000000..cd02b664 --- /dev/null +++ b/demo/validator/keyring-test/3ddae98ea5ebbaf6cd5b553d930fe6419ade300c.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMy0xMS0yMiAyMzoxMjoxNy42NTM2NDggKzAxMDAgQ0VUIG09KzAuMDI4MDU0NTg1IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoicnpSV1dUWFI0R3NSS3dTUiJ9.b5muOTRvULYIvwAoSnPBUFzk0jqpnVTUS1uIqqmCCK93RTEEjE_05w.NWQpT54RJ9kKM392.AziWSBFA47YglGahvWYQzpONUKnr-r1qmsWLRLD3KPRPozgRJ7sJ3JD4UFvZ8ebApPDVBNM9VkmddfE3G_5MFSPUjqctey5k66m34uh3MzIxCM7YMH4ZTTvZa693ewtof08F3vxlGS80OQtts0oO31XT7Zl3R9NUtCgPsJzqUjRA0OB-vWcmCcAbIWagMKIcd5Ap63lPplj_RugmYQh-efDfbbgbBEnwV5H9uLml14_X1x08nPqyE18S.Blhalz0bw3UHs8jqfZBa0Q \ No newline at end of file diff --git a/demo/validator/keyring-test/validator.info b/demo/validator/keyring-test/validator.info new file mode 100644 index 00000000..e6a4baca --- /dev/null +++ b/demo/validator/keyring-test/validator.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMy0xMS0yMiAyMzoxMjoxNy42NTIzNzIgKzAxMDAgQ0VUIG09KzAuMDI2Nzc4MjkzIiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiQUtSdjVXcERaZHFCZHlXUiJ9.YEZ8IF8SQgtF7_eM0K6khKrs-KPxGbDAeVB1LpIQ-E7lT59Zk-xIsQ.D42ak2LzTdIIGi_R.kqOeh2aNC0upzTmVrzdnuUwMrJzBjI5_MD6OZNSoiSGc3z2hayhdc8lbdRtP2IThJcfgf17ufQxEI6Ppg9T4oaWJnaufe8tsyWhdVBSo2FtGX7Zrgb9B35DExXATvUdQLzwuX4fZAmliLQtG1J19eBYukbANzF_N-HVudgtaoViCbUNduL1k1qVxG7hD0Jd-f84VX1znd12zrBpmWLMQePODveGErkEFHpCJelvbJESh1f2nfFBKZIaKyMAnMFDovJk4YcH7qkgnBsC7e5YBJX3nW3IHuzNzvaJpwDjWdWYe7yP7fFu5z9GPgJsUuLzJVvmjNYVeoM1wm1Gl1clgGXfPEatVM_Gg69d14gVYAK3AQ1Aru10tJ9PvJr_HsQiNHez4kkjpnSO2jja5IMjjiLElMLJhiTcBkEeYi2Mg7Cl5namYK0QF0cIYp7sO3wxEmNVk5129uA4.J4Ry8gG0sycbn1TsBwNtcQ \ No newline at end of file