Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect db types on retrieval/insertion #155

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c26a3f7
Working parsing of config file, need to implement file creation + imp…
phklive Jan 10, 2024
efce0e8
make clippy happy
phklive Jan 10, 2024
8dae787
applied changes, improved congfig file + encapsulated logic in genesi…
phklive Jan 11, 2024
3664282
make clippy happy
phklive Jan 11, 2024
027a162
Creation of genesis.dat file
phklive Jan 11, 2024
886990a
Move hex_str_to_byte_array() to utils
phklive Jan 11, 2024
89fdcf0
removed async for make_genesis(), created start.rs, added genesis test
phklive Jan 11, 2024
64461bc
Added back doc + added doc
phklive Jan 11, 2024
7e3dd38
Accounts are successfully added to accounts folder + genesis.dat created
phklive Jan 11, 2024
ffa08dd
Added testing for account files existing
phklive Jan 11, 2024
1a57577
refactor AccountData struct
phklive Jan 11, 2024
52e09c3
Fixed first half of comments
phklive Jan 12, 2024
cc4f35b
Use miden_crypto::utils::hex_to_bytes() for hex deserialization
phklive Jan 12, 2024
db1af97
Added Option<>
phklive Jan 12, 2024
6248c94
Changed NodeTopLevelConfig to StartCommandConfig
phklive Jan 12, 2024
d200aa2
Added new(), fixed functions, added try_from
phklive Jan 12, 2024
b68e4e9
Added manual Serialization / Deserialization for AuthSchemeInput and …
phklive Jan 12, 2024
82dbbe8
AccountData structs are correctly serialised and deserialised
phklive Jan 12, 2024
8d6f500
Added testing for serialization / deserialization, bugs
phklive Jan 12, 2024
e46ebbf
Removed unused crates
phklive Jan 12, 2024
93dca87
changed seed to init_seed
phklive Jan 16, 2024
b918a39
Merge branch 'main' into phklive-improve-genesis-file
phklive Jan 16, 2024
13fb7da
Updated with miden-base AccountData and AuthData additions
phklive Jan 17, 2024
2320106
Updated file structure + re-wrote test
phklive Jan 17, 2024
e780a44
Fix formatting
phklive Jan 17, 2024
138000c
Fix various errors related to DB and the node
igamigo Jan 17, 2024
bfd3a4f
Revert miden-base to main
igamigo Jan 17, 2024
c126e4a
Update mod.rs
igamigo Jan 18, 2024
aa3aae8
Update mod.rs
igamigo Jan 18, 2024
ff1a0fc
Update api.rs
igamigo Jan 18, 2024
df8774b
merge genesis stuff
igamigo Jan 18, 2024
c26fa66
merge fixes
igamigo Jan 18, 2024
b79a968
Merge branch 'main' of https://github.com/0xPolygonMiden/miden-node i…
igamigo Jan 18, 2024
68e7189
miden toml
igamigo Jan 18, 2024
a6cd415
Update miden.toml
igamigo Jan 18, 2024
bf726bc
Merge branch 'main' of https://github.com/0xPolygonMiden/miden-node i…
igamigo Jan 18, 2024
47e2653
merge main
igamigo Jan 18, 2024
5e65ce4
Merge branch 'igamigo-fix-db' of https://github.com/0xPolygonMiden/mi…
igamigo Jan 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ resolver = "2"
[workspace.dependencies]
miden-crypto = { package = "miden-crypto", git = "https://github.com/0xPolygonMiden/crypto.git", branch = "next" }
miden-lib = { package = "miden-lib", git = "https://github.com/0xPolygonMiden/miden-base.git", branch = "main" }
miden_objects = { package = "miden-objects", git = "https://github.com/0xPolygonMiden/miden-base.git", branch = "main" }
miden_objects = { package = "miden-objects", git = "https://github.com/0xPolygonMiden/miden-base.git", branch = "main", features = [
"serde",
] }
thiserror = "1.0"
tracing = { version = "0.1" }
tracing-subscriber = { version = "0.3", features = ["fmt", "json", "env-filter"] }
tracing-subscriber = { version = "0.3", features = [
"fmt",
"json",
"env-filter",
] }
Binary file added accounts/account0.mac
Binary file not shown.
Binary file added accounts/account1.mac
Binary file not shown.
Binary file added accounts/account2.mac
Binary file not shown.
Binary file added faucet.fsk
Binary file not shown.
Binary file added genesis.dat
Binary file not shown.
46 changes: 46 additions & 0 deletions miden.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This is an example configuration file for the Miden node.

version = 1
timestamp = 1672531200

[[accounts]]
type = "BasicWallet"
mode = "RegularAccountImmutableCode"
init_seed = "0xa123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
auth_scheme = "RpoFalcon512"
auth_seed = "0xb123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"

[[accounts]]
type = "BasicWallet"
mode = "RegularAccountImmutableCode"
init_seed = "0xa123456733abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
auth_scheme = "RpoFalcon512"
auth_seed = "0xb987654321abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"

[[accounts]]
type = "BasicFungibleFaucet"
mode = "FungibleFaucet"
init_seed = "0xc123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
auth_scheme = "RpoFalcon512"
auth_seed = "0xd123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
token_symbol = "POL"
decimals = 12
max_supply = 1000000


[block_producer]
# port defined as: sum(ord(c)**p for (p, c) in enumerate('miden-block-producer', 1)) % 2**16
endpoint = { host = "localhost", port = 48046 }
store_url = "http://localhost:28943"

[rpc]
# port defined as: sum(ord(c)**p for (p, c) in enumerate('miden-rpc', 1)) % 2**16
endpoint = { host = "localhost", port = 57291 }
block_producer_url = "http://localhost:48046"
store_url = "http://localhost:28943"

[store]
# port defined as: sum(ord(c)**p for (p, c) in enumerate('miden-store', 1)) % 2**16
endpoint = { host = "localhost", port = 28943 }
database_filepath = "miden-store.sqlite3"
genesis_filepath = "genesis.dat"
Binary file added node/.DS_Store
Binary file not shown.
28 changes: 28 additions & 0 deletions node/genesis.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This is an example configuration file for the Miden node.

version = 1
timestamp = 1672531200

[[accounts]]
type = "BasicWallet"
mode = "RegularAccountImmutableCode"
init_seed = "0xa123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
auth_scheme = "RpoFalcon512"
auth_seed = "0xb123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"

[[accounts]]
type = "BasicWallet"
mode = "RegularAccountImmutableCode"
init_seed = "0xa123456733abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
auth_scheme = "RpoFalcon512"
auth_seed = "0xb987654321abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"

[[accounts]]
type = "BasicFungibleFaucet"
mode = "FungibleFaucet"
init_seed = "0xc123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
auth_scheme = "RpoFalcon512"
auth_seed = "0xd123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
token_symbol = "POL"
decimals = 12
max_supply = 1000000
18 changes: 0 additions & 18 deletions node/miden.toml

This file was deleted.

152 changes: 0 additions & 152 deletions node/src/commands.rs

This file was deleted.

46 changes: 46 additions & 0 deletions node/src/commands/genesis/input.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
use miden_objects::accounts::AccountType;
use serde::Deserialize;

// INPUT HELPER STRUCTS
// ================================================================================================

/// Input types are helper structures designed for parsing and deserializing configuration files.
/// They serve as intermediary representations, facilitating the conversion from
/// placeholder types (like `GenesisInput`) to internal types (like `GenesisState`).
#[derive(Debug, Deserialize)]
pub struct GenesisInput {
pub version: u64,
pub timestamp: u64,
pub accounts: Vec<AccountInput>,
}

#[derive(Debug, Deserialize)]
#[serde(tag = "type")]
pub enum AccountInput {
BasicWallet(BasicWalletInputs),
BasicFungibleFaucet(BasicFungibleFaucetInputs),
}

#[derive(Debug, Deserialize)]
pub struct BasicWalletInputs {
pub mode: AccountType,
pub init_seed: String,
pub auth_scheme: AuthSchemeInput,
pub auth_seed: String,
}

#[derive(Debug, Deserialize)]
pub struct BasicFungibleFaucetInputs {
pub mode: AccountType,
pub init_seed: String,
pub auth_scheme: AuthSchemeInput,
pub auth_seed: String,
pub token_symbol: String,
pub decimals: u8,
pub max_supply: u64,
}

#[derive(Debug, Deserialize)]
pub enum AuthSchemeInput {
RpoFalcon512,
}
Loading
Loading