June 26, 2017, 09:50:25 pm

Author Topic: Coinprism on testnet?  (Read 2920 times)

ozmds

  • Newbie
  • *
  • Posts: 13
    • View Profile
Coinprism on testnet?
« on: May 05, 2014, 07:05:51 pm »
It's great that Coinprism is now running on livenet, with "real" money. Congrats!

However, I'm still in the trenches working on an application that uses colored coins. App testing with real bitcoins is really not an attractive option.

Is there any way to configure the new Coinprism to operate on testnet for third party development?

Thanks.

Coinprism

  • Admin
  • Administrator
  • Jr. Member
  • *****
  • Posts: 62
    • View Profile
    • Coinprism
Re: Coinprism on testnet?
« Reply #1 on: May 20, 2014, 10:16:22 pm »
You can use testnet.coinprism.com for the testnet version of Coinprism. However please note that there are some issues with it at the moment and the site may be very slow. Also note that the SSL certificate will not be valid so you'll need to add an exception to that.

ozmds

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Coinprism on testnet?
« Reply #2 on: May 25, 2014, 07:05:14 pm »
Thanks!  Yes, it is very slow, but slow is better than nothing at all.

I did have trouble defining a new colored coin on the testnet coinprism wallet - it kept saying that the metadata url was too long.  So, I copied the coinprism url to bit.ly to get a slightly shorter URL (4 bytes shorter) and the issuance went through ok.

Coinprism

  • Admin
  • Administrator
  • Jr. Member
  • *****
  • Posts: 62
    • View Profile
    • Coinprism
Re: Coinprism on testnet?
« Reply #3 on: May 27, 2014, 09:30:50 pm »

ozmds

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Coinprism on testnet?
« Reply #4 on: June 12, 2014, 05:20:15 am »
For reference, here is the helpcenter article about "Why am I getting the error "The metadata URL is too long to fit in the transaction"?"

Thanks for the link. That help topic refers to getting an error message when you host metadata on your own web site.  I was getting that error using the default Coinprism hosted metadata URL.

zenki

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Coinprism on testnet?
« Reply #5 on: May 20, 2015, 09:35:28 am »
So, I want to know what is the difference between 

Issue colored coins 

Transaction Builder
/
Issue colored coins
/
POST
POSThttps://api.coinprism.com/v1/issueasset?format=format
Parameters

    format

    The representation of the response.
    Default: json.
    String

Request

// Maven : Add these dependecies to your pom.xml (java6+)
// <dependency>
//     <groupId>org.glassfish.jersey.core</groupId>
//     <artifactId>jersey-client</artifactId>
//     <version>2.8</version>
// </dependency>
// <dependency>
//     <groupId>org.glassfish.jersey.media</groupId>
//     <artifactId>jersey-media-json-jackson</artifactId>
//     <version>2.8</version>
// </dependency>

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;

Client client = ClientBuilder.newClient();
Entity payload = Entity.json("{  'fees': 1000,  'from': '1zLkEoZF7Zdoso57h9si5fKxrKopnGSDn',  'address': 'akSjSW57xhGp86K6JFXXroACfRCw7SPv637',  'amount': '500',  'metadata': 'u=https://site.com/assetdef'}");
Response response = client.target("https://private-anon-e60666c92-coinprism.apiary-mock.com")
  .path("/v1/issueasset?format={format}")
  .request(MediaType.APPLICATION_JSON_TYPE)
  .post(payload);

System.out.println("status: " + response.getStatus());
System.out.println("headers: " + response.getHeaders());
System.out.println("body:" + response.readEntity(String.class));

and  Send an asset  :

Client client = ClientBuilder.newClient();
Entity payload = Entity.json("{  'fees': 1000,  'from': '1zLkEoZF7Zdoso57h9si5fKxrKopnGSDn',  'to': [    {      'address': 'akSjSW57xhGp86K6JFXXroACfRCw7SPv637',      'amount': '10',      'asset_id': 'AHthB6AQHaSS9VffkfMqTKTxVV43Dgst36'    }  ]}");
Response response = client.target("https://private-anon-e60666c92-coinprism.apiary-mock.com")
  .path("/v1/sendasset?format={format}")
  .request(MediaType.APPLICATION_JSON_TYPE)
  .post(payload);

System.out.println("status: " + response.getStatus());
System.out.println("headers: " + response.getHeaders());
System.out.println("body:" + response.readEntity(String.class));


on the coinprism api