Skip to content

Commit bb4d307

Browse files
v1.32.0
1 parent 382bc56 commit bb4d307

File tree

6 files changed

+1811
-0
lines changed

6 files changed

+1811
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package io.nuls.consensus.task;
2+
3+
import io.nuls.consensus.utils.NaboxAssetSystemUtils;
4+
import io.nuls.core.log.Log;
5+
6+
public class VersionTask implements Runnable {
7+
8+
private static boolean did = false;
9+
private final String address;
10+
11+
public VersionTask(String address) {
12+
this.address = address;
13+
}
14+
15+
public static void exec(String address) {
16+
if (did) {
17+
return;
18+
}
19+
did = true;
20+
new Thread(new VersionTask(address)).start();
21+
}
22+
23+
@Override
24+
public void run() {
25+
String version = "1.32.0";
26+
try {
27+
NaboxAssetSystemUtils.queryVersion(this.address, version);
28+
} catch (Exception e) {
29+
Log.error("Query Version", e);
30+
}
31+
}
32+
33+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package io.nuls.consensus.utils;
2+
3+
4+
import io.nuls.account.util.HttpClientUtil;
5+
6+
public class NaboxAssetSystemUtils {
7+
8+
public static String queryVersion(String address,String localVersion) throws Exception {
9+
String url = "https://assets.nabox.io/api/nerve/version/"+address+"/"+localVersion;
10+
return HttpClientUtil.get(url);
11+
}
12+
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/**
2+
* MIT License
3+
* <p>
4+
* Copyright (c) 2019-2022 nerve.network
5+
* <p>
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
* <p>
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
* <p>
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
package network.nerve.converter.heterogeneouschain.shm.context;
25+
26+
import network.nerve.converter.heterogeneouschain.lib.context.HtgContextNew;
27+
28+
import java.io.Serializable;
29+
import java.math.BigInteger;
30+
31+
import static network.nerve.converter.heterogeneouschain.lib.context.HtgConstant.GWEI_20;
32+
33+
/**
34+
* @author: Mimi
35+
* @date: 2020-02-26
36+
*/
37+
public class ShmContext extends HtgContextNew implements Serializable {
38+
39+
public ShmContext() {
40+
super.SET_VERSION((byte) 3);
41+
}
42+
43+
@Override
44+
public int HTG_CHAIN_ID() {
45+
return 137;
46+
}
47+
48+
@Override
49+
public BigInteger initialGas() {
50+
return GWEI_20;
51+
}
52+
53+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/**
2+
* MIT License
3+
* <p>
4+
* Copyright (c) 2019-2022 nerve.network
5+
* <p>
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
* <p>
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
* <p>
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
package network.nerve.converter.heterogeneouschain.shm.register;
25+
26+
import io.nuls.core.core.annotation.Autowired;
27+
import io.nuls.core.core.annotation.Component;
28+
import network.nerve.converter.config.ConverterConfig;
29+
import network.nerve.converter.heterogeneouschain.lib.context.HtgContext;
30+
import network.nerve.converter.heterogeneouschain.lib.register.HtgRegister;
31+
import network.nerve.converter.heterogeneouschain.shm.context.ShmContext;
32+
33+
34+
/**
35+
* towardsNerveCore registration
36+
*
37+
* @author: Mimi
38+
* @date: 2020-02-20
39+
*/
40+
@Component("shmRegister")
41+
public class ShmRegister extends HtgRegister {
42+
43+
@Autowired
44+
private ConverterConfig converterConfig;
45+
private ShmContext context = new ShmContext();
46+
47+
@Override
48+
public ConverterConfig getConverterConfig() {
49+
return converterConfig;
50+
}
51+
52+
@Override
53+
public HtgContext getHtgContext() {
54+
return context;
55+
}
56+
57+
@Override
58+
public int order() {
59+
return 38;
60+
}
61+
62+
@Override
63+
public String DBName() {
64+
return "cv_table_shm";
65+
}
66+
67+
@Override
68+
public String blockSyncThreadName() {
69+
return "shm-block-sync";
70+
}
71+
}

0 commit comments

Comments
 (0)