document signing accounts in deployment guide, minor fixes

This commit is contained in:
woodser 2023-11-10 11:29:23 -05:00
parent f6b33e877f
commit af38f82406
6 changed files with 28 additions and 16 deletions

View file

@ -23,6 +23,7 @@ import haveno.common.app.Capability;
import haveno.common.crypto.Hash; import haveno.common.crypto.Hash;
import haveno.common.proto.ProtoUtil; import haveno.common.proto.ProtoUtil;
import haveno.common.util.Utilities; import haveno.common.util.Utilities;
import haveno.core.trade.HavenoUtils;
import haveno.network.p2p.storage.P2PDataStorage; import haveno.network.p2p.storage.P2PDataStorage;
import haveno.network.p2p.storage.payload.CapabilityRequiringPayload; import haveno.network.p2p.storage.payload.CapabilityRequiringPayload;
import haveno.network.p2p.storage.payload.DateTolerantPayload; import haveno.network.p2p.storage.payload.DateTolerantPayload;
@ -30,7 +31,6 @@ import haveno.network.p2p.storage.payload.PersistableNetworkPayload;
import haveno.network.p2p.storage.payload.ProcessOncePersistableNetworkPayload; import haveno.network.p2p.storage.payload.ProcessOncePersistableNetworkPayload;
import lombok.Value; import lombok.Value;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.bitcoinj.core.Coin;
import java.time.Clock; import java.time.Clock;
import java.time.Instant; import java.time.Instant;
@ -176,7 +176,7 @@ public class SignedWitness implements ProcessOncePersistableNetworkPayload, Pers
",\n signerPubKey=" + Utilities.bytesAsHexString(signerPubKey) + ",\n signerPubKey=" + Utilities.bytesAsHexString(signerPubKey) +
",\n witnessOwnerPubKey=" + Utilities.bytesAsHexString(witnessOwnerPubKey) + ",\n witnessOwnerPubKey=" + Utilities.bytesAsHexString(witnessOwnerPubKey) +
",\n date=" + Instant.ofEpochMilli(date) + ",\n date=" + Instant.ofEpochMilli(date) +
",\n tradeAmount=" + Coin.valueOf(tradeAmount).toFriendlyString() + ",\n tradeAmount=" + HavenoUtils.formatXmr(tradeAmount, true) +
",\n hash=" + Utilities.bytesAsHexString(hash) + ",\n hash=" + Utilities.bytesAsHexString(hash) +
"\n}"; "\n}";
} }

View file

@ -35,7 +35,6 @@ import haveno.network.p2p.P2PService;
import haveno.network.p2p.storage.P2PDataStorage; import haveno.network.p2p.storage.P2PDataStorage;
import haveno.network.p2p.storage.persistence.AppendOnlyDataStoreService; import haveno.network.p2p.storage.persistence.AppendOnlyDataStoreService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.bitcoinj.core.Coin;
import org.bitcoinj.core.ECKey; import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.Utils; import org.bitcoinj.core.Utils;
@ -62,7 +61,7 @@ import java.util.stream.Collectors;
public class SignedWitnessService { public class SignedWitnessService {
public static final long SIGNER_AGE_DAYS = 30; public static final long SIGNER_AGE_DAYS = 30;
private static final long SIGNER_AGE = SIGNER_AGE_DAYS * ChronoUnit.DAYS.getDuration().toMillis(); private static final long SIGNER_AGE = SIGNER_AGE_DAYS * ChronoUnit.DAYS.getDuration().toMillis();
public static final BigInteger MINIMUM_TRADE_AMOUNT_FOR_SIGNING = HavenoUtils.coinToAtomicUnits(Coin.parseCoin("0.0025")); public static final BigInteger MINIMUM_TRADE_AMOUNT_FOR_SIGNING = HavenoUtils.xmrToAtomicUnits(.1);
private final KeyRing keyRing; private final KeyRing keyRing;
private final P2PService p2PService; private final P2PService p2PService;

View file

@ -844,7 +844,7 @@ public class AccountAgeWitnessService {
} }
public SignState getSignState(Trade trade) { public SignState getSignState(Trade trade) {
if (trade instanceof ArbitratorTrade) return SignState.UNSIGNED; // TODO (woodser): arbitrator has two peers if (trade instanceof ArbitratorTrade) return SignState.UNSIGNED;
return findTradePeerWitness(trade) return findTradePeerWitness(trade)
.map(this::getSignState) .map(this::getSignState)
.orElse(SignState.UNSIGNED); .orElse(SignState.UNSIGNED);

View file

@ -21,6 +21,7 @@ import haveno.core.locale.CurrencyUtil;
import haveno.core.monetary.Price; import haveno.core.monetary.Price;
import haveno.core.offer.Offer; import haveno.core.offer.Offer;
import haveno.core.offer.OfferDirection; import haveno.core.offer.OfferDirection;
import haveno.core.trade.ArbitratorTrade;
import haveno.core.trade.ClosedTradableFormatter; import haveno.core.trade.ClosedTradableFormatter;
import haveno.core.trade.ClosedTradableManager; import haveno.core.trade.ClosedTradableManager;
import haveno.core.trade.Tradable; import haveno.core.trade.Tradable;
@ -100,7 +101,7 @@ public class ClosedTradesListItem implements FilterableListItem {
public String getDirectionLabel() { public String getDirectionLabel() {
Offer offer = tradable.getOffer(); Offer offer = tradable.getOffer();
OfferDirection direction = closedTradableManager.wasMyOffer(offer) OfferDirection direction = closedTradableManager.wasMyOffer(offer) || tradable instanceof ArbitratorTrade
? offer.getDirection() ? offer.getDirection()
: offer.getMirroredDirection(); : offer.getMirroredDirection();
String currencyCode = tradable.getOffer().getCurrencyCode(); String currencyCode = tradable.getOffer().getCurrencyCode();

View file

@ -149,8 +149,29 @@ Enter a private key which is registered to send alerts.
Enter the alert message and new version number, then click the button to send the notification. Enter the alert message and new version number, then click the button to send the notification.
## Manually sign payment accounts as the arbitrator
Arbitrators can manually sign payment accounts. First open the legacy UI.
### Sign payment account after trade is completed
1. Go to Portfolio > History > open trade details > click 'DETAIL DATA' button.
2. Copy the `<witness hash>,<pub key hash>` string for the buyer or seller.
3. Go to Account > `ctrl + i` > `ctrl + p`.
5. Paste the buyer or seller's `<witness hash>,<pub key hash>` string.
6. Click the "Import unsigned account age witness" button to confirm.
### Sign payment account from dispute
1. Go to Account > `ctrl + i` > `ctrl + s`.
2. Select payment accounts to sign from disputes.
### Sign unsigned witness pub keys
1. Go to Account > `ctrl + i` > `ctrl + o`.
## Other operating tips ## Other operating tips
* To maintain the network, avoid all seed nodes going offline at the same time. If all seed nodes go offline at the same time, arbitrator registration and the network filter will be fully reset, so all arbitrators will need to be re-registered, and the network filter will need to be recreated. This should be done immediately or clients will cancel their offers due to the signing arbitrators being unregistered and no replacements being available to re-sign. * Avoid all seed nodes going offline at the same time. If all seed nodes go offline at the same time, arbitrator registration and the network filter will be fully reset, so all arbitrators will need to be re-registered, and the network filter will need to be recreated. This should be done immediately or clients will cancel their offers due to the signing arbitrators being unregistered and no replacements being available to re-sign.
* If a dispute does not open properly, try manually reopening the dispute with a keyboard shortcut: `ctrl + o`. * If a dispute does not open properly, try manually reopening the dispute with a keyboard shortcut: `ctrl + o`.
* To send a private notification to a peer: click the user icon and enter `alt + r`. Enter a private key which is registered to send private notifications. * To send a private notification to a peer: click the user icon and enter `alt + r`. Enter a private key which is registered to send private notifications.

View file

@ -36,15 +36,6 @@ Follow [instructions](https://github.com/haveno-dex/haveno-ts#run-tests) to run
9. Run the tests with `npm run test -- -t 'my test'` to run tests by name and `npm test` to run all tests together. Ensure all tests pass and there are no exception stacktraces in the terminals of Alice, Bob, or the arbitrator. 9. Run the tests with `npm run test -- -t 'my test'` to run tests by name and `npm test` to run all tests together. Ensure all tests pass and there are no exception stacktraces in the terminals of Alice, Bob, or the arbitrator.
10. Open pull requests to the haveno and haveno-ts projects for the backend and frontend implementations. 10. Open pull requests to the haveno and haveno-ts projects for the backend and frontend implementations.
## Manually sign accounts as the arbitrator
1. Open legacy UI as the arbitrator.
2. Go to the 'Account' tab.
3. Open Signing tab: `ctrl+i`
a. Sign payment account: `ctrl+s`, select payment accounts to sign (sourced from disputes).
b. Sign account age witness: `ctrl+p` then enter <witness hash>,<pub key hash> (from past trade details) and click the "Import unsigned account age witness" button.
c. Sign unsigned witness pub keys: `ctrl+o`
## Release portable Monero binaries for each platform ## Release portable Monero binaries for each platform
1. Update the release-v0.18 branch on Haveno's [monero repo](https://github.com/haveno-dex/monero) to the latest release from upstream + any customizations (e.g. a commit to speed up testnet hardforks for local development). 1. Update the release-v0.18 branch on Haveno's [monero repo](https://github.com/haveno-dex/monero) to the latest release from upstream + any customizations (e.g. a commit to speed up testnet hardforks for local development).