Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: config structs are directly mapped onto toml config #4006

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
4446da0
[wip] chore: update launchpad for dibbler
philipr-za Jan 27, 2022
79a6d53
Fix launchpad configs and FE for dibbler
CjS77 Jan 28, 2022
8c6539e
Fix clippy
CjS77 Jan 28, 2022
5bcf311
Define versioning better
CjS77 Jan 28, 2022
147ebfc
Merge branch 'development' into philipr-za-philip-launchpad-todo
Jan 28, 2022
c6dcb14
Pull tor configuration out into helper method
CjS77 Jan 30, 2022
a0ba44f
Mining node configuration
CjS77 Jan 30, 2022
d055abe
Remove mining_node config variables from global
CjS77 Jan 30, 2022
beb10c2
Use auto-merge config for Tari Merge Mining Proxy
CjS77 Jan 30, 2022
216bb20
Merge remote-tracking branch 'origin/philipr-za-philip-launchpad-todo…
CjS77 Jan 30, 2022
92e86dc
Update configs and formatting
CjS77 Jan 31, 2022
22ef52e
Convert most printlkns to log messages
CjS77 Jan 31, 2022
f441125
Allow arb network strings & optimise dockerfiles
CjS77 Jan 31, 2022
713bb38
Fix up tests
CjS77 Feb 1, 2022
b3eef8b
Merge branch 'development' into philipr-za-philip-launchpad-todo
stringhandler Feb 2, 2022
0ff4f2b
merge fixes
stringhandler Feb 3, 2022
e68f5bd
default mm proxy config
stringhandler Feb 4, 2022
43cc8bb
fix for windows defaults
stringhandler Feb 7, 2022
33bc050
remove data folder
stringhandler Feb 9, 2022
80caabc
add back .gitkeep
stringhandler Feb 9, 2022
a3a781d
Merge branch 'development' into philipr-za-philip-launchpad-todo
stringhandler Feb 9, 2022
a16ba81
add back .gitkeep
stringhandler Feb 9, 2022
534b9ef
fix clippy
stringhandler Feb 9, 2022
7b5e19d
Merge branch 'development' into philipr-za-philip-launchpad-todo
stringhandler Feb 9, 2022
48827a6
fix cucumber
stringhandler Feb 10, 2022
187161c
wip
stringhandler Feb 17, 2022
d2da8cf
wip
stringhandler Feb 17, 2022
f2d52af
wip
stringhandler Feb 21, 2022
1994c9c
wip
stringhandler Feb 21, 2022
6083baa
compiling
stringhandler Mar 14, 2022
9fca9f3
Merge branch 'development' into philipr-za-philip-launchpad-todo
stringhandler Mar 14, 2022
aa28c3d
compiling
stringhandler Mar 14, 2022
a54e6e3
Merge branch 'development' into philipr-za-philip-launchpad-todo
stringhandler Mar 15, 2022
ce18042
common cli
stringhandler Mar 16, 2022
39e154d
merge mining config
stringhandler Mar 17, 2022
da7f9bb
add config overrides
stringhandler Mar 18, 2022
427543c
tor basics
stringhandler Mar 24, 2022
0cfef17
base node starting
stringhandler Mar 28, 2022
3148e94
wallet starting
stringhandler Mar 29, 2022
4e36ad4
Merge branch 'development' into philipr-za-philip-launchpad-todo
stringhandler Mar 29, 2022
e05f6d7
after merge
stringhandler Mar 29, 2022
a32bafe
fix clippies
stringhandler Mar 29, 2022
43bc90e
more fixes
stringhandler Mar 30, 2022
f6212e6
Merge branch 'development' into philipr-za-philip-launchpad-todo
stringhandler Mar 30, 2022
c401d3c
more fixes
stringhandler Mar 30, 2022
49551b1
working except stack overflow
stringhandler Mar 30, 2022
f551870
cucumber
stringhandler Mar 31, 2022
7a0c594
Merge branch 'development' into philipr-za-philip-launchpad-todo
sdbondi Mar 31, 2022
e8c9b30
Add ApplicationConfig and refactor CommsTransport structs
sdbondi Apr 1, 2022
9590a4d
Completed base node config
sdbondi Apr 4, 2022
4a22da7
Console wallet done
sdbondi Apr 4, 2022
afc790d
Console wallet done
sdbondi Apr 4, 2022
6acaa9e
validator node + other apps done
sdbondi Apr 4, 2022
0caa36f
Merge branch 'philipr-za-philip-launchpad-todo' of github.com:sdbondi…
sdbondi Apr 4, 2022
e4eba71
Merge branch 'development' into philipr-za-philip-launchpad-todo
sdbondi Apr 4, 2022
726c21e
Collectibles done
sdbondi Apr 5, 2022
b088281
wip
sdbondi Apr 5, 2022
e3ae54b
Merge branch 'development' into philipr-za-philip-launchpad-todo
sdbondi Apr 6, 2022
8d521f9
merge errors
sdbondi Apr 6, 2022
2e1237a
configs
sdbondi Apr 6, 2022
7ab3dd8
Merge branch 'development' into refactor-config
sdbondi Apr 6, 2022
4864bb7
fix tests
sdbondi Apr 6, 2022
b6255e3
Merge branch 'development' into refactor-structs-as-config
sdbondi Apr 6, 2022
a424a12
license ignore vue files
sdbondi Apr 6, 2022
7a6346c
ignore dead code in launchpad for now
sdbondi Apr 6, 2022
d1f36ce
fix libtor
sdbondi Apr 6, 2022
3ebcdca
clippy fix + npm lockfile fix (hopefully)
sdbondi Apr 6, 2022
65abe55
use erbium for node checks
sdbondi Apr 6, 2022
b6ccf0f
clippy fix + cucumber fix
sdbondi Apr 6, 2022
f77dbf2
Merge branch 'development' into refactor-structs-as-config
sdbondi Apr 6, 2022
0d6140f
cucumber
sdbondi Apr 6, 2022
7df2df7
many cucumber fixes
sdbondi Apr 7, 2022
2636961
Merge branch 'development' into refactor-structs-as-config
sdbondi Apr 7, 2022
08bc6f8
Merge branch 'development' into refactor-structs-as-config
sdbondi Apr 7, 2022
b16c765
fix test
sdbondi Apr 8, 2022
b06f6ee
cucumber fixes
sdbondi Apr 8, 2022
696dcd6
use chain metadata in sync decide and remove extra conig item from st…
sdbondi Apr 8, 2022
20a1e7d
compile ffi in cucumbers
sdbondi Apr 8, 2022
90cc49e
Merge branch 'development' into refactor-structs-as-config
sdbondi Apr 8, 2022
80c89eb
remove eslint for now from launchpad
sdbondi Apr 8, 2022
677750f
add launchpad dist .gitkeep
sdbondi Apr 8, 2022
c72558d
ffi fixes
sdbondi Apr 8, 2022
64cd523
a few more cucumber fixes
sdbondi Apr 8, 2022
2941d7a
eslint fixes
sdbondi Apr 8, 2022
c208694
minor tweaks + mark cucumber test as broken
sdbondi Apr 8, 2022
8822644
mark some cucumbers as broken
sdbondi Apr 8, 2022
2e5928c
Merge branch 'development' into refactor-structs-as-config
sdbondi Apr 8, 2022
c64f2de
marked as broken
sdbondi Apr 8, 2022
7e0e264
npm checks
sdbondi Apr 8, 2022
3a61709
fix test
sdbondi Apr 8, 2022
c43f48f
Merge branch 'development' into refactor-structs-as-config
sdbondi Apr 11, 2022
5418456
fix test and clippies
sdbondi Apr 11, 2022
5634278
Merge branch 'development' into refactor-structs-as-config
sdbondi Apr 11, 2022
aaf549d
fix doctests
sdbondi Apr 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
566 changes: 273 additions & 293 deletions Cargo.lock

Large diffs are not rendered by default.

33 changes: 16 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -609,17 +609,16 @@ they are not enabled already:
[base_node.weatherwax]
transpo*_r_*t = "tor"
allow_test_addresses = false
grpc_enabled = true
grpc_base_node_address = "127.0.0.1:18142"
base_node_grpc_address = "127.0.0.1:18142"
```

And then depending on if you are using solo mining or self-select mining you will use one of the following:

###### Solo mining

- For the Tari Merge Mining Proxy, under section **`merge_mining_proxy.weatherwax`**
- For the Tari Merge Mining Proxy, under section **`merge_mining_proxy`**
```
[merge_mining_proxy.weatherwax]
[merge_mining_proxy]
monerod_url = [ # stagenet
"http://stagenet.xmr-tw.org:38081",
"http://stagenet.community.xmr.to:38081",
Expand All @@ -628,7 +627,7 @@ And then depending on if you are using solo mining or self-select mining you wil
"http://singapore.node.xmr.pm:38081",
]

proxy_host_address = "127.0.0.1:7878"
proxy_host_address = "127.0.0.1:18081"
proxy_submit_to_origin = true
monerod_use_auth = false
monerod_username = ""
Expand All @@ -637,9 +636,9 @@ And then depending on if you are using solo mining or self-select mining you wil

###### Self-Select mining

- For the Tari Merge Mining Proxy, under section **`merge_mining_proxy.weatherwax`**
- For the Tari Merge Mining Proxy, under section **`merge_mining_proxy`**
```
[merge_mining_proxy.weatherwax]
[merge_mining_proxy]
monerod_url = [ # stagenet
"http://stagenet.xmr-tw.org:38081",
"http://stagenet.community.xmr.to:38081",
Expand All @@ -648,14 +647,14 @@ And then depending on if you are using solo mining or self-select mining you wil
"http://singapore.node.xmr.pm:38081",
]

proxy_host_address = "127.0.0.1:7878"
proxy_host_address = "127.0.0.1:18081"
proxy_submit_to_origin = false
monerod_use_auth = false
monerod_username = ""
monerod_password = ""
```

**Note:** The ports `7878`, `18142` and `18143` shown in the example above should not be in use by other processes. If
**Note:** The ports `18081`, `18142` and `18143` shown in the example above should not be in use by other processes. If
they are, choose different ports. You will need to update the ports in the steps below as well.

The `monerod_url` set must contain valid addresses (`host:port`) for `monerod` that is running Monero mainnet (e.g.
Expand Down Expand Up @@ -731,7 +730,7 @@ Using the public stagenet wallet address above the resulting configuration file
"pools": [
{
"coin": "monero",
"url": "127.0.0.1:7878",
"url": "127.0.0.1:18081",
"user": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt",
"tls": false,
"daemon": true
Expand Down Expand Up @@ -767,7 +766,7 @@ be augmented with Tari specific settings. Using the wizard, create the following

- Result -> With `Config file`, copy or download, than save as `config.json`.

- Add custom entries for `"self-select": "127.0.0.1:7878"` and `"submit-to-origin": true` in the `"pools"` section.
- Add custom entries for `"self-select": "127.0.0.1:18081"` and `"submit-to-origin": true` in the `"pools"` section.

Mining pool `cryptonote.social` requires you to add a personalized handle to the wallet address so that you can
query your own pool statistics, separated by a full stop, i.e. `<YOUR WALLET ADDRESS>.<pool specific user name>`. For
Expand All @@ -791,7 +790,7 @@ activity for that address. The configuration file used for this exercise is show
"tls": false,
"keepalive": true,
"nicehash": false,
"self-select": "127.0.0.1:7878",
"self-select": "127.0.0.1:18081",
"submit-to-origin": true
}
]
Expand Down Expand Up @@ -874,14 +873,14 @@ Look out for the following outputs in the XMRig console to confirm that it is co
and accepting jobs:

```
* POOL #1 127.0.0.1:7878 coin monero
* POOL #1 127.0.0.1:18081 coin monero
```

```
[2021-01-21 12:10:18.960] net use daemon 127.0.0.1:7878 127.0.0.1
[2021-01-21 12:10:18.960] net new job from 127.0.0.1:7878 diff 286811 algo rx/0 height 756669
[2021-01-21 12:10:18.960] net use daemon 127.0.0.1:18081 127.0.0.1
[2021-01-21 12:10:18.960] net new job from 127.0.0.1:18081 diff 286811 algo rx/0 height 756669
[2021-01-21 12:10:56.730] cpu rejected (0/1) diff 286811 "Block not accepted" (656 ms)
[2021-01-21 12:10:57.398] net new job from 127.0.0.1:7878 diff 293330 algo rx/0 height 756670
[2021-01-21 12:10:57.398] net new job from 127.0.0.1:18081 diff 293330 algo rx/0 height 756670
[2021-01-21 12:12:23.695] miner speed 10s/60s/15m 4089.0 4140.2 n/a H/s max 4390.9 H/s
[2021-01-21 12:12:57.983] cpu accepted (1/1) diff 293330 (594 ms)
```
Expand Down Expand Up @@ -926,7 +925,7 @@ Look out for the following outputs in the XMRig console to confirm that it is co
Mining Proxy and accepting jobs:

```
* POOL #1 cryptonote.social:5555 coin monero self-select 127.0.0.1:7878 submit-to-origin
* POOL #1 cryptonote.social:5555 coin monero self-select 127.0.0.1:18081 submit-to-origin
```

```
Expand Down
1 change: 1 addition & 0 deletions applications/ffi_client/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const libWallet = ffi.Library("./libtari_wallet_ffi.dylib", {
u32,
"string",
"string",
"string",
fn,
fn,
fn,
Expand Down
1 change: 1 addition & 0 deletions applications/launchpad/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/fermium
11 changes: 7 additions & 4 deletions applications/launchpad/backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,28 @@ build = "src/build.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
tauri-build = { version = "1.0.0-beta.4" }
tauri-build = { version = "1.0.0-rc.5", features = [] }

[dependencies]
tari_app_utilities = { version = "^0.31", path = "../../tari_app_utilities" }
tari_comms = { version = "^0.31", path = "../../../comms/core" }
bollard = "0.11.0"
config = "0.11.0"
tari_common = { path="../../../common"}

bollard = "0.11.1"
config = "0.13.0"
env_logger = "0.9.0"
log = "0.4.14"
rand = "0.8.4"
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
strum = "0.23.0"
strum_macros = "0.23.0"
tauri = { version = "1.0.0-beta.8", features = ["api-all", "cli"] }
tauri = { version = "1.0.0-rc.6", features = ["api-all", "cli"] }
tor-hash-passwd = "1.0.1"
thiserror = "1.0.30"
tokio = { version = "1.9", features= ["sync"] }
futures = "0.3"
regex= "1.5.4"
derivative = "2.2.0"

[features]
Expand Down
73 changes: 43 additions & 30 deletions applications/launchpad/backend/assets/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Config for launchpad v0.0.2
[common]
network = "dibbler"
config = "dibbler"
message_cache_size = 10
message_cache_ttl = 1440
denylist_ban_period = 1440
Expand All @@ -9,19 +9,20 @@ dedup_cache_capacity = 25000
rpc_max_simultaneous_sessions = 1000

[common.igor]
network = "igor"
peer_seeds = [
# igor
"8e7eb81e512f3d6347bf9b1ca9cd67d2c8e29f2836fc5bd608206505cc72af34::/onion3/l4wouomx42nezhzexjdzfh7pcou5l7df24ggmwgekuih7tkv2rsaokqd:18141",
"00b35047a341401bcd336b2a3d564280a72f6dc72ec4c739d30c502acce4e803::/onion3/ojhxd7z6ga7qrvjlr3px66u7eiwasmffnuklscbh5o7g6wrbysj45vid:18141",
"40a9d8573745072534bce7d0ecafe882b1c79570375a69841c08a98dee9ecb5f::/onion3/io37fylc2pupg4cte4siqlsmuszkeythgjsxs2i3prm6jyz2dtophaad:18141",
"126c7ee64f71aca36398b977dd31fbbe9f9dad615df96473fb655bef5709c540::/onion3/6ilmgndocop7ybgmcvivbdsetzr5ggj4hhsivievoa2dx2b43wqlrlid:18141",
]

dns_seeds =["seeds.igor.tari.com"]
dns_seeds = ["seeds.igor.tari.com"]
dns_seeds_use_dnssec = false

[common.dibbler]
dns_seeds =["seeds.dibbler.tari.com"]
network = "dibbler"
dns_seeds = ["seeds.dibbler.tari.com"]
peer_seeds = [
"721e9da488302e69523bca1a9cdcbd2419dddda11698a1e8c6c7bd619659ff21::/onion3/qw4ymrzbanbcr3wwlesxbot72iayd7xdjcrtnacbwgk637vfon47hqad:18141",
# 333388d1cbe3e2bd17453d052f
Expand All @@ -39,72 +40,72 @@ peer_seeds = [
]

[base_node]
network = "dibbler"
config = "dibbler"
grpc_enabled = true
grpc_address = "/ip4/0.0.0.0/tcp/18142"
track_reorgs = true

[base_node.dibbler]
network = "dibbler"
db_type = "lmdb"
flood_ban_max_msg_count = 100_000
allow_test_addresses = false
use_libtor = false
base_node_identity_file = "/var/tari/base_node/config/dibbler/tari_base_node_id.json"
base_node_tor_identity_file = "/var/tari/base_node/config/dibbler/tari_base_node_tor.json"

# -- These values are overridden by envars in the Tauri code for EVERY network
# -------------- Transport configuration --------------
transport = "tor"
tor_control_auth = "password=tari"
tor_forward_address = "/dns4/base_node/tcp/18189"
tcp_listener_address = "/dns4/base_node/tcp/18189"
tor_socks_address_override = "/dns4/tor/tcp/9050"
tor_control_address = "/ip4/tor/tcp/9051"
grpc_enabled = true
grpc_base_node_address = "0.0.0.0:18142"
tor_control_address = "/dns4/tor/tcp/9051"


[base_node.igor]
network = "igor"
db_type = "lmdb"
flood_ban_max_msg_count = 100_000
allow_test_addresses = false
use_libtor = false
base_node_identity_file = "/var/tari/base_node/config/igor/base_node_id.json"
base_node_tor_identity_file = "/var/tari/base_node/config/igor/tari_base_node_tor.json"


[mempool.dibbler]

[mempool.igor]

[wallet]
config = "dibbler"
wallet_db_file = "wallet/wallet.dat"
console_wallet_db_file = "wallet/console-wallet.dat"
grpc_enabled = true
grpc_address = "/ip4/0.0.0.0/tcp/18143"
password = "tari"

[wallet.dibbler]
use_libtor = false
tor_onion_port = 18141

# Overidden in Tauri environment variables for ALL networks
# The following are overridden in Tauri environment variables for ALL networks - so just here for informational purposes
transport = "tor"
tor_control_auth = "password=tari"
tor_control_address = "/ip4/tor/tcp/9051"
tor_control_address = "/dns4/tor/tcp/9051"
tor_socks_address_override = ""
tor_forward_address = ""
tcp_listener_address= ""
tcp_listener_address = ""

[wallet.dibbler]
network = "dibbler"
use_libtor = false
tor_onion_port = 18141

[wallet.igor]
network = "igor"
use_libtor = false
tor_onion_port = 18141

[mining_node]
num_mining_threads=1
base_node_grpc_address = "/ip4/base_node/tcp/18142"
wallet_grpc_address = "/ip4/wallet/tcp/18143"
num_mining_threads = 1
base_node_grpc_address = "/dns4/base_node/tcp/18142"
wallet_grpc_address = "/dns4/wallet/tcp/18143"
base_node_addr = "/dns4/base_node/tcp/18142"
wallet_addr = "/dns4/wallet/tcp/18143"
mine_on_tip_only = true

[merge_mining_proxy]
config = "dibbler"

[merge_mining_proxy.dibbler]
monerod_url = [ # stagenet
"http://stagenet.xmr-tw.org:38081",
Expand All @@ -113,9 +114,21 @@ monerod_url = [ # stagenet
"http://xmr-lux.boldsuck.org:38081",
"http://singapore.node.xmr.pm:38081",
]
proxy_host_address = "/ip4/mm_proxy/tcp/7878"

[merge_mining_proxy]
base_node_grpc_address = "/dns4/base_node/tcp/18142"
console_wallet_grpc_address = "/dns4/wallet/tcp/18143"
proxy_host_address = "/dns4/mm_proxy/tcp/18081"
proxy_submit_to_origin = true
wait_for_initial_sync_at_startup = true
monerod_username = ""
monerod_password = ""
monerod_use_auth = false

[merge_mining_proxy.local]
grpc_base_node_address = "/ip4/127.0.0.1/tcp/18142"
grpc_console_wallet_address = "/ip4/127.0.0.1/tcp/18143"
proxy_host_address = "/ip4/127.0.0.1/tcp/18081"
proxy_submit_to_origin = false
wait_for_initial_sync_at_startup = true

[validator_node]
committee = ["2ea0df3059caf4411624d6bf5b9c02238d607d2798c586b3e6c2a054da3f205a"] # cannot be of zero size
Expand Down
4 changes: 2 additions & 2 deletions applications/launchpad/backend/assets/log4rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ loggers:
- core
additive: false
tari_mining_node:
level: info
level: debug
appenders:
- core
additive: false
tari_mm_proxy:
level: info
level: debug
appenders:
- core
additive: false
Expand Down
22 changes: 15 additions & 7 deletions applications/launchpad/backend/src/commands/create_workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//

use std::path::Path;
use std::{
env,
path::{Path, PathBuf},
str::FromStr,
};

use log::*;
use tauri::{
Expand All @@ -38,14 +42,18 @@ use crate::{commands::AppState, docker::create_workspace_folders, error::Launche
/// Create a new workspace environment by creating a folder hierarchy (if required) at the `root_folder`, and copying
/// the default config files into it.
#[tauri::command]
pub fn create_new_workspace(app: AppHandle<Wry>, root_path: String) -> Result<(), String> {
pub fn create_new_workspace(app: AppHandle<Wry>, root_path: Option<String>) -> Result<(), String> {
let config = app.config();
let package_info = &app.state::<AppState>().package_info;
let _result = create_workspace_folders(root_path.as_str()).map_err(|e| e.chained_message());
let path = Path::new(&root_path);
copy_config_file(path, config.as_ref(), package_info, "log4rs.yml").map_err(|e| e.chained_message())?;
copy_config_file(path, config.as_ref(), package_info, "config.toml").map_err(|e| e.chained_message())?;
info!("Workspace at {} complete!", root_path);
let path = root_path
.as_ref()
.map(|r| PathBuf::from_str(r.as_str()).unwrap())
.unwrap_or_else(|| env::temp_dir().join("tari"));
debug!("Creating workspace at {:?}", path);
create_workspace_folders(&path).map_err(|e| e.chained_message())?;
copy_config_file(path.as_path(), config.as_ref(), package_info, "log4rs.yml").map_err(|e| e.chained_message())?;
copy_config_file(path.as_path(), config.as_ref(), package_info, "config.toml").map_err(|e| e.chained_message())?;
info!("Workspace at {:?} complete!", path);
Ok(())
}

Expand Down
Loading