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

Enable tree compact setting bump version to v2.1.1 #661

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ brew install kyokan-bob
4. Compare a checksum of a downloaded Bob Wallet app file:
```
# Linux
sha256sum Bob-2.1.0.AppImage
sha256sum Bob-2.1.1.AppImage

# Windows
certUtil -hashfile Bob-2.1.0.msi SHA256
certUtil -hashfile Bob-2.1.1.msi SHA256

# macOS
shasum -a 256 Bob-2.1.0-x86.dmg
shasum -a 256 bob-2.1.0-arm64.dmg
shasum -a 256 Bob-2.1.1-x86.dmg
shasum -a 256 Bob-2.1.1-arm64.dmg
```

For more details and more advanced PGP signature verification see https://github.com/kyokan/bob-wallet/pull/612.
Expand Down
2 changes: 2 additions & 0 deletions app/background/node/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const clientStub = ipcRendererInjector => makeClient(ipcRendererInjector,
'generateToAddress',
'getAPIKey',
'getNoDns',
'getCompactTreeOnInit',
'getSpvMode',
'getInfo',
'getNameInfo',
Expand All @@ -24,6 +25,7 @@ export const clientStub = ipcRendererInjector => makeClient(ipcRendererInjector,
'setNodeDir',
'setAPIKey',
'setNoDns',
'setCompactTreeOnInit',
'setSpvMode',
'getDir',
'getAPIKey',
Expand Down
24 changes: 23 additions & 1 deletion app/background/node/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
SET_FEE_INFO,
SET_NODE_INFO,
SET_SPV_MODE,
SET_COMPACT_TREE_ON_INIT,
START_NODE_STATUS_CHANGE,
END_NODE_STATUS_CHANGE,
COMPACTING_TREE,
Expand All @@ -36,6 +37,7 @@ const HSD_PREFIX_DIR_KEY = 'hsdPrefixDir';
const WALLET_API_KEY = 'walletApiKey';
const NODE_API_KEY = 'nodeApiKey';
const NODE_NO_DNS = 'nodeNoDns1';
const NODE_COMPACT_TREE_ON_INIT = 'nodeCompactTreeOnInit1';
const SPV_MODE = 'nodeSpvMode';
const HANDSHAKE_API_BASE_URL = 'https://api.handshakeapi.com/hsd';

Expand Down Expand Up @@ -74,6 +76,15 @@ export class NodeService extends EventEmitter {
return false;
}

async getCompactTreeOnInit() {
const compactTreeOnInit = await get(NODE_COMPACT_TREE_ON_INIT);
if (compactTreeOnInit !== null) {
return compactTreeOnInit === '1';
}

return false;
}

async getSpvMode() {
const spv = await get(SPV_MODE);
if (spv !== null) {
Expand Down Expand Up @@ -123,6 +134,14 @@ export class NodeService extends EventEmitter {
await put(NODE_NO_DNS, noDns === true ? '1' : '0');
}

async setCompactTreeOnInit(compactTreeOnInit) {
await put(NODE_COMPACT_TREE_ON_INIT, compactTreeOnInit === true ? '1' : '0');
dispatchToMainWindow({
type: SET_COMPACT_TREE_ON_INIT,
payload: compactTreeOnInit === true,
});
}

async configurePaths() {
const dir = await this.getDir();
if (!fs.existsSync(dir)) {
Expand Down Expand Up @@ -193,6 +212,7 @@ export class NodeService extends EventEmitter {
this.network = network;
this.apiKey = await this.getAPIKey();
this.noDns = await this.getNoDns();
this.compactTreeOnInit = await this.getCompactTreeOnInit();
this.spv = await this.getSpvMode();
}

Expand Down Expand Up @@ -239,7 +259,7 @@ export class NodeService extends EventEmitter {
walletMigrate: 2,
walletIcannlockup: true,
maxOutbound: 4,
compactTreeOnInit: false,
compactTreeOnInit: this.compactTreeOnInit,
});

this.hsd.use(plugin);
Expand Down Expand Up @@ -619,6 +639,7 @@ const methods = {
reset: () => service.reset(),
getAPIKey: () => service.getAPIKey(),
getNoDns: () => service.getNoDns(),
getCompactTreeOnInit: () => service.getCompactTreeOnInit(),
getSpvMode: () => service.getSpvMode(),
getInfo: () => service.getInfo(),
getNameInfo: (name) => service.getNameInfo(name),
Expand All @@ -638,6 +659,7 @@ const methods = {
setNodeDir: data => service.setNodeDir(data),
setAPIKey: data => service.setAPIKey(data),
setNoDns: data => service.setNoDns(data),
setCompactTreeOnInit: data => service.setCompactTreeOnInit(data),
setSpvMode: data => service.setSpvMode(data),
getDir: () => service.getDir(),
getHNSPrice: () => service.getHNSPrice(),
Expand Down
18 changes: 17 additions & 1 deletion app/ducks/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
END_RPC_TEST,
SET_EXPLORER,
UPDATE_HNS_PRICE,
SET_NO_DNS, SET_SPV_MODE,
SET_NO_DNS, SET_SPV_MODE, SET_COMPACT_TREE_ON_INIT,
} from './nodeReducer';
import { VALID_NETWORKS } from '../constants/networks';

Expand Down Expand Up @@ -87,6 +87,12 @@ export const start = (network) => async (dispatch) => {
payload: spv,
});

const compactTreeOnInit = await nodeClient.getCompactTreeOnInit();
dispatch({
type: SET_COMPACT_TREE_ON_INIT,
payload: compactTreeOnInit,
});

dispatch(getWatching(network));

} catch (error) {
Expand Down Expand Up @@ -161,3 +167,13 @@ export const setNoDns = (noDns) => async (dispatch) => {
await dispatch(stop());
await dispatch(start());
};

export const setCompactTreeOnInit = (compactTreeOnInit) => async (dispatch) => {
await nodeClient.setCompactTreeOnInit(compactTreeOnInit);
await dispatch({
type: SET_COMPACT_TREE_ON_INIT,
payload: compactTreeOnInit,
})
await dispatch(stop());
await dispatch(start());
}
7 changes: 7 additions & 0 deletions app/ducks/nodeReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const UPDATE_HNS_PRICE = 'node/UPDATE_HNS_PRICE';
export const SET_RS_PORT = 'node/SET_RS_PORT';
export const SET_NS_PORT = 'node/SET_NS_PORT';
export const SET_NO_DNS = 'node/SET_NO_DNS';
export const SET_COMPACT_TREE_ON_INIT = 'node/SET_COMPACT_TREE_ON_INIT';
export const SET_SPV_MODE = 'node/SET_SPV_MODE';
export const COMPACTING_TREE = 'node/COMPACTING_TREE';

Expand All @@ -33,6 +34,7 @@ export function getInitialState() {
rsPort: 9892,
nsPort: 9891,
noDns: false,
compactTreeOnInit: false,
spv: false,
compactingTree: false,
fees: {
Expand Down Expand Up @@ -133,6 +135,11 @@ export default function nodeReducer(state = getInitialState(), action = {}) {
...state,
noDns: action.payload,
};
case SET_COMPACT_TREE_ON_INIT:
return {
...state,
compactTreeOnInit: action.payload,
};
case SET_SPV_MODE:
return {
...state,
Expand Down
14 changes: 14 additions & 0 deletions app/pages/Settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const connClient = cClientStub(() => require('electron').ipcRenderer);
rsPort: state.node.rsPort,
nsPort: state.node.nsPort,
noDns: state.node.noDns,
compactTreeOnInit: state.node.compactTreeOnInit,
walletApiKey: state.wallet.apiKey,
walletSync: state.wallet.walletSync,
walletInitialized: state.wallet.initialized,
Expand All @@ -74,6 +75,7 @@ const connClient = cClientStub(() => require('electron').ipcRenderer);
stopNode: () => dispatch(nodeActions.stop()),
startNode: () => dispatch(nodeActions.start()),
setNoDns: (noDns) => dispatch(nodeActions.setNoDns(noDns)),
setCompactTreeOnInit: (compactTreeOnInit) => dispatch(nodeActions.setCompactTreeOnInit(compactTreeOnInit)),
setCustomRPCStatus: isConnected => dispatch(setCustomRPCStatus(isConnected)),
fetchWalletAPIKey: () => dispatch(fetchWalletAPIKey()),
showError: (message) => dispatch(showError(message)),
Expand All @@ -91,6 +93,7 @@ export default class Settings extends Component {
rsPort: PropTypes.number.isRequired,
nsPort: PropTypes.number.isRequired,
noDns: PropTypes.bool.isRequired,
compactTreeOnInit: PropTypes.bool.isRequired,
spv: PropTypes.bool.isRequired,
wid: PropTypes.string.isRequired,
changeDepth: PropTypes.number.isRequired,
Expand All @@ -105,6 +108,7 @@ export default class Settings extends Component {
stopNode: PropTypes.func.isRequired,
startNode: PropTypes.func.isRequired,
setNoDns: PropTypes.func.isRequired,
setCompactTreeOnInit: PropTypes.func.isRequired,
showError: PropTypes.func.isRequired,
showSuccess: PropTypes.func.isRequired,
setLocale: PropTypes.func.isRequired,
Expand Down Expand Up @@ -446,6 +450,8 @@ export default class Settings extends Component {
nsPort,
noDns,
setNoDns,
compactTreeOnInit,
setCompactTreeOnInit,
isChangingNodeStatus,
isTestingCustomRPC,
isCustomRPCConnected,
Expand Down Expand Up @@ -547,6 +553,14 @@ export default class Settings extends Component {
null,
isChangingNodeStatus || isTestingCustomRPC || isCustomRPCConnected,
)}
{this.renderSection(
t('settingCompactTreeOnInitTitle'),
t('settingCompactTreeOnInitDesc'),
compactTreeOnInit ? t('disable') : t('enable'),
() => {setCompactTreeOnInit(!compactTreeOnInit)},
null,
isChangingNodeStatus || isTestingCustomRPC || isCustomRPCConnected,
)}
{this.renderSection(
t('settingHip2Title'),
t('settingHip2Desc', rsPort.toString()),
Expand Down
2 changes: 2 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,8 @@
"settingDNSNotRunning": "DNS servers are not running",
"settingDNSRunning": "DNS servers are running on ports %s (root) and %s (recursive).",
"settingDNSTitle": "DNS Servers",
"settingCompactTreeOnInitTitle": "Compact Urkel Tree on Init",
"settingCompactTreeOnInitDesc": "Delete stale data to recover disk space on startup",
"settingDeepcleanDesc": "Reset balance and transaction history.",
"settingDeepcleanTitle": "Deep Clean and Rescan Wallet",
"settingExchange": "Exchange",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "bob-wallet",
"productName": "Bob",
"author": "Kyokan Group, Inc.",
"version": "2.1.0",
"version": "2.1.1",
"description": "A Handshake wallet and auction manager.",
"scripts": {
"build": "./scripts/package.sh",
Expand Down
Loading