substrate-node-template | A new SRML-based Substrate node | Runtime Evironment library

 by   rstormsf Rust Version: Current License: Unlicense

kandi X-RAY | substrate-node-template Summary

kandi X-RAY | substrate-node-template Summary

substrate-node-template is a Rust library typically used in Server, Runtime Evironment, Nodejs applications. substrate-node-template has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

A new SRML-based Substrate node, ready for hacking
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              substrate-node-template has a low active ecosystem.
              It has 5 star(s) with 24 fork(s). There are 1 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              substrate-node-template has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of substrate-node-template is current.

            kandi-Quality Quality

              substrate-node-template has no bugs reported.

            kandi-Security Security

              substrate-node-template has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              substrate-node-template is licensed under the Unlicense License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              substrate-node-template releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of substrate-node-template
            Get all kandi verified functions for this library.

            substrate-node-template Key Features

            No Key Features are available at this moment for substrate-node-template.

            substrate-node-template Examples and Code Snippets

            No Code Snippets are available at this moment for substrate-node-template.

            Community Discussions

            QUESTION

            Substrate 3.0 "on_runtime_upgrade" function does not work
            Asked 2021-Apr-13 at 11:38

            I want to try "Runtime Upgrade" and "Storage Migration". I tried by steps as following,but "on_runtime_upgrade" function did not work. Unable to verify that the "on_runtime_upgrade" function is called. The implemented debug log is not output.

            1. Download "substrate-node-template 3.0".
            2. Compile it.
            3. I ran the node with the following command. "target/release/node-template --dev -l runtime = debug".
            4. Implement "on_runtime_upgrade" in "palet-template".The program I tried "substrate-node-template/pallets/template/lib.rs" is listed below.
            5. Compile it by "cargo build --release -p node-template-runtime" command.
            6. Upload "node_template_runtime.compact.wasm" by using "sudo" & "setcode" command.
            7. I checked the execution log of the node, but I couldn't check the log set to "on_runtime_upgrade".

            --lib.rs--

            ...

            ANSWER

            Answered 2021-Apr-13 at 11:38

            This Code works. But "debug::info!" does not work. The value of "Something" would be "32".

            Source https://stackoverflow.com/questions/66912571

            QUESTION

            How to test events in substrate 3.0.0?
            Asked 2021-Mar-23 at 07:00

            In substrate 2.0.1, its has following code:

            ...

            ANSWER

            Answered 2021-Mar-22 at 18:33

            In Substrate 3.0 you use the same construct_runtime! macro in tests that you use in the full runtime. You can see an example of how to test events the new way in the Substrate repository itself.

            https://github.com/paritytech/substrate/blob/83942f58fc859ef5790351691e1ef665d79f0ead/frame/balances/src/tests.rs#L470-L473

            Source https://stackoverflow.com/questions/66722979

            QUESTION

            Substrate genesis blocks not matching
            Asked 2021-Mar-10 at 10:14

            I am currently doing this tutorial. When I am following it as described and execute the alice and bob nodes both on the same machine it works as expected: the nodes are connecting and are creating and finalizing blocks. Now I want to get the same done but over the internet and on different machines. So I execute the bootnode on my PC and the other node on my Laptop. I compiled both from the same code and also forwarded the ports in my router. So now I expect the same behavior as when I am running both on my local machine. So when I execute them I see network traffic printed in both consoles but the bob node prints a warning: Bootnode with peer id '12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp' is on a different chain (our genesis: 0xbfbd…3144 theirs: 0x8859…14c4) and they are not connected (Idle 0 peers).

            So from the warning I conclude they have not the same genesis blocks which is obviously necessary to run as a blockchain. But from my understanding the joining node should copy the current state of the chain from the bootnode. How can I change bobs part to use alices state of the chain?

            Both machines are running rust version 1.50.0

            Thanks for your help!

            ...

            ANSWER

            Answered 2021-Mar-09 at 21:53

            Rust compilations are not deterministic, thus the exact same code for the exact same blockchain compiled on two computers will unfortunately not have the same genesis hash. (Specifically because part of the genesis of that chain is the Wasm Runtime blob, which is compiled non-deterministically with Rust).

            You need to create a chainspec file to use for all other nodes. Note that you want to generate this on one computer, and pass the file to other nodes (don't re-generate it, as the genesis code will differ, as you ran into) before you then start other nodes using the correct chainspec and manually specifying boot nodes.

            Source https://stackoverflow.com/questions/66554685

            QUESTION

            spurious network error (2 tries remaining): [7] Couldn't connect to server
            Asked 2021-Mar-01 at 06:10
            gh@ubuntu:~/substrate-node-template$ CARGO_HTTP_MULTIPLEXING=false cargo build --release
                Updating crates.io index
            warning: spurious network error (2 tries remaining): [7] Couldn't connect to server (Failed to connect to github.com port 443: Connection refused); class=Net (12)
            warning: spurious network error (1 tries remaining): [35] SSL connect error (OpenSSL SSL_connect: Connection reset by peer in connection to github.com:443 ); class=Net (12)
            error: failed to get `frame-benchmarking` as a dependency of package `node-template v3.0.0 (/home/gh/substrate-node-template/node)`
            
            Caused by:
              failed to fetch `https://github.com/rust-lang/crates.io-index`
            
            Caused by:
              network failure seems to have happened
              if a proxy or similar is necessary `net.git-fetch-with-cli` may help here
              https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli
            
            Caused by:
              [28] Timeout was reached (Operation timed out after 30001 milliseconds with 0 out of 0 bytes received); class=Net (12)
            
            ...

            ANSWER

            Answered 2021-Mar-01 at 06:10

            This is not a substrate question.

            Try to use a VPN. Or use a mirror source.

            Source https://stackoverflow.com/questions/66407083

            QUESTION

            How can I convert the block number into the Integer type in substrate module?
            Asked 2020-Dec-22 at 07:32

            I'm testing the substrate off-chain worker, what I want to do is receive the current block number, and then do some calculation, just like the below code if (get_block / 10 == 0), and I get some error. How can I convert the block number into the Integer type?

            my code ...

            ANSWER

            Answered 2020-Dec-22 at 07:32

            @kmdreko is right. You do not want to convert the block number to an integer, but convert the integer into a block number and then do the math.

            So replace:

            Source https://stackoverflow.com/questions/65402395

            QUESTION

            Stuck in compilation (substrate-node-template:make build )
            Asked 2020-Dec-15 at 05:31

            I followed the tutorialenter link description here to this step,

            ...

            ANSWER

            Answered 2020-Dec-14 at 05:35

            The compile is not stuck in compilation, it is just taking a while due to the 800+ dependencies. From @gnunicorn on this github issue:

            Rust isn't particular quick with the compiling at the moment and opaque to the person in front, at this step (when compiling node-template-runtime) we are actually building the project twice: once natively and once in wasm. So at some step in between it appears as if nothing happens and that can take up to half the total build time – if the other part took e.g. 10minutes then this process might take another 10min without any indicator of process (other than the CPU pumping hard).

            You are doing a release build (cargo build --release) which enables optimizations. For development purposes, a regular build or just a cargo check will be substantially faster.

            Some comments in the linked GitHub issue mentioned that running a cargo clean and rebuilding helped speed up compile times, so you can try that as well.

            Source https://stackoverflow.com/questions/65282298

            QUESTION

            Use custom Substrate node name (Substrate FRAME pallet + Polkadot/Substrate frontend)
            Asked 2020-Oct-30 at 13:14

            Scenario: You want to submit an extrinsic to your custom Substrate node based on the substrate-node-template by using the Polkadot/Substrate frontend. You have renamed the Substrate node either manually by carefully searching and replacing all occurences of substarte-node-template or by using danforbes renaming script

            Problem: When you try to submit an extrinsic to your Substrate node using the Polkadot/Substrate frontend, you receive an error message in the frontend:

            1002: Verification Error: Execution: Could not convert parameter tx between node and runtime: No such variant in enum MultiSignature: RuntimeApi, Execution: Could not convert parameter tx between node and runtime: No such variant in enum MultiSignature

            ...

            ANSWER

            Answered 2020-Oct-30 at 13:14

            Solution: as JoshOrndorff stated in a Github issue:

            [...] The problem now is because the UI needs to know the types your node uses. When you use the node template, the UI detects it, and uses the appropriate types for you. Sine you have renamed your template, the UI cannot tell that it is still basically the node template, so you need to add your own custom types. In the Apps UI, go the the developer settings, and enter:

            Source https://stackoverflow.com/questions/64609060

            QUESTION

            error[E0658]: non-builtin inner attributes are unstable
            Asked 2020-Aug-18 at 19:07

            I cloned fresh https://github.com/substrate-developer-hub/substrate-node-template repository (sometime ago it was working fine) I have executed:

            ...

            ANSWER

            Answered 2020-Aug-18 at 19:07

            I (thanks to Dan) solved it by execution:

            Source https://stackoverflow.com/questions/63474498

            QUESTION

            What does Something get(fn something): Option; mean in Rust?
            Asked 2020-Aug-06 at 08:30

            I cloned this template. There is a code like this:

            ...

            ANSWER

            Answered 2020-Aug-06 at 08:30

            Apparently this macro accepts custom syntax, as documented in https://substrate.dev/rustdocs/v2.0.0-rc5/frame_support/macro.decl_storage.html:

            Basic storage can be extended as such:

            #vis #name get(fn #getter) config(#field_name) build(#closure): #type = #default;

            • #vis: Set the visibility of the structure. pub or nothing.
            • #name: Name of the storage item, used as a prefix in storage.
            • [optional] get(fn #getter): Implements the function #getter to Module.
            • [optional] config(#field_name): field_name is optional if get is set. Will include the item in GenesisConfig.
            • [optional] build(#closure): Closure called with storage overlays.
            • #type: Storage type.
            • [optional] #default: Value returned when none.

            So in your Something is the name of the storage item, used as a prefix in storage.

            Source https://stackoverflow.com/questions/63279496

            QUESTION

            How to store hashes in the Substrate Chain?
            Asked 2020-Mar-17 at 18:13

            My objective is to store hash values in the substrate chain. I have declared the storage and the module for it in the following code:

            ...

            ANSWER

            Answered 2020-Mar-17 at 18:13

            You should be using a hash of known size, so do something like:

            Source https://stackoverflow.com/questions/60726987

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install substrate-node-template

            You can download it from GitHub.
            Rust is installed and managed by the rustup tool. Rust has a 6-week rapid release process and supports a great number of platforms, so there are many builds of Rust available at any time. Please refer rust-lang.org for more information.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/rstormsf/substrate-node-template.git

          • CLI

            gh repo clone rstormsf/substrate-node-template

          • sshUrl

            git@github.com:rstormsf/substrate-node-template.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link