Orbs is a public blockchain built for the needs of apps with millions of users, from SLAs to adjustable fee models to on-demand capacity.
The Orbs platform is designed with the input of consumer applications such as Kik, and inspired by existing best practices, like those of leading cloud computing platforms.
It’s an Infrastructure as a Service solution that makes it possible to launch disruptive, large-scale, consumer-focused applications.
For more information, please check https://orbs.com.
This repository contains all Orbs projects, including both server implementation and client SDK.
You are encouraged to run the script orbs-team-member-bootstrap.sh
, it will install all necessary software on your MacOS and then run the full build.
During the installation process, you will occasionally be asked for your credentials, please stay next to your machine at least until the build begins.
Note: if Docker is not already installed, the script will install it and then exit so you can run the Docker app manually. This is required for creating the
docker
shell command. You should then rerun the script to continue the installation.
The entire installation takes about 5 minutes on a modern mac. At the end of the installation, and before the build begins, you will be asked to either proceed with the build, or exit. Build time is about 15 minutes or more, depending on connection speed.
On a fresh MacOS, run the following:
xcrun --version
This tests if XCode Command Line Tools are installed. If
xcrun
is not found, runxcode-select --install
. This will also installgit
.mkdir -p ~/dev/orbs
cd ~/dev/orbs
git clone https://github.com/orbs-network/orbs-network.git
If you are prompted that
git
is not found, click "Install", then repeat step 4.- cd ~/dev/orbs/orbs-network
- chmod u+x orbs-team-member-bootstrap.sh
- ./orbs-team-member-bootstrap.sh
By default docker will limit itself to the amount of resources it takes from the system, usually that limit is not enough for orbs to run its test suite, we will later cover how to Run Inside of Docker and change the configuration.
Please refer to documentation in deploy/bootstrap
folder.
Run when you made a big change in one of the sub projects and you want to fully build all of them:
./build.sh
- This will
yarn install
all the sub projects which is a little slow but safer. - This will also lint your code which is a little slow but safer.
After installing, when developing services actively, use this to make your life easier:
./watch.sh
- This will watch for file changes on all typescript sub projects and recompile automatically.
Build process is divided into 3 parts:
- build server:
./docker/build-server-base.sh && ./docker-build.sh
- build sdk:
./docker/build-sdk-base.sh && ./docker/build-sdk.sh
- build e2e:
./docker/build-sdk-base.sh && ./docker/build-e2e.sh
You don't have to rebuild your base images most of the time unless something changed in docker
folder or one of the docker files.
The default memory configuration of the Docker app on your Mac is insufficient to run e2e tests. Open the Docker
Preferences --> Advanced --> Memory
and set it to 4.0 GiB and 3 CPUs. Leaving the default 2.0 GiB may result in Docker containers getting stuck during the e2e run on your machine.
This build will generate all the docker images required to run the orbs-network blockchain. there are two options to run e2e tests.
Please refer to e2e documentation in e2e
folder to learn more about end to end testing and the docker configuration we use.
In the ./e2e
folder the script test-from-host.sh
will execute the tests from your current machine. This test will fire up the nodes (docker images) and is slightly faster then running the entire e2e process from docker.
In the ./e2e
folder the script test-from-docker.sh
will execute the tests from the docker image. This should simulate exactly what the deployed environment will be like to the extent of configuration (.env
file, see the configuration section above)
Please refer to documentation in deploy
folder.
Since this is a monorepo, the build process is configured into three main groups: server
, sdk
and e2e
.
Each group modules and build order are defined in the config/projects.[name].json
. PROJECT_TYPE
variable is responsible for building a certain part of the system: server
, sdk
or e2e
.
There are shortcut scripts that are tailored for a specific type of build.
./build-sdk.sh
./build-server.sh
./build-e2e.sh
We use vsc to develop and build orbs-network.
We have committed the .vscode/extensions.json
file which contains the recommended extensions for the development of our code.
- For testing, we use a fork of
ts-sinon
, so if you get relevant build errors such asCannot find name 'Blob'
orCannot find name 'XMLHttpRequest'
, make sure package.json contains the line"ts-sinon": "https://github.com/orbs-network/ts-sinon"
and not some version number.