Code Monkey home page Code Monkey logo

orbs-network-typescript's Introduction

Orbs

Note: This repo is not fully compatible with V1 of the Orbs protocol, contributions are welcomed.

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.

Preparing your system

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.

Running the script

On a fresh MacOS, run the following:

  1. xcrun --version

    This tests if XCode Command Line Tools are installed. If xcrun is not found, run xcode-select --install. This will also install git.

  2. mkdir -p ~/dev/orbs
  3. cd ~/dev/orbs
  4. 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.

  5. cd ~/dev/orbs/orbs-network
  6. chmod u+x orbs-team-member-bootstrap.sh
  7. ./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.

Configuration

Please refer to documentation in deploy/bootstrap folder.

Build (slow)

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.

Develop Effectively

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.

Running the orbs-network

Run Inside of Docker

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.

Run from host

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.

Run 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)

Deployment to AWS

Please refer to documentation in deploy folder.

Development

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

Visual Studio Code

We use vsc to develop and build orbs-network.

Recommended Extensions

We have committed the .vscode/extensions.json file which contains the recommended extensions for the development of our code.

Troubleshooting

  • For testing, we use a fork of ts-sinon, so if you get relevant build errors such as Cannot find name 'Blob' or Cannot find name 'XMLHttpRequest', make sure package.json contains the line "ts-sinon": "https://github.com/orbs-network/ts-sinon" and not some version number.

orbs-network-typescript's People

Contributors

bolshchikov avatar electricmonk avatar erankirsh avatar gadcl avatar idandash avatar idozilberberg avatar jlevison avatar lbeder avatar liorkupf avatar netoneko avatar odedwx avatar talkol avatar talorbs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

orbs-network-typescript's Issues

Build fail on build-sdk - crypto-sdk-android

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'crypto-sdk-android'.

Could not resolve all artifacts for configuration ':classpath'.
Could not resolve com.github.dcendents:android-maven-gradle-plugin:2.1.
Required by:
project :
> Could not resolve com.github.dcendents:android-maven-gradle-plugin:2.1.
> Could not get resource 'https://jcenter.bintray.com/com/github/dcendents/android-maven-gradle-plugin/2.1/android-maven-gradle-plugin-2.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/github/dcendents/android-maven-gradle-plugin/2.1/android-maven-gradle-plugin-2.1.pom'. Received status code 500 from server:
Could not resolve org.codehaus.groovy.modules.http-builder:http-builder:0.7.2.
Required by:
project : > com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0
> Skipped due to earlier error
Could not resolve org.apache.maven:maven-ant-tasks:2.1.3.
Required by:
project : > com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0
> Skipped due to earlier error
Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jre8:1.2.0.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.lint:lint-gradle-api:26.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:gradle-api:3.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.databinding:compilerCommon:3.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdk-common:26.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools.build:manifest-merger:26.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2 > com.android.tools:repository:26.1.2
> Skipped due to earlier error
Could not resolve org.ow2.asm:asm:5.1.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2
> Skipped due to earlier error
Could not resolve org.ow2.asm:asm-analysis:5.1.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2
> Skipped due to earlier error
Could not resolve org.ow2.asm:asm-commons:5.1.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2
> Skipped due to earlier error
Could not resolve org.ow2.asm:asm-util:5.1.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2
> Skipped due to earlier error
Could not resolve net.sf.jopt-simple:jopt-simple:4.9.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2
> Skipped due to earlier error
Could not resolve net.sf.proguard:proguard-gradle:5.3.3.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2
> Skipped due to earlier error
Could not resolve com.google.auto.value:auto-value:1.5.2.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:bundletool:0.1.0-alpha01
> Skipped due to earlier error
Could not resolve com.google.guava:guava:22.0.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:bundletool:0.1.0-alpha01
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.lint:lint-gradle-api:26.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:gradle-api:3.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.databinding:compilerCommon:3.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:common:26.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools.analytics-library:shared:26.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools.analytics-library:tracker:26.1.2
> Skipped due to earlier error
Could not resolve com.google.protobuf:protobuf-java:3.4.0.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:bundletool:0.1.0-alpha01
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:bundletool:0.1.0-alpha01 > com.android.tools.build:aapt2-proto:0.1.0
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdk-common:26.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools.analytics-library:protos:26.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools.analytics-library:tracker:26.1.2
> Skipped due to earlier error
Could not resolve com.google.protobuf:protobuf-java-util:3.4.0.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:bundletool:0.1.0-alpha01
> Skipped due to earlier error
Could not resolve com.google.errorprone:error_prone_annotations:2.1.2.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:bundletool:0.1.0-alpha01
> Skipped due to earlier error
Could not resolve com.squareup:javawriter:2.5.0.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2
> Skipped due to earlier error
Could not resolve org.bouncycastle:bcpkix-jdk15on:1.56.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdk-common:26.1.2
> Skipped due to earlier error
Could not resolve org.bouncycastle:bcprov-jdk15on:1.56.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdk-common:26.1.2
> Skipped due to earlier error
Could not resolve org.ow2.asm:asm-tree:5.1.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2
> Skipped due to earlier error
Could not resolve it.unimi.dsi:fastutil:7.2.0.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2
> Skipped due to earlier error
Could not resolve com.googlecode.json-simple:json-simple:1.1.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2
> Skipped due to earlier error
Could not resolve org.jetbrains.kotlin:kotlin-reflect:1.2.0.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.lint:lint-gradle-api:26.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdk-common:26.1.2
> Skipped due to earlier error
Could not resolve org.antlr:antlr4:4.5.3.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.databinding:compilerCommon:3.1.2
> Skipped due to earlier error
Could not resolve commons-io:commons-io:2.4.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.databinding:compilerCommon:3.1.2
> Skipped due to earlier error
Could not resolve com.googlecode.juniversalchardet:juniversalchardet:1.0.3.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.databinding:compilerCommon:3.1.2
> Skipped due to earlier error
Could not resolve com.squareup:javapoet:1.8.0.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.databinding:compilerCommon:3.1.2
> Skipped due to earlier error
Could not resolve com.google.code.gson:gson:2.7.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.databinding:compilerCommon:3.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools.build:manifest-merger:26.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools.analytics-library:shared:26.1.2
> Skipped due to earlier error
Could not resolve org.apache.commons:commons-compress:1.12.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2 > com.android.tools:repository:26.1.2
> Skipped due to earlier error
Could not resolve org.apache.httpcomponents:httpclient:4.2.6.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2
> Skipped due to earlier error
Could not resolve org.apache.httpcomponents:httpmime:4.1.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2
> Skipped due to earlier error
Could not resolve net.sf.kxml:kxml2:2.3.0.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools.build:manifest-merger:26.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools.ddms:ddmlib:26.1.2
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2 > com.android.tools.layoutlib:layoutlib-api:26.1.2
> Skipped due to earlier error
Could not resolve org.jetbrains:annotations:13.0.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2 > com.android.tools.layoutlib:layoutlib-api:26.1.2
> Skipped due to earlier error
Could not resolve com.sun.activation:javax.activation:1.2.0.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2 > com.android.tools:repository:26.1.2
> Skipped due to earlier error
Could not resolve org.glassfish.jaxb:jaxb-runtime:2.2.11.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2 > com.android.tools:repository:26.1.2
> Skipped due to earlier error
Could not resolve com.google.jimfs:jimfs:1.1.
Required by:
project : > com.android.tools.build:gradle:3.1.2 > com.android.tools.build:gradle-core:3.1.2 > com.android.tools.build:builder:3.1.2 > com.android.tools:sdklib:26.1.2 > com.android.tools:repository:26.1.2
> Skipped due to earlier error

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 8s
Error: Error 1 in /opt/orbs/client/crypto-sdk-android

at projects.order.forEach (/opt/orbs/build/src/build-ts.js:26:13)
at Array.forEach (<anonymous>)
at main (/opt/orbs/build/src/build-ts.js:12:18)
at Object.<anonymous> (/opt/orbs/build/src/build-ts.js:33:1)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)

error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c node build/src/build-ts.js
Directory: /opt/orbs
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "/opt/orbs/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command '/bin/sh -c ./build-sdk.sh && yarn cache clean' returned a non-zero code: 1
Exited with code 1

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.