GithubHelp home page GithubHelp logo

haerdib / encointer-node Goto Github PK

View Code? Open in Web Editor NEW

This project forked from encointer/encointer-node

0.0 0.0 0.0 52.34 MB

encointer node and cli client

License: Apache License 2.0

Shell 1.73% Ruby 0.14% Python 25.00% Rust 71.40% Handlebars 1.31% Dockerfile 0.42%

encointer-node's Introduction

encointer-node

Encointer-node is the implementation of the encointer.org blockchain. Use this together with the mobile phone app encointer mobile app

The cli client is based on substrate-api-client The Trusted Execution version for Testnet Cantillon is on branch sgx-master based on substraTEE project.

Building

Install Rust:

curl https://sh.rustup.rs -sSf | sh

Install required tools:

// with a rust-toolchain.toml rustup automatically installs the correct tools.
rustup show

Build the node:

cargo build --release

Run Dev Node

You can start a development chain with:

export RUST_LOG=INFO,parity_ws=WARN,sc_basic_authorship=warn,aura=warn,encointer=debug
./target/release/encointer-node-notee --dev --enable-offchain-indexing true

Offchain-indexing is needed for the custom rpc encointer_getAllCommunities. If you don't want it, omit the flag. --rpc-methods unsafe is needed for the bazaar's business and offering aggregation rpcs.

Additional CLI usage options are available and may be shown by running ./target/release/encointer-node-notee --help.

Test state migrations

Compile the node with:

cargo build --release --features try-runtime

Then test state migrations with against live data on the Gesell network with:

./target/release/encointer-node-notee try-runtime \
  --runtime ./target/release/wbuild/encointer-node-notee-runtime/encointer_node_notee_runtime.wasm \
  on-runtime-upgrade --checks=all \
  live --uri wss://gesell.encointer.org:443

Run with docker

# Expose the node's ports to the host with the -p flag.
docker run -p 30333:30333 -p 9944:9944 -p 9933:9933 -p 9615:9615 \
  encointer/encointer-node-notee:0.0.2 \
  --dev \
  --enable-offchain-indexing true \
  --rpc-methods unsafe \
  -lencointer=debug,parity_ws=warn \
  --ws-external \
  --rpc-external

Run Testnet Gesell Node

Join our testnet as a full node with

RUST_LOG=INFO,parity_ws=WARN,sc_basic_authorship=warn,aura=warn,encointer=debug
./target/release/encointer-node-notee --chain gesellv4SpecRaw.json --enable-offchain-indexing true --rpc-cors all

CLI client

We currently have limited support for the polkadot-js apps UI. Encointer comes with a cli application instead that supports all interactions with the chain

Run Client

encointer-node/client> cargo build --release
encointer-node/client> ../target/release/encointer-client-notee transfer //Alice 5GziKpBELV7fuYNy7quQfWGgVARn8onchS86azuPQkFj9nEZ 1000000
encointer-node/client> ../target/release/encointer-client-notee list_participant_registry
encointer-node/client> ../target/release/encointer-client-notee list_meetup_registry
encointer-node/client> ../target/release/encointer-client-notee list_witnesses_registry
encointer-node/client> ../target/release/encointer-client-notee --help

The master of ceremony can play fast-forward for demo purposes (ceremonies only happen ~monthly. not good for demos)

encointer-node/client> ./encointer-client-notee next_phase

To run a full demo (you may need to fix ports in the scripts if you change them):

encointer-node/client> ./bootstrap_demo_community.sh

Run with docker

docker run -it encointer/encointer-client-notee:<version> [encointer-client-notee|bootstrap_demo_community.py|cli.py] <params>

# Example to talk to a node on the host.
docker run -it encointer/encointer-client-notee:<version> encointer-client-notee list-communities -u ws://host.docker.internal -p 9944

# Bootstrap demo community on a node on the host machine.
docker run -it encointer-client-notee:dev bootstrap_demo_community.py -u ws://host.docker.internal -p 9944

Grow Bot Community

Assuming a local node is running with default ports:

pip3 install random_word pyproj geojson
# in first terminal, do this to accelerate phase progress
./phase.py --idle-blocks 3
# in second terminal, launch faucet service
./faucet.py
# in third terminal, populate your bot community
./bot-community.py init
./bot-community.py benchmark

Web UI

There is no fully featured UI yet, but you can use polkadot-js apps. This allows you to explore chain state but it doesn't support all types of extrinsic parameters needed. Use our CLI client instead.

Mobile App

The PoC1 Android App doesn't work with this release anymore, but you can watch progress at encointer-app

Dev-Remarks

Benchmarking

For benchmarking a new pallet you need to do the following:

  1. Add the new pallet to be benchmarked to the define_benchmarks! macro in the runtime.
  2. Make sure you enable the pallet's benchmark by enabling its runtime-benchmark feature in the runtime's toml.
  3. Compile the node with --features runtime-benchmarks
  4. Add it to the benchmark script: ./scripts/benchmark_runtime.sh

This will automatically generate the new/updated weight file in ./runtime/src/weights.

encointer-node's People

Contributors

clangenb avatar brenzi avatar jeluard avatar pifragile avatar shawntabrizi avatar joshorndorff avatar anizeani avatar mosonyi avatar riusricardo avatar nicjak avatar kaichaosun avatar c410-f3r avatar danforbes avatar haerdib avatar tripleight avatar echevrier avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.