Skip to content

Commit

Permalink
Comente los Authorize Nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
NXHM committed Jun 7, 2024
1 parent d70f8f9 commit 417368b
Show file tree
Hide file tree
Showing 7 changed files with 236 additions and 1 deletion.
53 changes: 53 additions & 0 deletions NODOSINFO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Nodos
Son los nodos que componen la red blockchains, solo unos especificos se han unido. Similar a permisionada
1. Primer nodo
``` shell
nicolas@DESKTOP-OQLS8GH:~/projects/tesis-polkadot/substrate-node-template$ ./target/release/node-template key generate-scheme Sr25519 --password-interactive
Key password:
Secret phrase: satoshi case seek protect story useful clock they caught keen opera drip
Network ID: substrate
Secret seed: 0xd67e810fe7685b1a8c38f1781b483e40db2bb8d5ae77333c2ad596e0cce37137
Public key (hex): 0xe6675742a90b3dc4188158264b8eac33d525443329553f319e62ae4b336f5369
Account ID: 0xe6675742a90b3dc4188158264b8eac33d525443329553f319e62ae4b336f5369
Public key (SS58): 5HGoZyM3WALEQDhFAweUj7M2r5g16AJ7zKCvTE9sY64CkKVf
SS58 Address: 5HGoZyM3WALEQDhFAweUj7M2r5g16AJ7zKCvTE9sY64CkKVf
```
2. Segundo nodo
```shell
nicolas@DESKTOP-OQLS8GH:~/projects/tesis-polkadot/substrate-node-template$ ./target/release/node-template key inspect --password-interactive --scheme Ed25519 "satoshi case seek protect story useful clock they caught keen opera drip"
Key password:
Secret phrase: satoshi case seek protect story useful clock they caught keen opera drip
Network ID: substrate
Secret seed: 0xd67e810fe7685b1a8c38f1781b483e40db2bb8d5ae77333c2ad596e0cce37137
Public key (hex): 0x18d6870613ae85b0090b996d716047ae8a3b0bda463f28aa872283a1291482ae
Account ID: 0x18d6870613ae85b0090b996d716047ae8a3b0bda463f28aa872283a1291482ae
Public key (SS58): 5CdGjYcnyyxLM1PpY4dnwZiQDcYaEPnYWGDBEoMA6EacPU5L
SS58 Address: 5CdGjYcnyyxLM1PpY4dnwZiQDcYaEPnYWGDBEoMA6EacPU5L
```
3. Tercer Nodo
```shell
nicolas@DESKTOP-OQLS8GH:~/projects/tesis-polkadot/substrate-node-template$ ./target/release/node-template key generate --scheme Sr25519 --password-interactive
Key password:
Secret phrase: display liberty make afraid afford promote pulp flip consider huge cycle mirror
Network ID: substrate
Secret seed: 0xd61489a8db8df389b7656eb349ababdd3d1b780d09ef9dd7fb26af5af4834e5e
Public key (hex): 0x249271ec3f93b83aad76a8f5f1966b2627c89e63e38697f24b8b6b8c09b1144b
Account ID: 0x249271ec3f93b83aad76a8f5f1966b2627c89e63e38697f24b8b6b8c09b1144b
Public key (SS58): 5Ctf5qikajeH3zdrrSKruXxM5jzZj4ARxQy3Ggwdru2EpEyE
SS58 Address: 5Ctf5qikajeH3zdrrSKruXxM5jzZj4ARxQy3Ggwdru2EpEyE
```
4. Cuarto Nodo
``` shell
nicolas@DESKTOP-OQLS8GH:~/projects/tesis-polkadot/substrate-node-template$ ./target/release/node-template key inspect --password-interactive --scheme Ed25519 "display liberty make afraid afford promote pulp flip consider huge cycle mirror"
Key password:
Secret phrase: display liberty make afraid afford promote pulp flip consider huge cycle mirror
Network ID: substrate
Secret seed: 0xd61489a8db8df389b7656eb349ababdd3d1b780d09ef9dd7fb26af5af4834e5e
Public key (hex): 0xf9e9aec5241e31237f8525312d64be551c106e2bf2cdc191815814cf98bd5042
Account ID: 0xf9e9aec5241e31237f8525312d64be551c106e2bf2cdc191815814cf98bd5042
Public key (SS58): 5HiPCUipdyeipQXRAw9uwombFmYv2pXhcVPf9Pga97PahrrZ
SS58 Address: 5HiPCUipdyeipQXRAw9uwombFmYv2pXhcVPf9Pga97PahrrZ
```
90 changes: 90 additions & 0 deletions customSpec.json

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions customSpecRaw.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ clap = { version = "4.5.3", features = ["derive"] }
futures = { version = "0.3.30", features = ["thread-pool"] }
serde_json = { version = "1.0.114", default-features = true }
jsonrpsee = { version = "0.22", features = ["server"] }
# bs58 = { version = "0.4.0" }


# substrate client
sc-cli = { git = "/~https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0" }
Expand Down
14 changes: 14 additions & 0 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//use sp_core::OpaquePeerId; // A struct wraps Vec<u8> to represent the node `PeerId`.
//use node_template_runtime::NodeAuthorizationConfig; // The genesis config that serves the pallet.
use node_template_runtime::{AccountId, RuntimeGenesisConfig, Signature, WASM_BINARY};
use sc_service::ChainType;
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
Expand Down Expand Up @@ -113,5 +115,17 @@ fn testnet_genesis(
// Assign network admin rights.
"key": Some(root_key),
},
/*"nodeAuthorization": {
nodes: vec![
(
OpaquePeerId(bs58::decode("12D3KooWBmAwcd4PJNJvfV89HwE48nwkRmAgo8Vy3uQEyNNHBox2").into_vec().unwrap()),
endowed_accounts[0].clone()
),
(
OpaquePeerId(bs58::decode("12D3KooWQYV9dGMFoRzNStwpXztXaBUjtPqi6aU76ZgUriHhKust").into_vec().unwrap()),
endowed_accounts[1].clone()
),
],
},*/
})
}
6 changes: 5 additions & 1 deletion runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ targets = ["x86_64-unknown-linux-gnu"]
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = [
"derive",
] }



scale-info = { version = "2.10.0", default-features = false, features = [
"derive",
"serde",
Expand All @@ -37,7 +40,7 @@ pallet-grandpa = { git = "/~https://github.com/paritytech/polkadot-sdk.git", tag =
pallet-sudo = { git = "/~https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false }
pallet-timestamp = { git = "/~https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false }
pallet-transaction-payment = { git = "/~https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false }

# pallet-node-authorization = {git = "/~https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false } # Cambie la version
# primitives
sp-api = { git = "/~https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false }
sp-block-builder = { git = "/~https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false }
Expand Down Expand Up @@ -101,6 +104,7 @@ std = [
"pallet-timestamp/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
#"pallet-node-authorization/std",

"sp-api/std",
"sp-block-builder/std",
Expand Down
20 changes: 20 additions & 0 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@
#[cfg(feature = "std")]
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));

// use frame_system::EnsureRoot;

/*
parameter_types! {
pub const MaxWellKnownNodes: u32 = 8;
pub const MaxPeerIdLength: u32 = 128;
}
impl pallet_node_authorization::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type MaxWellKnownNodes = MaxWellKnownNodes;
type MaxPeerIdLength = MaxPeerIdLength;
type AddOrigin = EnsureRoot<AccountId>;
type RemoveOrigin = EnsureRoot<AccountId>;
type SwapOrigin = EnsureRoot<AccountId>;
type ResetOrigin = EnsureRoot<AccountId>;
type WeightInfo = ();
}
*/

use pallet_grandpa::AuthorityId as GrandpaId;
use sp_api::impl_runtime_apis;
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
Expand Down Expand Up @@ -33,6 +52,7 @@ pub use frame_support::{
},
StorageValue,
};

pub use frame_system::Call as SystemCall;
pub use pallet_balances::Call as BalancesCall;
pub use pallet_timestamp::Call as TimestampCall;
Expand Down

0 comments on commit 417368b

Please sign in to comment.