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

node issue #43

Open
akshitababel opened this issue Sep 24, 2018 · 2 comments
Open

node issue #43

akshitababel opened this issue Sep 24, 2018 · 2 comments

Comments

@akshitababel
Copy link

While using the function store from enclave package I am getting the following error :
time="2018-09-21T12:53:45+05:30" level=error msg="Unable to load sender public key, nacl: incorrect key length: 64" senderPubKey="[49 98 101 51 98 53 48 98 51 49 55 51 52 98 101 52 56 52 53 50 99 50 57 100 55 49 52 57 52 49 98 97 49 54 53 101 102 48 99 98 102 51 99 99 101 97 56 99 97 49 54 99 52 53 101 51 100 56 100 52 53 102 98 48]"
The sender public key which I am using is a quorum node key which is:
1be3b50b31734be48452c29d714941ba165ef0cbf3ccea8ca16c45e3d8d45fb0

@Puneetha17
Copy link
Contributor

It would be helpful if you could elaborate on how exactly you are using the store function?
Are you using any particular API in Crux or trying to call the store function from your code?

@akshitababel
Copy link
Author

I am trying to call store() function from my code.
The code is as below:

func CruxSecure(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
	var db storage.DataStore
	var pubKeyFiles, privKeyFiles []string
	var pi api.PartyInfo
	var client utils.HttpClient
	var grpc bool
	//var sender string
	pubKeyFiles = append(pubKeyFiles, "/home/akshita/quorum-examples/examples/7nodes/qdata/c1/tm.pub")
	pubKeyFiles = append(pubKeyFiles, "/home/akshita/quorum-examples/examples/7nodes/qdata/c2/tm.pub")
	privKeyFiles = append(privKeyFiles, "/home/akshita/quorum-examples/examples/7nodes/qdata/c1/tm.key")
	privKeyFiles = append(privKeyFiles, "/home/akshita/quorum-examples/examples/7nodes/qdata/c2/tm.key")
	message := "hello"
	grpc = true
	m := []byte(message)
	mes := &m
	sender := "1be3b50b31734be48452c29d714941ba165ef0cbf3ccea8ca16c45e3d8d45fb0"
	s := []byte(sender)
	var rec [][]byte
	recipient := "722f11686b2277dcbd72713d8a3c81c666b585c337d47f503c3c1f3c17cf001d"
	recipients := []byte(recipient)
	rec = append(rec, recipients)
	SecureEnclave := enclave.Init(db, pubKeyFiles, privKeyFiles, pi, client, grpc)

	hash, err := SecureEnclave.Store(mes, s, rec)
	if err != nil {
		util.WebResponse(w, r, http.StatusNotFound, "failed")
		return
	}
	w.Header().Set("Content-Type", "text/plain")
	w.Write(hash)
	return
}

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

No branches or pull requests

2 participants