Straightedge is an:
- On-chain Governed,
- Proof-of-Stake (PoS) Blockchain
- with a WASM Runtime.
For the Straightedge Mainnet Launch, we recommend the lockdrop allocation genesis spec with the following hashes. The hashes can be generated by running shasum
and b2sum
on the file node/service/src/genesis.json
.
➜ straightedge-node git:(master) ✗ shasum node/service/src/genesis.json
`todo` node/service/src/genesis.json
➜ straightedge-node git:(master) ✗ b2sum node/service/src/genesis.json
`todo` node/service/src/genesis.json
At launch, you can run straightedge-node
and recommended chainspec, as is. However, individuals are able to independently regenerate and verify that the recommended node/service/src/genesis.json
hashes follow the straightedge-lockdrop
specification. To do this, you'll need to:
- Clone edgeware-lockdrop
- Run
node scripts/lockdrop.js --allocation
to generate a lockdropgenesis.json
in your working directory. - Copy the
genesis.json
into your copy of thestraightedge-node/node/service/src
. - Compute the hashes and verify they match.
From here, you can use the normal build and run commands.
We are now pegged to the master branch of: https://github.com/hicommonwealth/substrate.
-
Download this entire repository to the file system that you are using to run the validator node.
- You can do this by going to this page and selecting "Clone or download" followed by "Download ZIP".
- If you are installing via a command line interface (e.g. SSH into a remote server), you can download by running
wget https://github.com/heystraightedge/straightedge-node/archive/master.zip
orgit clone github.com/heystraightedge/straightedge-node
- Once you have downloaded the zip file, unzip the
straightedge-node-master
folder onto the file system. If you are using a command line interface, you can unzip by runningunzip master.zip
. If yougit clone
d the repository, you can just cd into there. - All commands referenced in this document need to be run from within the
edgeware-node-master
folder.
-
You will also need to install
rust
andcargo
by installingrustup
here. You can do it using thesetup.sh
bash script in the repo. See the section Fresh Start.- Note: at the end of the install, you will need to log out and log in again, or run the suggested
source
command to configure the current shell.
- Note: at the end of the install, you will need to log out and log in again, or run the suggested
If your device is clean (such as a fresh cloud VM) you can use this script, otherwise, proceed with the Initial Setup.
./setup.sh
To create a keypair, install subkey with cargo install --force --git https://github.com/paritytech/substrate subkey
. Then run the following:
subkey generate
To create an ED25519 keypair, run the following:
subkey -e generate
To create derived keypairs, use the mnemonic generated from a method above and run (use -e
for ED25519):
subkey inspect "<mnemonic>"//<derive_path>
For example:
subkey inspect "west paper guide park design weekend radar chaos space giggle execute canoe"//edgewarerocks
Then proceed to the Running instructions or follow the instructions below for the manual setup.
curl https://sh.rustup.rs -sSf | sh
rustup update stable
rustup update nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
cargo install --git https://github.com/alexcrichton/wasm-gc
You will also need to install the following packages:
Linux:
sudo apt install cmake pkg-config libssl-dev git clang libclang-dev
Mac:
brew install cmake pkg-config openssl git llvm
cargo build --release
Ensure you have a fresh start if updating from another version:
./scripts/purge-chain.sh
To start up the Straightedge node and connect to the mainnet (starts on September 15th), run:
./target/release/straightedge --chain=straightedge --name <INSERT_NAME>
In order to validate on Straightedge, follow the guide here: Validating on Straightedge
- Aura
- AuthorityDiscovery
- Authorship
- Indices
- Balances
- Contracts
- Council
- Democracy
- Elections
- FinalityTracker
- Grandpa
- ImOnline
- Offences
- Session
- Staking
- Sudo
- System
- Timestamp
- Treasury
To run a chain locally for development purposes: ./target/release/straightedge --chain=local --alice --validator
To allow apps in your browser to connect, as well as anyone else on your local network, add the --rpc-cors=all
flag.
To force your local to create new blocks, even if offline, add the --force-authoring
flag.
- Add its github repo to:
- Cargo.toml
- node/runtime/Cargo.toml
- node/runtime/wasm/Cargo.toml (be sure to have
default-features = false
)
- Changes to the runtime:
- Add it as an
extern crate
. - Implement its
Trait
with production types. - Add it to the
construct_runtime
macro with all implemented components.
- If its storage contains
config
elements, then you need to modify the chain spec:
- Add it to the
straightedge_runtime
's list ofConfig
types. - Add it to the
testnet_genesis
function, initializing all storage fields set toconfig()
.
- Build and run the chain.
If you plan to validate on Edgeware or a testnet with any non-default keys, then you will need to store the keys so that the node has access to them, for signing transactions and authoring new blocks. Keys in Edgeware are stored in the keystore in the file system. To store keys into this keystore, you need to use one of the two provided RPC calls.
If your keys are encrypted or should be encrypted by the keystore, you need to provide the key using one of the cli arguments --password, --password-interactive or --password-filename.
For most users who want to run a validator node, the author_rotateKeys RPC call is sufficient. The RPC call will generate N Session keys for you and return their public keys. N is the number of session keys configured in the runtime. The output of the RPC call can be used as input for the session::set_keys transaction.
curl -H 'Content-Type: application/json' --data '{ "jsonrpc":"2.0", "method":"author_rotateKeys", "id":1 }' localhost:9933
If the Session keys need to match a fixed seed, they can be set individually key by key. The RPC call expects the key seed and the key type. The key types supported by default in Edgeware are aura
, gran
, and imon
.
curl -H 'Content-Type: application/json' --data '{ "jsonrpc":"2.0", "method":"author_insertKey", "params":["KEY_TYPE", "SEED", "PUBLIC_KEY"],"id":1 }' localhost:9933
KEY_TYPE
- needs to be replaced with the 4-character key type identifier. SEED
- is the seed of the key.