Closed PsychoPunkSage closed 4 months ago
hi @Kodylow
I saw there was some changes made in the fedimint-go/client.go
file. So I updated my test cases accordingly.
But I noticed some missing fn like SwitchGateway
, AwaitPay
. Is there any reason for their absence or they will be added later?
(Was busy with lab tests so wasn't able to focus much this side )
There's no more active gateway on the fedimint-clientd side so that active gateway logic switched to wrapper side logic. Await pay was a redundant method so removed
Ohk, got it
I have posted an issue related to fedimint-clientd
in discord channel. Can you please tell how should I proceed?
Can you link to that? And this doesn't match the requests pattern I'm using in the typescript, and it doesn't run locally when I just tried, is this ready for review?
Can you link to that? And this doesn't match the requests pattern I'm using in the typescript, and it doesn't run locally when I just tried, is this ready for review?
No I'm not able to test it currently as I'm facing problem in running clientd
... Its is not ready yet. As soon as the error get sorted with clientd I will make the changes to properly test it... won't take mush time in making changes I suppose
Discord Discussion Link :: nix-direnv issue is solved but clientd
issue still exist
My .env
currently look like this...
FEDIMINT_CLIENTD_INVITE_CODE = 'fed1...'
FEDIMINT_CLIENTD_DB_PATH = '/absolute/path/to/fm_db_dir'
FEDIMINT_CLIENTD_PASSWORD = 'some-secure-password-that-becomes-the-bearer-token'
FEDIMINT_CLIENTD_ADDR = '127.0.0.1:3333'
Can you tell the valid value for all the fields.. especially FEDIMINT_CLIENTD_INVITE_CODE
and FEDIMINT_CLIENTD_DB_PATH
?
I'm getting these errors..
$ sudo nix develop -i $ just dev
$ nix develop -i $ just dev
I just updated the example.env to have useful mutinynet defaults, you can use those
I just updated the example.env to have useful mutinynet defaults, you can use those
Yes it is working now.... I will try to complete this test suite within few days (actually our semester is ending so I am involved in lots of tests)
I want to ask that fm_db
has 2 folders multimint.db
and 15db8cb4f1ec8e484d73b889372bec94812580f929e8148b7437d359af422cd3.db
... what are these?? and what are they used for??
The MultiMint.db is a master DB, each sub DB is a specific client DB for a federation, the name of the DB is the federationId
Can you link to that? And this doesn't match the requests pattern I'm using in the typescript, and it doesn't run locally when I just tried, is this ready for review?
hi
So I have implemented TEST for ADMIN METHODS
inside func TestFedimintGo
also edited justfile.local.just
Altough, I face a small issue: On running just test-go-pps
(after nix develop -i
) I'm getting errors...
cd wrappers/fedimint-go && go test pkg/fedimint/client_test.go
warning: GOPATH set to GOROOT () has no effect
go: module cache not found: neither GOMODCACHE nor GOPATH is set
error: Recipe `test-go-pps` failed on line 14 with exit code 1
I think the GOPATH is not exposed to nix shell, Currently sorting it.. Can you test whether test is working or not??
Concern
I have little concern regarding newKeyPair()
... I have implemented it in a different way.. (Can you look at it?)
will review today, yeah you need to add go into the flake.nix
Hi Kodylow. I have implemented all the tests. Please review it. Thank You
(nix:nix-shell-env) Kodys-MacBook-Pro-2:fedimint-clientd kody$ just test-go-pps cd wrappers/fedimint-go && go test pkg/fedimint/client_test.go
pkg/fedimint/client_test.go:81:33: undefined: FedimintClient
pkg/fedimint/client_test.go:96:21: undefined: FedimintClient
pkg/fedimint/client_test.go:98:9: undefined: NewFedimintClient
FAIL command-line-arguments [build failed]
FAIL
error: Recipe test-go-pps
failed on line 14 with exit code 1
hi @Kodylow I have updated the file as you have told me in the discord.. Please have a look at it
Hi,
I have a little issue in my hand... regarding Golang support
inside nix-shell
I tried many methods but they didn't method..
Currently I changed my shell.nix
to this
# save this as shell.nix
{ pkgs ? import <nixpkgs> {}}:
pkgs.mkShell {
+ buildInputs = with pkgs; [ go ];
packages = [ pkgs.hello ];
}
.bashrc
......
# Nix-pkg-manager
- nix = {
- package = pkgs.nix;
- settings.experimental-features = [ "nix-command" "flakes" ];
- };
......
After I did this
nix develop -i
> nix-shell ./shell.nix
> just test-go
Error::>
cd wrappers/fedimint-go && go run -mod=mod cmd/main.go
warning: GOPATH set to GOROOT () has no effect
go: module cache not found: neither GOMODCACHE nor GOPATH is set
error: Recipe `test-go` failed on line 11 with exit code 1
I don't much about what is going wrong
you have to change it in the flake.nix, not the shell.nix
Hi @Kodylow I tried to use Golang inside nix shell like this
But it is not working. I have very little idea about nix + very AIs also misleading me....
Can you please provide me the flakes.nix setup
that you are using along with some nix materials so that I can handle such basic things?
Plus is the test working?? I think I mirrored everything
Go is definitely working, just rebase this PR I updated the flake for it yesterday for you. I just tested on my computer and replit in the flake so no idea why you're getting a flake error if you're rebased.
Running your pps tests throws that a bunch of stuff is undefined, running my test.go it errors at discover version but I haven't finished updating all of them yet. I'm almost done updating all the python stuff, between python and typescript that should be enough to mirror the go stuff
pps
one can be scrapped... as I have updated the tests in main.go
file. So, if the test is running after executing just test-go
then this PR is all good to be merged...
Ok if Python is updated then I will use it to mirror go_tests
I checked python tests... there was nothing much to add. Everything was updated. So you can take a look at it..
I have one question...
fedimint-go
has ClaimPubkeyReceive
and CreateInvoiceForPubkey
functions. But these functions are missing in both fedimint-py
and fedimint-ts
. Not sure whether to remove it or not
I removed those on purpose, those 2 shouldn't be used, you should only use the tweak methods
The go tests are still failing on the discoverVersion for me, I finished updating all the python stuff yesterday and merged it
Still getting an error
Steps I am following:
nix develop -i
just dev
: Let it compile. fedimint-clientd
: up | user
: down | ngrok
: downnix develop -i
> just test-go
and its failing with above error..The go tests are still failing on the discoverVersion for me, I finished updating all the python stuff yesterday and merged it
Got it whats the issue. I will change it..
Hello..
I have made required changes and I think now discover_version
should work. (Earlier threshold
var was optional, I made it compulsory and passed 1
as threshold var.)
Getting there, some of the outputs don't look deserialized and I get a segfault on join:
Method: /v2/admin/discover-version
jsonBody: {"threshold":1}
Input: 1
Output: &map[15db8cb4f1ec8e484d73b889372bec94812580f929e8148b7437d359af422cd3:map[version:map[core:map[maj
or:0 minor:1] modules:map[0:map[major:0 minor:0] 1:map[major:0 minor:0] 2:map[major:0 minor:0]]]]]
--------------------
--------------------
Method: /v2/admin/federation-ids
Input: <nil>
Output: {[15db8cb4f1ec8e484d73b889372bec94812580f929e8148b7437d359af422cd3]}
--------------------
--------------------
Method: /v2/admin/info
Input: <nil>
Output: &{ map[] 0 0 {map[]}}
--------------------
--------------------
Method: /v2/admin/join
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1025477e4]
Still getting an error
Steps I am following:
nix develop -i
just dev
: Let it compile.fedimint-clientd
: up |user
: down |ngrok
: down- in another terminal::
nix develop -i
>just test-go
and its failing with above error..
This thing is giving me pain due to which I'm not able to test anything... Can you please see what possibly is going wrong. I searched everything but couldn't find any working soln :(
RESOLVED IT NO WORRIES :)
@Kodylow Added serialize and deserialize lines to each output lines
Are u working on something cause i'm getting this new error on running just dev
Already have version > 1.74.0
rustc --version
rustc 1.75.0 (82e1608df 2023-12-21)
Make sure you rerun nix develop, was updating the flake
Yeah did that. Still getting that error. Maybe there is something that got missed while updating. No issues.
Hi @Kodylow I want some clarification on something
I found that some of the tests in my test_scripts are failing with some random HTTP errors like 500
, 400
, 402
etc..
Does this mean that tests are running fine but there is issue with connection??
Thank You
Okay I'm still getting errors whenever I run these. For those errors you have to figure out individually why they're throwing, some are because the method signatures are wrong, some are maybe because you're running the tests outside just dev
so the client isn't running, some aren't converting the types properly, they depend on the specific tests. Here's a branch with me trying to fix some of them, got through to /invoice but looks like the go types for gateway are off https://github.com/fedimint/fedimint-clientd/tree/kody-go-test
Yeah, I will go through them and sort the issues
Hi Kodylow Got some updates...
ADMIN FUNCTIONS
are all working
LIGHTNING METHODS
- list-gateways giving 405 error; I am using all the commands after
just dev
. I don'r know why its not working, it should work... is there any issue of limited access (u used ActiveFederationId as a parameter BUT I think I doesn't take any parameters)- CreateInvoice Error 422
Error calling INVOICE: HTTP error! status: 422, message: Failed to deserialize the JSON body into the target type: gatewayId: malformed public key at line 1 column 163
for gateway-id
i crosschecked it many times. it is implemented in the same way as in fedimint-py
and fedimint-ts
...
MINT METHODS
- Spend Error 500
500, message: Something went wrong: Insufficient balance: requested 3000 msat but only 0 msat available
I think I need some msat
with me to test this function (which I don't have). How can I get those msat?
ONCHAIN METHODS
- they are giving
404
error -_-
If you will be doing some sessions in general channel please let me know i can join it to speedrun things
Also there are some disparity between FedimintClient.py
and client.go
...
What should I do?? Should I update FedimintClient.py
or client.go
??
Hi @Kodylow :eyes: :eyes:
Hi Kodylow Got some updates...
ADMIN FUNCTIONS
are all working
LIGHTNING METHODS
- list-gateways giving 405 error; I am using all the commands after
just dev
. I don'r know why its not working, it should work... is there any issue of limited access (u used ActiveFederationId as a parameter BUT I think I doesn't take any parameters)- CreateInvoice Error 422
Error calling INVOICE: HTTP error! status: 422, message: Failed to deserialize the JSON body into the target type: gatewayId: malformed public key at line 1 column 163
for
gateway-id
i crosschecked it many times. it is implemented in the same way as infedimint-py
andfedimint-ts
...
MINT METHODS
- Spend Error 500
500, message: Something went wrong: Insufficient balance: requested 3000 msat but only 0 msat available
I think I need some
msat
with me to test this function (which I don't have). How can I get those msat?
ONCHAIN METHODS
- they are giving
404
error -_-If you will be doing some sessions in general channel please let me know i can join it to speedrun things
Also Kody I have gone through SoB Project Idea.... I was thinking to start working on it asap (given only 20 days are left and I have endsems exams too)...
I am interested in both the task Not sure which one to move forward with... Can you give some insight in this regard??
But before going any further I think I should wrap up this PR first.... (Its is open for quite some time) Thank you
@PsychoPunkSage For that first error you're not passing a gatewayId in, you have to do that now for all the lightning methods.
For the second error it's using mutinynet sats for the tests and hitting against the Fedi Testnet federation, you can get some sats from this faucet https://faucet.mutinynet.com
Happy to help with any SoB things you need just send me a discord DM
For getting mutinynet sats. Do I need to set up a wallet or something??
Or should I use FEDIMINT_CLIENTD_INVITE_CODE
from .env
file to get msats in it?
@PsychoPunkSage For that first error you're not passing a gatewayId in, you have to do that now for all the lightning methods.
Ok Sorted this error....
But listGateways
fn shouldn't take any parameter right? As internally It is calling get
method which doesn't require gatewayIds
to get infos... But still it is giving 405
errors...
@Kodylow
Is nix shell working?? Cause I'm getting error on just dev
Its telling that i dont have pkg-config
(/usr/bin/pkg-config) but I have... Plus i have also added it to PATH
var
Yes the nix flake is working for me on both mac and linux.
Listgateways needs to take a federationId and should be a post request.
The default federation_invite_code in .env is for the mutinynet federation fedi set up, you can just use the fedimint-clientd client to create an invoice, pay it from the faucet, and you'll have the sats
nix develop is definitely working on master. You just generate a lightning invoice from the fedimint-clientd on the default .env's federation id (that's the fedi mutinynet federation) then pay the lightning invoice from the mutinynet faucet
listGateways requires you to pass in a federationId and should be a post
Listgateways needs to take a federationId and should be a post request.
Ohk,
Then in that case I have to make a listGatewayRequest
to send request via postWithFederationId
..... right?
And since listGatewayRequest
is not given I have to make one inside modules/ln.go
....
But how should I frame the request? What should be fields of it?? Is is written somewhere?
yup, you can see the requests in the rust side or use the typescript / python impls for reference. I'm going to try to land this today, about to test it and see if I can just get the last little issues
okay got everything working on here, I can't commit to your branch. You can mirror those changes or you can pull it down and force push it up
https://github.com/fedimint/fedimint-clientd/tree/psychopunk-working
would also be nice if you could squash your changes down please haha
Hi Yeah this will the first thing I will do in morning. :)
Hi @Kodylow
would also be nice if you could squash your changes down please haha
I have pushed the required changes that you asked me to do... please have a look
Added basic test codes for
fedimint-go