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" : {
```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
{
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
- UNIQUE KEY `block_hash` (`block_hash`)
+ UNIQUE KEY `block_hash` (`id`,`block_hash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `chains` WRITE;
import (
"encoding/json"
- "fmt"
"net/http"
"reflect"
"strings"
}
func (s *Server) Run() {
- s.engine.Run(fmt.Sprintf(":%d", s.cfg.API.ListeningPort))
+ s.engine.Run(":9886")
}
func (s *Server) middleware() gin.HandlerFunc {
}
type API struct {
- ListeningPort uint64 `json:"listening_port"`
- IsReleaseMode bool `json:"is_release_mode"`
+ IsReleaseMode bool `json:"is_release_mode"`
}
type MySQLConfig struct {