|
|
@@ -19,7 +19,6 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
import org.springframework.retry.annotation.Backoff;
|
|
|
import org.springframework.retry.annotation.Retryable;
|
|
|
-import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.io.File;
|
|
|
@@ -94,7 +93,7 @@ public class AssetMintService {
|
|
|
|
|
|
public String ipfsUpload(String url) {
|
|
|
try {
|
|
|
- IPFS ipfs = new IPFS("112.74.34.84", 5001);
|
|
|
+ IPFS ipfs = new IPFS("120.24.204.226", 5001);
|
|
|
HttpRequest request = HttpRequest.get(url);
|
|
|
File file = File.createTempFile("ipfs", ".tmp");
|
|
|
request.receive(file);
|
|
|
@@ -102,6 +101,7 @@ public class AssetMintService {
|
|
|
MerkleNode put = ipfs.add(file1).get(0);
|
|
|
Multihash multihash = ipfs.pin.add(put.hash).get(0);
|
|
|
log.info("上传ipfs成功 {}", multihash.toBase58());
|
|
|
+ file.delete();
|
|
|
return multihash.toBase58();
|
|
|
} catch (Exception e) {
|
|
|
}
|