Giter Site home page Giter Site logo

ipfs-api-kotlin's People

Contributors

celeduc avatar dependabot-preview[bot] avatar dependabot[bot] avatar ido-ran avatar ligi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ipfs-api-kotlin's Issues

Async Support

Add commands are currently executing synchronously which means it is not possible to call them from the UI thread.
Do you think it makes sense to add async support or since any operation will take over 100ms there is no point in initiating them on the UI thread?

Moshi problem

Hey

having a moshi issue

in my build.gradle I was already using this:

    // Kotlin KSP support
    id("com.google.devtools.ksp") version "1.6.20-1.0.4"

    // Json
    implementation("com.squareup.moshi:moshi:1.13.0")
    implementation("com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:1.6.20-1.0.4")
    ksp("com.squareup.moshi:moshi-kotlin-codegen:1.13.0")

    // IPFS
    implementation("com.github.ligi:ipfs-api-kotlin:0.15")

Any idea how to solve this now I tried to add ipfs-api-kotlin?

 val multiHash = LocalIPFS().add.string("hello").Hash
  println(multiHash)
Cannot serialize Kotlin type io.ipfs.kotlin.model.NamedHash. Reflective serialization of Kotlin classes without using kotlin-reflect has undefined and unexpected behavior. Please use KotlinJsonAdapterFactory from the moshi-kotlin artifact or use code gen from the moshi-kotlin-codegen artifact.

Get cat Bytes Method

Do you have plans to spin off a new release that includes the Get catBytes method? I see it in the repo but not in V 0.12 and would like to play around with it without cloning the whole repo.
Thanks!

PubSub Experiment

I want to use IPFS on Android app with PubSub.
Specifically, I want to subscribe to a topic in the Android app.

What is required to add PubSub to this project?

Deal with files that have a size of 0

Exception in thread "main" java.io.EOFException
        at okio.RealBufferedSource.require(RealBufferedSource.java:59)
        at okio.RealBufferedSource.readHexadecimalUnsignedLong(RealBufferedSource.java:284)
        at okhttp3.internal.http.Http1xStream$ChunkedSource.readChunkSize(Http1xStream.java:437)
        at okhttp3.internal.http.Http1xStream$ChunkedSource.read(Http1xStream.java:418)
        at okio.RealBufferedSource$1.read(RealBufferedSource.java:409)
        at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
        at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
        at java.io.InputStreamReader.read(InputStreamReader.java:184)
        at java.io.BufferedReader.fill(BufferedReader.java:161)
        at java.io.BufferedReader.readLine(BufferedReader.java:324)
        at java.io.BufferedReader.readLine(BufferedReader.java:389)
        at kotlin.io.LinesSequence$iterator$1.hasNext(ReadWrite.kt:74)
        at kotlin.io.TextStreamsKt.forEachLine(ReadWrite.kt:154)
        at kotlin.io.TextStreamsKt.readLines(ReadWrite.kt:37)
        at io.ipfs.kotlin.commands.Add.addGeneric(Add.kt:73)
        at io.ipfs.kotlin.commands.Add.directory(Add.kt:26)
        at io.ipfs.kotlin.commands.Add.directory$default(Add.kt:26)
        at kontinuum.WorkPackageProcessorKt.addIPFS(WorkPackageProcessor.kt:130)
        at kontinuum.WorkPackageProcessorKt.doIn(WorkPackageProcessor.kt:125)
        at kontinuum.WorkPackageProcessorKt.processWorkPackages(WorkPackageProcessor.kt:73)
        at kontinuum.MainKt.main(Main.kt:30)

Unable to add a string

Hello,

I'd like to ask for a little help, please. I am trying to add a string to IPFS.

When I do:

             IPFS(
                    base_url = "https://gateway.ipfs.io/api/v0/",
                    okHttpClient = OkHttpClient.Builder()
                        .addInterceptor(HttpLoggingInterceptor().apply {
                            level = HttpLoggingInterceptor.Level.BODY
                        })
                        .build()
                )
                    .add
                    .string("Hello world.")
                    .Hash

Then it calls:

--> POST https://gateway.ipfs.io/api/v0/add?stream-channels=true&progress=false
Content-Type: multipart/form-data; boundary=f5f74a49-a0ba-4946-8b1e-211b7113943a
Content-Length: 263
--f5f74a49-a0ba-4946-8b1e-211b7113943a
Content-Disposition: form-data; name="string"; filename="string"
Content-Type: application/octet-stream; charset=utf-8
Content-Length: 36
e25hbWU6ImpvaG4iLHN1cm5hbWU6ImRvZSJ9
--f5f74a49-a0ba-4946-8b1e-211b7113943a--
--> END POST (263-byte body)

But the response is 404:

<-- 404 Not Found https://gateway.ipfs.io/api/v0/add?stream-channels=true&progress=false (343ms)
Date: Fri, 01 Jun 2018 17:16:22 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 18
Connection: keep-alive
Vary: Origin
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
404 page not found
<-- END HTTP (18-byte body)

I'm already fighting with this for hours. I also tried to run own ipfs node on my laptop and add string to it from emulator. Same result.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.