This repository has been archived by the owner on Jul 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(api): update the types of receipt api * refactor(listener): separated relay listener into files * feat(proxy): supports proxy in the relay process * feat(bin): add binary dj-proposal for testing proposal directly * chore(api): update the confirmed block api * feat(cmd): add command `confirm` * fix(redeem): correct the redeem loop * chore(bin): add binary tag to new bins
- Loading branch information
Showing
15 changed files
with
299 additions
and
195 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env node | ||
import { Config, log } from "../util"; | ||
import { API, ShadowAPI } from "../api"; | ||
|
||
(async () => { | ||
const args = process.argv.slice(2); | ||
if (args.length !== 1) { | ||
log.warn("Usage: dj-confirm <number>"); | ||
return; | ||
} | ||
|
||
/// Init logs | ||
process.env.LOGGER = "ALL"; | ||
|
||
/// Init API | ||
const conf = new Config(); | ||
const api = await API.auto(); | ||
const shadow = new ShadowAPI(conf.shadow); | ||
const target = Number.parseInt(args[0], 10); | ||
|
||
// Trigger relay | ||
const lastConfirmed = await api.lastConfirm(); | ||
try { | ||
await api.setConfirmed(await shadow.getProposal( | ||
lastConfirmed, | ||
target, | ||
target - 1, | ||
)); | ||
|
||
log.ox(`Set confirmed block ${target} succeed!`); | ||
} catch (e) { | ||
log.ex(e); | ||
} | ||
})(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env node | ||
import { Config, log } from "../util"; | ||
import { API, ShadowAPI } from "../api"; | ||
|
||
(async () => { | ||
const args = process.argv.slice(2); | ||
if (args.length !== 1) { | ||
log.warn("Usage: dj-proposal <number>"); | ||
return; | ||
} | ||
|
||
/// Init logs | ||
process.env.LOGGER = "ALL"; | ||
|
||
/// Init API | ||
const conf = new Config(); | ||
const api = await API.auto(); | ||
const shadow = new ShadowAPI(conf.shadow); | ||
const target = Number.parseInt(args[0], 10); | ||
|
||
// Trigger relay | ||
const lastConfirmed = await api.lastConfirm(); | ||
try { | ||
await api.submitProposal([await shadow.getProposal( | ||
lastConfirmed, | ||
target, | ||
target - 1, | ||
)]); | ||
|
||
log.ox(`Submitted proposal ${target}`); | ||
} catch (e) { | ||
log.ex(e); | ||
} | ||
})(); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export { guard } from "./guard"; | ||
export * as Cache from "./cache"; | ||
export { relay } from "./relay"; | ||
export { listen as guard } from "./guard"; | ||
export { listen as relay } from "./relay"; | ||
export { listen as ethereum } from "./eth"; |
Oops, something went wrong.