Skip to content

Commit

Permalink
feat: 🎸 Add besu adapter
Browse files Browse the repository at this point in the history
Adds support for capturing peer information in besu

✅ Closes: 76
  • Loading branch information
ccordi committed Nov 21, 2020
1 parent a3cbaf2 commit 9718835
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/introspect.ts
Expand Up @@ -6,6 +6,7 @@ import { GenericNodeAdapter } from './platforms/generic';
import { GethAdapter } from './platforms/geth';
import { ParityAdapter } from './platforms/parity';
import { QuorumAdapter } from './platforms/quorum';
import { BesuAdapter } from './platforms/besu';
import { retry, linearBackoff } from './utils/retry';

const { debug, info, warn, error } = createModuleDebug('introspect');
Expand All @@ -25,6 +26,9 @@ export function createNodeAdapter(version: string, chain?: string, network?: str
if (version.startsWith('Parity//') || version.startsWith('Parity-Ethereum//')) {
debug('Detected parity node');
return new ParityAdapter(version, chain, network);
} else if (version.includes('besu')) {
debug('Detected besu node');
return new BesuAdapter(version, chain, network);
}
debug('No specific support for given node type, falling bakc to generic adapter');
return new GenericNodeAdapter(version, chain, network);
Expand Down
7 changes: 7 additions & 0 deletions src/platforms/besu.ts
@@ -0,0 +1,7 @@
import { GethAdapter } from './geth';

export class BesuAdapter extends GethAdapter {
public get name(): string {
return 'besu';
}
}

0 comments on commit 9718835

Please sign in to comment.