{"id":22799955,"url":"https://github.com/tangle-network/substrate-eth-light-client","last_synced_at":"2025-04-19T16:52:32.102Z","repository":{"id":45015250,"uuid":"304397097","full_name":"tangle-network/substrate-eth-light-client","owner":"tangle-network","description":"ETH light-client + offchain worker inspired by Rainbow bridge.","archived":false,"fork":false,"pushed_at":"2022-01-14T02:59:06.000Z","size":999,"stargazers_count":7,"open_issues_count":5,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-10T05:29:27.716Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tangle-network.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-15T17:14:08.000Z","updated_at":"2022-10-26T15:59:35.000Z","dependencies_parsed_at":"2022-09-04T22:22:23.343Z","dependency_job_id":null,"html_url":"https://github.com/tangle-network/substrate-eth-light-client","commit_stats":null,"previous_names":["tangle-network/substrate-eth-light-client"],"tags_count":0,"template":false,"template_full_name":"hicommonwealth/offchain-workers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangle-network%2Fsubstrate-eth-light-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangle-network%2Fsubstrate-eth-light-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangle-network%2Fsubstrate-eth-light-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangle-network%2Fsubstrate-eth-light-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tangle-network","download_url":"https://codeload.github.com/tangle-network/substrate-eth-light-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229345342,"owners_count":18058474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-12T07:10:34.228Z","updated_at":"2024-12-12T07:10:35.081Z","avatar_url":"https://github.com/tangle-network.png","language":"Rust","readme":"# Substrate Node Template\n\nA new FRAME-based Substrate node, ready for hacking :rocket:\n\n## Local Development\n\nFollow these steps to prepare a local Substrate development environment :hammer_and_wrench:\n\n### Simple Setup\n\nInstall all the required dependencies with a single command (be patient, this can take up to 30\nminutes).\n\n```bash\ncurl https://getsubstrate.io -sSf | bash -s -- --fast\n```\n\n### Manual Setup\n\nFind manual setup instructions at the\n[Substrate Developer Hub](https://substrate.dev/docs/en/knowledgebase/getting-started/#manual-installation).\n\n### Build\n\nOnce the development environment is set up, build the node template. This command will build the\n[Wasm](https://substrate.dev/docs/en/knowledgebase/advanced/executor#wasm-execution) and\n[native](https://substrate.dev/docs/en/knowledgebase/advanced/executor#native-execution) code:\n\n```bash\ncargo build --release\n```\n\n## Run\n\n### Single Node Development Chain\n\nPurge any existing dev chain state:\n\n```bash\n./target/release/node-template purge-chain --dev\n```\n\nStart a dev chain:\n\n```bash\n./target/release/node-template --dev\n```\n\nOr, start a dev chain with detailed logging:\n\n```bash\nRUST_LOG=debug RUST_BACKTRACE=1 ./target/release/node-template -lruntime=debug --dev\n```\n\n### Multi-Node Local Testnet\n\nTo see the multi-node consensus algorithm in action, run a local testnet with two validator nodes,\nAlice and Bob, that have been [configured](/bin/node-template/node/src/chain_spec.rs) as the initial\nauthorities of the `local` testnet chain and endowed with testnet units.\n\nNote: this will require two terminal sessions (one for each node).\n\nStart Alice's node first. The command below uses the default TCP port (30333) and specifies\n`/tmp/alice` as the chain database location. Alice's node ID will be\n`12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp` (legacy representation:\n`QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR`); this is determined by the `node-key`.\n\n```bash\ncargo run -- \\\n  --base-path /tmp/alice \\\n  --chain=local \\\n  --alice \\\n  --node-key 0000000000000000000000000000000000000000000000000000000000000001 \\\n  --telemetry-url 'ws://telemetry.polkadot.io:1024 0' \\\n  --validator\n```\n\nIn another terminal, use the following command to start Bob's node on a different TCP port (30334)\nand with a chain database location of `/tmp/bob`. The `--bootnodes` option will connect his node to\nAlice's on TCP port 30333:\n\n```bash\ncargo run -- \\\n  --base-path /tmp/bob \\\n  --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp \\\n  --chain=local \\\n  --bob \\\n  --port 30334 \\\n  --ws-port 9945 \\\n  --telemetry-url 'ws://telemetry.polkadot.io:1024 0' \\\n  --validator\n```\n\nExecute `cargo run -- --help` to learn more about the template node's CLI options.\n\n## Template Structure\n\nA Substrate project such as this consists of a number of components that are spread across a few\ndirectories.\n\n### Node\n\nA blockchain node is an application that allows users to participate in a blockchain network.\nSubstrate-based blockchain nodes expose a number of capabilities:\n\n-   Networking: Substrate nodes use the [`libp2p`](https://libp2p.io/) networking stack to allow the\n    nodes in the network to communicate with one another.\n-   Consensus: Blockchains must have a way to come to\n    [consensus](https://substrate.dev/docs/en/knowledgebase/advanced/consensus) on the state of the\n    network. Substrate makes it possible to supply custom consensus engines and also ships with\n    several consensus mechanisms that have been built on top of\n    [Web3 Foundation research](https://research.web3.foundation/en/latest/polkadot/NPoS/index.html).\n-   RPC Server: A remote procedure call (RPC) server is used to interact with Substrate nodes.\n\nThere are several files in the `node` directory - take special note of the following:\n\n-   [`chain_spec.rs`](./node/src/chain_spec.rs): A\n    [chain specification](https://substrate.dev/docs/en/knowledgebase/integrate/chain-spec) is a\n    source code file that defines a Substrate chain's initial (genesis) state. Chain specifications\n    are useful for development and testing, and critical when architecting the launch of a\n    production chain. Take note of the `development_config` and `testnet_genesis` functions, which\n    are used to define the genesis state for the local development chain configuration. These\n    functions identify some\n    [well-known accounts](https://substrate.dev/docs/en/knowledgebase/integrate/subkey#well-known-keys)\n    and use them to configure the blockchain's initial state.\n-   [`service.rs`](./node/src/service.rs): This file defines the node implementation. Take note of\n    the libraries that this file imports and the names of the functions it invokes. In particular,\n    there are references to consensus-related topics, such as the\n    [longest chain rule](https://substrate.dev/docs/en/knowledgebase/advanced/consensus#longest-chain-rule),\n    the [Aura](https://substrate.dev/docs/en/knowledgebase/advanced/consensus#aura) block authoring\n    mechanism and the\n    [GRANDPA](https://substrate.dev/docs/en/knowledgebase/advanced/consensus#grandpa) finality\n    gadget.\n\nAfter the node has been [built](#build), refer to the embedded documentation to learn more about the\ncapabilities and configuration parameters that it exposes:\n\n```shell\n./target/release/node-template --help\n```\n\n### Runtime\n\nIn Substrate, the terms\n\"[runtime](https://substrate.dev/docs/en/knowledgebase/getting-started/glossary#runtime)\" and\n\"[state transition function](https://substrate.dev/docs/en/knowledgebase/getting-started/glossary#stf-state-transition-function)\"\nare analogous - they refer to the core logic of the blockchain that is responsible for validating\nblocks and executing the state changes they define. The Substrate project in this repository uses\nthe [FRAME](https://substrate.dev/docs/en/knowledgebase/runtime/frame) framework to construct a\nblockchain runtime. FRAME allows runtime developers to declare domain-specific logic in modules\ncalled \"pallets\". At the heart of FRAME is a helpful\n[macro language](https://substrate.dev/docs/en/knowledgebase/runtime/macros) that makes it easy to\ncreate pallets and flexibly compose them to create blockchains that can address\n[a variety of needs](https://www.substrate.io/substrate-users/).\n\nReview the [FRAME runtime implementation](./runtime/src/lib.rs) included in this template and note\nthe following:\n\n-   This file configures several pallets to include in the runtime. Each pallet configuration is\n    defined by a code block that begins with `impl $PALLET_NAME::Trait for Runtime`.\n-   The pallets are composed into a single runtime by way of the\n    [`construct_runtime!`](https://crates.parity.io/frame_support/macro.construct_runtime.html)\n    macro, which is part of the core\n    [FRAME Support](https://substrate.dev/docs/en/knowledgebase/runtime/frame#support-library)\n    library.\n\n### Pallets\n\nThe runtime in this project is constructed using many FRAME pallets that ship with the\n[core Substrate repository](https://github.com/paritytech/substrate/tree/master/frame) and a\ntemplate pallet that is [defined in the `pallets`](./pallets/template/src/lib.rs) directory.\n\nA FRAME pallet is compromised of a number of blockchain primitives:\n\n-   Storage: FRAME defines a rich set of powerful\n    [storage abstractions](https://substrate.dev/docs/en/knowledgebase/runtime/storage) that makes\n    it easy to use Substrate's efficient key-value database to manage the evolving state of a\n    blockchain.\n-   Dispatchables: FRAME pallets define special types of functions that can be invoked (dispatched)\n    from outside of the runtime in order to update its state.\n-   Events: Substrate uses [events](https://substrate.dev/docs/en/knowledgebase/runtime/events) to\n    notify users of important changes in the runtime.\n-   Errors: When a dispatchable fails, it returns an error.\n-   Trait: The `Trait` configuration interface is used to define the types and parameters upon which\n    a FRAME pallet depends.\n\n## Generate a Custom Node Template\n\nGenerate a Substrate node template based on a particular commit by running the following commands:\n\n```bash\n# Clone from the main Substrate repo\ngit clone https://github.com/paritytech/substrate.git\ncd substrate\n\n# Switch to the branch or commit to base the template on\ngit checkout \u003cbranch/tag/sha1\u003e\n\n# Run the helper script to generate a node template. This script compiles Substrate, so it will take\n# a while to complete. It expects a single parameter: the location for the script's output expressed\n# as a relative path.\n.maintain/node-template-release.sh ../node-template.tar.gz\n```\n\nCustom node templates are not supported. Please use a recently tagged version of the\n[Substrate Developer Node Template](https://github.com/substrate-developer-hub/substrate-node-template)\nin order to receive support.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftangle-network%2Fsubstrate-eth-light-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftangle-network%2Fsubstrate-eth-light-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftangle-network%2Fsubstrate-eth-light-client/lists"}