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

Leszek Wiesner 921337729b Prettier format %!s(int64=4) %!d(string=hai) anos
.github 1425bd5452 Add npm pack CI check %!s(int64=4) %!d(string=hai) anos
cli 12005b446a Add typescript/no-unused-vars rule and noUnusedLocals in tsconfig %!s(int64=4) %!d(string=hai) anos
devops eeb590c735 Merge pull request #940 from mnaamani/dev-init-vstore %!s(int64=4) %!d(string=hai) anos
docs 2a532261d6 update README %!s(int64=5) %!d(string=hai) anos
node 25ddf2ebef node: Fix set_lead_proposal_grace_period. %!s(int64=4) %!d(string=hai) anos
pioneer 86533cc065 Merge pull request #884 from mnaamani/js-playground-inject-joy-types %!s(int64=4) %!d(string=hai) anos
runtime 4b47026c61 runtime: Migrate proposals default values. %!s(int64=4) %!d(string=hai) anos
runtime-modules 6b7f6e9e7f Change working-group module and node versions. %!s(int64=4) %!d(string=hai) anos
scripts 9c897fd1ce Update scripts/create-test-chainspec.sh %!s(int64=4) %!d(string=hai) anos
storage-node 4ebb127c3b colossus: keyFile, providerId, publicUrl only required for server command %!s(int64=4) %!d(string=hai) anos
tests 2c18663f8d worker opening issue fixed %!s(int64=4) %!d(string=hai) anos
types 921337729b Prettier format %!s(int64=4) %!d(string=hai) anos
utils 29b5c0d48c Add linter fixes %!s(int64=4) %!d(string=hai) anos
.dockerignore 983b34cb32 review feedback applied %!s(int64=5) %!d(string=hai) anos
.editorconfig 565ade3481 code style last tweaks, add format and checks yarn scripts %!s(int64=4) %!d(string=hai) anos
.eslintrc.js 1a3bcbfa55 global tsconfig and .eslintrc %!s(int64=4) %!d(string=hai) anos
.gitignore ad88e65502 do not include vscode workspace settings.json %!s(int64=4) %!d(string=hai) anos
.prettierrc.js 9da958cc1c pretty some files %!s(int64=4) %!d(string=hai) anos
.travis.yml 271b754ab2 Merge branch 'travis-trigger-wasm' into travis-remove-deployment-task %!s(int64=4) %!d(string=hai) anos
.yarnclean 643c08c7a0 Pioneer workspaces config etc. %!s(int64=4) %!d(string=hai) anos
Cargo.lock 6b7f6e9e7f Change working-group module and node versions. %!s(int64=4) %!d(string=hai) anos
Cargo.toml 0a2091baeb Remove obsolete actors module. %!s(int64=4) %!d(string=hai) anos
README.md 796781f9c5 readme invalid hyperlinks and typo fix II %!s(int64=4) %!d(string=hai) anos
package.json 8b34fc03d2 storage-node: prettier formatting %!s(int64=4) %!d(string=hai) anos
setup.sh 0ad8eb24b5 build scripts: restore to using stable for test and clippy %!s(int64=4) %!d(string=hai) anos
tsconfig.json 7e97ac9cff Revert "dropped parserOptions.project array from pioneer/.eslintrc.js" %!s(int64=4) %!d(string=hai) anos
yarn.lock a22e8b0577 Merge pull request #782 from gleb-urvanov/feature/nicaea-runtime-upgrade %!s(int64=4) %!d(string=hai) anos

README.md

Joystream Build Status

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.

Build Status

Development Development Branch Build Status

More detailed build history on Travis CI

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 downloaded from the releases page.

Building from source

Clone the repository and install build tools:

git clone https://github.com/Joystream/joystream.git

cd 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-testnet.json

The rome-testnet.json chain file can be obtained from the releases 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

Network tests

./scripts/run-test-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. Proposal grace periods should be set to 0, otherwise proposal network tests will fail.

Rome-Constantinople migration network test

Ensure Rome node is up and running, and node URL is set using NODE_URL environment variable (default value is localhost:9944).

yarn test-migration

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.