Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Node.js binding PoC #162

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

jopemachine
Copy link
Member

@jopemachine jopemachine commented Oct 13, 2024

Related issue: #94.

This was done purely just for fun, and I have no intention of finishing this task.
But I'm leaving it as a PR for future reference.

❯ node example.js
Oct 13 06:55:59.846 INFO RaftNode bootstrapped. Config { raft_config: { id: 0, election_tick: 20, heartbeat_tick: 2, applied: 0, max_size_per_msg: 0, max_inflight_msgs: 256, check_quorum: false, pre_vote: false, min_election_tick: 0, max_election_tick: 0, read_only_option: Safe, skip_bcast_commit: false, batch_append: false, priority: 0, max_uncommitted_size: 18446744073709551615, max_committed_size_per_ready: 18446744073709551615, }, log_dir: logs, bootstrap_from_snapshot: false, save_compacted_logs: false, compacted_log_dir: ./, compacted_log_size_threshold: 1073741824, snapshot_interval: None, tick_interval: 0.1, initial_peers: None, lmdb_map_size: 1073741824, cluster_id: default, conf_change_request_timeout: 2, }
Oct 13 06:55:59.853 INFO switched to configuration; config: Configuration { voters: Configuration { incoming: Configuration { voters: {1} }, outgoing: Configuration { voters: {} } }, learners: {}, learners_next: {}, auto_leave: false }
Oct 13 06:55:59.853 DEBG reset election timeout 0 -> 37 at 0
Oct 13 06:55:59.853 INFO became follower at term 0 from_role Follower
Oct 13 06:55:59.853 INFO newRaft; term: 0, commit: 0, applied: 0, last index: 0, last term: 0, peers: Configuration { incoming: Configuration { voters: {1} }, outgoing: Configuration { voters: {} } }
Oct 13 06:55:59.853 INFO RawNode created with id 1.
Oct 13 06:55:59.853 DEBG reset election timeout 37 -> 36 at 0
Oct 13 06:55:59.853 INFO became candidate at term 1
Oct 13 06:55:59.853 DEBG reset election timeout 36 -> 31 at 0
Oct 13 06:55:59.853 INFO became leader at term 1
Oct 13 06:55:59.853 DEBG RaftServer starts to listen gRPC requests on "127.0.0.1:60061"...
Applying entries: [Entry { entry_type: EntryNormal, term: 1, index: 1, data: [], context: [], sync_log: false }]
Oct 13 06:55:59.968 DEBG persisted index 1
Oct 13 06:55:59.968 DEBG committing index 1
Oct 13 06:55:59.968 DEBG Entries [1, 2) requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant