the evolving blockchain :rocket:
depending on your operating system and rust version, there might be additional packages required to compile this project. check the install instructions for your platform for the most common dependencies. alternatively, you can use one of the alternative installation options.
fetch evolute code:
git clone https://github.com/evolute-live/evolute.git evolute
cd evolute
🔨 use the following command to build the node without launching it:
cargo build --release
after you build the project, you can use the following command to explore its parameters and subcommands:
./target/release/evolute-node -h
you can generate and view the rust docs for this template with this command:
cargo +nightly doc --open
the following command starts a single-node development chain that doesn't persist state:
./target/release/evolute-node --dev
to purge the development chain's state, run the following command:
./target/release/evolute-node purge-chain --dev
to start the development chain with detailed logging, run the following command:
RUST_BACKTRACE=1 ./target/release/evolute-node -ldebug --dev
development chains:
tmp folder while the node is running.sudo account./node/src/chain_spec.rs) that
includes several pre-funded development accounts.to persist chain state between runs, specify a base path by running a command similar to the following:
// create a folder to use as the db base path
$ mkdir my-chain-state
// use of that folder to store the chain state
$ ./target/release/evolute-node --dev --base-path ./my-chain-state/
// check the folder structure created inside the base path after running the chain
$ ls ./my-chain-state
chains
$ ls ./my-chain-state/chains/
dev
$ ls ./my-chain-state/chains/dev
db keystore network
after you start the node template locally, you can interact with it using the
hosted version of the polkadot/substrate
portal
front-end by connecting to the local node endpoint. a hosted version is also
available on ipfs. you can
also find the source code and instructions for hosting your own instance in the
polkadot-js/apps repository.
if you want to see the multi-node consensus algorithm in action, see simulate a network.
a substrate project such as this consists of a number of components that are spread across a few directories.
a blockchain node is an application that allows users to participate in a blockchain network. substrate-based blockchain nodes expose a number of capabilities:
libp2p networking
stack to allow the nodes in the network to communicate with one another.there are several files in the node directory. take special note of the
following:
chain_spec.rs: a chain
specification is a source code
file that defines a substrate chain's initial (genesis) state. chain
specifications are useful for development and testing, and critical when
architecting the launch of a production chain. take note of the
development_config and testnet_genesis functions. these functions are
used to define the genesis state for the local development chain
configuration. these functions identify some well-known
accounts and
use them to configure the blockchain's initial state.service.rs: this file defines the node
implementation. take note of the libraries that this file imports and the
names of the functions it invokes. in particular, there are references to
consensus-related topics, such as the block finalization and
forks
and other consensus
mechanisms
such as aura for block authoring and grandpa for finality.in substrate, the terms "runtime" and "state transition function" are analogous. both terms refer to the core logic of the blockchain that is responsible for validating blocks and executing the state changes they define. the substrate project in this repository uses frame to construct a blockchain runtime. frame allows runtime developers to declare domain-specific logic in modules called "pallets". at the heart of frame is a helpful macro language that makes it easy to create pallets and flexibly compose them to create blockchains that can address a variety of needs.
review the frame runtime implementation included in this template and note the following:
impl $PALLET_NAME::Config for Runtime.the runtime in this project is constructed using many frame pallets that ship
with the substrate
repository and a
template pallet that is defined in the
pallets directory.
a frame pallet is comprised of a number of blockchain primitives, including:
each pallet has its own Config trait which serves as a configuration interface
to generically define the types and parameters it depends on.
instead of installing dependencies and building this source directly, consider the following alternatives.
install nix and
nix-direnv for a fully
plug-and-play experience for setting up the development environment. to get all
the correct dependencies, activate direnv direnv allow.
please follow the substrate docker instructions here to build the docker container with the evolute binary.
4 activities