1. init a MySQL database with this [schema](./federation.sql);
2. run a `bytomd` node;
3. run a `vapord` node and import the federation private key;
-4. and last but not least, run a `fedd` node with a `fed_cfg.json`.
+4. and last but not least, run a `fedd` node with a `fed_cfg.json` and it will listen at 9886 port.
A `fed_cfg.json` would look like this:
```json
{
"api" : {
- "listening_port" : 3000,
"is_release_mode": false
},
"mysql" : {
},
"log_mode" : true
},
- "warders" : [
- {
- "position" : 1,
- "xpub" : "50ef22b3a3fca7bc08916187cc9ec2f4005c9c6b1353aa1decbd4be3f3bb0fbe1967589f0d9dec13a388c0412002d2c267bdf3b920864e1ddc50581be5604ce1"
- }
- ],
- "quorum": 1,
+ "network" : "testnet",
+ "federation_prog" : "0020f86826d640810eb08a2bfb706e0092273e05e9a7d3d71f9d53f4f6cc2e3d6c6a",
"mainchain" : {
- "name" : "bytom",
+ "name" : "btm",
"confirmations" : 10,
"upstream" : "http://127.0.0.1:9888",
"sync_seconds" : 150
},
"sidechain" : {
"name" : "vapor",
- "confirmations" : 100,
+ "confirmations" : 300,
"upstream" : "http://127.0.0.1:9889",
- "sync_seconds" : 5
+ "sync_seconds" : 150
}
}
```
```js
// Request
-curl -X POST 127.0.0.1:3000/api/v1/federation/list-crosschain-txs -d '{}'
+curl -X POST 127.0.0.1:9886/api/v1/federation/list-crosschain-txs -d '{}'
// Result
{