Crates.io | luk_chain |
lib.rs | luk_chain |
version | 0.2.0 |
source | src |
created_at | 2021-08-18 22:28:57.061504 |
updated_at | 2021-08-24 15:10:06.543893 |
description | Generalised blockchain library |
homepage | |
repository | https://github.com/FreddieBrown/LukChain |
max_upload_size | |
id | 439263 |
size | 167,826 |
Generalised BlockChain
Currently uses nightly
features
To use LukChain
, a config.toml
file needs to be setup to define different user profiles.
This should follow the following structure:
[config]
[[profiles]]
block_size = 10
lookup_address = "127.0.0.1:8181"
lookup_filter = "user"
user_location = "user1.json"
bc_location = "blockchain1.bin"
[[profiles]]
block_size = 20
lookup_address = "127.0.0.1:8181"
lookup_filter = "miner"
user_location = "user2.json"
bc_location = "blockchain2.bin"
Each field can be ommitted if not needed. The use of each field in the program is:
block_size
: If the role chosen is Miner
, this option will define the size of blocks that it will add to the blockchain and will distribute to connected nodes.lookup_address
: Address to contact initially to obtain addresses of other nodes in the network to connect to.lookup_filter
: Included in message to LookUp and allows filtering of address book members based on their role in the network.user_location
: Location where information about user is stored when it is generated or needs to be retrieved on startupbc_location
: Location of binary file containing local copy of blockchainTo run with cargo: cargo run --example chat -- --role lookup
Chat
USAGE:
chat [OPTIONS] --log LEVEL [INPUT]
FLAGS:
-h, --help Prints help information
OPTIONS:
--log LEVEL Sets logging level
--role ROLE Sets the role of the user in the network
--config NUMBER Sets chosen config (default: 0)
ARGS:
<INPUT>