Git Product home page Git Product logo

Comments (5)

brenzi avatar brenzi commented on July 27, 2024

same for substrate-test-runtime-client

from substrate-node-template.

JoshOrndorff avatar JoshOrndorff commented on July 27, 2024

The node_primitives crate is for use specifically in the demonstration node that lives in the Substrate repo. This is evidenced by the fact that it lives in bin/node/pirmitives. The two imports you mentioned, AccountId and Signature are both type aliases to things that are in the library part of the Substrate repo and are published on crates.io.

This node template, makes the same type aliases directly in the runtime's lib.rs (AccountId, Signature). If you're basing your node on this template, you can use those type aliases directly, or if you like having them in a separate crate, you can move them to their own crate. You could call that crate node-primitives and let it's context make it clear what node they are for or you could give it a name like brenzis-node-primitives. You can see polkadot also [follows this pattern](https://github.com/paritytech/polkadot/tree/master/primitives

from substrate-node-template.

brenzi avatar brenzi commented on July 27, 2024

ok. but how about substrate-test-runtime-client? Where should I get use test_client::AccountKeyring; from? From sp_keyring I guess?

from substrate-node-template.

JoshOrndorff avatar JoshOrndorff commented on July 27, 2024

TBH, I'm not nearly as familiar with that one. I guess maybe from here https://substrate.dev/rustdocs/master/sp_keyring/test/index.html

@gnunicorn is that right?

from substrate-node-template.

gnunicorn avatar gnunicorn commented on July 27, 2024

@brenzi node-* are meant for the substrate-node-default-implementation only, are very opinionated and not suitable for reusability but part of the executable only. We are still discussing whether we eventually publish them on crates.io but for the time being (and probably 2.0 release), these won't be published there (as we can't and won't give the same semver stability guarantees for the binary).

That said, what you are asking for is literally something you can (and should) define yourself:

use sp_runtime::{
	generic, traits::{Verify, IdentifyAccount}, MultiSignature
};

pub type Signature = MultiSignature;

pub type AccountId = <<Signature as Verify>::Signer as IdentifyAccount>::AccountId;

from substrate-node-template.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.