Skip to content

Commit

Permalink
Change branch in regtest setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel committed May 10, 2022
1 parent 0dc8a5a commit a892e03
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 31 deletions.
4 changes: 2 additions & 2 deletions docker/regtest/dockerfile-deps/joinmarket/latest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ RUN apt-get update \
curl build-essential automake pkg-config libtool python3-dev python3-pip python3-setuptools libltdl-dev \
&& rm -rf /var/lib/apt/lists/*

ENV REPO https://github.com/dnlggr/joinmarket-clientserver
ENV REPO_REF tumbler-rpc-options
ENV REPO https://github.com/JoinMarket-Org/joinmarket-clientserver
ENV REPO_REF master

WORKDIR /src
RUN git clone "$REPO" . --depth=10 --branch "$REPO_REF" && git checkout "$REPO_REF"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"regtest:logs:jmwalletd": "docker exec -t jm_regtest_joinmarket tail -f /root/.joinmarket/logs/jmwalletd_stdout.log",
"regtest:logs:schedule": "docker exec -t jm_regtest_joinmarket tail -f /root/.joinmarket/logs/TUMBLE.schedule",
"regtest:init": "./docker/regtest/init-setup.sh",
"regtest:mining": "watch -n 30 ./docker/regtest/mine-block.sh"
"regtest:mine": "watch -n 10 ./docker/regtest/mine-block.sh"
},
"eslintConfig": {
"extends": [
Expand Down
60 changes: 32 additions & 28 deletions src/components/Jam.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export default function Jam() {
const [destinationIsInternal, setDestinationIsInternal] = useState(false)
const [collaborativeOperationRunning, setCollaborativeOperationRunning] = useState(false)

const [useInsecureTestingSettings, setUseInsecureTestingSettings] = useState(false)
// Todo: Testing toggle is deactivated until https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/1260 is merged.
// const [useInsecureTestingSettings, setUseInsecureTestingSettings] = useState(false)

// Todo: Discuss if we should hardcode this or let the user pick an account.
const INTERNAL_DEST_ACCOUNT = 0
Expand Down Expand Up @@ -90,32 +91,33 @@ export default function Jam() {

const body = { destination_addresses: destinations }

if (process.env.NODE_ENV === 'development' && useInsecureTestingSettings) {
body.tumbler_options = {
addrcount: 3,
minmakercount: 1,
makercountrange: [1, 1],
mixdepthcount: 3,
mintxcount: 2,
txcountparams: [1, 1],
timelambda: 0.1,
stage1_timelambda_increase: 1.0,
liquiditywait: 10,
waittime: 1.0,
mixdepthsrc: 0,
}
}
console.log(body)
// Todo: Testing toggle is deactivated until https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/1260 is merged.
// if (process.env.NODE_ENV === 'development' && useInsecureTestingSettings) {
// body.tumbler_options = {
// addrcount: 3,
// minmakercount: 1,
// makercountrange: [1, 1],
// mixdepthcount: 3,
// mintxcount: 2,
// txcountparams: [1, 1],
// timelambda: 0.1,
// stage1_timelambda_increase: 1.0,
// liquiditywait: 10,
// waittime: 1.0,
// mixdepthsrc: 0,
// }
// }

try {
const res = await Api.postTumblerStart({ walletName: wallet.name, token: wallet.token }, body)

if (res.ok) {
setCollaborativeOperationRunning(true)
if (!res.ok) {
await Api.Helper.throwError(res, t('schedule.error_starting_schedule_failed'))
}

setCollaborativeOperationRunning(true)
} catch (err) {
const message = err.message || t('schedule.error_starting_schedule_failed')
setAlert({ variant: 'danger', message })
setAlert({ variant: 'danger', message: err.message })
}
}

Expand All @@ -127,12 +129,13 @@ export default function Jam() {
try {
const res = await Api.getTumblerStop({ walletName: wallet.name, token: wallet.token })

if (res.ok) {
setCollaborativeOperationRunning(false)
if (!res.ok) {
await Api.Helper.throwError(res, t('schedule.error_stopping_schedule_failed'))
}

setCollaborativeOperationRunning(false)
} catch (err) {
const message = err.message || t('schedule.error_stopping_schedule_failed')
setAlert({ variant: 'danger', message })
setAlert({ variant: 'danger', message: err.message })
}
}

Expand Down Expand Up @@ -243,19 +246,20 @@ export default function Jam() {
disabled={isSubmitting}
/>
</rb.Form.Group>
{process.env.NODE_ENV === 'development' && (
{/* Todo: Testing toggle is deactivated until https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/1260 is merged. */}
{/*process.env.NODE_ENV === 'development' && (
<rb.Form.Group className="mb-4" controlId="offertype">
<ToggleSwitch
label={'Use insecure testing settings'}
subtitle={
"This is completely insecure but makes testing the schedule much faster. This option won't be available in production."
}
initialValue={useInsecureTestingSettings}
onToggle={async (isToggled) => setUseInsecureTestingSettings(isToggled)}
onToggle={(isToggled) => setUseInsecureTestingSettings(isToggled)}
disabled={isSubmitting}
/>
</rb.Form.Group>
)}
)*/}
</>
)}
{!collaborativeOperationRunning &&
Expand Down

0 comments on commit a892e03

Please sign in to comment.