Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
enableForging(keys, port, ip) {
return popsicle
.put({
url: endpoints.versions[currentVersion].enableForging(
ip || '127.0.0.1',
port || 4000
),
headers,
body: {
password: 'elephant tree paris dragon chair galaxy',
publicKey: keys.publicKey,
forging: true,
},
})
.then(res => {
if (res.status !== apiCodes.OK) {
throw new Error(
`Failed to enable forging for delegate with publicKey: ${
testNodeConfig.delegates.forEach(keys => {
var enableForgingPromise = popsicle.put({
url: `http://${testNodeConfig.ip}:${testNodeConfig.wsPort -
1000}/api/node/status/forging`,
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: {
password: 'elephant tree paris dragon chair galaxy',
publicKey: keys.publicKey,
},
});
enableForgingPromises.push(enableForgingPromise);
});
});