Merge pull request #31 from status-im/develop

Develop
This commit is contained in:
Bruno Škvorc 2019-01-25 09:37:29 +01:00 committed by GitHub
commit f7f910a7b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 157 additions and 293 deletions

6
.gitignore vendored
View File

@ -54,4 +54,8 @@ packages/*
.vagrant
.vagrant/*
.env
.env
# built assets
themes/navy/source/js/vendor.js
themes/navy/source/js/vendor.js.map

3
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "themes/navy/layout/partial/shared-partials"]
path = themes/navy/layout/partial/shared-partials
url = https://github.com/status-im/status.im-partials
[submodule "themes/navy/source/js/shared-js"]
path = themes/navy/source/js/shared-js
url = git@github.com:status-im/status-im-js.git

View File

@ -37,7 +37,11 @@ var config = {
paths: {
src: {
scss: './themes/navy/source/scss/*.scss',
js: './themes/navy/source/js/main.js',
js: [
'./themes/navy/source/js/shared-js/js/utils.js',
'./themes/navy/source/js/shared-js/js/popups.js',
'./themes/navy/source/js/main.js',
]
},
dist: {
css: './public/css',

View File

@ -13,13 +13,14 @@
"update-submodules": "git submodule update --recursive --remote"
},
"dependencies": {
"gulp": "^3.9.1",
"cheerio": "^0.20.0",
"gulp": "^3.9.1",
"hexo": "^3.7.1",
"hexo-deployer-git": "^0.3.1",
"hexo-generator-archive": "^0.1.4",
"hexo-generator-feed": "^1.1.0",
"hexo-generator-sitemap": "^1.1.2",
"hexo-renderer-ejs": "^0.3.1",
"hexo-renderer-jade": "^0.4.1",
"hexo-renderer-marked": "^0.2.10",
"hexo-renderer-stylus": "^0.3.1",

View File

@ -8,30 +8,108 @@ This document will explain how to install, test, and run Nimbus on your local ma
## Getting Started
- [install Nim](https://bitfalls.com/nim1)
- be on a command-line friendly system (i.e. access to Terminal / Console / Git Bash / Powershell)
- be on a command-line friendly system (i.e. access to Terminal / Console / Cmder / [Git Bash](https://git-scm.com) / Powershell)
## Prerequisites
Alternatively, [download our pre-configured Vagrant box](https://our.status.im/setting-up-a-local-vagrant-environment-for-nim-development/).
- install [RocksDB](https://rocksdb.org/) via official instructions or by running the below commands:
_Note: the Nimbus build system uses Makefiles to make the process identical across platforms, easy to update, and compatible with any OS. We don't use Nim's package manager Nimble because it's fundamentally broken._
- on OS X:
```bash
brew install rocksdb
curl https://nim-lang.org/choosenim/init.sh -sSf | sh
```
- on Linux
```bash
sudo apt-get install librocksdb-dev rocksdb # or your own Linux distribution's equivalent
curl https://nim-lang.org/choosenim/init.sh -sSf | sh
```
## Install Nimbus
### Installing
Clone Nimbus.
```bash
git clone https://github.com/status-im/nimbus
git clone git@github.com:status-im/nimbus
cd nimbus
nimble install
nimble test
```
### Dependencies
To run Nimbus, we'll need the RocksDB database and a newer version of Nim. On OS X, execute:
```bash
brew install rocksdb
curl https://nim-lang.org/choosenim/init.sh -sSf | sh
```
Run Nimbus with `nimbus` or look at flags and options with `nimbus --help`.
On Linux, this should do it:
```bash
sudo apt-get install librocksdb-dev rocksdb # or your own Linux distribution's equivalent
curl https://nim-lang.org/choosenim/init.sh -sSf | sh
```
On Windows, please first make sure you have `make` installed - either in the form of `MinGW32make.exe` via [MinGW website](http://www.mingw.org) or regular old make installed through Git Bash or a package manager like Chocolatey:
```bash
choco install make
```
_Note - Windows requires you to add programs you want to be able to execute from anywhere on your machine to your PATH environment variable. This is done by simply opening the Start Menu, searching for "Env", selecting "Edit the system environment variables", clicking on Environment Variables in the popup, and then editing the PATH variable in the list by adding a new entry that corresponds to the folder into which you installed your version of `make` (Choco takes care of this for you, only applies if you installed manually). [This is what mine looks like](https://imgur.com/a/yQIi6Qa)._
Next, run:
```
make fetch-dlls
```
or
```
mingw32make.exe fetch-dlls
```
This downloads the rocksdb and sqlitedb DLL files into `nimbus/build` so that the built program can read them.
_In the content below, `make` will refer to `make` or `mingw32.exe`, depending on which you're using. Make the change to your commands accordingly._
### Building, Testing, Running
To build Nimbus:
On OS X / Linux:
```bash
make
```
The Nimbus client will now be in `build/nimbus` on any OS and can be run with the same command:
```bash
./build/nimbus
```
It should synchronize up to block 49439 and then crash, as mentioned above. Look at flags and options with `build/nimbus --help`.
To test, run:
```bash
make test
```
To update the source files for a rebuild:
```bash
make update
```
To clean the slate and start with a fresh build:
```bash
make clean
```
### Ethereum 2.0
To run and test the Ethereum 2.0 version of Nimbus (the network simulation):
```bash
make eth2_network_simulation
```
You should now see attestations and blocks being produced and confirmed and a bunch of other details from the nodes as they do their thing.
![Beacon nodes communicating](/img/beacon.jpg)
---
Congrats! You're now running Nimbus for both the Ethereum 1.0 platform, and the coming [Ethereum 2.0](https://our.status.im/tag/two-point-oh).

View File

@ -42,4 +42,4 @@ Within the community at large, we will promote Ethereum as the leader of scalabl
## Bounty-Based Development
To entice the community to accelerate the development, we will attach bounties to and **[publish](https://openbounty.status.im/app#/)** the tasks that can be self-contained and defined clearly.
To entice the community to accelerate the development, we will attach bounties to and **[publish](https://openbounty.status.im/app#/)** the tasks that can be self-contained and defined clearly. We'll also have bounties [on Gitcoin](https://gitcoin.co/explorer?keywords=nimbus&order_by=-web3_created).

View File

@ -8,12 +8,12 @@ In talking to people both familiar and complete strangers to Ethereum clients, t
### Q: When do you expect to have it production-ready?
Not for a while. Sharding is a long ways off, and until then we'll be focusing on getting Ethereum v1 tests to pass in our full node mode. The full node will be ready in 2019, but the super-light implementation might take longer.
Soon. We've got some network simulations already running for [Ethereum 2.0](https://out.status.im/tag/two-point-oh), and we're syncing up to block 50000 on Ethereum 1.0. To stay in the loop, please follow our development updates on [our blog](https://our.status.im/tag/nimbus).
### Q: How is a super-light node different from just calling Infura through Web3js?
A Web3js or any similar JavaScript package for communicating with the blockchain is basically a more advanced XMLHttpRequest / Fetch wrapper. What we mean by this is that these packages retrieve information from another node and trust it implicitly. They ask "has this transaction been confirmed?" and get a response that's either "yes" or "that transaction is unknown". With light nodes, they ask "give me the data to check if this transaction has been confirmed" and then check on their own. This is a trust-minimized setup which combines the best of both worlds - very little storage and processing power required while allowing for cryptographic verification of the full node's claims.
### Q: What's the plan for mobile? You speak of deploying to mobile devices, but Nimbus only compiles to C, C++ and JavaScript and iOS and Android don't support C natively. Will you be compiling to JS and deploying with a web wrapper? That doesn't sound performant!
### Q: What's the plan for mobile?
Native compiles with Nim work for both Android and iOS, just like geth written in go works. It's all NDK/C API. We'll soon have published specific instructions on how to compile it for all manner of devices.
While true that Nimbus only compiles to C, C++ and JavaScript and iOS and Android don't support C natively (and we definitely don't want a JS version of Nimbus running on a mobile device), native compiles with Nim work for both Android and iOS, just like geth written in go works. It's all NDK/C API. We'll soon have published specific instructions on how to compile it for all manner of devices, but you can already give it a go by following the [build instructions](/docs/building.html).

View File

@ -17,11 +17,6 @@ With a keen interest and background in peer-to-peer applications and compilers,
Mamy joined Status as a Nim developer in the research team. After a career in leading American and French banks and non-profits, he decided that tech, blockchain and AI will eat the world. On the side, instead of mining he is teaching deep learning tricks to his GPU.
### [Ryan Lipscombe](https://github.com/coffeepots)
Fascinated by the transformative potential of blockchain and distributed systems, Ryan joined Status research as a Nim developer. His career spans from data science to embedded systems and has been part of the Nim community since 2015, working on database components and virtual machines for evolutionary systems.
### [Yuriy Glukhov](https://github.com/yglukhov)
Yuriy has deep passion for new technologies and keen interest in many areas of IT. He was one of the first CTOs to successfully use Nim in a commercial project.
@ -39,6 +34,14 @@ Dustin is the team's Pure Quickwitted Indianglassfish.
Bruno is the technical writer and team's DX guy. He's been in blockchain for 3 years after 15 years of web. His passion for decentralization and forwarding the world's truly censorship-free internet is what drove him to Nimbus. What little free time he has, he tries to spend on sports, board games and VR. You can add him on Oculus and Steam as theswader.
### [Peter Munch-Ellingsen](https://github.com/PMunch)
Peter has been working with Nim since discovering it during his studies back in 2016. Since a young age he's been interested in programming. Starting out with games, but touching in on everything from web to high-performance and distributed computing through his work and studies.
### [Ștefan Talpalaru](https://github.com/stefantalpalaru)
Ștefan comes from a decade of professional web development and a decade and a half of amateur free software contributions in a wide range of domains and programming languages. His claim to fame in the Nim world is the grafting of a Go runtime to the Nim compiler by way of the pluggable garbage collector API.
# ETYMOLOGY
Nimbus is a reference to:

View File

@ -5,7 +5,7 @@
<p>Researching and implementing lighter Ethereum 2.0 clients </p>
<div class="intro-buttons">
<a class="button button--main" href="https://gitter.im/status-im/nimbus">JOIN OUR GITTER</a>
<a class="button button--main" href="/docs/">GET INVOLVED</a>
<a class="button button--main" href="/docs/">DOCUMENTATION</a>
</div>
</div>
</div>
@ -14,7 +14,7 @@
<h2 id="top-header">Research for Scale</h2>
<p>Nimbus is a research project and a client implementation for Ethereum 2.0 designed to perform well on embedded systems and personal mobile devices, including older smartphones with resource-restricted hardware.
</p>
<a href="https://github.com/status-im/nimbus">See our repos <img src="../img/arrow_orange.svg" /></a>
<a href="https://github.com/status-im?utf8=%E2%9C%93&q=nim&type=&language=">See our repos <img src="../img/arrow_orange.svg" /></a>
<div class="work-items">
<div class="work-item">
@ -65,8 +65,8 @@
<h3>Join the Team</h3>
<p>We are always looking for passionate and talented individuals to join our team.
<p>
<a href="https://status.im/open-positions.html">See list of open roles</a>
<span><a href="https://status.im/open-positions.html"><img src="../img/arrow_ogn.png" /></a></span>
<a href="https://status.im/contribute/open_positions.html">See list of open roles</a>
<span><a href="https://status.im/contribute/open_positions.html"><img src="../img/arrow_ogn.png" /></a></span>
</div>
<div class="contribute">
<h3>Work on Bounties</h3>
@ -112,15 +112,6 @@
<span><a href="https://github.com/mratsim"><img src="../img/arrow_ogn.png" /></a></span>
</p>
</div>
<div class="contribute">
<img class="contributor" src="../img/ryan.jpg" />
<h3>Ryan Lipscombe</h3>
<p><a href="https://get.status.im/user/0x042afe271620ea84c73e5f8f6846172c74851f4cbe7261b260742337a7f178a17d64738b211c9c5ce6f898bafbf073d61f0a55758e2f48e982dc0de665e6cb79dd
" style="color: #939ba1;">Descriptive Liquid Nightcrawler</a></p>
<p><a href="https://github.com/coffeepots">See Github profile</a>
<span><a href="https://github.com/coffeepots"><img src="../img/arrow_ogn.png" /></a></span>
</p>
</div>
<div class="contribute">
<img class="contributor" src="../img/zahary.jpg" />
<h3>Zahary Karadjov</h3>
@ -145,14 +136,30 @@
<a href="https://github.com/tersec">See Github profile</a>
<span><a href="https://github.com/tersec"><img src="../img/arrow_ogn.png" /></a></span></p>
</div>
<div class="contribute">
<img class="contributor" src="../img/bruno.jpg" />
<h3>Bruno Skvorc</h3>
<p><a href="https://get.status.im/user/0x04ec0447abf1a0f7308b1acd52d0c4db6ebf287f7aea4588ff3a8e943143c4c3852cdf1b89474b829428e9ec1041d9ba47975b6154f970bf13f2ea2d87707d7276" style="color: #939ba1;">Sarcastic General BlackRussianTerrier</a></p>
<p><a href="https://github.com/swader">See Github profile</a>
<span><a href="https://github.com/swader"><img src="../img/arrow_ogn.png" /></a></span>
</p>
</div>
<div class="contribute">
<img class="contributor" src="../img/bruno.jpg" />
<h3>Bruno Skvorc</h3>
<p><a href="https://get.status.im/user/0x04ec0447abf1a0f7308b1acd52d0c4db6ebf287f7aea4588ff3a8e943143c4c3852cdf1b89474b829428e9ec1041d9ba47975b6154f970bf13f2ea2d87707d7276" style="color: #939ba1;">Sarcastic General BlackRussianTerrier</a></p>
<p><a href="https://github.com/swader">See Github profile</a>
<span><a href="https://github.com/swader"><img src="../img/arrow_ogn.png" /></a></span>
</p>
</div>
<div class="contribute">
<img class="contributor" src="../img/peter.jpg" />
<h3>Peter Munch-Ellingsen</h3>
<p><a href="https://get.status.im/user/0x04910559b94b70d7c2cd7237f2e6ef3b8110c5fc726e7ef40fc9f3c59eeece2efb69bc9a255a8064f061e16a7b8149fae43ec81559199a50b46f6e4ff8e029c0fe" style="color: #939ba1;">Imaginative Admirable Elephant</a></p>
<p><a href="https://github.com/PMunch">See Github profile</a>
<span><a href="https://github.com/PMunch"><img src="../img/arrow_ogn.png" /></a></span>
</p>
</div>
<div class="contribute">
<img class="contributor" src="../img/stefan.jpg" />
<h3>Ștefan Talpalaru</h3>
<p><a href="https://get.status.im/user/0x0479be6aeb209d22f81363d8fc2d199e9cf8edf75731df6d5e4c7f9cb411afaecfd55088e2c8634877203df1f605bf7daaf07245012af2f206d388b80046a0abe8" style="color: #939ba1;">Teeming Frayed Argali</a></p>
<p><a href="https://github.com/stefantalpalaru">See Github profile</a>
<span><a href="https://github.com/stefantalpalaru"><img src="../img/arrow_ogn.png" /></a></span>
</p>
</div>
</div>
<div class="inner-header">
<h2>Read our Blog</h2>

@ -1 +1 @@
Subproject commit ef5db8a4de18fe58b1e5e44c7b7f965b13850a91
Subproject commit 1aac6836d674dbd9006775345a947cf7a8783752

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -63,43 +63,8 @@ $(document).ready(function () {
/* Popups */
let community = document.querySelectorAll(".item--dropdown-community")[0]
let projects = document.querySelectorAll(".item--dropdown-projects")[0]
let popups = document.querySelectorAll(".popup-wrap")
let overlays = document.querySelectorAll(".popup-overlay")
let closeButtons = document.querySelectorAll(".popup__button--close")
let activePopup = null;
let activeOverlay = null;
community.addEventListener('click', function(event){
showPopup(popups[0])
event.preventDefault()
})
projects.addEventListener('click', function(event){
showPopup(popups[1])
event.preventDefault()
})
closeButtons.forEach((button) => {
button.addEventListener('click', closeActivePopup)
})
overlays.forEach((overlay) => {
overlay.addEventListener('click', closeActivePopup)
})
function showPopup(whichPopup) {
activePopup = whichPopup
addClassToElement(whichPopup, "popup--shown");
}
function closeActivePopup() {
removeClassFromElement(activePopup, "popup--shown");
activePopup = null;
}
var addClassToElement = require('./shared-js/js/utils').addClassToElement;
var removeClassFromElement = require('./shared-js/js/utils').removeClassFromElement;
/* Code highlighting */
@ -153,19 +118,4 @@ function showNav() {
function closeNav() {
removeClassFromElement(nav, "mobile-nav--shown");
}
/*--- Utils ---*/
function addClassToElement(element, className) {
(element.classList) ? element.classList.add(className) : element.className += ' ' + className
return element
}
function removeClassFromElement(element, className) {
if(element.classList) {
element.classList.remove(className)
} else {
element.className = element.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ')
}
return element
}
}

@ -0,0 +1 @@
Subproject commit 24185e51517464988a80e3223417a4b3183c7954

View File

@ -1,172 +0,0 @@
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
$(document).ready(function () {
// Fixes Parallax effect and div to popup overlapping with the main menu options
$('div#container').append($('.popup-wrap.popup-wrap--community')[0]);
$('div#container').append($('.popup-wrap.popup-wrap--projects')[0]);
let url = 'https://our.status.im/ghost/api/v0.1/posts/?filter=tag:nimbus&order=published_at%20desc&limit=3&formats=plaintext&client_id=ghost-frontend&client_secret=2b055fcd57ba';
var urlBase = [location.protocol, '//', location.host, location.pathname].join('');
$.ajax({
type: "get",
url: url,
success: function (response) {
response.posts = response.posts.reverse();
$.each(response.posts, function (index, val) {
var excerpt = '';
if (val.custom_excerpt != null) {
excerpt = val.custom_excerpt;
} else {
excerpt = getWords(val.plaintext);
}
$('.contribute-wrap-blog').prepend('<div class="contribute blog"><a href="https://our.status.im/' + val.slug + '" class="feature-image"><img src="https://our.status.im/' + val.feature_image + '" alt="' + val.title + '"></a><h3><a href="https://our.status.im/' + val.slug + '">' + val.title + '</a></h3><p>' + excerpt + '</p><a href="https://our.status.im/' + val.slug + '">Read More <img src="' + urlBase + '/img/arrow_ogn.png" /></a></div>');
});
}
});
function getWords(str) {
return str.split(/\s+/).slice(0, 25).join(" ");
}
var months = { '01': 'Jan', '02': 'Feb', '03': 'Mar', '04': 'Apr', '05': 'May', '06': 'Jun', '07': 'Jul', '08': 'Aug', '09': 'Sep', '10': 'Oct', '11': 'Nov', '12': 'Dec' };
url = 'https://our.status.im/ghost/api/v0.1/posts/?order=published_at%20desc&limit=2&formats=plaintext&client_id=ghost-frontend&client_secret=2b055fcd57ba';
$.ajax({
type: "get",
url: url,
success: function (response) {
response.posts = response.posts.reverse();
$.each(response.posts, function (index, val) {
var excerpt = '';
if (val.custom_excerpt != null) {
excerpt = val.custom_excerpt;
} else {
excerpt = getWords(val.plaintext);
}
var newDate = new Date(val.published_at);
var minutes = newDate.getMinutes();
minutes = minutes + "";
if (minutes.length == 1) {
minutes = '0' + minutes;
}
$('.latest-posts').prepend(' \
<div class="post"> \
<time>' + newDate.getDate() + ' ' + months[newDate.getMonth() + 1] + ' at ' + newDate.getHours() + ':' + minutes + '</time> \
<h4><a href="https://our.status.im/' + val.slug + '">' + val.title + '</a></h3> \
</div> \
');
});
}
});
});
/* Popups */
let community = document.querySelectorAll(".item--dropdown-community")[0];
let projects = document.querySelectorAll(".item--dropdown-projects")[0];
let popups = document.querySelectorAll(".popup-wrap");
let overlays = document.querySelectorAll(".popup-overlay");
let closeButtons = document.querySelectorAll(".popup__button--close");
let activePopup = null;
let activeOverlay = null;
community.addEventListener('click', function (event) {
showPopup(popups[0]);
event.preventDefault();
});
projects.addEventListener('click', function (event) {
showPopup(popups[1]);
event.preventDefault();
});
closeButtons.forEach(button => {
button.addEventListener('click', closeActivePopup);
});
overlays.forEach(overlay => {
overlay.addEventListener('click', closeActivePopup);
});
function showPopup(whichPopup) {
activePopup = whichPopup;
addClassToElement(whichPopup, "popup--shown");
}
function closeActivePopup() {
removeClassFromElement(activePopup, "popup--shown");
activePopup = null;
}
/* Code highlighting */
function highlight() {
$('pre code').each(function (i, block) {
hljs.highlightBlock(block);
});
}
$(document).ready(function () {
try {
highlight();
} catch (err) {
console.log("retrying...");
setTimeout(function () {
highlight();
}, 2500);
}
var clipboard = new ClipboardJS(".btn");
clipboard.on('success', function (e) {
var id = $(e.trigger).attr("data-clipboard-target");
$(id).toggleClass("flash");
setTimeout(function () {
$(id).toggleClass("flash");
}, 200);
e.clearSelection();
});
});
/* Mobile Nav */
let moreLink = document.querySelectorAll(".item--more")[0];
let nav = document.querySelectorAll(".mobile-nav-wrap")[0];
let navOverlay = document.querySelectorAll(".mobile-nav-overlay")[0];
let navCloseButton = document.querySelectorAll(".mobile-nav-close")[0];
moreLink.addEventListener('click', function (event) {
showNav();
event.preventDefault();
});
navCloseButton.addEventListener('click', closeNav);
navOverlay.addEventListener('click', closeNav);
function showNav() {
addClassToElement(nav, "mobile-nav--shown");
}
function closeNav() {
removeClassFromElement(nav, "mobile-nav--shown");
}
/*--- Utils ---*/
function addClassToElement(element, className) {
element.classList ? element.classList.add(className) : element.className += ' ' + className;
return element;
}
function removeClassFromElement(element, className) {
if (element.classList) {
element.classList.remove(className);
} else {
element.className = element.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
}
return element;
}
},{}]},{},[1])
//# sourceMappingURL=vendor.js.map

File diff suppressed because one or more lines are too long