Closed Jefferson111 closed 2 years ago
This is a minimal keygen example adapted from example.go
package main
import (
"fmt"
"sync"
"github.com/taurusgroup/multi-party-sig/internal/test"
"github.com/taurusgroup/multi-party-sig/pkg/math/curve"
"github.com/taurusgroup/multi-party-sig/pkg/party"
"github.com/taurusgroup/multi-party-sig/pkg/pool"
"github.com/taurusgroup/multi-party-sig/pkg/protocol"
"github.com/taurusgroup/multi-party-sig/protocols/cmp"
)
func CMPKeygen(id party.ID, ids party.IDSlice, threshold int, n *test.Network, pl *pool.Pool) (*cmp.Config, error) {
h, err := protocol.NewMultiHandler(cmp.Keygen(curve.Secp256k1{}, id, ids, threshold, pl), nil)
if err != nil {
return nil, err
}
test.HandlerLoop(id, h, n)
r, err := h.Result()
if err != nil {
return nil, err
}
fmt.Println("Successfully generated the keygen config!")
fmt.Println(r)
return r.(*cmp.Config), nil
}
func main() {
ids := party.IDSlice{"a", "b", "c", "d", "e", "f"}
threshold := 4
net := test.NewNetwork(ids)
var wg sync.WaitGroup
for _, id := range ids {
wg.Add(1)
go func(id party.ID) {
pl := pool.NewPool(0)
defer pl.TearDown()
defer wg.Done()
CMPKeygen(id, ids, threshold, net, pl)
}(id)
}
wg.Wait()
}
I got this main.go:7:2: use of internal package github.com/taurusgroup/multi-party-sig/internal/test not allowed
When I exposed it, I realized its running on stubs and not producing key shares
When I exposed it, I realized its running on stubs and not producing key shares
You are not getting anything from the console output?
It should say something like this
Turns out it was the "github.com/taurusgroup/multi-party-sig/internal/test"
and its dependencies causing me trouble. All I had to do was to git clone
instead of running it stand alone. Thank you so much for the example, will look into test
implementation and figure things out from there on.
It would be great to have a minimum working example on how to use this library. I tried following the example in README and it wasn't enough.
The output of the handler just gives
<nil> protocol: not finished
My instinct tells me that I need to do something with the handler to make it work. So I tried adding this to handle my handlers based on the READMEAnd it did not work.
So I gave up and open an issue on Github and hope that developer of this software is kind enough to provide an example on how to use their software