Skip to content

Commit

Permalink
Merge pull request #1627 from ManfredKarrer/merged-voting
Browse files Browse the repository at this point in the history
Add DAO code
  • Loading branch information
ManfredKarrer authored Aug 15, 2018
2 parents 731fe0b + 59b5b13 commit 45a9019
Show file tree
Hide file tree
Showing 87 changed files with 6,423 additions and 3,736 deletions.
39 changes: 20 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ installDist.destinationDir = file('build/app')
//
// 3. Run `git diff` to verify that expected hashes have changed
// 4. Commit the changes

dependencyVerification {
verify = [
'org.controlsfx:controlsfx:b98f1c9507c05600f80323674b33d15674926c71b0116f70085b62bdacf1e573',
Expand All @@ -88,15 +89,6 @@ dependencyVerification {
'de.jensd:fontawesomefx-materialdesignfont:8f700556bbfdc4a581224d3bd6ff869b8a03f6670bd7e0fc78884bd2f31fdb64',
'de.jensd:fontawesomefx-commons:e1505a31433f1b2902478217651afc78dae5ab09670336afc46e582a1dea1e4d',
'com.googlecode.jcsv:jcsv:73ca7d715e90c8d2c2635cc284543b038245a34f70790660ed590e157b8714a2',
'net.sf.jopt-simple:jopt-simple:6f45c00908265947c39221035250024f2caec9a15c1c8cf553ebeecee289f342',
'network.bisq.btcd-cli4j:btcd-cli4j-daemon:300e2fb9500398f4c5cec6ae07d16d07570dbe0eb9944061eb67ab7db18fa72c',
'network.bisq.btcd-cli4j:btcd-cli4j-core:63baeecea21940670e054bba6b041959e49fa094a496c141b9da55401ee4a8e7',
'com.fasterxml.jackson.core:jackson-databind:fcf3c2b0c332f5f54604f7e27fa7ee502378a2cc5df6a944bbfae391872c32ff',
'com.fasterxml.jackson.core:jackson-core:39a74610521d7fb9eb3f437bb8739bbf47f6435be12d17bf954c731a0c6352bb',
'com.fasterxml.jackson.core:jackson-annotations:2566b3a6662afa3c6af4f5b25006cb46be2efc68f1b5116291d6998a8cdf7ed3',
'com.github.JesusMcCloud.netlayer:tor.native:de44e782b21838d3426dbff99abbfd1cbb8e5d3f6d5e997441ff4fd8354934fa',
'org.apache.httpcomponents:httpclient:db3d1b6c2d6a5e5ad47577ad61854e2f0e0936199b8e05eb541ed52349263135',
'org.fxmisc.easybind:easybind:666af296dda6de68751668a62661571b5238ac6f1c07c8a204fc6f902b222aaf',
'com.google.protobuf:protobuf-java:b5e2d91812d183c9f053ffeebcbcda034d4de6679521940a19064714966c2cd4',
'com.google.code.gson:gson:2d43eb5ea9e133d2ee2405cc14f5ee08951b8361302fdd93494a3a997b508d32',
'com.googlecode.json-simple:json-simple:4e69696892b88b41c55d49ab2fdcc21eead92bf54acc588c0050596c3b75199c',
Expand All @@ -108,6 +100,7 @@ dependencyVerification {
'com.google.guava:guava:36a666e3b71ae7f0f0dca23654b67e086e6c93d192f60ba5dfd5519db6c288c8',
'com.google.inject:guice:9b9df27a5b8c7864112b4137fd92b36c3f1395bfe57be42fedf2f520ead1a93e',
'network.bisq.libdohj:libdohj-core:cef7db8a2032ffbc229ccacc29b7d13e8ee1daf1cd60ee8f988cdfa60a041d8e',
'com.github.JesusMcCloud.netlayer:tor.native:de44e782b21838d3426dbff99abbfd1cbb8e5d3f6d5e997441ff4fd8354934fa',
'com.github.JesusMcCloud.netlayer:tor:3896950c56a41985f901ff9475524ac162cba18b2d5a0ed39810b20ddaf5128a',
'org.jetbrains.kotlin:kotlin-stdlib-jdk8:841b021d62fc007ce2883963ff9440d5393fb1f6a0604ed68cd016afcaf02967',
'com.github.MicroUtils:kotlin-logging:7dbd501cc210d721f730d480c53ee2a6e3c154ae89b07dc7dee224b9c5aca9eb',
Expand All @@ -118,29 +111,37 @@ dependencyVerification {
'commons-io:commons-io:cc6a41dc3eaacc9e440a6bd0d2890b20d36b4ee408fe2d67122f328bb6e01581',
'org.apache.commons:commons-lang3:734c8356420cc8e30c795d64fd1fcd5d44ea9d90342a2cc3262c5158fbc6d98b',
'org.bouncycastle:bcprov-jdk15on:963e1ee14f808ffb99897d848ddcdb28fa91ddda867eb18d303e82728f878349',
'net.sf.jopt-simple:jopt-simple:6f45c00908265947c39221035250024f2caec9a15c1c8cf553ebeecee289f342',
//'network.bisq.btcd-cli4j:btcd-cli4j-daemon:cf19fddccfd9c5302498dfdb29a7fead8faff04912285bfdaacad1fd7a27f646',
//'network.bisq.btcd-cli4j:btcd-cli4j-core:cc063c3a501ee6dd6f2e2e98ce59e82d720a52522acc1ec0751434dece4851e4',
'com.fasterxml.jackson.core:jackson-databind:fcf3c2b0c332f5f54604f7e27fa7ee502378a2cc5df6a944bbfae391872c32ff',
'com.fasterxml.jackson.core:jackson-core:39a74610521d7fb9eb3f437bb8739bbf47f6435be12d17bf954c731a0c6352bb',
'com.fasterxml.jackson.core:jackson-annotations:2566b3a6662afa3c6af4f5b25006cb46be2efc68f1b5116291d6998a8cdf7ed3',
'org.apache.httpcomponents:httpclient:db3d1b6c2d6a5e5ad47577ad61854e2f0e0936199b8e05eb541ed52349263135',
'org.fxmisc.easybind:easybind:666af296dda6de68751668a62661571b5238ac6f1c07c8a204fc6f902b222aaf',
'com.google.zxing:javase:0ec23e2ec12664ddd6347c8920ad647bb3b9da290f897a88516014b56cc77eb9',
'commons-logging:commons-logging:daddea1ea0be0f56978ab3006b8ac92834afeefbd9b7e4e6316fca57df0fa636',
'javax.inject:javax.inject:91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff',
'aopalliance:aopalliance:0addec670fedcd3f113c5c8091d783280d23f75e3acb841b61a9cdb079376a08',
'com.github.bisq-network.bitcoinj:bitcoinj-core:05c94cc68f1524ed08f5aa815f5f09d99a3aae5ab277527d7729ee74d0aece13',
'com.lambdaworks:scrypt:9a82d218099fb14c10c0e86e7eefeebd8c104de920acdc47b8b4b7a686fb73b4',
'commons-codec:commons-codec:ad19d2601c3abf0b946b5c3a4113e226a8c1e3305e395b90013b78dd94a723ce',
'com.cedricwalter:tor-binary-macos:87790e9eade1e44eeadc81f92670f338cd47ef1b39b46a4b022c75d0cf6465fd',
'com.cedricwalter:tor-binary-linux32:814f6da3b662c96490bcb09781764dd31dfe497ea9c25c73fe61170d2a78086f',
'com.cedricwalter:tor-binary-linux64:9da7f8a166ad0a767a5373ca67c68971c9c0cac17964eed2e0850bfecc228312',
'com.cedricwalter:tor-binary-windows:9487a735dadcadc6ede5ffad36a911c2d4a484f996be93d71094f26591b8c29e',
'com.github.ravn:jsocks:3c71600af027b2b6d4244e4ad14d98ff2352a379410daebefff5d8cd48d742a4',
'org.apache.httpcomponents:httpcore:d7f853dee87680b07293d30855b39b9eb56c1297bd16ff1cd6f19ddb8fa745fb',
'commons-logging:commons-logging:daddea1ea0be0f56978ab3006b8ac92834afeefbd9b7e4e6316fca57df0fa636',
'javax.inject:javax.inject:91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff',
'aopalliance:aopalliance:0addec670fedcd3f113c5c8091d783280d23f75e3acb841b61a9cdb079376a08',
'com.github.bisq-network.bitcoinj:bitcoinj-core:05c94cc68f1524ed08f5aa815f5f09d99a3aae5ab277527d7729ee74d0aece13',
'com.lambdaworks:scrypt:9a82d218099fb14c10c0e86e7eefeebd8c104de920acdc47b8b4b7a686fb73b4',
'com.google.zxing:core:11aae8fd974ab25faa8208be50468eb12349cd239e93e7c797377fa13e381729',
'com.cedricwalter:tor-binary-geoip:7fc7b5ebf80d65ec53d97dd8d3878b8d2c85dc04f3943e5e85e7ba641655492b',
'com.github.JesusMcCloud:jtorctl:c6ef92e46074d8d26db718ce0fe4b64b8cf7b934b7377d164c5d613b4cd7b847',
'org.apache.commons:commons-compress:a778bbd659722889245fc52a0ec2873fbbb89ec661bc1ad3dc043c0757c784c4',
'org.tukaani:xz:a594643d73cc01928cf6ca5ce100e094ea9d73af760a5d4fb6b75fa673ecec96',
'com.madgag.spongycastle:core:8d6240b974b0aca4d3da9c7dd44d42339d8a374358aca5fc98e50a995764511f',
'net.jcip:jcip-annotations:be5805392060c71474bf6c9a67a099471274d30b83eef84bfc4e0889a4f1dcc0',
'org.bitcoinj:orchid:f836325cfa0466a011cb755c9b0fee6368487a2352eb45f4306ad9e4c18de080',
'com.squareup.okhttp:okhttp:b4c943138fcef2bcc9d2006b2250c4aabbedeafc5947ed7c0af7fd103ceb2707',
'org.objenesis:objenesis:5e168368fbc250af3c79aa5fef0c3467a2d64e5a7bd74005f25d8399aeb0708d',
'com.cedricwalter:tor-binary-geoip:7fc7b5ebf80d65ec53d97dd8d3878b8d2c85dc04f3943e5e85e7ba641655492b',
'com.github.JesusMcCloud:jtorctl:c6ef92e46074d8d26db718ce0fe4b64b8cf7b934b7377d164c5d613b4cd7b847',
'org.apache.commons:commons-compress:a778bbd659722889245fc52a0ec2873fbbb89ec661bc1ad3dc043c0757c784c4',
'org.tukaani:xz:a594643d73cc01928cf6ca5ce100e094ea9d73af760a5d4fb6b75fa673ecec96',
'com.squareup.okio:okio:114bdc1f47338a68bcbc95abf2f5cdc72beeec91812f2fcd7b521c1937876266',
'org.objenesis:objenesis:5e168368fbc250af3c79aa5fef0c3467a2d64e5a7bd74005f25d8399aeb0708d',
]
}
5 changes: 4 additions & 1 deletion doc/rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ If you use RegTest in development environment you need to create the genesis tra
Create one Bitcoin transaction from Bitcoin Core to one or 2 Bisq instances using the BSQ receive addresses from those apps (1 tx with 2 or more outputs to the Bisq app).
If you copy the BSQ address and use that in Bitcoin Core you need to remove the "B" at the beginning. This is only for protection to mix up BTC and BSQ addresses but without the B it is a native Bitcoin address.
Create one block with the debug command line inside Bitcoin Core (generate 1). Look up the block height in the info screen in the debug window.
Set the block height and transaction ID at BsqBlockChain.BTC_REG_TEST_GENESIS_TX_ID and BsqBlockChain.BTC_REG_TEST_GENESIS_BLOCK_HEIGHT.
Set the block height and transaction ID at with options genesisBlockHeight and genesisTxId.
Restart the Bisq apps. After that the app will recognize the received Bitcoin as BSQ.

Here are example options for regtest mode:
--daoActivated=true --genesisBlockHeight=111 --genesisTxId=aa92a8d56be3aaafc6b1a8d248ae67c221d78a31de8867a9564e7ae24340b495 --useDevPrivilegeKeys=true --useDevMode=true--baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --nodePort=3612 --appName=bisq-BTC_REGTEST_Bob_dao --fullDaoNode=true --rpcUser=bisq --rpcPassword=bisqPW --rpcPort=18332 --rpcBlockNotificationPort=5159
3 changes: 3 additions & 0 deletions src/main/java/bisq/desktop/DesktopModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import bisq.desktop.common.view.ViewLoader;
import bisq.desktop.common.view.guice.InjectorViewFactory;
import bisq.desktop.main.MarketPricePresentation;
import bisq.desktop.main.dao.bonding.BondingViewUtils;
import bisq.desktop.main.funds.transactions.DisplayedTransactionsFactory;
import bisq.desktop.main.funds.transactions.TradableRepository;
import bisq.desktop.main.funds.transactions.TransactionAwareTradableFactory;
Expand Down Expand Up @@ -79,6 +80,8 @@ protected void configure() {
bind(TransactionAwareTradableFactory.class).in(Singleton.class);
bind(DisplayedTransactionsFactory.class).in(Singleton.class);

bind(BondingViewUtils.class).in(Singleton.class);

bindConstant().annotatedWith(Names.named(AppOptionKeys.APP_NAME_KEY)).to(environment.getRequiredProperty(AppOptionKeys.APP_NAME_KEY));
}
}
21 changes: 12 additions & 9 deletions src/main/java/bisq/desktop/app/BisqApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@

import bisq.core.alert.AlertManager;
import bisq.core.app.AppOptionKeys;
import bisq.core.btc.wallet.BsqWalletService;
import bisq.core.btc.wallet.BtcWalletService;
import bisq.core.btc.wallet.WalletService;
import bisq.core.btc.wallet.WalletsManager;
import bisq.core.filter.FilterManager;
import bisq.core.locale.Res;
Expand Down Expand Up @@ -249,7 +247,9 @@ private void addSceneKeyEventHandler(Scene scene, Injector injector) {
stop();
} else {
if (Utilities.isAltOrCtrlPressed(KeyCode.E, keyEvent)) {
showEmptyWalletPopup(injector.getInstance(BtcWalletService.class), injector);
showBtcEmergencyWalletPopup(injector);
} else if (Utilities.isAltOrCtrlPressed(KeyCode.B, keyEvent)) {
showBsqEmergencyWalletPopup(injector);
} else if (Utilities.isAltOrCtrlPressed(KeyCode.M, keyEvent)) {
showSendAlertMessagePopup(injector);
} else if (Utilities.isAltOrCtrlPressed(KeyCode.F, keyEvent)) {
Expand All @@ -267,10 +267,7 @@ private void addSceneKeyEventHandler(Scene scene, Injector injector) {
new Popup<>().warning(Res.get("popup.warning.walletNotInitialized")).show();
} else if (DevEnv.isDevMode()) {
// dev ode only
if (Utilities.isAltOrCtrlPressed(KeyCode.B, keyEvent)) {
// BSQ empty wallet not public yet
showEmptyWalletPopup(injector.getInstance(BsqWalletService.class), injector);
} else if (Utilities.isAltOrCtrlPressed(KeyCode.P, keyEvent)) {
if (Utilities.isAltOrCtrlPressed(KeyCode.P, keyEvent)) {
showFPSWindow(scene);
} else if (Utilities.isAltOrCtrlPressed(KeyCode.Z, keyEvent)) {
showDebugWindow(scene, injector);
Expand Down Expand Up @@ -298,9 +295,15 @@ private void showFilterPopup(Injector injector) {
.show();
}

private void showEmptyWalletPopup(WalletService walletService, Injector injector) {
private void showBtcEmergencyWalletPopup(Injector injector) {
EmptyWalletWindow emptyWalletWindow = injector.getInstance(EmptyWalletWindow.class);
emptyWalletWindow.setWalletService(walletService);
emptyWalletWindow.setIsBtc(true);
emptyWalletWindow.show();
}

private void showBsqEmergencyWalletPopup(Injector injector) {
EmptyWalletWindow emptyWalletWindow = injector.getInstance(EmptyWalletWindow.class);
emptyWalletWindow.setIsBtc(false);
emptyWalletWindow.show();
}

Expand Down
23 changes: 23 additions & 0 deletions src/main/java/bisq/desktop/app/BisqAppMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
public class BisqAppMain extends BisqExecutable {
private BisqApp application;

/* @Nullable
private BisqHttpApiServer bisqHttpApiServer;*/
/* @Nullable
private BisqGrpcServer bisqGrpcServer;
*/
public static void main(String[] args) throws Exception {
if (BisqExecutable.setupInitialOptionParser(args)) {
// For some reason the JavaFX launch process results in us losing the thread context class loader: reset it.
Expand Down Expand Up @@ -119,5 +124,23 @@ protected void startApplication() {
@Override
protected void onApplicationStarted() {
super.onApplicationStarted();

/* if (runWithHttpApi()) {
final BisqFacade bisqFacade = injector.getInstance(BisqFacade.class);
bisqHttpApiServer = new BisqHttpApiServer(bisqFacade);
}*/
/*
if (runWithGrpcApi()) {
final BisqFacade bisqFacade = injector.getInstance(BisqFacade.class);
bisqGrpcServer = new BisqGrpcServer(bisqFacade);
}*/
}

private boolean runWithHttpApi() {
return bisqEnvironment.getDesktopWithHttpApi().toLowerCase().equals("true");
}

private boolean runWithGrpcApi() {
return bisqEnvironment.getDesktopWithGrpcApi().toLowerCase().equals("true");
}
}
142 changes: 90 additions & 52 deletions src/main/java/bisq/desktop/bisq.css
Original file line number Diff line number Diff line change
Expand Up @@ -327,57 +327,6 @@ bg color of non edit textFields: fafafa
-fx-text-fill: -bs-red-soft;
}

.dao-tx-type-fee-icon,
.dao-tx-type-fee-icon:hover {
-fx-text-fill: #5ab9ea;
-fx-cursor: hand;
}

.dao-tx-type-unverified-icon,
.dao-tx-type-unverified-icon:hover {
-fx-text-fill: -bs-yellow;
}

.dao-tx-type-invalid-icon,
.dao-tx-type-invalid-icon:hover {
-fx-text-fill: -bs-error-red;
}

.dao-tx-type-default-icon,
.dao-tx-type-default-icon:hover {
-fx-text-fill: -bs-grey;
}

.dao-tx-type-genesis-icon,
.dao-tx-type-genesis-icon:hover {
-fx-text-fill: -fx-accent;
}

.dao-tx-type-received-funds-icon,
.dao-tx-type-received-funds-icon:hover {
-fx-text-fill: -bs-green-soft;
}

.dao-tx-type-sent-funds-icon,
.dao-tx-type-sent-funds-icon:hover {
-fx-text-fill: -bs-red-soft;
}

.dao-tx-type-vote-icon,
.dao-tx-type-vote-icon:hover {
-fx-text-fill: -bs-bg-blue1;
}

.dao-tx-type-vote-reveal-icon,
.dao-tx-type-vote-reveal-icon:hover {
-fx-text-fill: -bs-bg-green2;
}

.dao-tx-type-issuance-icon,
.dao-tx-type-issuance-icon:hover {
-fx-text-fill: -bs-green;
}

.version {
-fx-text-fill: black;
-fx-underline: false;
Expand Down Expand Up @@ -1327,17 +1276,106 @@ textfield */
-fx-font-size: 0.846em;
}


/********************************************************************************************************************
* *
* DAO *
* *
********************************************************************************************************************/

.dao-tx-type-trade-fee-icon,
.dao-tx-type-trade-fee-icon:hover {
-fx-text-fill: #689f43;
}

.dao-tx-type-unverified-icon,
.dao-tx-type-unverified-icon:hover {
-fx-text-fill: #ffac00;
}

.dao-tx-type-invalid-icon,
.dao-tx-type-invalid-icon:hover {
-fx-text-fill: #ff4500;
}

.dao-tx-type-self-icon,
.dao-tx-type-self-icon:hover {
-fx-text-fill: #818181;
}

.dao-tx-type-proposal-fee-icon,
.dao-tx-type-proposal-fee-icon:hover {
-fx-text-fill: #6c8b3b;
}

.dao-tx-type-genesis-icon,
.dao-tx-type-genesis-icon:hover {
-fx-text-fill: -fx-accent;
}

.dao-tx-type-received-funds-icon,
.dao-tx-type-received-funds-icon:hover {
-fx-text-fill: -bs-green-soft;
}

.dao-tx-type-sent-funds-icon,
.dao-tx-type-sent-funds-icon:hover {
-fx-text-fill: -bs-red-soft;
}

.dao-tx-type-vote-icon,
.dao-tx-type-vote-icon:hover {
-fx-text-fill: #0a4576;
}

.dao-tx-type-vote-reveal-icon,
.dao-tx-type-vote-reveal-icon:hover {
-fx-text-fill: #4AC5FF;
}

.dao-tx-type-issuance-icon,
.dao-tx-type-issuance-icon:hover {
-fx-text-fill: #04a908;
}

.dao-tx-type-lockup-icon,
.dao-tx-type-lockup-icon:hover {
-fx-text-fill: #203e7f;
}

.dao-tx-type-unlock-icon,
.dao-tx-type-unlock-icon:hover {
-fx-text-fill: #438e6c;
}

.dao-accepted-icon {
-fx-text-fill: -bs-green;
}

.dao-rejected-icon {
-fx-text-fill: -bs-error-red;
}

.dao-ignored-icon {
-fx-text-fill: -bs-medium-grey;
}

.compensation-root {
-fx-background-insets: 0, 0 0 0 0
}

.info-icon {
-fx-text-fill: -fx-accent;
}

.info-icon-button {
-fx-cursor: hand;
-fx-background-color: transparent;
}

.dao-remove-proposal-icon {
-fx-text-fill: -fx-accent;
}

/********************************************************************************************************************
* *
* Notifications *
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/bisq/desktop/components/HyperlinkWithIcon.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@

import javafx.geometry.Insets;

import lombok.Getter;

public class HyperlinkWithIcon extends Hyperlink {
@Getter
private final Label icon;

public HyperlinkWithIcon(String text) {
this(text, AwesomeIcon.INFO_SIGN);
Expand All @@ -36,7 +40,7 @@ public HyperlinkWithIcon(String text, AwesomeIcon awesomeIcon) {

super(text);

Label icon = new Label();
icon = new Label();
AwesomeDude.setIcon(icon, awesomeIcon);
icon.setMinWidth(20);
icon.setOpacity(0.7);
Expand Down
Loading

0 comments on commit 45a9019

Please sign in to comment.