fix: pin added did documents to local ipfs node

This commit is contained in:
Prad Nukala
2024-09-06 11:10:21 -04:00
parent fac81d90a3
commit 93ebc9eea1
8 changed files with 297 additions and 166 deletions
+84 -40
View File
@@ -101,6 +101,8 @@ func (m *QueryRequest) GetCredentials() []*Credential {
type QueryParamsResponse struct {
// params defines the parameters of the module.
Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
// ipfs_active returns true if the IPFS client is initialized
IpfsActive bool `protobuf:"varint,2,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"`
}
func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} }
@@ -143,6 +145,13 @@ func (m *QueryParamsResponse) GetParams() *Params {
return nil
}
func (m *QueryParamsResponse) GetIpfsActive() bool {
if m != nil {
return m.IpfsActive
}
return false
}
// QueryAccountsResponse is the response type for the Query/Exists RPC method.
type QueryAccountsResponse struct {
Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"`
@@ -430,46 +439,48 @@ func init() {
func init() { proto.RegisterFile("did/v1/query.proto", fileDescriptor_ae1fa9bb626e2869) }
var fileDescriptor_ae1fa9bb626e2869 = []byte{
// 620 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0x4f, 0x4f, 0x13, 0x41,
0x18, 0xc6, 0x59, 0x4a, 0xb7, 0xf5, 0x5d, 0x40, 0x9c, 0x16, 0xb2, 0x16, 0xdc, 0x90, 0x31, 0x51,
0x48, 0x4c, 0x27, 0x54, 0x8f, 0x7a, 0x40, 0xb8, 0x78, 0x83, 0x95, 0x83, 0x31, 0x5e, 0x96, 0xdd,
0x49, 0x1d, 0x6d, 0x67, 0xca, 0xce, 0x6c, 0x03, 0x21, 0x5c, 0x3c, 0x79, 0x34, 0xf1, 0x43, 0x78,
0xf7, 0x53, 0x78, 0x24, 0xf1, 0xe2, 0xd1, 0x80, 0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, 0x81, 0xf9, 0xa0, 0xa2, 0x5e, 0x77, 0x17, 0x5e,
0xd5, 0xd4, 0x65, 0xd4, 0xd2, 0xd4, 0xd3, 0x84, 0x25, 0x67, 0x24, 0xb2, 0xc4, 0x31, 0x78, 0x3b,
0xe5, 0x27, 0x9d, 0x5a, 0x60, 0xbd, 0xa2, 0x4e, 0x31, 0x23, 0x26, 0xba, 0xc6, 0x26, 0x7a, 0x4c,
0xcc, 0xf6, 0xc9, 0x69, 0x6e, 0xad, 0x33, 0x72, 0x6a, 0xcc, 0x77, 0x46, 0xca, 0xde, 0xd9, 0x87,
0x86, 0x31, 0xc8, 0x0d, 0x35, 0xd7, 0xae, 0xa9, 0x15, 0x33, 0x61, 0xa4, 0xeb, 0xcd, 0x23, 0x28,
0x66, 0x42, 0x6f, 0xa0, 0x61, 0x3c, 0x70, 0x2b, 0xe4, 0x35, 0x67, 0xe1, 0xfb, 0x1a, 0xd9, 0x42,
0xf7, 0xfe, 0x19, 0x01, 0xbd, 0x82, 0xfa, 0x41, 0xfe, 0xfa, 0x53, 0xb9, 0x9d, 0x8a, 0x5a, 0xb1,
0x1b, 0x5e, 0xd4, 0xd4, 0x26, 0x76, 0x89, 0xf6, 0xcf, 0xcb, 0xe7, 0x3f, 0x2e, 0x02, 0xe7, 0xfc,
0x22, 0x70, 0x7e, 0x5f, 0x04, 0xce, 0x97, 0xcb, 0x60, 0xe6, 0xfc, 0x32, 0x98, 0xf9, 0x75, 0x19,
0xcc, 0xbc, 0xc5, 0x7d, 0xa6, 0xde, 0x67, 0x87, 0xdd, 0x58, 0x0c, 0x89, 0xe0, 0x52, 0xf0, 0x94,
0xe8, 0x8f, 0x63, 0x3d, 0xa2, 0x3a, 0x19, 0x51, 0x79, 0xe8, 0xea, 0xbf, 0xc4, 0xa7, 0x7f, 0x03,
0x00, 0x00, 0xff, 0xff, 0xb5, 0xea, 0x49, 0x17, 0x79, 0x05, 0x00, 0x00,
// 641 bytes of a gzipped FileDescriptorProto
0x1f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 0xfd, 0x2b, 0x79,
0x5b, 0x25, 0xb4, 0x64, 0x37, 0x3a, 0x8f, 0xac, 0x75, 0xea, 0x32, 0xf4, 0xcf, 0xd3, 0x27, 0xdf,
0xcf, 0xda, 0xce, 0xe9, 0x59, 0xdb, 0xf9, 0x75, 0xd6, 0x76, 0x3e, 0x9f, 0xb7, 0xa7, 0x4e, 0xcf,
0xdb, 0x53, 0x3f, 0xcf, 0xdb, 0x53, 0x2f, 0x69, 0x4f, 0xe8, 0x77, 0xa3, 0xfd, 0x4e, 0x24, 0x07,
0x4c, 0x26, 0x4a, 0x26, 0x29, 0xc3, 0x8f, 0x43, 0x3c, 0x51, 0x1f, 0x0d, 0xb9, 0xda, 0x77, 0xf1,
0x3f, 0xf3, 0xd1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x17, 0xd1, 0xf9, 0x55, 0x9a, 0x05, 0x00,
0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -822,6 +833,16 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if m.IpfsActive {
i--
if m.IpfsActive {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x10
}
if m.Params != nil {
{
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
@@ -1108,6 +1129,9 @@ func (m *QueryParamsResponse) Size() (n int) {
l = m.Params.Size()
n += 1 + l + sovQuery(uint64(l))
}
if m.IpfsActive {
n += 2
}
return n
}
@@ -1450,6 +1474,26 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.IpfsActive = bool(v != 0)
default:
iNdEx = preIndex
skippy, err := skipQuery(dAtA[iNdEx:])