File tree Expand file tree Collapse file tree 5 files changed +15
-6
lines changed
key/load_local_certificate Expand file tree Collapse file tree 5 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 22import com .bloock .sdk .client .AvailabilityClient ;
33import com .bloock .sdk .client .RecordClient ;
44import com .bloock .sdk .entity .availability .HostedPublisher ;
5+ import com .bloock .sdk .entity .availability .PublishResponse ;
56import com .bloock .sdk .entity .record .Record ;
67
78public class PublishHosted {
@@ -14,7 +15,9 @@ public static void main(String[] args) throws Exception {
1415
1516 Record record = recordClient .fromString ("Hello world" ).build ();
1617
17- String id = availabilityClient .publish (record , new HostedPublisher ()); // it returns the hash
18+ PublishResponse response = availabilityClient .publish (record , new HostedPublisher ());
19+ String id = response .getID ();
20+
1821 } catch (Exception e ) {
1922 System .out .println (e );
2023 }
Original file line number Diff line number Diff line change 22import com .bloock .sdk .client .AvailabilityClient ;
33import com .bloock .sdk .client .RecordClient ;
44import com .bloock .sdk .entity .availability .IpfsPublisher ;
5+ import com .bloock .sdk .entity .availability .PublishResponse ;
56import com .bloock .sdk .entity .record .Record ;
67
78public class PublishIpfs {
@@ -14,8 +15,9 @@ public static void main(String[] args) throws Exception {
1415 Record record = recordClient
1516 .fromString ("Hello world" )
1617 .build ();
17-
18- String id = availabilityClient .publish (record , new IpfsPublisher ());
18+
19+ PublishResponse response = availabilityClient .publish (record , new IpfsPublisher ());
20+ String id = response .getID ();
1921
2022 System .out .println ("Record was published successfully" );
2123 }
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ runners:
1616 cmd : yarn eslint -c /var/runners/typescript/eslint.config.js {{ snippet.dir }}/**/*.{ts,tsx}
1717 run :
1818 before : timeout 600 ash -c 'until stat /tmp/runner_is_ready; do sleep 1; done'
19- cmd : yarn tsc {{ snippet.dir }}/{{ snippet.source }} --noEmit --module es2022 --target es2022 --moduleResolution Node --esModuleInterop
19+ cmd : yarn tsc {{ snippet.dir }}/{{ snippet.source }} --noEmit --module es2022 --target es2022 --moduleResolution Node --esModuleInterop --skipLibCheck
2020
2121 golang :
2222 service : doc-runner-golang
Original file line number Diff line number Diff line change @@ -8,4 +8,6 @@ const keyClient = new KeyClient();
88const dirPath = path . join ( __dirname , '/certificate.p12' ) ;
99const buffer = fs . readFileSync ( dirPath ) ;
1010
11- const _certificate = await keyClient . loadLocalCertificate ( buffer , 'password' ) ;
11+ const uint8 = new Uint8Array ( buffer ) ;
12+
13+ const _certificate = await keyClient . loadLocalCertificate ( uint8 , 'password' ) ;
Original file line number Diff line number Diff line change 1414
1515 // we can read a file as an array of bytes
1616 const file = fs . readFileSync ( 'sample.pdf' ) ;
17- const _record3 = await recordClient . fromFile ( file ) . build ( ) ;
17+ const uint8 = new Uint8Array ( file ) ;
18+
19+ const _record3 = await recordClient . fromFile ( uint8 ) . build ( ) ;
1820} catch ( e ) {
1921 console . log ( e ) ;
2022}
You can’t perform that action at this time.
0 commit comments