### Initialize Benchmark Environment Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-iavl/benchmarks/README.md Commands to grant execution permissions to setup scripts and run the root installation script on the target machine. ```bash cd setup chmod +x * sudo ./INSTALL_ROOT.sh ``` -------------------------------- ### Setup Remote Environment via SSH Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-iavl/benchmarks/README.md Commands to transfer setup files to a remote host and initiate a secure shell session for configuration. ```bash scp -r setup user@host: ssh user@host ``` -------------------------------- ### Execute Benchmarks and Retrieve Results Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-iavl/benchmarks/README.md Commands to start the benchmark process within a screen session and copy the generated results file back to the local machine. ```bash screen ./RUN_BENCHMARKS.sh scp user@host:go/src/github.com/cosmos/iavl/results.txt results.txt git add results ``` -------------------------------- ### Validator Setup Source: https://context7.com/sei-protocol/sei-chain/llms.txt Provides a step-by-step guide to setting up a validator node on the Sei network, including cloning the repository, initializing the node, configuring genesis and gas prices, and setting up a systemd service. ```bash # Clone and build git clone https://github.com/sei-protocol/sei-chain cd sei-chain git checkout v5.0.0 # Use appropriate version make install # Initialize node seid init --chain-id pacific-1 --mode validator # Download genesis wget https://raw.githubusercontent.com/sei-protocol/testnet/main/pacific-1/genesis.json \ -O $HOME/.sei/config/genesis.json # Configure minimum gas prices sed -i 's/minimum-gas-prices = ""/minimum-gas-prices = "0.01usei"/g' \ $HOME/.sei/config/app.toml # Create systemd service cat > /etc/systemd/system/seid.service << 'EOF' [Unit] Description=Sei Network Node After=network.target [Service] Type=simple User=sei WorkingDirectory=/home/sei ExecStart=/home/sei/go/bin/seid start Restart=on-failure RestartSec=3 LimitNOFILE=65535 [Install] WantedBy=multi-user.target EOF # Start service systemctl daemon-reload systemctl enable seid systemctl start seid ``` -------------------------------- ### Run Benchmarks via Docker Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-iavl/benchmarks/README.md A single-command Docker execution that installs dependencies, runs benchmarks for multiple database backends, and outputs the results. ```bash docker run --rm -it ubuntu:16.04 /bin/bash -c \ "apt-get update && apt-get install -y curl && \ sh <(curl -s https://raw.githubusercontent.com/baabeetaa/iavl/fix-bencharks/benchmarks/setup/INSTALL_ROOT.sh) && \ sh <(curl -s https://raw.githubusercontent.com/baabeetaa/iavl/fix-bencharks/benchmarks/setup/RUN_BENCHMARKS.sh) fix-bencharks baabeetaa && \ cat ~/iavl/results.txt" ``` -------------------------------- ### Start `simd` Node Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-ibc-go/testing/simapp/README.md Starts the `simd` node, allowing it to join and participate in the testnet. This command should be run after all configuration steps are completed. ```bash # Start the simd node $ ./simd start ``` -------------------------------- ### Install Seid Binary and Checkout Version Source: https://github.com/sei-protocol/sei-chain/blob/main/README.md Clones the sei-chain repository, checks out a specific version, and installs the seid binary. Requires Go 1.18+ and Git. ```bash git clone https://github.com/sei-protocol/sei-chain cd sei-chain git checkout $VERSION make install ``` -------------------------------- ### Run Built-in Single Node with Tendermint Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-tendermint/test/e2e/README.md Build and run a single Tendermint node using the 'make node' command, initialize a validator, and then start the node with a built-in configuration file. Alternatively, start Tendermint in proxy mode. ```bash make node tendermint init validator TMHOME=$HOME/.tendermint ./build/node ./node/built-in.toml ``` ```bash tendermint start --proxy-app e2e ``` -------------------------------- ### Start Sei Node via Systemd Source: https://github.com/sei-protocol/sei-chain/blob/main/README.md Commands to reload systemd services, enable the seid service to start on boot, and start the Sei node, tailing its logs. ```bash sudo systemctl daemon-reload sudo systemctl enable seid.service systemctl start seid && journalctl -u seid -f ``` -------------------------------- ### Address Precompile Interface and Example (Solidity) Source: https://context7.com/sei-protocol/sei-chain/llms.txt Provides the interface for the Address precompile, enabling EVM and Sei native address association and lookup. Includes an example contract for retrieving addresses and associating them via public key. ```solidity // SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IAddr {\n // Get Sei native address from EVM address\n function getSeiAddr(address evmAddr) external view returns (string memory);\n\n // Get EVM address from Sei native address\n function getEvmAddr(string memory seiAddr) external view returns (address);\n\n // Associate addresses using signature\n function associate(\n string memory v,\n string memory r,\n string memory s,\n string memory customMessage\n ) external returns (string memory seiAddr, address evmAddr);\n\n // Associate addresses using public key\n function associatePubKey(string memory pubKeyHex) external returns (string memory seiAddr, address evmAddr);\n}\n\ncontract AddressLookup {\n IAddr constant ADDR = IAddr(0x0000000000000000000000000000000000001004);\n\n function lookupSeiAddress(address evmAddress) external view returns (string memory) {\n return ADDR.getSeiAddr(evmAddress);\n }\n\n function lookupEvmAddress(string memory seiAddress) external view returns (address) {\n return ADDR.getEvmAddr(seiAddress);\n }\n\n function associateWithPubKey(string memory compressedPubKeyHex) external returns (string memory, address) {\n return ADDR.associatePubKey(compressedPubKeyHex);\n }\n} ``` -------------------------------- ### Create Application Instance with Server Options - Go Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-cosmos/server/README.md This Go code illustrates the creation of an application instance using the `StartCmd` function. It defines an `AppCreator` that constructs a `simapp.NewSimApp` by processing various application options obtained from `server.AppOptions`, including cache settings, upgrade heights, pruning options, and gas prices. ```go func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts server.AppOptions) server.Application { var cache sdk.MultiStorePersistentCache if cast.ToBool(appOpts.Get(server.FlagInterBlockCache)) { cache = store.NewCommitKVStoreCacheManager() } skipUpgradeHeights := make(map[int64]bool) for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) { skipUpgradeHeights[int64(h)] = true } pruningOpts, err := server.GetPruningOptionsFromFlags(appOpts) if err != nil { panic(err) } return simapp.NewSimApp( logger, db, traceStore, true, skipUpgradeHeights, cast.ToString(appOpts.Get(flags.FlagHome)), cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), baseapp.SetPruning(pruningOpts), baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))), baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))), baseapp.SetHaltTime(cast.ToUint64(appOpts.Get(server.FlagHaltTime))), baseapp.SetInterBlockCache(cache), baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))), ) } ``` -------------------------------- ### Install RocksDB Shared Library Source: https://github.com/sei-protocol/sei-chain/blob/main/docs/migration/seidb_migration.md Instructions to clone the RocksDB repository, compile it to create a shared library, and install it. This is a prerequisite for using RocksDB as a backend database. ```bash git clone https://github.com/facebook/rocksdb.git cd rocksdb DEBUG_LEVEL=0 make shared_lib install-shared export LD_LIBRARY_PATH=/usr/local/lib ``` -------------------------------- ### Configure and Initialize SimApp Node Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-cosmos/cosmovisor/README.md Commands to build the binary, reset the local environment, configure the chain, and initialize the genesis state for testing purposes. ```bash git checkout v0.42.7 make build ./build/simd unsafe-reset-all ./build/simd config chain-id test ./build/simd config keyring-backend test ./build/simd config broadcast-mode block ./build/simd init test --chain-id test --overwrite ``` -------------------------------- ### Install and Setup Local Wasmd Node Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-wasmd/contrib/local/README.md This script installs the necessary components and sets up a local Wasmd node for development and testing. It requires a clean temporary directory for the node's home. ```shell make install cd contrib/local rm -rf /tmp/trash HOME=/tmp/trash bash setup_wasmd.sh HOME=/tmp/trash bash start_node.sh ``` -------------------------------- ### Add RocksDB Build Tag Source: https://github.com/sei-protocol/sei-chain/blob/main/docs/migration/seidb_migration.md Include the `rocksdbBackend` build tag when installing the `seid` Go package to enable RocksDB support. ```bash -tags "rocksdbBackend" ``` -------------------------------- ### Manage Tokens via CLI Source: https://github.com/sei-protocol/sei-chain/blob/main/x/tokenfactory/README.md Command line interface examples for creating new tokens, minting existing tokens, and querying token metadata using the seid binary. ```bash # Create a new token seid tx tokenfactory create-denom ufoo --from mylocalwallet # Mint a new token seid tx tokenfactory mint 100000000000factory/sei166vhptur29s3gw5qr6dm30s06gej6pr4n6qc4l/ufoo --from mylocalwallet # Query token metadata seid query bank denom-metadata --denom factory/sei166vhptur29s3gw5qr6dm30s06gej6pr4n6qc4l/ufoo ``` -------------------------------- ### Setup Cosmovisor Environment Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-cosmos/cosmovisor/README.md Commands to set environment variables and directory structures required for Cosmovisor to manage binary upgrades. ```bash export DAEMON_NAME=simd export DAEMON_HOME=$HOME/.simapp export DAEMON_RESTART_AFTER_UPGRADE=true mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin cp ./build/simd $DAEMON_HOME/cosmovisor/genesis/bin ``` -------------------------------- ### Setup and Run RPC Test Server Source: https://github.com/sei-protocol/sei-chain/blob/main/evmrpc/tests/README.md Initializes a test server with a given set of blocks and genesis state initializers, then runs a provided function to make RPC requests. ```golang SetupTestServer(blocks [][][]byte, initializers ...func(sdk.Context, *app.App)) Run(func(port int)) ``` -------------------------------- ### Manage Local Sei Chain Cluster Source: https://github.com/sei-protocol/sei-chain/blob/main/docker/README.md Commands to build and start single-node or multi-node Sei chain clusters. These commands utilize the project Makefile to handle container orchestration and log management. ```bash make build-docker-node && make run-local-node make docker-cluster-start make docker-cluster-start-skipbuild tail -f build/generated/logs/seid-0.log ``` -------------------------------- ### Run Single Node with Socket and Tendermint Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-tendermint/test/e2e/README.md Build and run a single Tendermint node using the 'make node' command, initialize a validator, and then start Tendermint, linking it to the node executable via a socket. Configuration can be tweaked in node/config.go. ```bash make node tendermint init validator tendermint start ./build/node ./node.socket.toml ``` -------------------------------- ### Query Account Balance via REST API Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-cosmos/x/bank/atlas/atlas-v0.39.1.md This example demonstrates how to query an account's balance using a GET request to the `/bank/balances/{address}` REST endpoint. The response includes the balance for each denomination held by the account. ```json { "height": "0", "result": [ { "denom": "node0token", "amount": "1000000000" }, { "denom": "usei", "amount": "400000000" } ] } ``` -------------------------------- ### Get Test Name Format from Output (Bash) Source: https://github.com/sei-protocol/sei-chain/blob/main/giga/tests/CLAUDE.md Retrieves the exact test name format required for the skip list by running tests and filtering the output for lines starting with '- category/'. This ensures accurate identification of tests to be skipped. ```bash # Run tests and look for failure summary lines starting with "- category/" grep -E "^\s+- category/" /tmp/results.log ``` -------------------------------- ### Implement BeforeEpochStart Hook in Go Source: https://github.com/sei-protocol/sei-chain/blob/main/x/epoch/README.md This Go code snippet demonstrates the signature for the BeforeEpochStart hook in the x/epoch module. Modules implement this hook to execute custom logic at the beginning of each epoch. ```go func (k Keeper) BeforeEpochStart(ctx sdk.Context, epoch epochTypes.Epoch) { ... } ``` -------------------------------- ### LCInitData Structure in Go Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-tendermint/spec/light-client/supervisor/supervisor_001_draft.md Defines the LCInitData structure for initializing the light client. It accepts either a LightBlock or a GenesisDoc. ```go type LCInitData struct { lightBlock LightBlock genesisDoc GenesisDoc } ``` -------------------------------- ### Run Grafana with Docker (Shell) Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-wasmd/contrib/prometheus/README.md This command starts a Grafana instance using Docker, exposing its UI on port 3000. Grafana can then be configured to use the local Prometheus instance (running on `http://host.docker.internal:9091`) as a data source to visualize wasmd metrics. ```sh docker run -it -p 3000:3000 grafana/grafana ``` -------------------------------- ### Verify Ignite CLI Installation Source: https://github.com/sei-protocol/sei-chain/blob/main/docs/README.md This command verifies the installation of the Ignite CLI tool. It's a prerequisite for generating OpenAPI/Swagger documentation. The output shows the installed version and any available updates. ```bash % ignite version 路 路 馃浉 Ignite CLI v28.2.0 is available! 路 路 To upgrade your Ignite CLI version, see the upgrade doc: https://docs.ignite.com/guide/install.html#upgrading-your-ignite-cli-installation 路 路路 Ignite CLI version: v0.23.0 .... ``` -------------------------------- ### Initialize Light Client Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-tendermint/spec/light-client/supervisor/supervisor_001_draft.md Initializes the LightStore by either trusting a provided light block or fetching and verifying blocks starting from the genesis document. It includes an attack detection phase to ensure the integrity of the initial state. ```go func InitLightClient (initData LCInitData) (LightStore, Error) { if LCInitData.LightBlock != nil { // we trust the provided initial block. newblock := LCInitData.LightBlock } else { genesisBlock := makeblock(initData.genesisDoc); result := NoResult; while result != ResultSuccess { current = FetchLightBlock(PeerList.primary(), genesisBlock.Header.Height + 1) if CANNOT_VERIFY = ValidAndVerify(genesisBlock, current) { Replace_Primary(); } else { result = ResultSuccess } } auxLS := new LightStore auxLS.Add(current) Evidences := AttackDetector(genesisBlock, auxLS) if Evidences.Empty { newBlock := current } else { submitEvidence(Evidences); return(nil, ErrorAttack); } } lightStore := new LightStore; lightStore.Add(newBlock); return (lightStore, OK); } ``` -------------------------------- ### GET /cosmos/gov/v1beta1/proposals Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-cosmos/x/gov/spec/07_client.md Retrieves all proposals with optional filters. This endpoint is useful for getting an overview of all governance proposals on the Sei chain. ```APIDOC ## GET /cosmos/gov/v1beta1/proposals ### Description Retrieves all proposals with optional filters. This endpoint is useful for getting an overview of all governance proposals on the Sei chain. ### Method GET ### Endpoint /cosmos/gov/v1beta1/proposals ### Parameters #### Query Parameters - **pagination.key** (string) - Optional - Key to retrieve the next page of results. - **pagination.offset** (string) - Optional - Offset of the results. - **pagination.limit** (string) - Optional - Limit of the results. - **pagination.count_total** (boolean) - Optional - Whether to return the total number of results. - **pagination.reverse** (boolean) - Optional - Whether to reverse the order of results. - **proposal_status** (string) - Optional - Filter proposals by status (e.g., PROPOSAL_STATUS_VOTING_PERIOD). - **voter** (string) - Optional - Filter proposals by a specific voter's address. - **depositor** (string) - Optional - Filter proposals by a specific depositor's address. ### Request Example ```bash curl localhost:1317/cosmos/gov/v1beta1/proposals?pagination.limit=5 ``` ### Response #### Success Response (200) - **proposals** (array) - An array of proposal objects. - **proposal_id** (string) - The unique identifier for the proposal. - **content** (object) - The content of the proposal (e.g., TextProposal, SoftwareUpgradeProposal). - **status** (string) - The current status of the proposal. - **final_tally_result** (object) - The final tally of votes for the proposal. - **submit_time** (string) - The timestamp when the proposal was submitted. - **deposit_end_time** (string) - The timestamp when the deposit period ends. - **total_deposit** (array) - An array of coin objects representing the total deposit. - **voting_start_time** (string) - The timestamp when the voting period starts. - **voting_end_time** (string) - The timestamp when the voting period ends. - **pagination** (object) - Pagination information for the results. #### Response Example ```json { "proposals": [ { "proposal_id": "1", "content": { "@type": "/cosmos.gov.v1beta1.TextProposal", "title": "Test Proposal", "description": "testing, testing, 1, 2, 3" }, "status": "PROPOSAL_STATUS_VOTING_PERIOD", "final_tally_result": { "yes": "0", "abstain": "0", "no": "0", "no_with_veto": "0" }, "submit_time": "2021-09-16T19:40:08.712440474Z", "deposit_end_time": "2021-09-18T19:40:08.712440474Z", "total_deposit": [ { "denom": "usei", "amount": "10000000" } ], "voting_start_time": "2021-09-16T19:40:08.712440474Z", "voting_end_time": "2021-09-18T19:40:08.712440474Z" } ], "pagination": { "next_key": null, "total": "2" } } ``` ``` -------------------------------- ### Initialize Root Command with Server Context - Go Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-cosmos/server/README.md This Go code snippet demonstrates how to initialize the root command for an application using the Cobra framework. It sets up persistent pre-run functions to handle client and server context initialization, ensuring that all child commands have access to necessary configurations and handlers. ```go var ( initClientCtx = client.Context{...} rootCmd = &cobra.Command{ Use: "simd", Short: "simulation app", PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { return err } return server.InterceptConfigsPreRunHandler(cmd) }, } // add root sub-commands ... ) ``` -------------------------------- ### Build `simd` Binary Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-ibc-go/testing/simapp/README.md Builds the `simd` binary and installs it in the Cosmos SDK repo's `build` directory. This is a prerequisite for running any `simd` commands. ```bash # Build the simd binary $ make build ``` -------------------------------- ### Get ABCI Info - JSONRPC Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-tendermint/spec/rpc/README.md Retrieves ABCI application information using JSONRPC. The 'abci_info' method is called without any parameters to get details about the application's state and version. ```shell curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"abci_info\"}" ``` -------------------------------- ### Configure Local Dependency Debugging Source: https://github.com/sei-protocol/sei-chain/blob/main/docker/README.md Instructions for linking local versions of Cosmos SDK and Tendermint repositories to the Sei chain project using Go module replacements. ```bash cd ../ git clone https://github.com/sei-protocol/sei-tendermint.git git clone https://github.com/sei-protocol/sei-cosmos.git go mod edit -replace github.com/cosmos/cosmos-sdk=../sei-cosmos go mod edit -replace github.com/tendermint/tendermint=../sei-tendermint ``` -------------------------------- ### Get All Evidence using REST Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-cosmos/x/evidence/spec/07_client.md This REST endpoint retrieves a list of all evidence entries. It requires a GET request to the base evidence endpoint. ```bash curl -X GET "http://localhost:1317/cosmos/evidence/v1beta1/evidence" ``` -------------------------------- ### Example JSON Response for Commit Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-tendermint/spec/rpc/README.md An example JSON response for a commit request, detailing the signed header, commit information, and canonical status. This structure is returned when querying block commit data. ```json { "jsonrpc": "2.0", "id": 0, "result": { "signed_header": { "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "commit": { "height": "1311801", "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "signatures": [ { "block_id_flag": 2, "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "timestamp": "2019-04-22T17:01:58.376629719Z", "signature": "14jaTQXYRt8kbLKEhdHq7AXycrFImiLuZx50uOjs2+Zv+2i7RTG/jnObD07Jo2ubZ8xd7bNBJMqkgtkd0oQHAw==" } ] } }, "canonical": true } } ``` -------------------------------- ### Create EvidenceKeeper with Dependencies in Go Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-cosmos/x/evidence/atlas/atlas-v0.41.x.md Initializes the EvidenceKeeper, establishing its dependencies on the application's codec, store key, staking keeper, and slashing keeper. This setup is vital for evidence handling logic. ```go func NewApp(...) *App { // ... // create evidence keeper with router evidenceKeeper := evidencekeeper.NewKeeper( appCodec, keys[evidencetypes.StoreKey], &app.StakingKeeper, app.SlashingKeeper, ) } ``` -------------------------------- ### Initialize TestingApp for IBC Tests Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-ibc-go/testing/README.md Demonstrates how to create an initialization function for the testing application and register it with the framework. This setup is necessary to generate the genesis state and application instance for tests. ```go func SetupTestingApp() (TestingApp, map[string]json.RawMessage) { db := dbm.NewMemDB() encCdc := simapp.MakeTestEncodingConfig() app := simapp.NewSimApp( db, nil, true, map[int64]bool{}, simapp.DefaultNodeHome, 5, encCdc, simapp.EmptyAppOptions{}) return app, simapp.NewDefaultGenesisState(encCdc.Marshaler) } func init() { ibctesting.DefaultTestingAppInit = MySetupTestingAppFunction } ``` -------------------------------- ### Get Block Header by Hash (HTTP) Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-tendermint/spec/rpc/README.md Retrieves a block header using its unique hash via an HTTP GET request. This endpoint is useful when the specific block hash is known and direct access to its header is required. ```shell curl http://127.0.0.1:26657/header_by_hash?hash=0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED ``` -------------------------------- ### Initialize State Sync RPC Node Source: https://github.com/sei-protocol/sei-chain/blob/main/docker/README.md Steps to verify cluster status and launch a state sync node. Requires a running 4-node cluster as a prerequisite. ```bash make docker-cluster-start seid status |jq make run-rpc-node ``` -------------------------------- ### Get Evidence by Hash using REST Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-cosmos/x/evidence/spec/07_client.md This REST endpoint allows fetching specific evidence details by providing its hash in the URL. It requires a GET request to the specified endpoint. ```bash curl -X GET "http://localhost:1317/cosmos/evidence/v1beta1/evidence/DF0C23E8634E480F84B9D5674A7CDC9816466DEC28A3358F73260F68D28D7660" ``` -------------------------------- ### Example JSON Response for Validators Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-tendermint/spec/rpc/README.md An example JSON response for a validators request, showing the block height, a list of validators with their voting power and proposer priority, and pagination details. This is the expected output when querying validator sets. ```json { "jsonrpc": "2.0", "id": 0, "result": { "block_height": "55", "validators": [ { "address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "voting_power": "239727", "proposer_priority": "-11896414" } ], "count": "1", "total": "25" } } ``` -------------------------------- ### Sequential Supervisor Logic - Go Source: https://github.com/sei-protocol/sei-chain/blob/main/sei-tendermint/spec/light-client/supervisor/supervisor_001_draft.md Implements the main loop for the light client supervisor. It initializes the light store, then enters an infinite loop to process user inputs for the next lightblock height. It calls VerifyAndDetect to update the light store and outputs trusted lightblocks upon successful verification. The loop terminates if a light client attack is detected or an error occurs. ```Go func Sequential-Supervisor (initdata LCInitData) (Error) { lightStore,result := InitLightClient(initData); if result != OK { return result; } loop { // get the next height nextHeight := input(); lightStore,result := VerifyAndDetect(lightStore, nextHeight); if result == OK { output(LightStore.Get(targetHeight)); // we only output a trusted lightblock } else { return result } // QUESTION: is it OK to generate output event in normal case, // and terminate with failure in the (light client) attack case? } } ``` -------------------------------- ### Skipped Tests JSON Example Source: https://github.com/sei-protocol/sei-chain/blob/main/giga/tests/CLAUDE.md Provides concrete examples of how to specify individual tests to be skipped in the `skip_list.json` file. The keys follow the format 'category/relPath/FullJSONKey/index' and map to a reason for skipping. ```json { "skipped_tests": { "Shanghai/stEIP3651-warmcoinbase/coinbaseWarmAccountCallGas.json/GeneralStateTests/Shanghai/stEIP3651-warmcoinbase/coinbaseWarmAccountCallGas.json::coinbaseWarmAccountCallGas-fork_[Cancun-Prague]-d[0-7]g0v0/5": "gas_mismatch", "stTransactionTest/HighGasPriceParis.json/GeneralStateTests/stTransactionTest/HighGasPriceParis.json::HighGasPriceParis-fork_[Cancun-Prague]-d0g0v0": "fee_out_of_bound" } } ```