Skip to content

Commit

Permalink
chore: give funds to alice , bob and charlie
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Dare committed Aug 16, 2024
1 parent ed95db2 commit f60f68f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
34 changes: 34 additions & 0 deletions node/src/chain_spec/raonet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@

use super::*;

/// Generates the configuration for the Raonet chain.
///
/// # Returns
///
/// * `Result<ChainSpec, String>` - The chain specification or an error message.
///
/// # Example
///
/// ```rust
/// let chain_spec = raonet_config().expect("Failed to generate Raonet config");
/// ```
pub fn raonet_config() -> Result<ChainSpec, String> {
let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?;

Expand Down Expand Up @@ -44,11 +55,34 @@ pub fn raonet_config() -> Result<ChainSpec, String> {
.build())
}

/// Generates the genesis configuration for the Raonet chain.
///
/// # Arguments
///
/// * `initial_authorities` - A vector of initial authorities (AuraId, GrandpaId).
/// * `_enable_println` - A boolean flag to enable println (currently unused).
///
/// # Returns
///
/// * `serde_json::Value` - The genesis configuration as a JSON value.
fn raonet_genesis(
initial_authorities: Vec<(AuraId, GrandpaId)>,
_enable_println: bool,
) -> serde_json::Value {
let mut balances = vec![
// Add Alice, Bob, and Charlie with 10 trillion tokens each
(
get_account_id_from_seed::<sr25519::Public>("Alice"),
10_000_000_000_000u128,
),
(
get_account_id_from_seed::<sr25519::Public>("Bob"),
10_000_000_000_000u128,
),
(
get_account_id_from_seed::<sr25519::Public>("Charlie"),
10_000_000_000_000u128,
),
(
<AccountId32 as Ss58Codec>::from_ss58check("5FRo4vab84LM3aiK4DijnVawGDKagLGLzfn95j9tjDaHja8Z").unwrap(),
100_000_000_000u128,
Expand Down
5 changes: 4 additions & 1 deletion scripts/specs/raonet.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da91b167e23cbebb7878d58f0cfbe24fade1e7baeac6e4320c5c6b73a5eb854500b7ff2b8687ed317db704b4abad0a45f65": "0x0000000000000000010000000000000000e87648170000000000000000000000000000000000000000000000000000000000000000000080",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da938dd096bcb24cc8c4e13c4599ef5c3b81493fb01f6bc22dc61058060bda668bd9176f1d65b6d66d2049e89977e5bd668": "0x0000000000000000010000000000000000e87648170000000000000000000000000000000000000000000000000000000000000000000080",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9429fc86d7333582b998a35c8896a77ce3ede627d972b461687bb5b61e787755834a8766c2a97cdad7c3d0057b21e931e": "0x0000000000000000010000000000000000e87648170000000000000000000000000000000000000000000000000000000000000000000080",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da94f9aea1afa791265fae359272badc1cf8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48": "0x0000000000000000010000000000000000a0724e180900000000000000000000000000000000000000000000000000000000000000000080",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da964e5f34e3743dc8069c20d13b30c5fbddc84503cd7f06da23828bf915f198ea549d0d4f4398c32c4d84154e819a8c23b": "0x0000000000000000010000000000000000e87648170000000000000000000000000000000000000000000000000000000000000000000080",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da96a55c6839a54c8ca50de2626b6f039dce0730733a54b0595ceddaf2b0d4089a777c1dd8bdeba334656beda1567e7bc0c": "0x0000000000000000010000000000000000e87648170000000000000000000000000000000000000000000000000000000000000000000080",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9716d4f62e450a2bd8928b2962b8c0501e41ff5d2aa23e35a4830fdd5a4191abb9c9c804f0aa315d257bcd132e91a332d": "0x0000000000000000010000000000000000e87648170000000000000000000000000000000000000000000000000000000000000000000080",
Expand All @@ -39,8 +40,10 @@
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da98f65b4d1e52ab839c9d2ac69e6a0e41f3e31d977c148833c83e2ee95e74034a1b3b32946e5c5ae4ae9ce4d1ac2f0b444": "0x0000000000000000010000000000000000e87648170000000000000000000000000000000000000000000000000000000000000000000080",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9a027f81e14ea99ce4073009c0d87ae906a7952ece498544ab3bd8978d5350f0f475846289d80dceafca38070c9f27832": "0x0000000000000000010000000000000000e87648170000000000000000000000000000000000000000000000000000000000000000000080",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9a7a93cd301b14fb55b5551dbf15d9f361ccfe35ab623e7eaec1590656d36a74bc8582dc3f1f769a1838d075ff9e1cd6a": "0x0000000000000000010000000000000000e87648170000000000000000000000000000000000000000000000000000000000000000000080",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9b0edae20838083f2cde1c4080db8cf8090b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22": "0x0000000000000000010000000000000000a0724e180900000000000000000000000000000000000000000000000000000000000000000080",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9b65645a40eeb88fbfc80422e63f5bb88ba5aad47261de88951fda9fd78998be184cd208349267ad95320470daaf0694b": "0x0000000000000000010000000000000000e87648170000000000000000000000000000000000000000000000000000000000000000000080",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9cfa073cf1f3eb4ae5db2029ea6f52ebc9095a72dd4aa58af5f43914ae500754b4bc20d89ba9c44e84eb386f222b77b6a": "0x0000000000000000010000000000000000e87648170000000000000000000000000000000000000000000000000000000000000000000080",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9de1e86a9a8c739864cf3cc5ec2bea59fd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d": "0x0000000000000000010000000000000000a0724e180900000000000000000000000000000000000000000000000000000000000000000080",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9df3cf604c2c25efbc864feb8f6d4feed48ea0f98e9c83ff536e748efa8cc4a708009d9896c9adf2910395a22742dcb38": "0x0000000000000000010000000000000000e87648170000000000000000000000000000000000000000000000000000000000000000000080",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9e99a494997e77bbb23d2c85322a5f7e5d4974d8d2d4c8f7005f81c70f222738c6d37010ae219037481fe75c5cceb886f": "0x0000000000000000010000000000000000e87648170000000000000000000000000000000000000000000000000000000000000000000080",
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9f128d73105ad2727b45028c061fe9141b099776c4958437cd72bfefe9f73788f3a06734dc9c4350d2acc886eecabb10b": "0x0000000000000000010000000000000000e87648170000000000000000000000000000000000000000000000000000000000000000000080",
Expand Down Expand Up @@ -83,7 +86,7 @@
"0xb8c7f96c134ebb49eb7e77df71f098ad4e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0xbd2a529379475088d3e29a918cd478724e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0xc2261276cc9d1f8598ea4b6a74b15c2f4e7b9012096b41c4eb3aaf947f6ea429": "0x0100",
"0xc2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80": "0x0008c1f1e8010000",
"0xc2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80": "0x00e818dd311d0000",
"0xca407206ec1ab726b2636c4b145ac2874e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0xd5e1a2fa16732ce6906189438c0a82c64e7b9012096b41c4eb3aaf947f6ea429": "0x0000",
"0xd8f314b7f4e6b095f0f8ee4656a448254e7b9012096b41c4eb3aaf947f6ea429": "0x0100",
Expand Down

0 comments on commit f60f68f

Please sign in to comment.