Skip to content

Commit 0da2b49

Browse files
Cleanup react (#13)
* commit wip * Map bars (#11) * progress * growing bars * much closer * fix timeout issue * layering bars * zoomed in * layering correct * below bar * getting closer * very close * change hex formatting * don't emit skipped * shorten hex * handle no time * zoom in * remove stat card * remove timed out text * fix seed by 1 * fix multi-view tracking * dumb interface * better mobile * responsive scaling works * Working * Commonware aesthetic (#12) * mirror commonware aesthetic * nits * remove connected * fix legend colors * pretty good * make circle a little bigger * good * nits * unify locations * Seed for leader (#14) * progress * fix seed selection * add network key * fix legend * update README * fix zero issue * update zoom to 1 * remove junk * fix build errors * improve refresh rate * remove unnecessary consts * update public * add error boundary * Restore connected (#16) * restore basic connected * connection status styling * fix center
1 parent bf0b1ae commit 0da2b49

24 files changed

+19618
-8
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
*.DS_Store
33
/target
44
*.vscode
5-
/chain/assets
5+
/chain/assets
6+
/types/pkg

chain/src/actors/application/supervisor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use alto_types::leader_index;
12
use commonware_consensus::{
23
threshold_simplex::View, Activity, Proof, Supervisor as Su, ThresholdSupervisor as TSu,
34
};
@@ -8,7 +9,6 @@ use commonware_cryptography::{
89
},
910
ed25519::PublicKey,
1011
};
11-
use commonware_utils::modulo;
1212
use std::collections::HashMap;
1313

1414
/// Implementation of `commonware-consensus::Supervisor`.
@@ -73,8 +73,8 @@ impl TSu for Supervisor {
7373

7474
fn leader(&self, _: Self::Index, seed: Self::Seed) -> Option<Self::PublicKey> {
7575
let seed = seed.serialize();
76-
let index = modulo(&seed, self.participants.len() as u64);
77-
Some(self.participants[index as usize].clone())
76+
let index = leader_index(&seed, self.participants.len());
77+
Some(self.participants[index].clone())
7878
}
7979

8080
fn identity(&self, _: Self::Index) -> Option<&Self::Identity> {

explorer/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*

explorer/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# alto-explorer
2+
3+
## Populate Configuration
4+
5+
```typescript
6+
// TODO: Replace this with the indexer URL
7+
export const INDEXER_URL = "ws://localhost:4000/consensus/ws";
8+
9+
// TODO: Replace this with the consensus threshold key
10+
export const PUBLIC_KEY_HEX = "976ab7efaef8a73690b9067690ac7541bc34f74b2543e8db16b5bf63aec487758ca98efdf5c9fcf1154941d8a8a1ec3d";
11+
12+
// TODO: Replace this with an ordered list of validator locations (sorted by validator public key)
13+
export const LOCATIONS: [[number, number], string][] = [
14+
[[37.7749, -122.4194], "San Francisco"],
15+
[[51.5074, -0.1278], "London"],
16+
[[35.6895, 139.6917], "Tokyo"],
17+
[[-33.8688, 151.2093], "Sydney"],
18+
[[55.7558, 37.6173], "Moscow"],
19+
[[-23.5505, -46.6333], "Sao Paulo"],
20+
[[28.6139, 77.2090], "New Delhi"],
21+
[[40.7128, -74.0060], "New York"],
22+
[[19.4326, -99.1332], "Mexico City"],
23+
[[31.2304, 121.4737], "Shanghai"],
24+
];
25+
```
26+
27+
## Compile `alto-types`
28+
29+
```bash
30+
cd ../types
31+
wasm-pack build --release --target web
32+
mv pkg/alto_types.js ../explorer/src/alto_types
33+
mv pkg/alto_types_bg.wasm ../explorer/src/alto_types
34+
cd ../explorer
35+
```
36+
37+
## Run the app
38+
39+
```bash
40+
npm start
41+
```
42+
43+
## Build the app
44+
45+
```bash
46+
npm run build
47+
```
48+
49+
## Run the production app
50+
51+
```bash
52+
npm install -g serve
53+
serve -s build
54+
```

0 commit comments

Comments
 (0)