Skip to content

Commit

Permalink
chore: add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
trung2891 committed Aug 26, 2024
1 parent 6659875 commit 30d78d7
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 10 deletions.
6 changes: 4 additions & 2 deletions packages/relayer/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
XRPL_RPC=
XRPL_SERVER="wss://s1.ripple.com/"
MNEMONIC_ENCRYPTED=
XRPL_SEED_ENCRYPTED= # or XRPL_MNEMONIC_ENCRYPTED, XRPL_SECRET_ENCRYPTED
LAST_LEDGER=-1
LAST_LEDGER=-1
CW_BRIDGE_ADDRESS=
XRPL_MULTISIG=rn77T6TDSTrbYKHaxDBrUMcZR95iQFYNvt
38 changes: 38 additions & 0 deletions packages/relayer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# XRPL - bridge - relayer



## Installation

You can install xrplRelayer globally using npm `npm install -g @oraichain/xrpl-bridge-relayer` or yarn `yarn global add @oraichain/xrpl-bridge-relayer`

## Installation from source

1. Clone this repository
```https://github.com/oraichain/xrpl-bridge-sdk```

2. Run ```yarn``` to install all dependencies <br>

3. Create .env file with same structure like .env.example

4. Run ```yarn build```

5. Run ```cd packages/relayer```

6. Run ```yarn start```

## Usage

Type `xrplRelayer`

```bash
xrplRelayer [command]

Commands:
xrplRelayer start start relay packet between Oraichain and XRP Ledger

Options:
-h, --help Show help [boolean]
--version Show version number [boolean]
--env Path to JSON config file [default: ".env"]
```
3 changes: 2 additions & 1 deletion packages/relayer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"dist/index.js"
],
"scripts": {
"build": "esbuild src/index.ts --bundle --minify --platform=node --external:fsevents --external:shelljs --log-level=error --outfile=dist/index.js"
"build": "esbuild src/index.ts --bundle --minify --platform=node --external:fsevents --external:shelljs --log-level=error --outfile=dist/index.js",
"start": "node dist/index.js"
},
"license": "MIT",
"publishConfig": {
Expand Down
12 changes: 5 additions & 7 deletions packages/relayer/src/relayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,18 @@ export class XrplBridgeRelayer {
for (const relayerAction of this.relayerActions) {
await relayerAction.takeAction();
}
await setTimeout(PROCESS_INTERVAL);
} catch (err) {
console.log(err);
}
await setTimeout(PROCESS_INTERVAL);
}
}
}

export default async (yargs: Argv) => {
const oraiRpcUrl = process.env.RPC_URL ?? "https://rpc.orai.io";
const xrplServer =
process.env.XRPL_SERVER || "wss://s.altnet.rippletest.net:51233";
const xrplServer = process.env.XRPL_SERVER ?? "wss://xrplcluster.com/";
const lastLedger = Number(process.env.LAST_LEDGER) || -1;
console.log(xrplServer);

const discordWebhookUrl = process.env.DISCORD_WEBHOOK_URL;

Expand All @@ -93,9 +91,9 @@ export default async (yargs: Argv) => {
await xrplClient.connect();
let xrplWallet = getXRPLWallet();

let xrplBridgeAddr = "rK6GUy3ki2DFxbqe6CyZiSNZvgiUmDBPZU";
let cwBridgeAddr =
"orai1rtkh7uzewvpq3uml3hhfmcwrq8l4x85ahch4dp940zlyfqe7m24sxhq0cm";
let xrplBridgeAddr = process.env.XRPL_MULTISIG;
let cwBridgeAddr = process.env.CW_BRIDGE_ADDRESS;

let bridgeAdapter = await XrplBridgeRelayer.connect(
oraiRpcUrl,
oraiSigner,
Expand Down

0 comments on commit 30d78d7

Please sign in to comment.