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

[txs] change balance_transfer API for Carpe app #990

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
237 commits
Select commit Hold shift + click to select a range
77b7582
makefile
0o-de-lally Oct 11, 2021
9d5d4a0
move safety rules file out of key_store.json
0o-de-lally Oct 11, 2021
526adfd
makefile
0o-de-lally Oct 11, 2021
d57f529
makefile
0o-de-lally Oct 11, 2021
ed7ff44
refresh seed peers
0o-de-lally Oct 16, 2021
193a13d
catch state tree error and handle
0o-de-lally Oct 16, 2021
652daab
merge
0o-de-lally Oct 17, 2021
f6fa30b
refactor block execution to reduce calls.
0o-de-lally Oct 18, 2021
9d58ee4
format doc
0o-de-lally Oct 18, 2021
e5b577d
patch setting upstream connection on client
0o-de-lally Oct 18, 2021
c856f5b
remove deprecated args in tower start
0o-de-lally Oct 18, 2021
81ad100
make log levels in ureq go away
0o-de-lally Oct 18, 2021
a0208f0
patch toml
0o-de-lally Oct 18, 2021
686dd63
clean up debug prints
0o-de-lally Oct 18, 2021
1a42855
benchmarking vdf
0o-de-lally Oct 18, 2021
027702c
make vdf delay and verify receive params.
0o-de-lally Oct 18, 2021
b78ac7a
make all tower apis receive difficulty and security params
0o-de-lally Oct 19, 2021
ad7c4e9
change transaction api for tower and account creation.
0o-de-lally Oct 19, 2021
adb6195
more benches
0o-de-lally Oct 19, 2021
b72d42b
patch tests
0o-de-lally Oct 19, 2021
e6452bb
patch tower tests
0o-de-lally Oct 19, 2021
76dff69
patch native function arg parsing
0o-de-lally Oct 19, 2021
181cedb
patch vdf tests
0o-de-lally Oct 19, 2021
2880c02
patch miner and vdf tests
0o-de-lally Oct 19, 2021
3703a75
patch tests
0o-de-lally Oct 19, 2021
d8d4e5e
consolidate names challenge/solution
0o-de-lally Oct 19, 2021
4c6b220
patch test build errors
0o-de-lally Oct 19, 2021
c10595f
cleanup
0o-de-lally Oct 19, 2021
5b48446
patch e2e build
0o-de-lally Oct 19, 2021
acb297e
build stdlib
0o-de-lally Oct 19, 2021
211895f
patch e2e reconfig test.
0o-de-lally Oct 19, 2021
841c91d
rebuild upgarde fixtures
0o-de-lally Oct 19, 2021
0fc63bd
patch autopay integration tests
0o-de-lally Oct 19, 2021
a19054f
Merge branch 'patch-integration' into genesis
0o-de-lally Oct 19, 2021
6c6a859
Merge branch 'genesis' into vdf-security
0o-de-lally Oct 19, 2021
cc35e1e
get toml file from fixtures
0o-de-lally Oct 19, 2021
ba6252c
change VDF scheme BREAKING CHANGE
0o-de-lally Oct 19, 2021
e1ee132
set new vdf parameters
0o-de-lally Oct 19, 2021
37e6741
change native function
0o-de-lally Oct 19, 2021
f176ba0
created test fixtures
0o-de-lally Oct 19, 2021
394f375
fixtures makefile
0o-de-lally Oct 20, 2021
21cc09c
make test mode only TEST=y
0o-de-lally Oct 20, 2021
f83da01
patch
0o-de-lally Oct 20, 2021
7170a4d
create prod fixtures
0o-de-lally Oct 20, 2021
31c357d
updating move test fixtures
0o-de-lally Oct 20, 2021
d92bfb6
build stdlib
0o-de-lally Oct 20, 2021
6c137ab
get blocks from fixtures
0o-de-lally Oct 20, 2021
7ae2291
get block fixtures from files
0o-de-lally Oct 20, 2021
3ca15c8
wip patching miner tests
0o-de-lally Oct 20, 2021
21dd291
cleanup
0o-de-lally Oct 20, 2021
816bcdd
patch build
0o-de-lally Oct 20, 2021
584c315
remove mentions of 2048
0o-de-lally Oct 20, 2021
a958fc9
fix imports in genesis
0o-de-lally Oct 20, 2021
eb181ea
wip patch vdf proofs
0o-de-lally Oct 20, 2021
e36fdb7
vdf tets passing
0o-de-lally Oct 20, 2021
0f502f2
add block 1 fixtures
0o-de-lally Oct 20, 2021
33f9d8c
add eve block 1 fixtures
0o-de-lally Oct 20, 2021
4cb18a9
complete move fixtures
0o-de-lally Oct 20, 2021
ca5b406
patch miner tests
0o-de-lally Oct 20, 2021
9ab66ac
all tests passing.
0o-de-lally Oct 20, 2021
e20ab39
tower tests passing
0o-de-lally Oct 20, 2021
3dc0ebd
add tower link to genesis preimage, make preimage a fixed 1024 size
0o-de-lally Oct 20, 2021
7eff167
add wizard to add a tower link
0o-de-lally Oct 20, 2021
3805f2c
patching e2e tests and tools tests
0o-de-lally Oct 20, 2021
f9a0487
more sane fixtures managment for e2e tests
0o-de-lally Oct 21, 2021
990e9eb
Merge branch 'main' into vdf-security
0o-de-lally Oct 21, 2021
2097130
Merge branch 'vdf-security' into genesis-vdf
0o-de-lally Oct 21, 2021
289280f
update makefile
0o-de-lally Oct 21, 2021
202fea4
Merge branch 'vdf-security' into genesis-vdf
0o-de-lally Oct 21, 2021
d44f46d
patch merge
0o-de-lally Oct 21, 2021
009447b
patch fixtures helpers locations
0o-de-lally Oct 21, 2021
c4f9ac0
remove duplicate fixtures helper
0o-de-lally Oct 21, 2021
cf6e54f
Merge branch 'vdf-security' into genesis-vdf
0o-de-lally Oct 21, 2021
d4b3c47
makefile recipe to backup 0L folder
0o-de-lally Oct 21, 2021
44a2566
documentation
0o-de-lally Oct 21, 2021
95bd3d3
makefile genesis
0o-de-lally Oct 21, 2021
653d632
makefile for sync
0o-de-lally Oct 21, 2021
6cc7ebd
nodefiles to use key_store only
0o-de-lally Oct 21, 2021
2dd2ccc
Merge branch 'main' into genesis-vdf
0o-de-lally Oct 21, 2021
4d9aaa2
build stdlib
0o-de-lally Oct 21, 2021
3cdf11d
bring back info prints
0o-de-lally Oct 21, 2021
34d39e5
staging net epoch
0o-de-lally Oct 21, 2021
d7ed4df
delay difficulty for stage was off.
0o-de-lally Oct 21, 2021
184a52d
prints
0o-de-lally Oct 21, 2021
0023672
looking for wrong filename
0o-de-lally Oct 21, 2021
b84c160
Merge branch 'main' into vdf-security
0o-de-lally Oct 21, 2021
926ff14
Merge branch 'vdf-security' of https://github.com/OLSF/libra into vdf…
0o-de-lally Oct 21, 2021
d8dbb6f
Merge branch 'vdf-security' into genesis-vdf
0o-de-lally Oct 21, 2021
f3828a0
build stdlib
0o-de-lally Oct 22, 2021
ca3abe7
Merge branch 'main' into genesis-vdf
0o-de-lally Oct 22, 2021
98f19e9
patch globals for vdf difficulty
0o-de-lally Oct 22, 2021
b112276
init swarm returns result
0o-de-lally Oct 22, 2021
fbb2e4d
patch build
0o-de-lally Oct 22, 2021
ee860c1
rename block_0.json throughout
0o-de-lally Oct 22, 2021
fdd6e30
patch build
0o-de-lally Oct 22, 2021
c1601ef
revert name change
0o-de-lally Oct 22, 2021
bd6d9be
skip add_tower when in test mode for onboarding
0o-de-lally Oct 22, 2021
e10554c
patch build
0o-de-lally Oct 22, 2021
9000c84
Merge branch 'genesis-vdf' into tauri
0o-de-lally Oct 22, 2021
6a95cbb
refactor swarm init to not copy files, but write a proof
0o-de-lally Oct 22, 2021
96ceb63
merge
0o-de-lally Oct 22, 2021
9d06060
get_account_mnemonic to have result type return
0o-de-lally Oct 22, 2021
a219990
Merge branch 'main' into tauri
0o-de-lally Oct 26, 2021
27ca03b
refactor fetching epoch data from upstream
0o-de-lally Oct 26, 2021
dae1404
enforce correct path json rpc
0o-de-lally Oct 26, 2021
1f9a5ac
debug prints
0o-de-lally Oct 26, 2021
a24be04
patch getting waypoint from upstream
0o-de-lally Oct 26, 2021
871760d
update cli node object
0o-de-lally Oct 27, 2021
9570072
Merge branch 'main' into tauri
0o-de-lally Oct 27, 2021
775968d
remove unwrap which panics
0o-de-lally Oct 28, 2021
28a32e5
refactor set wallet type command
0o-de-lally Oct 28, 2021
a3e621c
set visibility
0o-de-lally Oct 28, 2021
3d7c46d
clean
0o-de-lally Oct 28, 2021
ebba0c9
patch unwrap which is crashing nodes
0o-de-lally Oct 28, 2021
cb8340c
try different erro handling
0o-de-lally Oct 28, 2021
2bed6c0
write genesis if no block is found
0o-de-lally Oct 30, 2021
019e423
patch build
0o-de-lally Oct 30, 2021
a6928e8
genesis info testnet
0o-de-lally Oct 30, 2021
ea4b587
Merge branch 'tauri' of github.com:OLSF/libra into tauri
0o-de-lally Oct 30, 2021
32332e8
Merge branch 'main' into tauri
0o-de-lally Nov 1, 2021
c94dfff
no need to panic on inability to parse toml
0o-de-lally Nov 1, 2021
80a78c1
catch exit when trying to create a Node object and no .yaml is found.
0o-de-lally Nov 1, 2021
1c6a339
patch
0o-de-lally Nov 1, 2021
044ede5
WIP method to get a ledger waypoint
0o-de-lally Nov 3, 2021
02180a4
patch
0o-de-lally Nov 3, 2021
9f525f3
Merge branch 'vfn' into tauri
0o-de-lally Nov 3, 2021
6e789df
patch panic on batch saving
0o-de-lally Nov 3, 2021
b130508
remove the unwraps from submit_tx::stage
0o-de-lally Nov 3, 2021
7bfbcca
cleaning up unwraps in submit_tx
0o-de-lally Nov 3, 2021
7158690
clean most unwraps from submit_tx
0o-de-lally Nov 3, 2021
0b0e16f
get waypoint from json-rpc
0o-de-lally Nov 3, 2021
df8a3f1
Merge remote-tracking branch 'origin/tauri' into main
liangping Nov 4, 2021
b64675a
Remove gag from Cargo.toml
liangping Nov 5, 2021
2628440
Merge branch 'main' into tauri
0o-de-lally Nov 5, 2021
72b4ce3
remove unused dependencies in cargo.toml
0o-de-lally Nov 5, 2021
84049a7
Merge branch 'remove-unused' into tauri
0o-de-lally Nov 5, 2021
26eaa4f
restore serde_json
0o-de-lally Nov 5, 2021
d1d489f
Merge branch 'remove-unused' into tauri
0o-de-lally Nov 5, 2021
d9e487e
patch unix directory paths hardcode in diem-framework. Breaks windows…
0o-de-lally Nov 7, 2021
fda2d71
Hack to build on windows 7
simsekgokhan Nov 7, 2021
ce51902
Fix previous hack commit: Adding conditional compiling and symlink fi…
simsekgokhan Nov 10, 2021
437bc05
Fix hack commit: Revert to original
simsekgokhan Nov 10, 2021
32a2bf0
Hack again to generate Windows installers ASAP (fix this later)
simsekgokhan Nov 12, 2021
3027a2e
Static link gmp lib
simsekgokhan Nov 12, 2021
b6f51e5
Removing fix attempt for now, fails on unix, needs improvement
simsekgokhan Nov 12, 2021
87178ba
Re-do previous hack
simsekgokhan Nov 15, 2021
4b2b79c
Use cross-platform path
simsekgokhan Nov 15, 2021
e1064e3
Remove hack for unix, hack only for windows
simsekgokhan Nov 15, 2021
5036ec3
change pragmas for win config
0o-de-lally Nov 15, 2021
38b4cdf
add mac 10.15 libgmp.a
0o-de-lally Nov 15, 2021
4e66131
Merge branch 'main' into carpe-build
Jan 7, 2022
83b7773
Merge branch 'main' into carpe-build
0o-de-lally Jan 17, 2022
7d8c62d
move the default init of txparams to a constructor
0o-de-lally Jan 20, 2022
2df74ef
seprate the txparams type into a new module. place constructors in ri…
0o-de-lally Jan 20, 2022
c3ff70d
cargo fix
0o-de-lally Jan 20, 2022
1f75585
clear warnings
0o-de-lally Jan 20, 2022
fd4c600
patch build
0o-de-lally Jan 20, 2022
430e93d
patch build
0o-de-lally Jan 20, 2022
fdae637
patch get_process
0o-de-lally Jan 20, 2022
1d410a2
cli args patch
0o-de-lally Jan 20, 2022
0679118
remove default_node from 0L.toml
0o-de-lally Jan 20, 2022
21b854b
rename upstream_nodes to rpc_fullnodes
0o-de-lally Jan 20, 2022
f7ec96d
patch tests
0o-de-lally Jan 21, 2022
8172095
app configs documentation
0o-de-lally Jan 21, 2022
a32023f
grammar
0o-de-lally Jan 21, 2022
15f8b1b
Merge branch 'txsparam-refactor' into carpe-build
0o-de-lally Jan 21, 2022
7f441fc
make upstream_node not an option
0o-de-lally Jan 21, 2022
214a238
build
0o-de-lally Jan 21, 2022
e3c334d
Merge branch 'txsparam-refactor' into carpe-build
0o-de-lally Jan 21, 2022
02e69d9
update error message for conecting to remote
0o-de-lally Jan 21, 2022
1e8c0a6
log upstream being attempted
0o-de-lally Jan 21, 2022
e9b7272
limit backlog sending when miner has maxed current epoch proofs.
0o-de-lally Jan 21, 2022
f75c1df
Merge branch 'txsparam-refactor' into carpe-build
0o-de-lally Jan 21, 2022
d7d6762
patch issue with swarm not making txs params
0o-de-lally Jan 21, 2022
c96a42e
Merge branch 'txsparam-refactor' into carpe-build
0o-de-lally Jan 21, 2022
54c31d3
make MAX_PROOFS_PER_EPOCH pub
0o-de-lally Jan 21, 2022
1a3cc2a
clean
0o-de-lally Jan 21, 2022
69da1e4
Merge branch 'txsparam-refactor' into carpe-build
0o-de-lally Jan 21, 2022
57e4fb4
patch test build error
0o-de-lally Jan 22, 2022
de0c226
add rustyline = "9.1.2"
liangping Jan 23, 2022
26e06ef
uncomment crash_handler
liangping Jan 23, 2022
25d118a
uncomment generate_key
liangping Jan 23, 2022
11e9949
Merge branch 'main' into txsparam-refactor
0o-de-lally Jan 25, 2022
10fc0e9
backlog should exit with a TxError if can't evaluate tx status
0o-de-lally Jan 25, 2022
93b2caf
scaffold tower error
0o-de-lally Jan 25, 2022
7e3e8ca
patch build
0o-de-lally Jan 25, 2022
4283f67
patch build
0o-de-lally Jan 25, 2022
497fa8f
Merge branch 'txsparam-refactor' into carpe-build
0o-de-lally Jan 25, 2022
af2ae65
use correct rustyline version
0o-de-lally Jan 25, 2022
3d2c1ee
update move stdlib
0o-de-lally Jan 25, 2022
8c1da0d
test same stdlib for all OS
0o-de-lally Jan 25, 2022
b2c4049
change return type
0o-de-lally Jan 26, 2022
9623922
patch build
0o-de-lally Jan 26, 2022
d00d604
Merge branch 'txsparam-refactor' into carpe-build
0o-de-lally Jan 26, 2022
0125e22
display trait for towererror
0o-de-lally Jan 26, 2022
95cf098
Merge branch 'txsparam-refactor' into carpe-build
0o-de-lally Jan 26, 2022
3216a86
format tower errors
0o-de-lally Jan 26, 2022
4adf527
Merge branch 'txsparam-refactor' into carpe-build
0o-de-lally Jan 26, 2022
7177f3b
Add tower error
0o-de-lally Jan 26, 2022
a4db942
Merge branch 'txsparam-refactor' into carpe-build
0o-de-lally Jan 26, 2022
c03823d
add error code
0o-de-lally Jan 26, 2022
7953e63
Merge branch 'txsparam-refactor' into carpe-build
0o-de-lally Jan 26, 2022
2754ccb
add tower error
0o-de-lally Jan 27, 2022
dce19eb
Merge branch 'txsparam-refactor' into carpe-build
0o-de-lally Jan 27, 2022
75707a3
add min mining threshold
0o-de-lally Jan 27, 2022
6983d3e
add lower bound mining thresh
0o-de-lally Jan 27, 2022
2a94639
patch defaults affecting integration tests
0o-de-lally Jan 31, 2022
3d08e8e
Merge branch 'main' into txsparam-refactor
0o-de-lally Feb 2, 2022
3ef9012
Merge branch 'txsparam-refactor' into carpe-build
0o-de-lally Feb 2, 2022
6132cf7
tower WrongDifficulty type
0o-de-lally Feb 2, 2022
a826e25
patch build
0o-de-lally Feb 2, 2022
b443616
Merge branch 'txsparam-refactor' into carpe-build
0o-de-lally Feb 2, 2022
e39fbe9
remove evil unwraps
0o-de-lally Feb 5, 2022
eaf0c17
Merge branch 'txsparam-refactor' into carpe-build
0o-de-lally Feb 5, 2022
196aaac
remove annoying prints
0o-de-lally Feb 5, 2022
0c5656d
Merge branch 'txsparam-refactor' into carpe-build
0o-de-lally Feb 5, 2022
27c1255
Txsparam refactor (#973)
0o-de-lally Feb 8, 2022
8cfe093
adds ubuntu gmp lib (#976)
soaresa Feb 8, 2022
9701845
scaffold init rpc-playlist command
0o-de-lally Feb 9, 2022
0ac6e9c
add rpc-playlist command
0o-de-lally Feb 9, 2022
6f461b8
add rpc-playlist command
0o-de-lally Feb 9, 2022
6bcc722
scrub
0o-de-lally Feb 9, 2022
5c68536
remove all evil unwraps from chain_view.rs
0o-de-lally Feb 9, 2022
736d528
scrub
0o-de-lally Feb 9, 2022
e31f716
cargo clean
0o-de-lally Feb 9, 2022
25700ae
remove deprecated state refresh
0o-de-lally Feb 10, 2022
dfe50d1
patch merge
0o-de-lally Feb 10, 2022
a5b898b
Merge pull request #981 from OLSF/ol-start-clean
liangping Feb 10, 2022
d897f2f
use %h specifier to dynamically set the user home directory in system…
Feb 11, 2022
c91e849
adds documentation on how to set up a build environment for macOS (#983)
intuitiveminds Feb 11, 2022
1de1723
Merge branch 'main' into carpe-build
0o-de-lally Feb 11, 2022
c977081
create update_config_file on fullnodeplaylist, to dedup with ol init …
0o-de-lally Feb 11, 2022
a1a564b
clean
0o-de-lally Feb 11, 2022
8232eb8
Merge branch 'rpc-fullnodes-clean' into carpe-build
0o-de-lally Feb 11, 2022
47cb429
Merge branch 'rpc-fullnodes-clean' into carpe-build
0o-de-lally Feb 11, 2022
f16e792
[Txs] Allow invoking balance_transfer function when importing libra
ea-open-source Feb 14, 2022
c96fbf3
Resolve conflict merging from main
ea-open-source Feb 18, 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
212 changes: 83 additions & 129 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions config/management/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ serde = { version = "1.0.124", features = ["rc"], default-features = false }
serde_yaml = "0.8.17"
structopt = "0.3.21"
thiserror = "1.0.24"
toml = { version = "0.5.8", default-features = false }

bcs = "0.1.2"
diem-config = { path = ".."}
diem-crypto = { path = "../../crypto/crypto" }
Expand All @@ -31,10 +29,11 @@ diem-temppath = { path = "../../common/temppath" }
diem-transaction-builder = { path = "../../sdk/transaction-builder" }

# //////// 0L ////////
rustyline = "6.2.0"
diem-wallet = { path = "../../testsuite/cli/diem-wallet", version = "0.1.0"}
ol-keys = { path = "../../ol/keys", version = "0.1.0" }
dirs = "2.0.2"
#toml = { version = "0.5.8", default-features = false }
# rustyline = "6.2.0"
# diem-wallet = { path = "../../testsuite/cli/diem-wallet", version = "0.1.0"}
# ol-keys = { path = "../../ol/keys", version = "0.1.0" }
# dirs = "2.0.2"
serde_json = "1"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion config/management/genesis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ diem-transaction-builder = { path = "../../../sdk/transaction-builder" }
vm-genesis = { path = "../../../language/tools/vm-genesis" }

# //////// 0L ////////
rustyline = "6.2.0"
# rustyline = "6.2.0"
diem-wallet = { path = "../../../testsuite/cli/diem-wallet", version = "0.1.0"}
ol-keys = { path = "../../../ol/keys", version = "0.1.0" }
hex = "0.4.2"
Expand Down
2 changes: 1 addition & 1 deletion language/diem-framework/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ bcs = "0.1.2"
anyhow = "1.0.38"
clap = "2.33.3"
log = "0.4.14"
rayon = "1.5.0"
# rayon = "1.5.0"
sha2 = "0.9.3"
walkdir = "2.3.1"
once_cell = "1.7.2"
Expand Down
9 changes: 7 additions & 2 deletions language/diem-framework/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ fn main() {
let base_path = std::path::Path::new(&exec_path)
.parent()
.unwrap()
.join("../../language/diem-framework");
.parent()
.unwrap()
.parent()
.unwrap()
.join("language")
.join("diem-framework"); //////// 0L //////// was causing windows compile problems.
std::env::set_current_dir(&base_path).expect("failed to change directory");

#[cfg(debug_assertions)]
Expand All @@ -103,7 +108,7 @@ fn main() {

let output_path = matches
.value_of("output")
.unwrap_or("releases/artifacts/current");
.unwrap_or("releases/artifacts/current"); // TODO: this will break on Windows

release::create_release(
&Path::new(output_path), &options
Expand Down
4 changes: 2 additions & 2 deletions ol/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"

[dependencies]
bitflags = "1.0"
cassowary = "0.3"
# cassowary = "0.3"
unicode-segmentation = "1.2"
unicode-width = "0.1"
chrono = "0.4.19"
Expand All @@ -27,7 +27,7 @@ dirs = "2.0.2"
toml = "0.5.6"
rustyline = "6.2.0"
diem-json-rpc-client = { path = "../../client/json-rpc", version = "0.1.0" }
crossterm = "0.19.0"
# crossterm = "0.19.0"
tokio = { version = "1.0", features = ["full"] }
tokio-stream = "0.1.1"
warp = "0.3.0"
Expand Down
112 changes: 65 additions & 47 deletions ol/cli/src/commands/init_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ use url::Url;
/// `init` subcommand
#[derive(Command, Debug, Default, Options)]
pub struct InitCmd {
/// Create the 0L.toml file for 0L apps
/// Create the 0L.toml file for 0L apps
#[options(help = "Create the 0L.toml file for 0L apps")]
app: bool,

/// For "app" option an upstream peer to use in 0L.toml
#[options(help = "An upstream peer to use in 0L.toml")]
rpc_peer: Option<Url>,


/// For "app" option home path for app config
#[options(help = "home path for app config")]
app_cfg_path: Option<PathBuf>,
Expand All @@ -51,7 +50,9 @@ pub struct InitCmd {
fullnode: bool,

/// Set the upstream peers playlist from an http served playlist file
#[options(help = "Use a playlist.json file hosted online to set the upstream_peers field in 0L.toml")]
#[options(
help = "Use a playlist.json file hosted online to set the upstream_peers field in 0L.toml"
)]
rpc_playlist: Option<String>, // Using string so that the user can use a default upstream

/// Search and get seed peers from chain
Expand Down Expand Up @@ -102,12 +103,17 @@ impl Runnable for InitCmd {
let entry_args = entrypoint::get_args();
let is_swarm = *&entry_args.swarm_path.is_some();


if self.update_waypoint {
// TODO: will need to update the key_store.json file with waypoint info.
if let Some(w) = self.waypoint {
app_cfg.chain_info.base_waypoint = Some(w);
app_cfg.save_file();
match app_cfg.save_file() {
Ok(_) => {}
Err(e) => {
println!("could not save config file, exiting. Message: {:?}", e);
exit(1)
}
}
return;
};
let client = match client::pick_client(entry_args.swarm_path.clone(), &mut app_cfg) {
Expand All @@ -125,11 +131,25 @@ impl Runnable for InitCmd {

match node.waypoint() {
Ok(w) => {
key::set_waypoint(&app_cfg.workspace.node_home, &app_cfg.profile.account.to_string(), w);
key::set_genesis_waypoint(&app_cfg.workspace.node_home, &app_cfg.profile.account.to_string(), w);
key::set_waypoint(
&app_cfg.workspace.node_home,
&app_cfg.profile.account.to_string(),
w,
);
key::set_genesis_waypoint(
&app_cfg.workspace.node_home,
&app_cfg.profile.account.to_string(),
w,
);

app_cfg.chain_info.base_waypoint = Some(w);
app_cfg.save_file();
match app_cfg.save_file() {
Ok(_) => {}
Err(e) => {
println!("could not save config file, exiting. Message: {:?}", e);
exit(1)
}
}
return;
}
Err(e) => {
Expand All @@ -138,45 +158,39 @@ impl Runnable for InitCmd {
}
}
}

if let Some(url) = self.rpc_playlist.as_ref() {


// try to parse it, otherwise get_known_fullnodes will use a default playlist
let playlist_url: Option<Url> = url.parse().ok();

match rpc_playlist::get_known_fullnodes(playlist_url){
Ok(f) => {

let mut new_cfg = match parse_toml(self.app_cfg_path.clone()) { // if None path just use default
Ok(c) => c,
Err(e) => {
println!("could not parse app config toml file, exiting. Message: {:?}", e );
exit(1);
},
};
new_cfg.profile.upstream_nodes = f.get_urls();

println!("peers found:");
new_cfg.profile.upstream_nodes.iter()
.for_each(|u| {
println!("{}", u.as_str())
});

// println!("peers found: {:?}", new_cfg.profile.upstream_nodes);

new_cfg.save_file();
println!("Upstream RPC peers updated in 0L.toml");
return
},
Err(e) => {
println!("could not read playlists from {:?}, exiting. Message: {:?}", url, e);
exit(1);
},
};
if let Some(url) = self.rpc_playlist.as_ref() {
// try to parse it, otherwise get_known_fullnodes will use a default playlist
let playlist_url: Option<Url> = url.parse().ok();

match rpc_playlist::get_known_fullnodes(playlist_url) {
Ok(f) => {
println!("peers found:");
f.get_urls()
.into_iter()
.for_each(|u| println!("{}", u.as_str()));

match f.update_config_file(self.app_cfg_path.clone()) {
Ok(_) => println!("Upstream RPC peers updated in 0L.toml"),
Err(e) => {
println!(
"could not update rpc peers in config file, exiting. Message: {:?}",
e
);
exit(1);
}
}
return;
}
Err(e) => {
println!(
"could not read playlists from {:?}, exiting. Message: {:?}",
url, e
);
exit(1);
}
};
}



// fetch a list of seed peers from the current on chain discovery
// doesn't need mnemonic
Expand Down Expand Up @@ -393,7 +407,7 @@ pub fn initialize_host_swarm(
persona: Option<String>,
source_path: &Option<PathBuf>,
) -> Result<(), Error> {
let cfg = AppCfg::init_app_configs_swarm(swarm_path, node_home, source_path.clone());
let cfg = AppCfg::init_app_configs_swarm(swarm_path, node_home, source_path.clone())?;
let p = persona.unwrap_or("alice".to_string());
let source = fixtures::get_persona_block_zero_path(&p, "test");
let blocks_dir = PathBuf::new()
Expand Down Expand Up @@ -433,7 +447,11 @@ pub fn initialize_val_key_store(
let home_dir = &app_cfg.workspace.node_home;
let keys = KeyScheme::new(wallet);
let namespace = app_cfg.format_oper_namespace();
let way = way_opt.unwrap_or("0:c12c01d2ac6deb028567c9a9c816ca3fe53fab9c461e4eab2f89125f975b63c3".parse().unwrap());
let way = way_opt.unwrap_or(
"0:c12c01d2ac6deb028567c9a9c816ca3fe53fab9c461e4eab2f89125f975b63c3"
.parse()
.unwrap(),
);

init::key_store_init(home_dir, &namespace, keys, is_genesis);
key::set_operator_key(home_dir, &namespace);
Expand Down
12 changes: 6 additions & 6 deletions ol/cli/src/mgmt/management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,13 +307,13 @@ impl Node {
pub fn kill_zombies(&self, name: &str) {
println!("Killing zombie '{}' processes...", name);
println!("Will NOT disable any systemd services, you must disable those manually");
use nix::sys::signal::{self, Signal};
// use nix::sys::signal::{self, Signal};

if let Some(hp) = self.get_process(name) {
for pid in hp.pids.iter() {
let _res = signal::kill(nix::unistd::Pid::from_raw(*pid as i32), Signal::SIGTERM);
}
}
// if let Some(hp) = self.get_process(name) {
// for pid in hp.pids.iter() {
// let _res = signal::kill(nix::unistd::Pid::from_raw(*pid as i32), Signal::SIGTERM);
// }
// }
}
/// Stop node, as validator
pub fn stop_node(&self) {
Expand Down
6 changes: 3 additions & 3 deletions ol/cli/src/node/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,17 @@ pub fn find_a_remote_jsonrpc(config: &AppCfg, waypoint: Waypoint) -> Result<Diem
if m.version > 0 {
true
} else {
println!("can make client but could not get blockchain height > 0");
println!("can make client to {:?}, but could not get blockchain height > 0", remote_url);
false
}
}
Err(e) => {
println!("can make client but could not get metadata {:?}", e);
println!("can make client for {:?} but could not get metadata, message: {:?}", remote_url, e);
false
}
},
Err(e) => {
println!("could not make client {:?}", e);
println!("could not make client for {:?}, message: {:?}", remote_url, e);
false
}
}
Expand Down
4 changes: 2 additions & 2 deletions ol/cli/src/node/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ impl Node {
.into_iter()
.filter(|i| match i.status() {
ProcessStatus::Run => true,
ProcessStatus::Sleep => true,
// ProcessStatus::Sleep => true,
_ => false,
})
.find(|i| !i.cmd().is_empty());
Expand Down Expand Up @@ -352,7 +352,7 @@ impl Node {
.into_iter()
.filter(|i| match i.status() {
ProcessStatus::Run => true,
ProcessStatus::Sleep => true,
// ProcessStatus::Sleep => true,
_ => false,
})
.find(|i| !i.cmd().is_empty());
Expand Down
2 changes: 1 addition & 1 deletion ol/tower/src/backlog.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Miner resubmit backlog transactions module
#![forbid(unsafe_code)]

use crate::EPOCH_MINING_THRES_UPPER;
use crate::commit_proof::commit_proof_tx;
use crate::proof::{parse_block_height, FILENAME};
use anyhow::{anyhow, bail, Error, Result};
Expand All @@ -12,7 +13,6 @@ use std::io::BufReader;
use std::{fs::File, path::PathBuf};
use txs::submit_tx::{eval_tx_status, TxError};
use txs::tx_params::TxParams;
use crate::EPOCH_MINING_THRES_UPPER;

/// Submit a backlog of blocks that may have been mined while network is offline.
/// Likely not more than 1.
Expand Down
14 changes: 8 additions & 6 deletions ol/txs/src/commands/transfer_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

#![allow(clippy::never_loop)]

use crate::{entrypoint, submit_tx::{TxError, maybe_submit, tx_params_wrapper}};
use crate::{
entrypoint,
submit_tx::{TxError, maybe_submit, tx_params_wrapper},
tx_params::TxParams,
};
use abscissa_core::{Command, Options, Runnable};

use diem_json_rpc_types::views::TransactionView;
Expand All @@ -29,8 +33,8 @@ impl Runnable for TransferCmd {
exit(1);
},
};

match balance_transfer(destination, self.coins, entry_args.save_path) {
let tx_params = tx_params_wrapper(TxType::Mgmt).unwrap();
match balance_transfer(destination, self.coins, tx_params, entry_args.save_path) {
Ok(_) => println!("Success: Balance transfer posted: {}", self.destination_account),
Err(e) => {
println!("ERROR: execute balance transfer message: {:?}", &e);
Expand All @@ -41,9 +45,7 @@ impl Runnable for TransferCmd {
}

/// create an account by sending coin to it
pub fn balance_transfer(destination: AccountAddress, coins: u64, save_path: Option<PathBuf>) -> Result<TransactionView, TxError>{
let tx_params = tx_params_wrapper(TxType::Mgmt).unwrap();

pub fn balance_transfer(destination: AccountAddress, coins: u64, tx_params: TxParams, save_path: Option<PathBuf>) -> Result<TransactionView, TxError>{
// NOTE: coins here do not have the scaling factor. Rescaling is the responsibility of the Move script. See the script in ol_accounts.move for detail.
let script = transaction_builder::encode_balance_transfer_script_function(
destination,
Expand Down
2 changes: 1 addition & 1 deletion ol/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ byteorder = "1"
diem-global-constants = { path = "../../config/global-constants", version = "0.1.0"}
dirs = "2.0.2"
machine-ip = "0.2.1"
rustyline = "6.2.0"
ajson = "0.2.3"
diem-crypto = { path = "../../crypto/crypto/" }
toml = "0.5.6"
Expand All @@ -29,3 +28,4 @@ move-core-types = { path = "../../language/move-core/types" }
sha2 = "0.9.1"
num-format = "0.4.0"
glob = "0.3"
rand = "0.8.4"
Loading