- Install the Git webhook for Push to Deploy
- Custom headers (!!) NEEDS [ ] STATIC to be DISABLED even if static, example: https://github.com/WietseWind/iPubXahau-Homepage
- Make sure you have the nixpacks.toml and the .nix folder, the custom headers (nginx format) are in the .nix folder.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install | |
# sudo curl https://gist.githubusercontent.com/WietseWind/5ef71f7a26d9588a233f1d034762ac84/raw/dlvr.sh > /usr/local/bin/dlvr | |
# sudo chmod +x /usr/local/bin/dlvr | |
# Use: dlvr somefilename | |
DLVR_INIT=$(curl -i -s https://dlvr.cloud/api.php) | |
DLVR_SESSION=$(echo "$DLVR_INIT"|grep session|grep addr|grep domain|jq .session|cut -d '"' -f 2) | |
DLVR_ADDR=$(echo "$DLVR_INIT"|grep session|grep addr|grep domain|jq .addr|cut -d '"' -f 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fetch from 'node-fetch' | |
import { XrplDefinitions, derive, sign } from 'xrpl-accountlib' | |
const now = new Date() | |
const Server = 'https://xahau-test.net' // can be testnet, xahau-test.net / xahau.network | |
const secret = '{sender secret}' // can be RK secret | |
const Account = derive.familySeed(secret) | |
Account.address = '{sender account r-address}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Access: http://{ip}/script/1/prtg | |
HTTPServer.registerEndpoint('prtg', function (request, response) { | |
response.headers = [ | |
['content-type', 'application/json'] | |
] | |
const em = Shelly.getComponentStatus('switch', 0) | |
const ip = Shelly.getComponentStatus('input', 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shelly: Scripts - create prtg.js with contents below - Start - Scripts main page: "Run on start" | |
// Call with (assuming the first script): http://{shellyip}/script/1/prtg | |
// PRTG: Import HTTP Data Advanced sensor. | |
HTTPServer.registerEndpoint('prtg', function (request, response) { | |
response.headers = [ | |
['content-type', 'application/json'] | |
] | |
const em = Shelly.getComponentStatus('em', 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fetch from 'node-fetch' | |
import { hookStateXLFtoBigNumber } from './xfl.mjs' | |
// Credits: https://github.com/tequdev/xahau-reward-claim/blob/main/src/app/ClaimReward.tsx | |
const account = 'rTeLeproT3BVgjWoYrDYpKbBLXPaVMkge' | |
const RPC_ENDPOINT = 'https://xahau.network' | |
const toUnixTimestamp = ts => ts + 946684800 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { getPubKey, xflHexToString } from "./statelib.mjs"; | |
const main = async () => { | |
console.log(getPubKey(process.argv[2])); | |
const options = { | |
method: "POST", | |
headers: { | |
"Content-Type": "application/json", | |
}, | |
body: JSON.stringify({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createECDH } from 'crypto' | |
import elliptic from 'elliptic' | |
import { deriveAddress } from 'ripple-keypairs' | |
const curve = 'secp256k1' | |
const secp256k1 = elliptic.ec(curve) | |
const bytesToHex = a => a.map(byteValue => ('0' + byteValue.toString(16)).slice(-2)).join('') | |
const getPublic = echdObj => bytesToHex(secp256k1.keyFromPrivate(echdObj.getPrivateKey()).getPublic().encodeCompressed()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
enableEmit, | |
getState, | |
setState, | |
prepareEmit, | |
doEmit, | |
log, | |
AnyJson, | |
} from '@xahau/hooks' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import accountlib from 'xrpl-accountlib' | |
import assert from 'assert' | |
const requiredBits = 256 | |
const requiredThrows = Math.ceil(requiredBits / Math.log2(10)) | |
// Adapted from validator keypair dice tool by RichardAH | |
// https://github.com/RichardAH/validator-keys-from-dice/blob/main/dice.js | |
// Random (BAD RANDOM! BAD BAD BAD RANDOM! DO NOT EVER USE THIS!! TESTING PURPOSES ONLY!) |
NewerOlder