Replies: 13 comments
-
Thank you for writing and checking out the repo! It would be great to have assistance on these tools! What areas of research are you working on? The repo is being actively worked on a few days per week. I'm not able to dedicate full time to it at the moment (I would certainly love to though). Efforts over the last ~month were spent on metawork to get the repository easier to work with as a modular system. Some of those changes include:
I've been the primary person working on this repo for now, so the master branch is rather unstable until these changes are finalized. I also have a handful of projects locally that haven't been pushed to the repo since they're not in the Lerna format yet. The release modules of On the issues you're encountering:
// packages/lntools-noise/test.js
// @ts-check
/* eslint-disable no-console */
const crypto = require('@lntools/crypto');
const winston = require('winston');
winston.configure({
level: 'info',
transports: [new winston.transports.Console()],
format: winston.format.combine(
winston.format.splat(),
winston.format.colorize(),
winston.format.simple()
),
});
const { connect, createServer } = require('./lib');
async function run() {
startServer();
createClient();
}
run().catch(console.error);
function startServer() {
let ls = Buffer.from('2121212121212121212121212121212121212121212121212121212121212121', 'hex');
let esFactory = () => Buffer.from('2222222222222222222222222222222222222222222222222222222222222222', 'hex'); // prettier-ignore
let msg = 0;
// fire up the server
let server = createServer({ ls, esFactory }, socket => {
winston.info('server socket open');
socket.on('connect', () => {
winston.info('server socked connected');
socket.write(Buffer.from('hello ' + ++msg));
});
socket.on('data', d => {
winston.info('server received: ' + d.toString());
socket.write(Buffer.from('hello ' + ++msg));
});
});
server.listen({ port: 9735, host: '127.0.0.1' });
}
function createClient() {
let ls = Buffer.from('1111111111111111111111111111111111111111111111111111111111111111', 'hex');
let rpk = crypto.getPublicKey(
Buffer.from('2121212121212121212121212121212121212121212121212121212121212121', 'hex')
);
let es = Buffer.from('1212121212121212121212121212121212121212121212121212121212121212', 'hex');
let msg = 0;
let socket = connect({
ls,
es,
rpk,
host: 'localhost',
port: 9735,
});
socket.on('connect', () => {
winston.info('client connected');
});
socket.on('data', data => {
winston.info('client received: ' + data.toString());
setTimeout(() => {
socket.write(Buffer.from('hello ' + ++msg));
}, 250);
});
} |
Beta Was this translation helpful? Give feedback.
-
Thanks for getting back to me on such a short notice. I'll look into things
in more detail tomorrow and get back to you.
I'm based in Kuala Lumpur and it 22:30 over here, so I'm calling it a day.
…On Tue, Apr 30, 2019, 22:16 Brian Mancini ***@***.***> wrote:
Thank you for writing and checking out the repo! It would be great to have
assistance on these tools! What areas of research are you working on?
The repo is being actively worked on a few days per week. I'm not able to
dedicate full time to it at the moment (I would certainly love to though).
Efforts over the last ~month were spent on metawork to get the repository
easier to work with as a modular system. Some of those changes include:
- breaking out from a single project into a monorepo with Lerna
- adding CI with CircleCI across all projects
- adding code coverage with codecov.io across all projects
- improving and standardizing JSDoc/TSDoc across all projects
- adding build-time JavaScript type checking with TypeScript (note
we're not using TypeScript but checking using JSDoc/TSDoc definitions)
I've been the primary person working on this repo for now, so the master
branch is rather unstable until these changes are finalized. I also have a
handful of projects locally that haven't been pushed to the repo since
they're not in the Lerna format yet.
The release modules of @lntools/noise and @lntools/invoice on NPM should
be stable.
On the issues you're encountering:
- src/daemon is woefully out of date. I can clean that up shortly and
get it checked into master. It will likely be replaced by more specific
tools as the project progresses. It was originally just a testing ground
for connecting to a Bitcoin testnet node and ensuring connection state can
be maintained.
- I will take a look into noise-state.js:L185 and see what might be
going on. CI builds are passing for noise, so I wonder if there is
some compatibility issue with Windows (I'm running on Mac and CI runs in
Linux). Also I just pulled a fresh version of the repo, ran NPM install,
and was able to get a simple test application below running. (Note this
file was dropped to packages/lntools-noise/test.js)
// packages/lntools-noise/test.js// @ts-check
/* eslint-disable no-console */const crypto = ***@***.***/crypto');
const winston = require('winston');winston.configure({
level: 'info',
transports: [new winston.transports.Console()],
format: winston.format.combine(
winston.format.splat(),
winston.format.colorize(),
winston.format.simple()
),
});
const { connect, createServer } = require('./lib');
async function run() {
startServer();
createClient();
}
run().catch(console.error);
function startServer() {
let ls = Buffer.from('2121212121212121212121212121212121212121212121212121212121212121', 'hex');
let esFactory = () => Buffer.from('2222222222222222222222222222222222222222222222222222222222222222', 'hex'); // prettier-ignore
let msg = 0;
// fire up the server
let server = createServer({ ls, esFactory }, socket => {
winston.info('server socket open');
socket.on('connect', () => {
winston.info('server socked connected');
socket.write(Buffer.from('hello ' + ++msg));
});
socket.on('data', d => {
winston.info('server received: ' + d.toString());
socket.write(Buffer.from('hello ' + ++msg));
});
});
server.listen({ port: 9735, host: '127.0.0.1' });
}
function createClient() {
let ls = Buffer.from('1111111111111111111111111111111111111111111111111111111111111111', 'hex');
let rpk = crypto.getPublicKey(
Buffer.from('2121212121212121212121212121212121212121212121212121212121212121', 'hex')
);
let es = Buffer.from('1212121212121212121212121212121212121212121212121212121212121212', 'hex');
let msg = 0;
let socket = connect({
ls,
es,
rpk,
host: 'localhost',
port: 9735,
});
socket.on('connect', () => {
winston.info('client connected');
});
socket.on('data', data => {
winston.info('client received: ' + data.toString());
setTimeout(() => {
socket.write(Buffer.from('hello ' + ++msg));
}, 250);
});
}
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://github.com/altangent/lntools/issues/1#issuecomment-487969824>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB4LVHU4WP7S2RTMDT3UTUTPTBIFHANCNFSM4HJLG6DQ>
.
|
Beta Was this translation helpful? Give feedback.
-
Sounds good. The |
Beta Was this translation helpful? Give feedback.
-
@gijswijs I just pushed a few changes to update daemon. You will need to run |
Beta Was this translation helpful? Give feedback.
-
@bmancini55 I just made a small test with the release module of @lntools/noise on NPM. I installed the Visual C++ Build Tools in VS2015, and set the NPM config key After that the install of @lntools/noise didn't default to the pure JS version of chacha-native. Just to be sure I also tested the pure JS build with the release module of @lntools/noise on NPM and that gave the same errors I mentioned earlier. So it's save to say that the C++ build and the pure JS build aren't exact ports of each other. Now that we got that out of the way, I'm very eager to go ahead and try the daemon you just updated. To answer your earlier question: My research is on privacy and second layer solutions, mainly Lightning. It's PhD research so I'll be doing this for the next three years if everything goes all right. What I try to do is test if the theoretical improvements of 2nd layer solutions with regards to privacy hold up in practice. For now I'm interested in the opening and closing of LN channels. For this I need to scan the gossip messages to see when channels open, and then check the blockchain to see when they close and whether this was mutual or unilateral (or revoked). As such, at his moment, I'm interested in BOLT 7, and obviously BOLT 1 and 8 because without those 2 you got nothing. |
Beta Was this translation helpful? Give feedback.
-
Are you sure? I don't see any new commits yet. |
Beta Was this translation helpful? Give feedback.
-
@gijswijs ah sorry. Ran out the door too quickly. You should be good now. |
Beta Was this translation helpful? Give feedback.
-
I think we got something running!
I'm really happy with this. If you want, I can close this issue, because the answer is that the current status of this repository is pretty much reflected the README.md. But if you have some pointers on where you want this repository to go, let me know, and I'll see if I can help out. |
Beta Was this translation helpful? Give feedback.
-
I'm glad you were able to get the native version working! I'm going to change that package to use Also we can update master README.md file to include your notes for windows users. Your research sounds great and aligns nicely with our initial goals! One of Altangent's main projects is the data analysis platform www.blocktap.io. We've been collecting statistics on the Lightning Network for a while and working on a variety of tools (https://graph.lndexplorer.com/ for one). The first goals of lntools is collection of p2p message and on-chain monitoring so that we can achieve more granular lightning data for blocktap. I have a few projects that need to be merged into lntools:
The wire projects currently needs a good bit of work. It is the code for the LN wire protocol and currently includes the peer wrapper for the noise socket, ping/pong state machine, and partially implemented parsing/building messages. |
Beta Was this translation helpful? Give feedback.
-
I've been thinking about this. I'd love to help. Let me be honest. My development skills are rusty, to say the least. I've been working in my own company for the past 17 years, and development was less and less part of my job. Only recently the opportunity arose to do my PhD, and I grabbed it. So I've been brushing up on my javascript/node skills (and my C# skills, but that's not really relevant for this repo) |
Beta Was this translation helpful? Give feedback.
-
Any help would be appreciated! Most of the code is either in local branches (going to push them to GitHub branches today) or scattered throughout this repo: https://github.com/bmancini55/crypto-playpen. For connecting to bitcoind, the package lntools-bitcoind already exists. It is just an RPC and ZeroMQ wrapper and some TypeScript type definitions. Packages that will be pushed today:
The initial goal will be building an in-memory graph using the graph package. Additional graph traversal/routing logic could go there as well. At some point this could be serialized to disk or pushed to a GDB pretty easily. |
Beta Was this translation helpful? Give feedback.
-
Hey man, You are on a rampage lately with this repository. Great to see. |
Beta Was this translation helpful? Give feedback.
-
Thanks! Been trying to get all the gossip code buttoned up. Almost there. More examples and better documentation are on the list as well. |
Beta Was this translation helpful? Give feedback.
-
I'll come to business right away:
This repository is exactly what I'm looking for. A modular implementation of the BOLT specifications. And it's first use case, research, is what I need it for.
I'm also in the position to invest considerable time in this repository, if it actually fits my needs, and it seems that it does.
That being said, after playing around with it I have some questions about the current status.
This is what I got so far:
After that I tried to start smaller, so I tried to get the NoiseSocket server running and that worked! But when I connect with a client, I get an error. I do get a socket connection, but the handshake fails. It fails with this error:
I think that's because in
noise-state.js
line 185 an zero sized Buffer is passed asplaintext
argument, and it seems that ChaCha doesn't like that.So that's where I am right now. My question is: @bmancini55 , did you get things to run so far? Am I doing something wrong? Do you have a local version with stuff that's still to be committed?
Thanks in advance for any help or pointers.
Beta Was this translation helpful? Give feedback.
All reactions