code: func (h *handler) newPermanode() (blob.Ref, error) {
  	// TODO(mpl): sign things ourselves if we can.
  	var pn blob.Ref
  	upn, err := schema.NewUnsignedPermanode().SetSigner(h.signer).JSON()
  	if err != nil {
  		return pn, fmt.Errorf("could not create unsigned permanode: %v", err)
  	}
  	spn, err := h.cl.Sign(context.TODO(), h.server, strings.NewReader("json="+upn))
  	if err != nil {
  		return pn, fmt.Errorf("could not get signed permanode: %v", err)
  	}
  	sbr, err := h.cl.Upload(context.TODO(), client.NewUploadHandleFromString(string(spn)))
  	if err != nil {
  		return pn, fmt.Errorf("could not upload permanode: %v", err)
  	}
  	return sbr.BlobRef, nil
  }
docs: // TODO(mpl): move that to client pkg, with a good API ?