Skip to content

Build, Develop, Launch

Jessica Mulein edited this page Sep 14, 2021 · 9 revisions

Requirements

  • 64 bit recommended
  • >16 GB memory required
  • 32+ GB memory recommended
  • Windows 10+ recommended
  • Visual Studio 2022 recommended, Rider EAP otherwise (as of 9/12/21)
  • Docker Desktop for windows recommended
  • Recommend Windows Terminal for command line with a Git Bash session

Clone

git clone --recursive git@github.com:BrightChain/BrightChain.git

Develop

  • Use Visual Studio 2022 (preview at this time) and open All.sln

Build BrightChain Engine

cd BrightChain
dotnet build All.sln

Build BrightChain Engine nuget

  • Install nuget 6.0+ Download
  • Make sure to add ~/.nuget/packages as a local source to Visual Studio and use dotnet
cd BrightChain
dotnet pack All.sln
nuget add .... ~/.nuget/packages (?)
TODO

Build BrightChain docker container

cd BrightChain/src/BrightChain.API
docker build -t brightchainapi:latest .

Test

cd BrightChain
dotnet test All.sln

Get LetsEncrypt certs for production

$ docker run -it --rm -p 443:443 -p 80:80 --name certbot -v https:/etc/letsencrypt -v varhttps:/var/lib/letsencrypt certbot/certbot certonly --standalone
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Please enter the domain name(s) you would like on your certificate (comma and/or
space separated) (Enter 'c' to cancel): *.brightchain.net,brightchain.net,*.therevolution.network,therevolution.network
Requesting a certificate for *.brightchain.net and 3 more domains

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/brightchain.net/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/brightchain.net/privkey.pem
This certificate expires on 2021-12-11.
These files will be updated when the certificate renews.

NEXT STEPS:
- The certificate will need to be renewed before it expires. Certbot can automatically renew the certificate in the background, but you may need to take steps to enable that functionality. See https://certbot.org/renewal-setup for instructions.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
 * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
 * Donating to EFF:                    https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Launch container to production

$ docker run --rm -itd --name=brightchainapi -v https:/etc/letsencrypt -v varhttps:/var/lib/letsencrypt --privileged -p 10.2.0.4:80:80 -p 10.2.0.4:443:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=443 -e DOMAIN_NAME=brightchain.net -e USE_STAGING_SERVER=false brightchainapi:splash

Clone this wiki locally