Skip to content

Commit

Permalink
Merge pull request #19 from Kava-Labs/ko-persist-config
Browse files Browse the repository at this point in the history
feat: add basic persistence, fixes
  • Loading branch information
kincaidoneil authored Mar 9, 2019
2 parents 01707d4 + 537691d commit b82befb
Show file tree
Hide file tree
Showing 30 changed files with 1,062 additions and 847 deletions.
7 changes: 3 additions & 4 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"include": ["src/**/*.ts"],
"exclude": ["**/__tests__/**/*.ts", "**/*.d.ts"],
"extension": [".ts"],
"require": ["ts-node/register"],
"include": ["build/**/*.js"],
"exclude": ["**/__tests__/**/*.js", "**/*.ts"],
"extension": [".js"],
"reporter": ["text", "html", "lcov"]
}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Create an instance of the API, which automatically connects to the underlying le
import { connect, LedgerEnv, SettlementEngineType } from '@kava-labs/switch-api'

// Connect to testnet
// (State is loaded and persisted to ~/.switch/config.json automatically)
const api = await connect()

// Alternatively, run a local connector using Kava's connector-config
Expand Down Expand Up @@ -229,15 +230,15 @@ await api.disconnect()

## Known Issues

- Currently, no state is persisted, meaning payment channels claims and credentials are not saved after the session ends. We've architected the API to enable this, and it's a top priority within the next week or two.
- Persisted private keys, secrets and other data is currently stored **unencrypted**.
- By design, clients do not currently pay for incoming capacity on ETH nor XRP. However, that's not a sustainable solution. In order to scale and prevent liquidity denial of service attacks, clients should pay a fee to "buy" incoming capacity/bandwidth for a period of time. However, this negotiation and accounting adds a great deal of complexity.
- Uplinks don't operate an internal `ilp-connector`, which may introduce some minor security risks. We intend to update this after the internal plugin architecture is refactored.
- Machinomy payment channels don't currently support watchtowers, which can become a security risk if a client is offline for an extended period of time and the connector disputes the channel. (In XRP, this is less of an issue, since the on-chain fees are low enough that regular checkpoints of the latest claim can be submitted to the ledger).
- The speed of Lightning settlements degrades significantly as the number of hops increases, and even with a direct channel between peers, is currently much slower than XRP or ETH. We can make some optimizations (albeit minor) to improve this.

## Roadmap

- [ ] Persistence and encryption of the configuration, so the uplinks and payment channel claims are restored between sessions (very soon)
- [ ] Encryption of stored credentials
- [ ] Internal refactoring/improving code quality
- [ ] Support for user-defined connectors
- [ ] Additional assets, including ERC-20 tokens such as DAI
Expand Down
8 changes: 3 additions & 5 deletions ava.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
export default {
files: ['src/__tests__/**/*.ts'],
files: ['build/__tests__/**/*.test.js'],
failFast: true,
verbose: true,
serial: true,
timeout: '3m',
compileEnhancements: false,
extensions: ['ts'],
require: ['ts-node/register']
timeout: '2m',
require: ['source-map-support/register']
}
Loading

0 comments on commit b82befb

Please sign in to comment.