Skip to content

Commit

Permalink
Chore: Modified default data directory & README
Browse files Browse the repository at this point in the history
  • Loading branch information
emailnjv committed Jun 4, 2024
1 parent 4ab7337 commit 2cee0ae
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 51 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/projects.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ docs/book/
/target

# Sidechain
/.bob
/.alys
/data/execution
/data/logs

Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,10 @@ cargo run --bin app -- \
--chain data/chain.json \
--aura-secret-key 0000000000000000000000000000000000000000000000000000000000000001 \
--geth-url http://localhost:8551/ \
--db-path .bob/chain_db0/ \
--db-path .alys/chain_db0/ \
--rpc-port 3000 \
--mine \
--wallet-path .bob/wallet0 \
--wallet-path .alys/wallet0 \
--bitcoin-secret-key 0000000000000000000000000000000000000000000000000000000000000001 \
--bitcoin-rpc-url localhost:18443 \
--bitcoin-rpc-user rpcuser \
Expand All @@ -329,10 +329,10 @@ cargo run --bin app -- \
--chain data/chain.json \
--aura-secret-key 0000000000000000000000000000000000000000000000000000000000000002 \
--geth-url http://localhost:8561/ \
--db-path .bob/chain_db1/ \
--db-path .alys/chain_db1/ \
--rpc-port 3001 \
--mine \
--wallet-path .bob/wallet1 \
--wallet-path .alys/wallet1 \
--bitcoin-secret-key 0000000000000000000000000000000000000000000000000000000000000002 \
--bitcoin-rpc-url localhost:18443 \
--bitcoin-rpc-user rpcuser \
Expand All @@ -346,10 +346,10 @@ cargo run --bin app -- \
--chain data/chain.json \
--aura-secret-key 0000000000000000000000000000000000000000000000000000000000000003 \
--geth-url http://localhost:8571/ \
--db-path .bob/chain_db2/ \
--db-path .alys/chain_db2/ \
--rpc-port 3002 \
--mine \
--wallet-path .bob/wallet2 \
--wallet-path .alys/wallet2 \
--bitcoin-secret-key 0000000000000000000000000000000000000000000000000000000000000003 \
--bitcoin-rpc-url localhost:18443 \
--bitcoin-rpc-user rpcuser \
Expand All @@ -365,10 +365,10 @@ cargo run --bin app -- \
--chain data/chain.json \
--aura-secret-key 0000000000000000000000000000000000000000000000000000000000000001 \
--geth-url http://localhost:8551/ \
--db-path .bob/chain_db0/ \
--db-path .alys/chain_db0/ \
--rpc-port 3000 \
--mine \
--wallet-path .bob/wallet0 \
--wallet-path .alys/wallet0 \
--bitcoin-secret-key 0000000000000000000000000000000000000000000000000000000000000001 \
--bitcoin-rpc-url localhost:18332 \
--bitcoin-rpc-user rpcuser \
Expand All @@ -383,10 +383,10 @@ cargo run --bin app -- \
--chain data/chain.json \
--aura-secret-key 0000000000000000000000000000000000000000000000000000000000000002 \
--geth-url http://localhost:8561/ \
--db-path .bob/chain_db1/ \
--db-path .alys/chain_db1/ \
--rpc-port 3001 \
--mine \
--wallet-path .bob/wallet1 \
--wallet-path .alys/wallet1 \
--bitcoin-secret-key 0000000000000000000000000000000000000000000000000000000000000002 \
--bitcoin-rpc-url localhost:18332 \
--bitcoin-rpc-user rpcuser \
Expand All @@ -401,10 +401,10 @@ cargo run --bin app -- \
--chain data/chain.json \
--aura-secret-key 0000000000000000000000000000000000000000000000000000000000000003 \
--geth-url http://localhost:8571/ \
--db-path .bob/chain_db2/ \
--db-path .alys/chain_db2/ \
--rpc-port 3002 \
--mine \
--wallet-path .bob/wallet2 \
--wallet-path .alys/wallet2 \
--bitcoin-secret-key 0000000000000000000000000000000000000000000000000000000000000003 \
--bitcoin-rpc-url localhost:18332 \
--bitcoin-rpc-user rpcuser \
Expand Down Expand Up @@ -444,9 +444,9 @@ Running a full node is similar to running a federation node. The main difference
cargo run --bin app -- \
--chain data/chain.json \
--geth-url http://localhost:8551/ \
--db-path .bob/chain_db0/ \
--db-path .alys/chain_db0/ \
--rpc-port 3000 \
--wallet-path .bob/wallet0 \
--wallet-path .alys/wallet0 \
--bitcoin-rpc-url localhost:18332 \
--bitcoin-rpc-user rpcuser \
--bitcoin-rpc-pass rpcpassword \
Expand Down
2 changes: 1 addition & 1 deletion app/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use strum::{EnumString, IntoStaticStr};
use tracing::*;
use types::{EthSpec, Hash256, MainnetEthSpec};

pub const DEFAULT_ROOT_DIR: &str = ".bob";
pub const DEFAULT_ROOT_DIR: &str = ".alys";

pub const HEAD_KEY: Hash256 = Hash256::repeat_byte(5);
pub const LATEST_POW_BLOCK_KEY: Hash256 = Hash256::repeat_byte(6);
Expand Down
4 changes: 1 addition & 3 deletions docs/src/merged-mining.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Federation consensus nodes create signed blocks optimistically by collecting tra

If no valid PoW mined blocks are generated for a pre-defined timeout period, the rollup/sidechain considers this a consensus failure and block production is halted - until a mined block is found.

More details can be found in the paper [Optimistically Sequenced Merged Mining](https://gobob.xyz/optimine).

## Preliminaries

**Actors**
Expand Down Expand Up @@ -88,7 +86,7 @@ Figure 2: Overview of the Alice Architecture
In black, we show the interaction between the Alice sidechain nodes (authority nodes) and the miner (mining pool):

- Authority nodes are responsible for block production and verification as part of the PoA consensus protocol.
- The authority nodes run the consensus client and the execution client (geth). Alice implements a [custom consensus client](https://github.com/bob-collective/merged-bob/tree/main/app) integrated with vanilla [go-ethereum](https://github.com/ethereum/go-ethereum) as an execution client that interfaces via the [Engine API](https://hackmd.io/@danielrachi/engine_api). This means Alice adopts the [same architecture as the PoS Ethereum clients](https://ethresear.ch/t/eth1-eth2-client-relationship/7248).
- The authority nodes run the consensus client and the execution client (geth). Alice implements a custom consensus client integrated with vanilla [go-ethereum](https://github.com/ethereum/go-ethereum) as an execution client that interfaces via the [Engine API](https://hackmd.io/@danielrachi/engine_api). This means Alice adopts the [same architecture as the PoS Ethereum clients](https://ethresear.ch/t/eth1-eth2-client-relationship/7248).
- The execution client is responsible for transaction gossiping, executing transactions and smart contracts. Alice does not modify geth and therefore, other execution clients such as [reth](https://github.com/paradigmxyz/reth) can also be used.
- The consensus client is responsible for block gossiping, block production, and finalization. The leader of the current slot proposes a block to the other federation members (to their authority nodes). The other federation members approve the blocks by signing the block.
- The consensus and execution client communicate via the via the `getPayload` and `newPayload` RPCs.
Expand Down
5 changes: 3 additions & 2 deletions scripts/start_geth.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash
# includes

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
. $SCRIPT_DIR/utils/geth.sh

trap stop_all_geth SIGINT

if [[ -z "${NUM}" ]]; then
# when running dev mode (single node)
rm -rf ".bob/chain_db"
rm -rf ".bob/wallet"
rm -rf ".alys/chain_db"
rm -rf ".alys/wallet"
fi

mkdir -p data/logs/
Expand Down
12 changes: 6 additions & 6 deletions scripts/utils/chain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ function resume_chain() {
$PWD/target/debug/app \
--chain $PWD/data/chain.json \
--geth-url "http://localhost:${AUTHRPC_PORT}/" \
--db-path "$PWD/.bob/chain_db${NUM}" \
--db-path "$PWD/.alys/chain_db${NUM}" \
--rpc-port $((3000 + $1)) \
--wallet-path "$PWD/.bob/wallet${NUM}" \
--wallet-path "$PWD/.alys/wallet${NUM}" \
--bitcoin-rpc-url http://localhost:18443 \
--bitcoin-rpc-user rpcuser \
--bitcoin-rpc-pass rpcpassword \
Expand All @@ -43,8 +43,8 @@ function resume_chain() {
function start_chain_from_genesis() {
NUM=$1

rm -rf "${PWD}/.bob/chain_db${NUM}"
rm -rf "${PWD}/.bob/wallet${NUM}"
rm -rf "${PWD}/.alys/chain_db${NUM}"
rm -rf "${PWD}/.alys/wallet${NUM}"
echo "" > $PWD/data/logs/app${NUM}.txt

resume_chain $NUM
Expand All @@ -60,8 +60,8 @@ function start_multiple_chain() {
function start_full_node_from_genesis() {
NUM=$1

rm -rf "${PWD}/.bob/chain_db${NUM}"
rm -rf "${PWD}/.bob/wallet${NUM}"
rm -rf "${PWD}/.alys/chain_db${NUM}"
rm -rf "${PWD}/.alys/wallet${NUM}"
echo "" > $PWD/data/logs/app${NUM}.txt

FULL_NODE=1
Expand Down
3 changes: 2 additions & 1 deletion scripts/utils/geth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ function start_geth() {
WS_PORT=$((8546 + $NUM * 10))
PORT=$((30303 + $NUM * 10))

geth init --datadir "./data/execution/node${NUM}" ./data/genesis.json > "$PWD/data/logs/geth${NUM}.txt" 2>&1
geth init --state.scheme "hash" --datadir "./data/execution/node${NUM}" ./data/genesis.json > "$PWD/data/logs/geth${NUM}.txt" 2>&1
geth --datadir "./data/execution/node${NUM}" \
--state.scheme "hash" \
--networkid 212121 \
--authrpc.vhosts "*" \
--authrpc.addr "0.0.0.0" \
Expand Down

0 comments on commit 2cee0ae

Please sign in to comment.