Forked from Joystream/joystream https://github.com/Joystream/joystream

metmirr de8808f272 Add substrate-query-node REAME.md 4 năm trước cách đây
devops 2cb5391df2 bump traivs and docker files to use rust 1.42.0 5 năm trước cách đây
docs 2a532261d6 update README 5 năm trước cách đây
node da0f4f4b81 Merge pull request #253 from mnaamani/council-mint 4 năm trước cách đây
query-node de8808f272 Add substrate-query-node REAME.md 4 năm trước cách đây
runtime da0f4f4b81 Merge pull request #253 from mnaamani/council-mint 4 năm trước cách đây
runtime-modules da0f4f4b81 Merge pull request #253 from mnaamani/council-mint 4 năm trước cách đây
scripts bc0b5115ff reorganize scripts and docker files 5 năm trước cách đây
tests 267b7c99fa async nonce usage fix 4 năm trước cách đây
utils 7fa0703f6e update dependency path, integrate node into workspace 5 năm trước cách đây
.dockerignore 983b34cb32 review feedback applied 4 năm trước cách đây
.editorconfig 411f6f59bd Initial commit 6 năm trước cách đây
.gitignore 150f712da9 Remove generated directory 4 năm trước cách đây
.travis.yml 2cb5391df2 bump traivs and docker files to use rust 1.42.0 5 năm trước cách đây
Cargo.lock 3df8a4d224 add mint to council 4 năm trước cách đây
Cargo.toml 1fce5d2649 configure profile in root package 5 năm trước cách đây
README.md 983b34cb32 review feedback applied 4 năm trước cách đây
package.json 6d4d3994ba fee estimation added, style fix, readme update 4 năm trước cách đây
setup.sh bc0b5115ff reorganize scripts and docker files 5 năm trước cách đây

README.md

Joystream

This is the main code reposity for all joystream software. It will house the substrate chain project, the full node and runtime and all reusable substrate runtime modules that make up the joystream runtime. In addition to all front-end apps and infrastructure servers necessary for operating the network.

The repository is currently just a cargo workspace, but eventually will also contain yarn workspaces, and possibly other project type workspaces.

Overview

The joystream network builds on a pre-release version of substrate v2.0 and adds additional functionality to support the various roles that can be entered into on the platform.

Validator

 Nodes for Joystream

Joystream node is the main server application that connects to the network, synchronizes the blockchain with other nodes and produces blocks if configured as a validator node.

To setup a full node and validator review the advanced guide from the helpdesk.

Pre-built Binaries

The latest pre-built binaries can be downloads from the releases page.

Building from source

Clone the repository and install build tools:

git clone https://github.com/Joystream/substrate-runtime-joystream.git

cd substrate-runtime-joystream/

./setup.sh

Building

cargo build --release

Running a public node on the Rome testnet

Run the node and connect to the public testnet.

cargo run --release -- --chain ./rome-tesnet.json

The rome-testnet.json chain file can be ontained from the release page

Installing a release build

This will install the executable joystream-node to your ~/.cargo/bin folder, which you would normally have in your $PATH environment.

cargo install joystream-node --path node/

Now you can run

joystream-node --chain rome-testnet.json

Local development

This will build and run a fresh new local development chain purging existing one:

./scripts/run-dev-chain.sh

Unit tests

cargo test

API integration tests

./scripts/run-dev-chain.sh
yarn test

To run the integration tests with a different chain, you can omit step running the local development chain and set the node URL using NODE_URL environment variable.

Joystream Runtime

Joystream Runtime

The runtime is the code that defines the consensus rules of the Joystream protocol. It is compiled to WASM and lives on chain. Joystream node execute the code's logic to validate transactions and blocks on the blockchain.

When building joystream-node as described abot with cargo build --release, in addition to the joystream-node binary being built the WASM blob artifact is produced in:

target/release/wbuild/joystream-node-runtime/joystream_node_runtime.compact.wasm

Deployment

Deploying the compiled runtime on a live system can be done in one of two ways:

  1. Joystream runtime upgrade proposals which will be voted on by the council. When the Joystream platform is live, this will be the only way to upgrade the chain's runtime code.

  2. During development and testnet phases, we can send an extrinsic (transaction signed with the sudo key) invoking system::setCode(). This can be done either from the UI/extrinsics app, or directly with an admin script.

Versioning the runtime

Versioning of the runtime is set in runtime/src/lib.rs For detailed information about how to set correct version numbers when developing a new runtime, see this

Coding style

We use cargo-fmt to format the source code for consistency.

It should be available on your machine if you ran the setup.sh script, otherwise install it with rustup:

rustup component add rustfmt

Applying code formatting on all source files recursing subfolders:

cargo-fmt

Contributing

Please see our contributing guidlines for details on our code of conduct, and the process for submitting pull requests to us.

Authors

See also the list of CONTRIBUTORS who participated in this project.

License

This project is licensed under the GPLv3 License - see the LICENSE file for details

Acknowledgments

Thanks to the whole Parity Tech team for making substrate and helping on riot chat with tips, suggestions, tutorials and answering all our questions during development.