proximax-storage / java-xpx-chain-sdk

ProximaX Sirius-Chain Java SDK
Apache License 2.0
7 stars 1 forks source link

Cannot send a plan message in PRIVATE_TEST network #122

Closed thuhc closed 5 years ago

thuhc commented 5 years ago
  1. Expected behavior and actual behavior. I got this exception when send a plan message
    
    java.util.concurrent.ExecutionException: java.lang.RuntimeException: Method Not Allowed
        at io.reactivex.internal.observers.FutureObserver.get(FutureObserver.java:85)
        at io.proximax.utils.TransactionHelper.sendPlainMessage(TransactionHelper.java:48)
        at io.proximax.test.TransactionTestRunner.sendRandomMessage(TransactionTestRunner.java:113)
        at io.proximax.test.TransactionTestRunner.activeAccount(TransactionTestRunner.java:168)
        at io.proximax.test.TransactionTestRunner.stressTest(TransactionTestRunner.java:71)
        at io.proximax.test.TransactionTestRunner.run(TransactionTestRunner.java:159)
        at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.RuntimeException: Method Not Allowed
        at io.proximax.sdk.infrastructure.Http.mapStringOrError(Http.java:77)
        at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:59)
        at io.reactivex.internal.operators.observable.ObservableCreate$CreateEmitter.onNext(ObservableCreate.java:67)
        at io.proximax.sdk.infrastructure.OkHttpHttpClient.lambda$createHttpResponseObservable$0(OkHttpHttpClient.java:107)
        at io.reactivex.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
        at io.reactivex.Observable.subscribe(Observable.java:10981)
        at io.reactivex.internal.operators.observable.ObservableMap.subscribeActual(ObservableMap.java:33)
        at io.reactivex.Observable.subscribe(Observable.java:10981)
        at io.reactivex.internal.operators.observable.ObservableMap.subscribeActual(ObservableMap.java:33)
        at io.reactivex.Observable.subscribe(Observable.java:10981)
        at io.reactivex.internal.operators.observable.ObservableMap.subscribeActual(ObservableMap.java:33)
        at io.reactivex.Observable.subscribe(Observable.java:10981)
        at io.reactivex.Observable.subscribeWith(Observable.java:11032)
        at io.reactivex.Observable.toFuture(Observable.java:5139)
        ... 6 more
2. Steps to reproduce the problem.
My function:

public static String sendPlainMessage(NetworkType networkType, String apiUrl, String senderPrivateKey, String recipientAddress, String message) throws Exception { final Account account = Account.createFromPrivateKey(senderPrivateKey, networkType); BlockchainApi blockchainApi = new BlockchainApi(new URL(apiUrl), networkType); final TransferTransaction transferTransaction = blockchainApi.transact().transfer() .deadline(Deadline.create(1, ChronoUnit.HOURS)) .to(Address.createFromRawAddress(recipientAddress)) .mosaics(new ArrayList()) .message(PlainMessage.create(message)) .networkType(networkType) .build(); final SignedTransaction signedTransaction = blockchainApi.sign(transferTransaction, account); final TransactionHttp transactionHttp = (TransactionHttp) blockchainApi.createTransactionRepository(); transactionHttp.announce(signedTransaction).toFuture().get(); signedTransaction.getHash()); return signedTransaction.getHash(); }


3. Specifications like the version of the project, operating system, or hardware.
- java xpx chain sdk v0.5.0
- Network: PRIVATE_TEST
- Node: http://bcdev1.xpxsirius.io:3000
tonowie commented 5 years ago

seems like server does not allow transaction announcements as PUT to /transaction/ and now it is PUT to /transaction (without the trailing slash) will review all endpoints and prepare patch for 5.0.1

tonowie commented 5 years ago

pull request #124 created and pending approval